Repository navigation
layers: Allow color access for depth/stencil resolves in BP - #13241
Merged
spencer-lunarg merged 1 commit intoSep 28, 2026
Merged
Conversation
Multisample resolve operations use the color attachment access types even when the attachments are depth/stencil, but BestPractices-ImageBarrierAccessLayout only allowed depth/stencil attachment accesses for the depth/stencil layouts, so barriers that followed the spec for a resolve were warned about. Allow COLOR_ATTACHMENT_READ/WRITE for the depth/stencil attachment layouts, where the single sample attachment is written, and COLOR_ATTACHMENT_READ for the read-only ones, where the multisample attachment is only read.
Collaborator
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
spencer-lunarg
approved these changes
Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11341.
The spec's resolve operations section says reads from the multisample attachment use
COLOR_ATTACHMENT_READ, access to the single sample attachment usesCOLOR_ATTACHMENT_READ/WRITE, and "these pipeline stage and access types are used whether the attachments are color or depth/stencil attachments".BestPractices-ImageBarrierAccessLayoutonly accepted the depth/stencil attachment accesses for the depth/stencil layouts, so the reporter's barrier on a depth/stencil resolve attachment (srcAccessMask = COLOR_ATTACHMENT_WRITE) got:While looking into it I realized the resolve has two sides, so this covers both:
COLOR_ATTACHMENT_READ/WRITEforDEPTH_STENCIL_ATTACHMENT_OPTIMAL,DEPTH_ATTACHMENT_OPTIMAL,STENCIL_ATTACHMENT_OPTIMALand the attachment aspect of the two mixed layouts, since the resolve attachment is writtenCOLOR_ATTACHMENT_READforDEPTH_STENCIL_READ_ONLY_OPTIMAL,DEPTH_READ_ONLY_OPTIMAL,STENCIL_READ_ONLY_OPTIMALand the read-only aspect of the mixed layouts, since the multisample attachment is only read. As far as I can tell nothing stops it from being in a read-only layout (theresolveImageLayoutVUs only rule out read-only layouts for the resolve attachment), but I may well have missed something thereTests:
PositiveBestPractices.DepthStencilResolveAccessMaskdoes the reporter's barrier, then each layout and aspect above on both the src and dst side, plus a sync1 barrier. On main it gets 23 warnings (all 12 barriers, both sides); with this change, none.NegativeBestPractices.DepthStencilReadOnlyResolveWritechecks thatCOLOR_ATTACHMENT_WRITEis still reported for each read-only layout and aspect. It passes on main and with this change, and fails if the read-only layouts are givenWRITEas well.I ran the full suite with the mock ICD and max_profile.json with no failures, and the full suite on lavapipe and RADV (RX 9070 XT). The only differences from main there are pre-existing failures, crashes and one flaky GPU-AV test, none in Best Practices.
If you'd rather keep this to just the resolve attachment side, I'm happy to drop the read-only part.