How to use color attachment as a texture in the next subpass?

I need to use the color attachment of the previous subpass as a texture for the next subpass. How do I do this?

You cannot. That has to be done in a separate render pass.

Attachments are owned by a render pass from the beginning of the pass to its end. During that time, you can only used the attached image subresources in accord with their uses as an attachment.

Textures are not attachments. Therefore, you cannot use an attachment as a texture.

There are input attachments, which you can read from in a fragment shader. However, they can only read from the part of the image that the fragment’s current pixel overlays. That is, you cannot read from someone else’s pixel in an image attachment. If your uses fit within that limitation, then you may use the attachment as a color attachment in one subpass and as an input attachment in another.

1 Like

It should be possible with VK_EXT_attachment_feedback_loop_layout.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.