Is it legal for 1 color-attachment to map to 2 different input-attachments from 2 different passes?

Viewed 60

Is this RenderPass setup legal in Vulkan?

Frame diagram of 4 passes

That shows a frame setup of 4 subpasses, back to back. Subpass0 (C) outputs to 2 color-attachments. Its second output C.out1 maps to 2 input attachments: T0.in1 and T1.in1

Is it legal for 1 color-attachment to map to 2 input-attachments from 2 different subpasses?

1 Answers

maps to 2 input attachments: T0.in1 and T1.in1

Subpasses do not own attachments; the render pass owns attachments. Subpasses use attachments. The two subpasses are just using the same attachment as input attachments.

It's no different from two drawing commands using the same texture.

Related