Add option to set the depth-buffer-clear position counting from the last one - #431
Add option to set the depth-buffer-clear position counting from the last one#431microdee wants to merge 4 commits into
Conversation
|
This Source Engine case is theoretically already supposed to be addressed by the "Choose last clear operation with high number of draw calls" option (see also b1effa7). However I see in the videos that the option is not shown here, presumably because the condition for showing it is too restrictive ( |
…ion when there are multiple items See #431
|
Oh! I'm going to try with that commit, thanks for pointing it out, do you remember what was the reason to restrict "Choose last clear operation with high number of draw calls" like that in the first place? |


This PR gives a tool for Source games to help with correctly copying the depth-buffer there. There are well known problems with reliably getting the depth buffer in Source games:
To get around all that I introduced the option to manually set the copy-depth-before-clear position counting from the last clear operation, since the count of the UI depth-buffer clears are much more stable than the depth-buffer-clears done during actual rendering.
Depth buffer without this fix:
2026-07-13_15-37-39.mp4
Depth buffer with this fix:
2026-07-13_15-41-05.mp4
Another example:
2026-07-13_16-09-53.mp4
Unfortunately since we rely on data from previous frame (the number of depth-buffer-clears in one frame) there may be flickering if the clear operations change often, but in Source games at least it's barely noticeable.