Add more texture barriers to prevent depth sampling issues #1816
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 this issue for me which can happen when SSAO + realtime lights + bindless textures are used:
It's a weird bug since what seems to matter is whether realtime lights were rendered on the first frame after loading. Turning on or off
r_drawDynamicLightsafterward has no effect.Although #1684 as a whole triggers the SSAO noise bug to occur all the time for me (not just on certain maps), one of the commits from it turned out to fix the bug. If I cherry-pick
Add 2 missing glTextureBarrier()to master, the SSAO noise is gone. So this PR is an expanded version of that commit.In the light tile case, I don't think there is normally a texture feedback loop because we are not writing to the main rendering FBO, only the depth tile one. But I found a comment saying that with bindless textures, feedback loops can depend in some way on whether a texture handle is resident. I don't understand what rules should be followed for that case.