renderer: track constant-buffer DCC clears for RGBA16F targets #424

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

@⁠Techx3 on GitHub · 2026-08-31 11:35 UTC · original
Techx3:techx3/dcc-constant-buffer-clear → main · +465 −2 · 8 files · 1 commits · closed without merging

Summary

Recognize complete, straight-line uint4 metadata fills sourced from a 16-byte constant buffer and track opaque-black DCC clears for registered RGBA16F attachments. This addresses the growing-light accumulation observed in Bendy and the Ink Machine without changing lighting math or selecting a game/shader hash.

The original compute dispatch always executes. Only four equal 0x40404040 words from CPU-current backing can update the existing deferred attachment-clear state. A complete known single-plane, single-sample HDR metadata range and compatible image aliases are required; unknown, partial and unsupported fills keep their existing behavior.

Fixed DCC clear values are enabled for RGBA16F separately from packed clear-register support. The metadata footprint helper is intentionally limited to the supported pipe-aligned R_X layout, not a general DCC layout implementation.

Public references: AMD PAL non-GFX11 black/white clear codes, AMD addrlib Gfx10 metadata dimensions.

Validation

  • Release emulator and test executable built independently on Windows with clang-cl/Ninja from a9166f8.
  • 8/8 focused CTests passed: the two new DCC tests plus image views, storage sampling, HTILE clear, command scheduling, GPU command lane and stream-buffer regressions.
  • The new tests cover structural recognition/rejection, exact metadata coverage, native Vulkan RGBA16F (0,0,0,1) pixels, one-time clear consumption, and preservation of later image writes. Synthetic kernel compilation also validates SPIR-V.
  • Repeated the new Vulkan clear test with VK_LAYER_KHRONOS_validation; passed with no reported validation errors.
  • Earlier combined local builds were visually verified in Bendy, with no expanding white wash during sampled gameplay. An isolated run of this branch stops before the menu on the unchanged depthRenderTarget.cpp check: stencil state without an active stencil attachment. The local depth/stencil prerequisite is deliberately excluded, so this PR does not claim standalone gameplay validation on current upstream.

Scope

Independent branch from official main; no dependency on the separate image-to-CPU coherence change. No Inspector, diagnostic tooling, captured game shaders, SDK files, HDR display presentation, FSR, import stubs or unrelated shader changes are included. General DCC emulation and full-game compatibility are not claimed.

**@⁠Techx3** on GitHub · 2026-08-31 11:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/424) `Techx3:techx3/dcc-constant-buffer-clear` → `main` · +465 −2 · 8 files · 1 commits · closed without merging ## Summary Recognize complete, straight-line `uint4` metadata fills sourced from a 16-byte constant buffer and track opaque-black DCC clears for registered RGBA16F attachments. This addresses the growing-light accumulation observed in Bendy and the Ink Machine without changing lighting math or selecting a game/shader hash. The original compute dispatch always executes. Only four equal `0x40404040` words from CPU-current backing can update the existing deferred attachment-clear state. A complete known single-plane, single-sample HDR metadata range and compatible image aliases are required; unknown, partial and unsupported fills keep their existing behavior. Fixed DCC clear values are enabled for RGBA16F separately from packed clear-register support. The metadata footprint helper is intentionally limited to the supported pipe-aligned R_X layout, not a general DCC layout implementation. Public references: [AMD PAL non-GFX11 black/white clear codes](https://github.com/GPUOpen-Drivers/pal/blob/dev/src/core/hw/gfxip/gfx9/gfx9MaskRam.cpp), [AMD addrlib Gfx10 metadata dimensions](https://github.com/GPUOpen-Drivers/pal/blob/dev/src/core/imported/addrlib/src/gfx10/gfx10addrlib.cpp). ## Validation - Release emulator and test executable built independently on Windows with clang-cl/Ninja from `a9166f8`. - 8/8 focused CTests passed: the two new DCC tests plus image views, storage sampling, HTILE clear, command scheduling, GPU command lane and stream-buffer regressions. - The new tests cover structural recognition/rejection, exact metadata coverage, native Vulkan RGBA16F `(0,0,0,1)` pixels, one-time clear consumption, and preservation of later image writes. Synthetic kernel compilation also validates SPIR-V. - Repeated the new Vulkan clear test with `VK_LAYER_KHRONOS_validation`; passed with no reported validation errors. - Earlier combined local builds were visually verified in Bendy, with no expanding white wash during sampled gameplay. An isolated run of this branch stops before the menu on the unchanged `depthRenderTarget.cpp` check: `stencil state without an active stencil attachment`. The local depth/stencil prerequisite is deliberately excluded, so this PR does **not** claim standalone gameplay validation on current upstream. ## Scope Independent branch from official `main`; no dependency on the separate image-to-CPU coherence change. No Inspector, diagnostic tooling, captured game shaders, SDK files, HDR display presentation, FSR, import stubs or unrelated shader changes are included. General DCC emulation and full-game compatibility are not claimed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:20:09 +00:00
github-bot closed this pull request 2026-11-26 09:20:09 +00:00

Pull request closed

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