Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segmentation faults when subpass has unused attachments #826

Closed
wants to merge 1 commit into from
Closed

Fix segmentation faults when subpass has unused attachments #826

wants to merge 1 commit into from

Conversation

doitsujin
Copy link
Contributor

This fixes two issues related to color attachments in subpasses.

  1. Serialise_vkCmdClearAttachments uses the render pass attachment index from the subpass description without checking whether the attachment is used in the subpass.

  2. VulkanDebugManager::RenderOverlay uses the wrong attachment indices for vkCmdClearAttachments. The correct index is the index into the color attachment reference array of the current subpass description, not the index into the attachment description array of the render pass description.
    Section 17.2 from the Vulkan specification says:

colorAttachment is only meaningful if VK_IMAGE_ASPECT_COLOR_BIT is set in aspectMask, in which
case it is an index to the pColorAttachments array in the VkSubpassDescription structure of the
current subpass which selects the color attachment to clear.

Issue #2 occurs when trying to use the "Clear before draw/pass" overlays in case the attachment index in the render pass description differs from the attachment index in the subpass description.

@doitsujin
Copy link
Contributor Author

nevermind, wrong branch.

@doitsujin doitsujin closed this Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant