| 60 | } |
| 61 | |
| 62 | PipelineColorAttachment 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 | |
| 83 | static std::array<float, 4> GetRTAdjustArray(const RenderTarget* renderTarget) { |
| 84 | std::array<float, 4> result = {}; |