gpu: avoid an indexed constant array in the texture-init shader #742

Merged
lukaslw-lab merged 1 commit from upstream-pr/748 into main 2026-11-23 01:02:48 +00:00
lukaslw-lab commented 2026-11-23 00:28:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-23T00:28:27Z.


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

Change

The texture-init compute shader from #705 picks each texel's color with a select chain instead of an indexed constant array. Windows 10's in-box WARP (10.0.19041.7811) crashes in its DXIL compiler on that array while creating the PSO, so cpu_shim_texture_reuse_warp fails on Windows 10 (#742). The written values are unchanged: the fixture dispatches one 2×2 group, so the index 2 * y + x is always 0–3. A shader comment names the cause so the array isn't reintroduced.

Fixes #742. Refs #705.

Verification

Commit c9f9606 (on 1ab3756) on Windows 10 22H2 (build 19045.7846), Visual Studio 2026 18.12 (MSVC 19.52.37029), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7, DXC 1.9.2609, GPU: NVIDIA GeForce RTX 3080 Ti, driver 610.47. dev uses the in-box WARP; w10 is dev configured with app-local WARP 1.0.22 and Agility SDK 1.620.2 (OFFSCREEN_WARP_DIR, OFFSCREEN_AGILITY_620_DIR).

Shim and texture tests, before and after the change (at fd2486f; the rebase onto 1ab3756 only touched tools/setup-spirv-tools.ps1):

ctest --preset dev --no-tests=error -R '^(cpu_shim_.*|cpu_native_shim_startup|compute_mesh_texture_.*|mesh_textured_draw_.*)$'
Build Before After
dev cpu_shim_texture_reuse_warp fails: native runner 0xc0000005 in d3d10warp!CShaderInfo::CompileShaderDXIL 13 total: 10 passed, 3 skipped, 0 failed
w10 cpu_shim_texture_reuse_warp fails: the pe_map runner (hosted by python.exe) loads the in-box WARP and crashes the same way 13 total: 12 passed, 1 skipped, 0 failed

Capability skips (exit 77): dev — cpu_shim_chain_warp, mesh_textured_draw_warp, compute_mesh_texture_warp (no mesh shaders on the in-box WARP); w10 — cpu_shim_chain_warp.

The full dev suite at c9f9606 is still running; I'll post its result as a comment.

The native fixture's published output (startup text + three RGBA frames, 49,267 bytes) is byte-identical before and after, for both cases on both adapters wherever the original ran:

Case SHA-256 prefix, before = after
texture ff7b115bf9d388c7
texture-stale 0fe5fc1bb64fc246

The dev WARP runs, which crashed before, now produce the same two hashes.

Evidence and follow-up

  • No new fixture. The existing stale-update control (texture-stale) still reports its expected first mismatch at stage 2, pixel (24, 8).
  • #705 was verified on Windows 11 and CI runs Server 2025; both ship a newer in-box WARP that compiles the array, so CI could not see this. An app-local WARP doesn't cover the pe_map runner, because D3D12 selects the runtime and WARP relative to the host executable.

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. (No capability or requirement changed.)
  • I did not include game files, dumps, distribution links or secrets.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6549797186 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/748). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-23T00:28:27Z. --- _AI-assisted: prepared with Claude Code; the commands and results below were run on the author's PC._ ## Change The texture-init compute shader from #705 picks each texel's color with a select chain instead of an indexed constant array. Windows 10's in-box WARP (`10.0.19041.7811`) crashes in its DXIL compiler on that array while creating the PSO, so `cpu_shim_texture_reuse_warp` fails on Windows 10 (#742). The written values are unchanged: the fixture dispatches one 2×2 group, so the index `2 * y + x` is always 0–3. A shader comment names the cause so the array isn't reintroduced. Fixes #742. Refs #705. ## Verification Commit `c9f9606` (on `1ab3756`) on Windows 10 22H2 (build 19045.7846), Visual Studio 2026 18.12 (MSVC 19.52.37029), Windows SDK 10.0.26100, CMake 4.3.1, Python 3.13.7, DXC 1.9.2609, GPU: NVIDIA GeForce RTX 3080 Ti, driver 610.47. `dev` uses the in-box WARP; `w10` is `dev` configured with app-local WARP 1.0.22 and Agility SDK 1.620.2 (`OFFSCREEN_WARP_DIR`, `OFFSCREEN_AGILITY_620_DIR`). Shim and texture tests, before and after the change (at `fd2486f`; the rebase onto `1ab3756` only touched `tools/setup-spirv-tools.ps1`): ```powershell ctest --preset dev --no-tests=error -R '^(cpu_shim_.*|cpu_native_shim_startup|compute_mesh_texture_.*|mesh_textured_draw_.*)$' ``` | Build | Before | After | |---|---|---| | `dev` | `cpu_shim_texture_reuse_warp` fails: native runner `0xc0000005` in `d3d10warp!CShaderInfo::CompileShaderDXIL` | 13 total: 10 passed, 3 skipped, 0 failed | | `w10` | `cpu_shim_texture_reuse_warp` fails: the `pe_map` runner (hosted by `python.exe`) loads the in-box WARP and crashes the same way | 13 total: 12 passed, 1 skipped, 0 failed | Capability skips (exit 77): `dev` — `cpu_shim_chain_warp`, `mesh_textured_draw_warp`, `compute_mesh_texture_warp` (no mesh shaders on the in-box WARP); `w10` — `cpu_shim_chain_warp`. The full `dev` suite at `c9f9606` is still running; I'll post its result as a comment. The native fixture's published output (startup text + three RGBA frames, 49,267 bytes) is byte-identical before and after, for both cases on both adapters wherever the original ran: | Case | SHA-256 prefix, before = after | |---|---| | `texture` | `ff7b115bf9d388c7` | | `texture-stale` | `0fe5fc1bb64fc246` | The `dev` WARP runs, which crashed before, now produce the same two hashes. ## Evidence and follow-up - No new fixture. The existing stale-update control (`texture-stale`) still reports its expected first mismatch at stage 2, pixel (24, 8). - #705 was verified on Windows 11 and CI runs Server 2025; both ship a newer in-box WARP that compiles the array, so CI could not see this. An app-local WARP doesn't cover the `pe_map` runner, because D3D12 selects the runtime and WARP relative to the host executable. ## 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. (No capability or requirement changed.) - [x] I did not include game files, dumps, distribution links or secrets. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 06:44:35 +00:00
lukaslw-lab commented 2026-11-24 06:48:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-23T00:36:52Z.


Full dev suite at c9f9606 (same environment as above, in-box WARP 10.0.19041.7811):

ctest --preset dev --no-tests=error
323 total: 282 passed, 40 skipped (exit 77), 1 failed
  • cpu_shim_texture_reuse_warp and cpu_shim_texture_reuse_hardware pass.
  • The one failure is gpu_alias_lookup_writes_warp, already known on this in-box WARP (#332, #369). It's unrelated to this change.
  • Skips: in-box WARP has no mesh shaders, DXR or wave64 (mesh_*_warp, dxr_*_warp, bvh_*_warp, wave_shuffle_warp, cpu_shim_chain_warp, compute_mesh_texture_warp); the CPU has no ADX, SHA, CLFLUSHOPT or CLWB (cpu_aot_adx, cpu_aot_crypto_sha, cpu_aot_fences_hints_clflushopt/_clwb, cpu_aot_x87_compare); bvh_wave64_hardware and wave_shuffle_hardware need wave64; the eight spirv_* tests skip because the SPIR-V tools weren't installed when this build was configured.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7088492934 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/748#issuecomment-7088492934). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-23T00:36:52Z. --- Full `dev` suite at `c9f9606` (same environment as above, in-box WARP `10.0.19041.7811`): ```powershell ctest --preset dev --no-tests=error ``` ```text 323 total: 282 passed, 40 skipped (exit 77), 1 failed ``` - `cpu_shim_texture_reuse_warp` and `cpu_shim_texture_reuse_hardware` pass. - The one failure is `gpu_alias_lookup_writes_warp`, already known on this in-box WARP (#332, #369). It's unrelated to this change. - Skips: in-box WARP has no mesh shaders, DXR or wave64 (`mesh_*_warp`, `dxr_*_warp`, `bvh_*_warp`, `wave_shuffle_warp`, `cpu_shim_chain_warp`, `compute_mesh_texture_warp`); the CPU has no ADX, SHA, CLFLUSHOPT or CLWB (`cpu_aot_adx`, `cpu_aot_crypto_sha`, `cpu_aot_fences_hints_clflushopt`/`_clwb`, `cpu_aot_x87_compare`); `bvh_wave64_hardware` and `wave_shuffle_hardware` need wave64; the eight `spirv_*` tests skip because the SPIR-V tools weren't installed when this build was configured.
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!742
No description provided.