Skip to content
The Chat Archive
vicuna-33b Arena Human Preference 55K

i have a vulkan program where i have a renderpass that has two subpasses the first…

  1. User

    i have a vulkan program where i have a renderpass that has two subpasses

    the first writes into a offscreen framebuffer the second reads this framebuffer as input attachment

    in the dependencies of the second subpass, if i don't add MEMORY_WRITE to the dst_access_mask. i get validation errors. but why would MEMORY_WRITE be needed?

  2. Assistant

    The validation error you're encountering is likely due to the fact that Vulkan's validation layers are being conservative in their interpretation of the specification. While it might not seem strictly necessary to include MEMORY_WRITE in the dst_access_mask for the second subpass, doing so can help ensure that your usage aligns with the Vulkan specification.

    When you have a dependency on a memory attachment (in this case, the offscreen framebuffer), the validation layers require that you include MEMORY_WRITE in the dst_access_mask to ensure that you're not attempting to use the memory attachment in a way that violates the rules defined by the Vulkan specification.

    In practice, if you're certain that your usage of the offscreen framebuffer attachment in the second subpass does not require writing to the memory, you can potentially ignore this validation error. However, it's generally a good practice to follow the validation layers' suggestions, as they can help catch potential issues in your code.

    If you want to avoid the validation error but are sure that you don't need to write to the memory attachment, you can try submitting a question or bug report to the Khronos Vulkan Developer Forum, where developers and maintainers of the Vulkan spec can provide more insight into the issue. Keep in mind that the validation layers are not part of the official Vulkan implementation, so their behavior may not always align perfectly with the specification.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.