MCPcopy Create free account
hub / github.com/Tencent/tgfx / getPipelineColorAttachment

Method getPipelineColorAttachment

src/gpu/ProgramInfo.cpp:62–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62PipelineColorAttachment ProgramInfo::getPipelineColorAttachment() const {
63 PipelineColorAttachment colorAttachment = {};
64 colorAttachment.format = renderTarget->format();
65 if (xferProcessor != nullptr || blendMode == BlendMode::Src) {
66 return colorAttachment;
67 }
68 BlendFormula blendFormula = {};
69 if (!BlendModeAsCoeff(blendMode, numColorProcessors < fragmentProcessors.size(), &blendFormula)) {
70 return colorAttachment;
71 }
72 colorAttachment.blendEnable = true;
73 colorAttachment.srcColorBlendFactor = blendFormula.srcFactor();
74 colorAttachment.dstColorBlendFactor = blendFormula.dstFactor();
75 colorAttachment.colorBlendOp = blendFormula.operation();
76 colorAttachment.srcAlphaBlendFactor = blendFormula.srcFactor();
77 colorAttachment.dstAlphaBlendFactor = blendFormula.dstFactor();
78 colorAttachment.alphaBlendOp = blendFormula.operation();
79 colorAttachment.colorWriteMask = ColorWriteMask::All;
80 return colorAttachment;
81}
82
83static std::array<float, 4> GetRTAdjustArray(const RenderTarget* renderTarget) {
84 std::array<float, 4> result = {};

Callers 1

finalizeMethod · 0.80

Calls 6

BlendModeAsCoeffFunction · 0.85
srcFactorMethod · 0.80
dstFactorMethod · 0.80
operationMethod · 0.80
formatMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected