graphics: honour PS5 register DCC clears on 16-bit colour targets #1234

Closed
github-bot wants to merge 1 commit from gh-pr/1234/head into gh-pr/1234/base
Owner

@⁠TheCruZ on GitHub · 2026-10-08 19:31 UTC · original
pr/dcc-clear-key-0x10 → main · +6 −1 · 2 files · 1 commits · closed without merging

Summary

Fixes black smoke and particles in Grand Theft Auto V (PPSA04263): Michael's exhaled cigar smoke in the Father/Son cutscene (and small particles over the sky) rendered as opaque black blobs with ragged edges instead of translucent smoke.

Problem

The particle pixel shader also writes its view depth to an R16_FLOAT MRT blended with MIN. GTA V clears that target to 65504 (CB_COLOR_CLEAR_WORD0 = 0x7bff7bff) with a DCC fast clear whose metadata keys are 0x10.

DecodeColorClear only treated the GFX10 0x20 key as a clear-to-register, so the clear was dropped and the target kept the zeros in guest memory. MIN(0, depth) stays 0, and the depth-of-field pass then treats the smoke as touching the camera and blends in its dark near-field blur.

humo_negro_bug

Change

DCC keys 0x10 are treated as clear-to-register like 0x20, so the target is cleared to the CB_COLOR_CLEAR_WORD value (the 16-bit clear words already decode since 57c97ebd).

Testing

  • Grand Theft Auto V (PPSA04263): the cigar smoke in Father/Son and the particles over the sky are translucent.
  • shader_recompiler_compute_tests: RenderExecutorColorMetadataClear gets a case that fills the metadata of an R16_FLOAT target with 0x10 keys and clear word 0x7bff7bff (fails without this change, passes with it). --image-overlap-only and the default run pass.
  • Tested on Windows 11 with AMD Ryzen 5900x and RTX 3090.

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.

**@⁠TheCruZ** on GitHub · 2026-10-08 19:31 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1234) `pr/dcc-clear-key-0x10` → `main` · +6 −1 · 2 files · 1 commits · closed without merging ## Summary Fixes black smoke and particles in Grand Theft Auto V (PPSA04263): Michael's exhaled cigar smoke in the Father/Son cutscene (and small particles over the sky) rendered as opaque black blobs with ragged edges instead of translucent smoke. ## Problem The particle pixel shader also writes its view depth to an `R16_FLOAT` MRT blended with `MIN`. GTA V clears that target to 65504 (`CB_COLOR_CLEAR_WORD0 = 0x7bff7bff`) with a DCC fast clear whose metadata keys are `0x10`. `DecodeColorClear` only treated the GFX10 `0x20` key as a clear-to-register, so the clear was dropped and the target kept the zeros in guest memory. `MIN(0, depth)` stays 0, and the depth-of-field pass then treats the smoke as touching the camera and blends in its dark near-field blur. <img width="1783" height="847" alt="humo_negro_bug" src="https://github.com/user-attachments/assets/aa9d19e8-07a5-47f2-9a3a-9bd07c780bb3" /> ## Change DCC keys `0x10` are treated as clear-to-register like `0x20`, so the target is cleared to the `CB_COLOR_CLEAR_WORD` value (the 16-bit clear words already decode since 57c97ebd). ## Testing - Grand Theft Auto V (PPSA04263): the cigar smoke in Father/Son and the particles over the sky are translucent. - `shader_recompiler_compute_tests`: `RenderExecutorColorMetadataClear` gets a case that fills the metadata of an `R16_FLOAT` target with `0x10` keys and clear word `0x7bff7bff` (fails without this change, passes with it). `--image-overlap-only` and the default run pass. - Tested on Windows 11 with AMD Ryzen 5900x and RTX 3090. ## 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](https://github.com/TheCruZ/KytyPS5-GTA), i will be bringing PRs here after test them enough.
GTA V's exhaled cigar smoke in the Father/Son cutscene (and small
particles over the sky) rendered as opaque black blobs with ragged
edges. The particle pixel shader also writes its view depth to an
R16_FLOAT MRT blended with MIN; GTA V clears that target to 65504
(CB_COLOR_CLEAR_WORD0 = 0x7bff7bff) with a DCC fast clear whose keys
are 0x10. Only the GFX10 0x20 key was treated as a clear-to-register,
so the clear was dropped and the target kept the zeros in guest memory.
MIN(0, depth) stays 0, and the depth-of-field pass then treats the smoke
as touching the camera and blends in its dark near-field blur.

