gpu: check DCC fast clears on the GPU instead of reading metadata back (PPSA32309) #1819
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!1819
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1819/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?
@MrBigBritches on GitHub · 2026-10-22 05:38 UTC · original
MrBigBritches:dcc-gpu-clear-check→main· +659 −5 · 10 files · 1 commits · closed without mergingWhen a surface with DCC metadata is looked up,
MaterializeColorClearreads its metadata to find slices fast-cleared to a single code, and clears them. If the GPU had written that metadata, this was a synchronous download that drained the GPU.The Adventures of Elliot (PPSA32309) fast-clears several surfaces, including 3D volumes, with a compute shader every frame, and binds them throughout the frame. That added up to about 1,000 downloads and 330 ms of GPU waits per second, holding even a black-screen cutscene at ~45 fps (1% low ~30 fps).
#1124
Changes
VK_EXT_conditional_rendering, a small compute shader (color_clear_check.comp) replaces the readback.vkCmdClearAttachmentsper slice and candidate code under conditional rendering, using the clear values the CPU path would use.Results (RTX 5090, Ryzen 7 7800X3D)
Tests
New
CheckColorClearCheck(skipped without conditional rendering):The test harness enables conditional rendering when the GPU supports it.
@coderabbitai[bot] on GitHub · 2026-10-22 05:47 UTC · original
📝 Walkthrough
The change adds conditional-rendering capability detection and a compute shader that checks color-metadata slices against candidate clear codes. The texture cache uses the resulting predicates to conditionally materialize supported color clears and tracks checked metadata codes. GPU writes invalidate overlapping cached checks. Compute tests cover predicate results, reset behavior, and range invalidation.
Suggested reviewers:
nmzikPriority: ⬆️ High
Change: Bug fix
Merge Risk: 🔵 Low · up to
c6f26A recreated VideoOut image may miss a color clear. Restricting the cache entries and testing invalidation through a GPU write would address the remaining bounded risk before merge.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 7 files. (3 skipped: 2 unsupported, 1 too large.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
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.@ -1038,0 +1125,4 @@checked = {slice_size, 0};}checked.codes |= code_mask;}@coderabbitai[bot] on GitHub · 2026-10-22 05:47 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 6028
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 29875
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 3678
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 8653
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 28303
Do not cache checked metadata for
VideoOut.VideoOutkeeps its metadata code, but the current cache records it as checked. IfFindImagecreates a replacement image with the same metadata range,all_checkedcan return before the replacement receives the clear. Cache entries only when the check resets the metadata.🐛 Suggested fix
@coderabbitai[bot] on GitHub · 2026-10-22 05:47 UTC · original · reviewed
Actionable comments posted: 1
🧹 Nitpick comments: 1
ℹ️ Review info
⚙️ Run configuration
f3c6ca8e-8e78-48d2-ae37-6858b2043ff1📥 Commits
Reviewing files that changed from the base of the PR and between
c5016d9455andc6f26c1201.📒 Files selected for processing: 10
CMakeLists.txtsrc/graphics/host_gpu/graphicContext.hsrc/graphics/host_gpu/renderer/cache/bufferCache.cppsrc/graphics/host_gpu/renderer/cache/colorClearCheck.cppsrc/graphics/host_gpu/renderer/cache/colorClearCheck.hsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.hsrc/graphics/host_gpu/shaders/color_clear_check.compsrc/graphics/presentation/window/vulkanWindow.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
@Nmzik on GitHub · 2026-10-22 14:14 UTC · original
@MrBigBritches Thanks! Sole authored & pushed to main
b54057942dPull request closed