graphics: keep layered depth stencil and HTile ranges for partial views #927
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!927
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/927/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?
@TheCruZ on GitHub · 2026-09-29 21:21 UTC · original
pr/layered-depth-ranges→main· +27 −4 · 1 files · 1 commits · closed without mergingSummary
Fixes the emulator exiting with
TextureCache: invalid depth uploadwhen Grand Theft Auto V (PPSA04263) enters Story mode.Problem
The game renders into slice 0 of a six-layer depth/stencil shadow cube. A depth target view that covers only the first slices of a cached layered image describes its stencil and HTile planes only up to its last slice.
FindDepthTargetreplaced the cached image's ranges with that shorter range, so the stencil association covered one slice of a six-layer image and the next refresh failed the depth upload check.Change
This change scales both ranges to the cached image's layer count. It applies only when the view has fewer layers than the cached image, starts at the same address, and the range size is a multiple of the view's layer count; otherwise the range is kept as before.
The
invalid depth uploaderror now also prints the rejected plane geometry, to make similar reports easier to diagnose.Testing
AI usage
AI (Claude Opus 5.5) was used to investigate the issue and to implement the change. I reviewed the code, understand it, tested it as described above, and wrote this description myself, in general fully tested the game while doing few missions and playing in-game with my GTA V fork, i will be bringing PRs here after test them enough.
@coderabbitai[bot] on GitHub · 2026-09-29 21:30 UTC · original · edited 2026-09-29 21:32 UTC
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
ba62629b-9a5e-45da-b88a-85d67d4237c0📥 Commits
Reviewing files that changed from the base of the PR and between
05057c9441and4fc3e315c3.📒 Files selected for processing (1)
src/graphics/host_gpu/renderer/cache/textureCache.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
📝 Walkthrough
Walkthrough
Depth-upload validation now reports image and backing sample details when its existing failure condition is met.
FindDepthTargetcan scale matching stencil and metadata ranges to the cached image’s layer count under the specified range-size condition. Stencil association uses the stored scaled range.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
4fc3eThe range scaling reconstructs the cached backing range, and the diagnostic change does not alter when uploads fail. No concrete merge-blocking risk was identified.
Security Architecture Review
Security architecture risk: 🔵 Low · up to
4fc3eThe change is confined to depth-target handling in the renderer. The reviewed paths do not show a new external entrypoint or a demonstrated security boundary bypass. Validation of the expanded ranges is not equally explicit for both planes, so some uncertainty remains.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@TheCruZ on GitHub · 2026-10-05 16:33 UTC · original
fixed by
github.com/KytyPS5/KytyPS5@068d7621dbPull request closed