Treat 0x10 DCC keys as clear-to-register (the 16-bit clear words decode
since 57c97ebd).

Test: RenderExecutorColorMetadataClear (--image-overlap-only) clears an
R16_FLOAT target through 0x10 keys.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:49:16 +00:00
github-bot closed this pull request 2026-11-26 09:49:16 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-08 19:35 UTC · original · edited 2026-10-08 19:46 UTC

Review in Change Stack →

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: 9c6a548e-bb4a-472d-a6ac-91a5815da967
📥 Commits

Reviewing files that changed from the base of the PR and between 2f4b8a335d and d8616fd788.

📒 Files selected for processing (2)
  • src/graphics/host_gpu/renderer/cache/textureCache.cpp
  • tests/ShaderRecompilerComputeTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

DecodeColorClear now accepts DCC clear codes 0x10 and 0x20 for non-CMASK metadata. For CMASK metadata, only code 0 selects the register-clear path. A test case covers a 16-bit layout with fill value 0x10101010 and expected texel and clear word 0x7bff7bff.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to d8616

The change enables the reported 16-bit DCC clear path, and the added R16 test verifies the resulting clear value. The author reports the test runs pass; no actionable merge blocker is evident.

🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the main change: supporting PS5 register DCC clears for 16-bit color targets.
Description check ✅ Passed The description directly explains the GTA V rendering issue, the DCC clear decoding change, and the validation performed.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 too large.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-08 19:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1234#issuecomment-6067580644) · edited 2026-10-08 19:46 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1234?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `9c6a548e-bb4a-472d-a6ac-91a5815da967` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2f4b8a335d5e27a5153bdea670bd877a061e37b1 and d8616fd78875f41b5f408538ae39a5f74839eec6. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `src/graphics/host_gpu/renderer/cache/textureCache.cpp` * `tests/ShaderRecompilerComputeTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough `DecodeColorClear` now accepts DCC clear codes `0x10` and `0x20` for non-CMASK metadata. For CMASK metadata, only code `0` selects the register-clear path. A test case covers a 16-bit layout with fill value `0x10101010` and expected texel and clear word `0x7bff7bff`. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"d8616fd78875f41b5f408538ae39a5f74839eec6" --> **Change:** Bug fix <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** **⚪ Minimal** · up to `d8616` <!-- final_review_risk_coverage:{"sourceCommitId":"d8616fd78875f41b5f408538ae39a5f74839eec6","coveredCommitId":"d8616fd78875f41b5f408538ae39a5f74839eec6","kind":"reviewed"} --> The change enables the reported 16-bit DCC clear path, and the added R16 test verifies the resulting clear value. The author reports the test runs pass; no actionable merge blocker is evident. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❓ 1</summary> ### ❌ Failed checks (1 inconclusive) | Check name | Status | Explanation | Resolution | | :---------------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ❓ Inconclusive | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------ | :------- | :------------------------------------------------------------------------------------------------------------------------ | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Title check | ✅ Passed | The title clearly and concisely identifies the main change: supporting PS5 register DCC clears for 16-bit color targets. | | Description check | ✅ Passed | The description directly explains the GTA V rendering issue, the DCC clear decoding change, and the validation performed. | </details> <details> <summary>Full details: Docstring Coverage</summary> **Explanation** Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 too large.) </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autopilot</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1234)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.