Skip to content

Interaction between VK_KHR_dynamic_rendering_local_read and VK_EXT_dynamic_rendering_unused_attachments #2565

@etang-cw

Description

@etang-cw

VUID-vkCmdDraw-None-09548 says: If the current render pass was begun with vkCmdBeginRendering, and there is no shader object bound to any graphics stage, the value of each element of VkRenderingAttachmentLocationInfo::pColorAttachmentLocations set by vkCmdSetRenderingAttachmentLocations must match the value set for the corresponding element in the bound pipeline.

vkCmdSetRenderingAttachmentLocations says: Until this command is called, mappings in the command buffer state are treated as each color attachment specified in vkCmdBeginRendering having a location equal to its index in VkRenderingInfo::pColorAttachments. This state is reset whenever vkCmdBeginRendering is called.

Currently, the validation layers don't check 09548 until the first use of vkCmdSetRenderingAttachmentLocations, meaning that as long as you don't call vkCmdSetRenderingAttachmentLocations, you can bind any pipeline with any mapping you want. I assume this is not what was intended, and instead, the default state is supposed to be validated against until vkCmdSetRenderingAttachmentLocations is called. If this was intended, vkCmdSetRenderingAttachmentLocations docs should be updated to clarify that until it is called, mappings are taken from the currently bound pipeline unless you're using VK_EXT_shader_object (and something similar for 09549).

However when attempting to change the validation layers to always check 09548, I started failing their tests for VK_EXT_dynamic_rendering_unused_attachments. Thinking about it, I don't think it's possible to take advantage of VK_EXT_dynamic_rendering_unused_attachments without violating VUID-vkCmdDraw-None-09548. So how is the interaction between these supposed to work?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions