runtime: keep the sampler heap span when installing a compute translation #3626

Merged
lukaslw-lab merged 1 commit from upstream-pr/3626 into main 2026-11-30 17:18:32 +00:00
lukaslw-lab commented 2026-11-30 16:22:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T16:22:22Z.


Change

install_compute_translation now copies sampler_heap_bytes from the loaded candidate. Without it, a native compute program that reads the directly indexed sampler heap (#3540, smpidx) is dispatched with a root that has SAMPLER_HEAP_DIRECTLY_INDEXED but no sampler heap bound: the debug layer reports error 1419 and the program reads no samplers. The field was added by #3540 after #3506 introduced the install function, so neither change alone shows the gap. Fixes #3625.

Verification

Commit 3d17bd3a (on main cf43986d) on Windows 10 22H2 (build 19045), Visual Studio 2026 (MSVC 19.52.37029), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7. Release tree configured with -DOFFSCREEN_AGILITY_620_DIR=<Agility 1.620.2> and -DOFFSCREEN_WARP_DIR=<WARP 1.0.22>. GPU: NVIDIA GeForce RTX 3080 Ti, driver 32.0.16.1047, debug layer enabled by the fixture.

ctest --test-dir out\build\release-agility -R "^startup_compute_dispatch_sampler_heap_(warp|hardware)$"
Commit _warp _hardware
main cf43986d failed: every lane 1.7636e+25 (0x69696969), expected (11, 22, 109, 1000) failed: sev=1 id=1419 … SetDescriptorHeaps must be called to bind a sampler descriptor before setting a root signature with D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED
this PR passed passed

On the Windows 10 in-box runtime both tests stop earlier (root signature creation failed), with and without this change.

Evidence and follow-up

The existing fixture already covers the behaviour; main is the negative control. CI's pr preset does not run these tests, and _hardware tests do not run on CI at all.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5569238816 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3626). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-30T16:22:22Z. --- ## Change `install_compute_translation` now copies `sampler_heap_bytes` from the loaded candidate. Without it, a native compute program that reads the directly indexed sampler heap (#3540, `smpidx`) is dispatched with a root that has `SAMPLER_HEAP_DIRECTLY_INDEXED` but no sampler heap bound: the debug layer reports error 1419 and the program reads no samplers. The field was added by #3540 after #3506 introduced the install function, so neither change alone shows the gap. Fixes #3625. ## Verification Commit `3d17bd3a` (on `main` `cf43986d`) on Windows 10 22H2 (build 19045), Visual Studio 2026 (MSVC 19.52.37029), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7. Release tree configured with `-DOFFSCREEN_AGILITY_620_DIR=<Agility 1.620.2>` and `-DOFFSCREEN_WARP_DIR=<WARP 1.0.22>`. GPU: NVIDIA GeForce RTX 3080 Ti, driver 32.0.16.1047, debug layer enabled by the fixture. ctest --test-dir out\build\release-agility -R "^startup_compute_dispatch_sampler_heap_(warp|hardware)$" | Commit | `_warp` | `_hardware` | |---|---|---| | `main` `cf43986d` | failed: every lane `1.7636e+25` (`0x69696969`), expected `(11, 22, 109, 1000)` | failed: `sev=1 id=1419 … SetDescriptorHeaps must be called to bind a sampler descriptor before setting a root signature with D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED` | | this PR | passed | passed | On the Windows 10 in-box runtime both tests stop earlier (`root signature creation failed`), with and without this change. ## Evidence and follow-up The existing fixture already covers the behaviour; `main` is the negative control. CI's `pr` preset does not run these tests, and `_hardware` tests do not run on CI at all. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. _AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
R0Y00 commented 2026-11-30 17:17:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-30T17:17:53Z.

Review: APPROVED


Verified that the installed span is used both for dispatch validation and selecting the bound heap. Exact revision, Windows 11 build 26300.9974, Debug, ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_compute_dispatch_sampler_heap_(warp|hardware)$': RTX 4060 Laptop GPU driver 32.0.16.1656 passed slot 67 on all 32 lanes and all refusal/decoy controls with the debug layer enabled and no error message. In-box WARP driver 10.0.26100.9818 checked the manifest and reader refusals, then skipped dispatch (77, no 32-lane waves).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6116956775 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3626#pullrequestreview-6116956775). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-30T17:17:53Z. **Review:** APPROVED --- Verified that the installed span is used both for dispatch validation and selecting the bound heap. Exact revision, Windows 11 build 26300.9974, Debug, `ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_compute_dispatch_sampler_heap_(warp|hardware)$'`: RTX 4060 Laptop GPU driver 32.0.16.1656 passed slot 67 on all 32 lanes and all refusal/decoy controls with the debug layer enabled and no error message. In-box WARP driver 10.0.26100.9818 checked the manifest and reader refusals, then skipped dispatch (77, no 32-lane waves).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!3626
No description provided.