Reputation: 4983
I wonder whether it is possible to render multiple passes into the same color and depth attachment in Vulkan? I need to do a headless rendering of a huge model that does not fit into the the GPU memory (I'm using Swiftshader that has only 1GB of memory). I'd like to do the following sequence of actions:
I'm currently stuck on vkCmdBeginRenderPass()
which takes a "clear value". But what if I don't want to clear the buffer. Can I just do clearValues = 0
? What else is needed to get the scenario above to work?
Upvotes: 2
Views: 1279
Reputation: 473437
Whether a render pass clears the buffer(s) on load is part of the render pass's setup. There is the loadOp
field in every attachment which states how it should use any previous data in the attachment (if any).
In your case, because you're constantly accumulating distinct rendering processes into the same images, you want the loadOp
to load the data, not clear it. You can explicitly clear the attachments the first time you execute the render pass with vkCmdClearAttachments
.
Upvotes: 4