shaders: e4a9f58e3acfcf7b, project quad lanes that miss the decal box (black ground tiles at widths not a multiple of 128) #271

Manually merged
github merged 1 commit from github-bot/gh-271 into gh-pr/271/base 2026-12-06 00:55:44 +00:00 AGit
Owner

@⁠matthieupl87-spec on GitHub · 2026-12-05 22:26 UTC · original
matthieupl87-spec:fix/decal-resolve-scalarized-derivatives → main · +28 −40 · 1 files · 1 commits · merged 2026-12-05 22:51 UTC

What

CS_ProjDecalResolve_Scalarized (shaders/replace/e4a9f58e3acfcf7b.compute.hlsl) draws black 8 x 8 tiles on the ground at render widths that are not a multiple of 128. For example, 3440 x 1440 native, or 2288 x 960 under DLSS quality with a 3440 x 1440 output. Ultrawide players see it first (#26).

Cause

In a uniform loop, the coarse derivatives read a coordinate for each quad lane. For a lane in the loop that failed the decal's box test, the file took the registers the pass's head wrote: 0, cz, cx, cy, and the high half of the decal's dword 0xd0 + P. Those are world positions, not texture coordinates, so the gradients passed to SampleGrad had world-position size.

Fix

Such a lane now gives the coordinate projected at its own position for this decal. This is what c4183d3cbee28e8e (the vectorized resolve) already does. The Q_FAILED state, the failed argument and the constants that fed it are removed, and the header comment is updated. Only this one file changes.

Tested

Tested in game on an RTX card with a Ryzen 7 5800X3D (Windows, Series X profile, 40 fps cap), with the VI-Ultrawide mod for 21:9:

  • Bisection: removing only e4a9f58e3acfcf7b (translation used instead) gives a clean ground. Removing only the classification pair does not.
  • 3440 x 1440 without an upscaler: black tiles before, clean ground after.
  • 3440 x 1440 with DLSS quality (render 2288 x 960): clean ground and no black edges under cars. The game also felt smoother than with the translation.
  • Build: the file compiles with the Windows SDK dxc (cs_6_6, the flags from build.rs).

Not verified on the console: what the hardware's derivatives actually read from an inactive lane. The file already notes this as an assumption.

🤖 Generated with Claude Code

**@⁠matthieupl87-spec** on GitHub · 2026-12-05 22:26 UTC · [original](https://github.com/gamingwithhomie/larp/pull/271) `matthieupl87-spec:fix/decal-resolve-scalarized-derivatives` → `main` · +28 −40 · 1 files · 1 commits · merged 2026-12-05 22:51 UTC ## What `CS_ProjDecalResolve_Scalarized` (`shaders/replace/e4a9f58e3acfcf7b.compute.hlsl`) draws black 8 x 8 tiles on the ground at render widths that are not a multiple of 128. For example, 3440 x 1440 native, or 2288 x 960 under DLSS quality with a 3440 x 1440 output. Ultrawide players see it first (#26). ## Cause In a uniform loop, the coarse derivatives read a coordinate for each quad lane. For a lane in the loop that failed the decal's box test, the file took the registers the pass's head wrote: `0`, `cz`, `cx`, `cy`, and the high half of the decal's dword `0xd0 + P`. Those are world positions, not texture coordinates, so the gradients passed to `SampleGrad` had world-position size. ## Fix Such a lane now gives the coordinate projected at its own position for this decal. This is what `c4183d3cbee28e8e` (the vectorized resolve) already does. The `Q_FAILED` state, the `failed` argument and the constants that fed it are removed, and the header comment is updated. Only this one file changes. ## Tested Tested in game on an RTX card with a Ryzen 7 5800X3D (Windows, Series X profile, 40 fps cap), with the VI-Ultrawide mod for 21:9: - **Bisection:** removing only `e4a9f58e3acfcf7b` (translation used instead) gives a clean ground. Removing only the classification pair does not. - **3440 x 1440 without an upscaler:** black tiles before, clean ground after. - **3440 x 1440 with DLSS quality** (render 2288 x 960): clean ground and no black edges under cars. The game also felt smoother than with the translation. - **Build:** the file compiles with the Windows SDK `dxc` (`cs_6_6`, the flags from `build.rs`). Not verified on the console: what the hardware's derivatives actually read from an inactive lane. The file already notes this as an assumption. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CS_ProjDecalResolve_Scalarized took, for a quad lane in the loop that failed
the decal's box test, the registers the pass's head wrote (0, cz, cx, cy, a
half of the decal's dword 0xd0 + P) as its texture coordinate for the coarse
derivatives. Those are world positions, not coordinates: at render widths
that are not a multiple of 128 (3440 x 1440 native, 2288 x 960 under DLSS
quality at 3440) the ground showed black 8 x 8 tiles. Now such a lane gives
the coordinate projected at its own position for this decal, as
c4183d3cbee28e8e (the vectorized resolve) already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 22:29:06 +00:00
github-bot changed target branch from main to gh-pr/271/base 2026-12-05 22:54:27 +00:00
github-bot referenced this pull request from a commit 2026-12-06 00:55:31 +00:00
github manually merged commit 4fc21bdbec into gh-pr/271/base 2026-12-06 00:55:44 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.