-
Notifications
You must be signed in to change notification settings - Fork 472
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
Clarification on layout transitions for unused attachments. #821
Comments
I don't think the initial & final layout should be ignored, i.e. that the validation layers are doing the right thing here. -- The spec uses different wording to describe when load/store ops happen vs the layout transitions. Load/Store ops for an attachment happen as part of the subpass that references those attachments:
(similar language exists for storeOp) Layout transitions happen at the begin/end of a render pass instance:
And:
This is saying that the layout transitions happen regardless of whether the attachments are used within the render pass instance. |
Thanks for the clarification. |
Before the renderpass the "unused" attachment image is cleared to a known value and left in the VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL layout. However, the initialLayout field for the "unused" attachment is set to VK_IMAGE_LAYOUT_UNDEFINED, which might cause the image contents to be perturbed when the image is transitioned from VK_IMAGE_LAYOUT_UNDEFINED to the finalLayout of VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL. I understand that part of the purpose of these "unused_attachment" tests is to ensure "unused" attachments aren't modified by the renderpass. However, there is nothing in the Vulkan spec that says the layout of "unused" attachments should be ignored. This was discussed in issue: KhronosGroup/Vulkan-Docs#821 And the conclusion is that the layout must: not be ignored for "unused" attacments. Affects: dEQP-VK.renderpass*.unused_attachment.* Components: Vulkan VK-GL-CTS issue: 1129 Change-Id: Ia6db607538cb191bc8ca6e03f8da9c88bac031c4
From Validation Layers Git Hub Issue 300 --KhronosGroup/Vulkan-ValidationLayers#300 and KhronosGroup/Vulkan-ValidationLayers#303
Vulkan spec section 7.1 states:
If an attachment is not used by any subpass, then loadOp, storeOp, stencilStoreOp, and stencilLoadOp are ignored, and the attachment’s memory contents will not be modified by execution of a render pass instance.
Does the statement "memory contents will not be modified" imply also that the final layout of an unreferenced attachment should be ignored too. However validation tracks the new layout even for unused attachments, currently.
The bug is requesting that these layouts be treated as ignored, but it's unclear whether that is the intention of the spec language above
@janharaldfredriksen-arm
The text was updated successfully, but these errors were encountered: