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

Closed
opened 2026-11-30 16:22:09 +00:00 by lukaslw-lab · 0 comments
lukaslw-lab commented 2026-11-30 16:22:09 +00:00 (Migrated from github.com)
Contributor

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


Summary

install_compute_translation (from #3506, 1f866f50) copies every field of a loaded candidate into the live ComputeTranslation except sampler_heap_bytes, which #3540 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 (#3621), 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 #3626).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6700941129 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3625). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-30T16:22:09Z. --- ## Summary `install_compute_translation` (from #3506, `1f866f50`) copies every field of a loaded candidate into the live `ComputeTranslation` except `sampler_heap_bytes`, which #3540 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` (#3621), 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 #3626).
Sign in to join this conversation.
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#3625
No description provided.