Fix: Race condition when compute shader writes to texture. #8527
Merged
Wumpf merged 3 commits intogfx-rs:trunkfrom Nov 16, 2025
Merged
Fix: Race condition when compute shader writes to texture. #8527Wumpf merged 3 commits intogfx-rs:trunkfrom
Wumpf merged 3 commits intogfx-rs:trunkfrom
Conversation
If shader writes to texture in any way the barrier should be placed to avoid race when downloading texture somewhere else
Contributor
|
@SpeedCrash100 could you create an issue with the output from the test |
Contributor
Author
Wumpf
requested changes
Nov 16, 2025
Member
Wumpf
left a comment
There was a problem hiding this comment.
Thanks for digging deeper into this!
Beside needing to clarify what happens in queue.rs, please also add a changelog entry, thanks :)
547cea5 to
24f68d6
Compare
Contributor
Author
|
Replaced barrier from |
71756ce to
3c97b93
Compare
3c97b93 to
a94385b
Compare
Wumpf
reviewed
Nov 16, 2025
Member
Wumpf
left a comment
There was a problem hiding this comment.
looking great now & makes sense to me :)
thanks again!
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.
Connections
fixes #8473
Description
This fix for race where compute pass writes to texture which then copy to buffer. The race can be seen only on Mesa radeonsi drivers.
Testing
It tested on this gist https://gist.github.com/SpeedCrash100/6c60d121a32ef5bd6077c1822da19a38 with AMD RX 9070 XT.
The test switches white and black images and find inconsistency. For example when parts of white images found when the black one image were passed to input. The gist will print error:
Before the changes if run with
WGPU_BACKEND=glenv (to force use radeonsi) the errors were detected by the gist. The error no longer printing by the test program.Squash or Rebase?
Squash
Test run results