1
votes

Given 2 RenderPasses, A and B, and an attachment X accessed by both, if A does a .storeOp=store on X on its last subpass, and B does a .loadOp=load on X on its first subpass, can B read from X as an input attachment?

Futhermore, I can think of 3 ways of reading attachment data from a previous RenderPass.

  • Using a sampler.
  • (Potentially) as an input attachment.
  • As a storage image.

Are there any other ways?

1

1 Answers

1
votes

Once a render pass instance has concluded, all attachments cease to be attachments. They're just regular images from that point forward. The contents of the image are governed by the render pass's storage operation. But once the storage operation is done (subject to the correct use of dependencies), the image has the data produced by the storage operation.

So there is no such thing as an attachment "from a previous RenderPass". There is merely an image and its data. How that image got its data (again, subject to the correct use of dependencies) irrelevant to how you're going to use it now. The data is there, and it can be accessed in any way that any image is access, subject only to the restrictions you choose to impose.

So if an image has some data, and you use it as an attachment, and you use a load operation of load, the data in that attachment will have the image data from the image before becoming an attachment regardless of how the data got there. That's how load operations work.