xshader: accept the sampler heap base in rooted pixel shaders #157

Manually merged
github merged 1 commit from gh-pr/157/head into gh-pr/157/base 2026-11-26 06:35:03 +00:00
Owner

@⁠NathansDomainSolutions on GitHub · 2026-11-25 09:50 UTC · original
NathansDomainSolutions:fix/rooted-pixel-sampler-heap → main · +4 −1 · 1 files · 1 commits · merged 2026-11-25 09:55 UTC

Summary

A pixel shader that indexes the descriptor heaps receives the sampler heap base in the user SGPR named by FSSM user-data class 6 (the resource heap is class 5). pixel_heap_base refused class 6 whenever a root signature was present. Fixed-offset reads from the sampler heap (e.g. s16 + 0x430) then fell through to the root-table lookup, stayed unmapped, and the rooted translation was refused with unmapped descriptor at sN + 0x_ in a heap-indexing pixel shader.

In ProjectScarlett this mostly hits pixel stages of mesh pipelines. When the rooted translation is refused, slot 86 falls back to the root-less pixel translation, whose private space1 bindings (e.g. b21 space1) the mesh pipeline's root doesn't provide. vkd3d-proton rejects the pipeline with vkd3d result -3, and the draw is lost.

This PR accepts class 6 when the root sets SAMPLER_HEAP_DIRECTLY_INDEXED (0x800), as class 5 already requires CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED (0x400). An example root that triggers it: flags 0xc00, FSSM user records [5, 0, 1, 0, 0xf] (resource heap in s15) and [6, 0, 1, 0, 0x10] (sampler heap in s16).

Checks

  • Over 5,942 recorded rooted pixel requests (pixel stages carrying the pipeline RTS0): 2,786 newly translated, 0 regressions, 13 existing outputs changed. Before this change, 2,363 of the remaining refusals in that set were this message.
  • DXC: a sample of 55 new outputs all compile (-O0 above 128 KiB).
  • cargo test for tools/shader-compiler (x86_64-unknown-linux-gnu): all pass.
  • Not yet run in game on its own: an in-game run with this on top of current main is in progress. In run 35 (main + #150), mesh slot 86 pipelines failing with -3 numbered about 10,400. The pixel shaders I sampled from those failures were root-less fallbacks of exactly this kind.

AI-assisted: written with Claude Code and reviewed by me.

🤖 Generated with Claude Code

**@⁠NathansDomainSolutions** on GitHub · 2026-11-25 09:50 UTC · [original](https://github.com/brcly/TuxBox/pull/157) `NathansDomainSolutions:fix/rooted-pixel-sampler-heap` → `main` · +4 −1 · 1 files · 1 commits · merged 2026-11-25 09:55 UTC ## Summary A pixel shader that indexes the descriptor heaps receives the sampler heap base in the user SGPR named by FSSM user-data class 6 (the resource heap is class 5). `pixel_heap_base` refused class 6 whenever a root signature was present. Fixed-offset reads from the sampler heap (e.g. `s16 + 0x430`) then fell through to the root-table lookup, stayed unmapped, and the rooted translation was refused with `unmapped descriptor at sN + 0x_ in a heap-indexing pixel shader`. In ProjectScarlett this mostly hits pixel stages of mesh pipelines. When the rooted translation is refused, slot 86 falls back to the root-less pixel translation, whose private space1 bindings (e.g. `b21 space1`) the mesh pipeline's root doesn't provide. vkd3d-proton rejects the pipeline with `vkd3d result -3`, and the draw is lost. This PR accepts class 6 when the root sets `SAMPLER_HEAP_DIRECTLY_INDEXED` (0x800), as class 5 already requires `CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED` (0x400). An example root that triggers it: flags `0xc00`, FSSM user records `[5, 0, 1, 0, 0xf]` (resource heap in s15) and `[6, 0, 1, 0, 0x10]` (sampler heap in s16). ## Checks - Over 5,942 recorded rooted pixel requests (pixel stages carrying the pipeline RTS0): **2,786 newly translated, 0 regressions**, 13 existing outputs changed. Before this change, 2,363 of the remaining refusals in that set were this message. - DXC: a sample of 55 new outputs all compile (`-O0` above 128 KiB). - `cargo test` for tools/shader-compiler (x86_64-unknown-linux-gnu): all pass. - Not yet run in game on its own: an in-game run with this on top of current main is in progress. In run 35 (main + #150), mesh slot 86 pipelines failing with -3 numbered about 10,400. The pixel shaders I sampled from those failures were root-less fallbacks of exactly this kind. AI-assisted: written with Claude Code and reviewed by me. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A pixel shader that indexes the descriptor heaps gets the sampler heap base
in the user SGPR of FSSM class 6. pixel_heap_base refused class 6 whenever a
root signature was present, so fixed-offset reads from that heap were left
as unmapped table descriptors and the rooted translation was refused. The
runtime then fell back to the root-less translation, whose private bindings
the mesh pipeline root does not provide.

Accept class 6 when the root sets SAMPLER_HEAP_DIRECTLY_INDEXED (0x800), as
class 5 already requires 0x400.

Over 5,942 recorded rooted pixel requests: 2,786 newly translated, 0
regressions, 13 outputs changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:35:00 +00:00
github manually merged commit 71c7c8546c into gh-pr/157/base 2026-11-26 06:35:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.