graphics: hold HTile fast clears on depth-read-only passes #401
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!401
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/401/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@brandostrong on GitHub · 2026-08-29 16:16 UTC · original
brandostrong:fix/htile-clear-depth-readonly→main· +4 −1 · 1 files · 1 commits · closed without mergingThis is a huge improvement in GTA. It goes from 70% of the things in the scene not being drawn(no walls no ceiling, floor is invisible, no objects) to basically all of them.
Summary
writing pass still receives it.
Problem
HTile fast clears are emulated by recording that a depth surface is logically cleared,
then discharging that as a Vulkan
loadOp = CLEARon the next bind of the target. Theconsume site tested only whether a clear was armed, never whether the binding pass
writes depth:
A pass with
Z_WRITE_ENABLEcleared only reads depth. Discharging the clear theredestroys the depth it is about to test against, so every fragment fails, no fragment
writes depth, and the surface stays at the clear value for the rest of the frame. On
hardware this cannot happen: the fast clear is a change to metadata state, not an
operation attached to a pass.
In GTA V (PPSA04264) the main scene depth target is cleared to 0.0 and written by a
GEQUAL prepass (reversed-Z), then bound by a read-only pass using LESS. That pass
consumed the clear, leaving the buffer uniformly 0.0:
A RenderDoc capture of the same frame showed the depth attachment uniformly 0.0 with
Func = Less, Write = off, and geometry rejected with "Depth test failed".Implementation
depth_meta_clear_enableondepth_write_enableinAcquireRenderTargets.TouchMeta(..., false)consume is already gated on the same flag, so aheld clear stays armed rather than being silently discarded.
AI assistance
AI assistance was used because I'm a smooth brained javascript dev
Pull request closed