Does screen recording write a color buffer?

I studied the drawsubpasses sample in LunarG samples (file: API-Samples / drawsubpasses / drawsubpasses.cpp).

In this example, the active sub pass, when the very first vkCmdDraw () is called, has no color binding, but only a depth / stencil embedding. The fragment shader used has an output variable.

Reading the spec did not help me understand whether this use is "safe" or how the driver will process it.

+5
source share
1 answer

Vulkan 1.0.16 seems to have fixed this. It explicitly states that no entries are made with attachment indices greater than subpasses attachmentCount , or that are explicitly declared by VK_ATTACHMENT_UNUSED . The output variable will be undefined, but nothing will be written to it based on the current subpass description.


This is a very good question. I spent a few minutes reading the specification in the expected places, and yet there is no language explaining what happens when the fragment shader writes to an output location that does not have a subpass attachment. This should be stated in section 14.3, but there is nothing in it.

You can create a Vulkan spec error report .

I assume that the correct behavior will be the same as OpenGL: effectively ignore such exits.

+2
source

All Articles