Is it possible to have a pipeline (with appropriate fragment shader) that doesn't write to all color attachments of a pass? e.g. Pass has 2xColor + 1depth attachments. Some fragment programs may write both color01+depth, while some only write color0+depth.
Just setting the colorWriteMask to none for the unused attachment isn't successful. I haven't been able to find a pipeline configuration that will pass the validation layer. it always complains that the extra attachments are not written by the fragment shader.
If this is in a separate subpass then you can simply add the color attachment to the pPreserveAttachments
.
The other option is to use blending to trick the fragment shader to discard the fragment shader output and use the existing color. Using ONE for dst and ZERO for src with OP_ADD blending.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With