Repository navigation
Synchronize the mesh allocation-count clear before request writes - #1
Open
MichaelSmithAI wants to merge 1 commit into
Open
MichaelSmithAI wants to merge 1 commit into
MichaelSmithAI wants to merge 1 commit into
Conversation
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.
This fixes the initialization order of the shared allocation-count word added in VIctory #586. Thread zero clears the word, and a shader allocation request later stores the group's packed vertex and primitive counts into the same location. In a multi-wave group, the barrier at the final read orders both stores before that read, but leaves the order of the stores undetermined. A valid request can therefore be overwritten with zero.
The generated mesh prologue now emits a group synchronization and shared-memory fence after all lanes reconverge from the thread-zero initialization. The later fence still orders the request before the count is read. This adds one barrier per workgroup on the staged-count path. Its runtime cost is unmeasured.
I checked the disassembly of the existing synthetic 128-thread mesh program that requests three vertices and three primitives. On
9b5e239the clear and request stores both precede the first barrier. With this change their order is clear → group barrier → request → group barrier → count load. The clear and the branch that skips it both reach the first barrier. Microsoft's DXIL validator accepted the fixed shader and the Linux shader library suite passed all 70 tests.Native frame output and timing for this follow-up have not been measured. The game measurements in Marvisak#586 belong to the original branch. AI assistance was used for implementation and verification.