Repository navigation
shaders: let a wave catch up before a barrier in block-dispatched programs - #161
Merged
Merged
Conversation
…grams A guest wave reaches S_BARRIER as a whole: a lane that leaves a loop early stays masked out in EXEC until the rest of the wave is done. The block dispatcher gives every lane its own program counter, so such a lane went through the barrier on its own and read group-shared memory the others had not written yet. Start a block at each barrier and enter it only once every active lane of the wave stands at one, the earliest first when they stand at different ones. CS_TAA2_Resolve shows it: the lanes fill a 10x10 tile, some in two iterations and some in one, and the last rows of every 8x8 group came out near zero. Mean of the resolved image by row of the group, on RADV GFX12: .342 .343 .343 .344 .277 .115 .023 .001. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Block-dispatched programs give every lane its own program counter, so a lane that left a loop early went through
s_barrieralone and read group-shared memory the others had not written yet. On the console it stays masked in EXEC and the wave reaches the barrier together.This starts a block at each barrier and enters it once every active lane of the wave stands at one.
Checked with GTA VI on RADV GFX12:
CS_TAA2_Resolvecame out near zero in the last rows of each 8x8 group (means by row .342 .343 .343 .344 .277 .115 .023 .001), and the dark horizontal lines are gone in the game with this change.Tests: new
dispatched_lanes_wait_for_their_wave_at_a_barrier; translator, dxbc, xg-layout, d3d12 check and Python suites pass.🤖 Generated with Claude Code