Skip to content

Conversation

@slipher
Copy link
Member

@slipher slipher commented Sep 19, 2025

Fixes this issue for me which can happen when SSAO + realtime lights + bindless textures are used:

unvanquished_2025-09-18_235217_000

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_drawDynamicLights afterward 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.

Since it's about to be used more times. I named it like
PrepareForSamplingDepthMap instead of something about texture barrier,
because I may want to add more stuff in for DaemonEngine#1814 where there is the
possibility to use a copy of the depth texture instead.

Also, always mark depth buffer dirtiness with material system.
Thanks to Reaper for finding the motion blur and light tile spots.
@slipher slipher merged commit 4d3bf7b into DaemonEngine:master Sep 20, 2025
9 checks passed
@slipher slipher deleted the barriers branch September 20, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants