runtime: installed compute translations lose the sampler heap span, so directly indexed sampler reads run without a sampler heap #3627

Closed
opened 2026-11-30 16:25:41 +00:00 by github-bot · 0 comments
Owner

@⁠lukaslw-lab on GitHub · 2026-11-30 16:22 UTC · original

Summary

install_compute_translation (from #3508, 1f866f50) copies every field of a loaded candidate into the live ComputeTranslation except sampler_heap_bytes, which #3542 added for smpidx programs. The root is still built with D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED. The dispatch, however, sees a span of 0, binds only the view heap (dropping the sampler heap the title set) and then sets that root. Each change is correct on its own; the gap appeared when both were on main.

Evidence

main cf43986d, tree configured with -DOFFSCREEN_AGILITY_620_DIR (Agility 1.620.2) and -DOFFSCREEN_WARP_DIR (WARP 1.0.22), Windows 10 22H2, RTX 3080 Ti driver 32.0.16.1047:

Test Result
startup_compute_dispatch_sampler_heap_hardware fails: sev=1 id=1419 ID3D12CommandList::SetComputeRootSignature: SetDescriptorHeaps must be called to bind a sampler descriptor before setting a root signature with D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED
startup_compute_dispatch_sampler_heap_warp fails: every lane reads 1.7636e+25 (0x69696969, the untouched output), expected (11, 22, 109, 1000)

Temporary logging at the bind showed tr->sampler_heap_bytes=0, samplers=nullptr for a translation whose root carries the flag.

Some setups do not show it: the _warp test passed in a full Windows 11 run at 35a3f6d (#3623), and CI does not run _hardware tests.

Fix

Copy the field in install_compute_translation. With that one line, both tests pass on the same tree (PR #3628).

**@⁠lukaslw-lab** on GitHub · 2026-11-30 16:22 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3625) ## Summary `install_compute_translation` (from #3508, `1f866f50`) copies every field of a loaded candidate into the live `ComputeTranslation` except `sampler_heap_bytes`, which #3542 added for `smpidx` programs. The root is still built with `D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED`. The dispatch, however, sees a span of 0, binds only the view heap (dropping the sampler heap the title set) and then sets that root. Each change is correct on its own; the gap appeared when both were on `main`. ## Evidence `main` `cf43986d`, tree configured with `-DOFFSCREEN_AGILITY_620_DIR` (Agility 1.620.2) and `-DOFFSCREEN_WARP_DIR` (WARP 1.0.22), Windows 10 22H2, RTX 3080 Ti driver 32.0.16.1047: | Test | Result | |---|---| | `startup_compute_dispatch_sampler_heap_hardware` | fails: `sev=1 id=1419 ID3D12CommandList::SetComputeRootSignature: SetDescriptorHeaps must be called to bind a sampler descriptor before setting a root signature with D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED` | | `startup_compute_dispatch_sampler_heap_warp` | fails: every lane reads `1.7636e+25` (`0x69696969`, the untouched output), expected `(11, 22, 109, 1000)` | Temporary logging at the bind showed `tr->sampler_heap_bytes=0`, `samplers=nullptr` for a translation whose root carries the flag. Some setups do not show it: the `_warp` test passed in a full Windows 11 run at `35a3f6d` (#3623), and CI does not run `_hardware` tests. ## Fix Copy the field in `install_compute_translation`. With that one line, both tests pass on the same tree (PR #3628).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 16:25:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#3627
No description provided.