graphics: honour PS5 0x10 DCC register clears (GTA V black smoke) #2394
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!2394
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2394"
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?
@oguzhanozfe on GitHub · 2026-11-18 22:22 UTC · original
oguzhanozfe:fix/gta5-dcc-0x10-register-clear→main· +12 −4 · 4 files · 1 commits · openSummary
Fixes black smoke and particles in Grand Theft Auto V (PPSA04263 / PPSA04264). In the Father/Son cutscene, Michael's exhaled cigar smoke, and small particles over the sky, render as opaque black blobs instead of translucent smoke (#979: "Smoke renders black in some areas").
This picks up TheCruZ's closed #1234 and finishes it for current
main.Problem
The particle pixel shader also writes its view depth to an
R16_FLOATMRT blended withMIN. GTA V clears that target to 65504 (CB_COLOR_CLEAR_WORD0 = 0x7bff7bff) with a DCC fast clear whose metadata keys are0x10.Two places only accepted the GFX10
0x20key as a clear-to-register:DecodeColorClear(textureCache.cpp). This is the CPU decode #1234 fixed.gpu_tiler_color_clear.comp, which was added after #1234. It requires(key & 0x1f) == 0and picks a slot withkey >> 5, so a0x10key never matched.Because of that the clear is dropped and the target keeps zeros.
MIN(0, depth)then stays 0, and depth of field treats the smoke as touching the camera, so it blends in the dark near-field blur.Change
DecodeColorClear:0x10DCC keys decode as a register clear, like0x20.gpu_tiler_color_clear.comp: a0x10key is checked in0x20's slot. Both keys mean "clear toCB_COLOR_CLEAR_WORD", so the existing per-slot decode (DecodeColorClear(key << 5)) and the metadata expansion work unchanged.tiler.h: the slot comment mentions the shared slot.RenderExecutorColorMetadataCleargets a case that fills anR16_FLOATtarget's metadata with0x10keys and clear word0x7bff7bff.Testing
Windows 11, Ryzen 9 5950X, RTX 3090, clang-cl (LLVM 23), Release.
shader_recompiler_compute_tests --dcc-clear-onlyRenderExecutorColorMetadataClear failed at GPU color clear value: native metadata did not materialize the expected colorRenderExecutorColorMetadataClear okmain.--compute-meta-clear-only,--image-overlap-onlyand the default full run all pass (exit 0).AI usage
AI (Claude Opus 5.5) was used to:
0x20-only checkThe
0x10finding and the original fix are TheCruZ's (#1234), credited withCo-authored-by.🤖 Generated with Claude Code
@coderabbitai[bot] on GitHub · 2026-11-18 22:27 UTC · original
No actionable comments were generated in the recent review.
Walkthrough
For non-Cmask metadata,
DecodeColorClearnow treats keys0x10and0x20as register clears. The shader maps key0x10to0x20for slot selection and key-mask matching. The tiler comment documents that both keys share a slot. A compute test case adds a 16-bit clear with value0x7bff7bff.Suggested reviewers:
mrbigbritches,nmzikChange: Bug fix · Severity of issue fixed: Medium
Merge Risk:
Minimal · up to
041fbThis change makes the renderer treat PS5 DCC key 0x10 as a register clear, which should fix the black smoke and particles in GTA V. No concrete merge-blocking risk was found. The author has not tested GTA V on this exact branch.
Pre-merge checks:
4
#1234, is closed and completed. The linked-issue context marks it as historical background only. No active directly linked targets remain, so no linked-issue coding requirements…Full details: Title check
Explanation
The title names the main change: PS5 0x10 DCC register clears are now honoured, which matches the changes to DecodeColorClear, the GPU color clear shader, and the test case. It also names the user-visible symptom (GTA V black smoke). The title is fairly long, but it is specific and related to the changeset.
Full details: Description check
Explanation
The description explains the problem (black smoke and particles in GTA V), the root cause (0x10 DCC keys rejected by DecodeColorClear and the native metadata check in gpu_tiler_color_clear.comp), the planned change, and the test results. It matches the changeset closely.
Full details: Linked Issues check
Explanation
The only linked issue,
#1234, is closed and completed. The linked-issue context marks it as historical background only. No active directly linked targets remain, so no linked-issue coding requirements apply to this pull request. The pull request states its own intent: handle PS5 DCC metadata key 0x10 as a register clear, in both DecodeColorClear and the native metadata check in gpu_tiler_color_clear.comp. The#1234acceptance criteria are not treated as requirements.Full details: Out of Scope Changes check
Explanation
Every changed file serves the stated objective of treating DCC key 0x10 as a clear to CB_COLOR_CLEAR_WORD. textureCache.cpp (DecodeColorClear) accepts 0x10 alongside 0x20 for non-Cmask metadata. gpu_tiler_color_clear.comp maps 0x10 to the 0x20 slot before the mask test. tiler.h updates the slot comment to match. ShaderRecompilerComputeTests.cpp adds a 0x10 test case that covers the same behavior. No change falls outside this objective. The GTA V in-game result is not verified on this branch, but that uncertainty concerns verification, not scope.
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
6d277e0b-d4a8-4df6-a375-dd08e2fb16f8Reviewing files that changed from the base of the PR and between
a90be8dd73and041fbb830f.src/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/image/tiler.hsrc/graphics/host_gpu/shaders/gpu_tiler_color_clear.comptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.