Skip to content

Validation Errors in dynamicrenderinglocalread example #1271

Description

@SRSaunders

The dynamicrenderinglocalread example has some validation errors:

  1. Wrong image layout type for colorAttachment swapChain.imageViews[currentImageIndex]. Should be VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL instead of VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR. This is actually a VVL defect, see: Validation for dynamic rendering attachment layout possibly doesn't respect input attachment indices for local reads KhronosGroup/Vulkan-ValidationLayers#12039
  2. Wrong number of colorAttachments in renderingInfo when drawing the UI. Should be 1 attachment, not 4. Vulkan can ignore unused attachments if configured with VK_EXT_dynamic_rendering_unused_attachments, but this may not be a universal extension. Instead, another solution is to end dynamic rendering and restart with an updated renderingInfo structure with only 1 attachment specified.

ERROR: [-52447566][VUID-vkCmdDrawIndexed-colorAttachmentCount-06179] : vkCmdDrawIndexed(): Currently bound VkPipeline 0x240000000024 was created with VkPipelineRenderingCreateInfo::colorAttachmentCount (1) which must be equal to VkRenderingInfo::colorAttachmentCount (4).
The dynamicRenderingUnusedAttachments feature allows a way to remove this restriction.
The Vulkan spec states: If the dynamicRenderingUnusedAttachments feature is not enabled and the current render pass instance was begun with vkCmdBeginRendering, the bound graphics pipeline must have been created with a VkPipelineRenderingCreateInfo::colorAttachmentCount equal to VkRenderingInfo::colorAttachmentCount (https://vulkan.lunarg.com/doc/view/1.4.350.0/mac/antora/spec/latest/chapters/drawing.html#VUID-vkCmdDrawIndexed-colorAttachmentCount-06179)

  1. Failure to destroy a Vulkan buffer and associated memory for lightsBuffer. Now fixed in master.
  2. Missing overrides which show up with automatic static analysis in the IDE (e.g. Xcode sees them, perhaps VS as well but not sure).

Fixed in PR #1268.

Again, @SaschaWillems if you have already fixed or plan something else, please feel free to disregard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions