Metal: Do not reset barrier fence index after first wait.#67
Merged
DarioSamo merged 1 commit intorenderbag:mainfrom Dec 9, 2025
Merged
Metal: Do not reset barrier fence index after first wait.#67DarioSamo merged 1 commit intorenderbag:mainfrom
DarioSamo merged 1 commit intorenderbag:mainfrom
Conversation
DarioSamo
approved these changes
Dec 9, 2025
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.
Unleashed Recompiled can do the following for resolve passes:
The current logic for barriers here will reset the fence index after the placed barrier is waited on by the next encoder. This was a mistaken optimization that does not account for when encoders are split for reasons other than a new barrier. As a result, subsequent encoders are not blocked on the barrier fence like they should be, and can run out-of-order with the operations before the barrier.
In this particular scenario, the copies are separated into different render encoders due to the framebuffer change, it forgets about the last barrier before the second encoder, and the result is the following:
As a result the depth copy may be reordered to before the barrier, causing e.g. water to flicker in Apotos with anti-aliasing turned off (because this causes both resolves to be shader copy draws).
Fix the issue by removing the lines that reset the fence index to -1 after a wait.