Separate ordinary and depth-reference sampler bindings in the HLSL bridge #676

Manually merged
github merged 1 commit from gh-pr/676/head into gh-pr/676/base 2026-11-26 22:10:44 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-22 19:23 UTC · original
R0Y00:codex/sampler-use → main · +360 −3 · 10 files · 1 commits · merged 2026-11-22 19:50 UTC

Refs #218. In a mixed module, SPIRV-Cross inferred one comparison sampler type from a shared guest table, preventing DXC from resolving ordinary Sample and SampleLevel overloads. Keep the original descriptor index and texture and clone only the depth-reference access into a second typed view. The host binds the comparison view at s1 in space3.

The self-built PS and CS assemble, validate and cross-compile with the two HLSL sampler types. On Windows 26200.9974, RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818 both read ordinary values (0.25, 0.75) and comparison values (0, 1). Swapping only the ordinary pair gave (0.75, 0.25; 0, 1). Swapping only the comparison pair gave (0.25, 0.75; 1, 0). Both reported zero debug errors and zero warnings.

Reproduce with ctest --preset dev --no-tests=error -R spirv_sampler_views -V when SPIRV-Tools and SPIRV-Cross are installed. Local runs used WSL assembly/cross-compilation, native Windows DXC and the release offscreen_check executable on both adapters. The full-package rerun is being counted separately.

**@⁠R0Y00** on GitHub · 2026-11-22 19:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/676) `R0Y00:codex/sampler-use` → `main` · +360 −3 · 10 files · 1 commits · merged 2026-11-22 19:50 UTC Refs #218. In a mixed module, SPIRV-Cross inferred one comparison sampler type from a shared guest table, preventing DXC from resolving ordinary Sample and SampleLevel overloads. Keep the original descriptor index and texture and clone only the depth-reference access into a second typed view. The host binds the comparison view at s1 in space3. The self-built PS and CS assemble, validate and cross-compile with the two HLSL sampler types. On Windows 26200.9974, RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818 both read ordinary values (0.25, 0.75) and comparison values (0, 1). Swapping only the ordinary pair gave (0.75, 0.25; 0, 1). Swapping only the comparison pair gave (0.25, 0.75; 1, 0). Both reported zero debug errors and zero warnings. Reproduce with `ctest --preset dev --no-tests=error -R spirv_sampler_views -V` when SPIRV-Tools and SPIRV-Cross are installed. Local runs used WSL assembly/cross-compilation, native Windows DXC and the release offscreen_check executable on both adapters. The full-package rerun is being counted separately.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:10:43 +00:00
github manually merged commit 03c774f7d8 into gh-pr/676/base 2026-11-26 22:10:44 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-22 23:42 UTC · original

Source-only implementation at 5748b02. Replayed 26,503 archive records with the original four-entry address window and SM 6.6/native 16-bit compilation settings. Of these, 1,840 records previously stopped at an ordinary sampling call receiving a comparison sampler. Archive multiplicity is preserved.

Stage Reached HLSL New DXIL DXC explicit errors DXC 90 s timeouts New hardware PSOs New WARP PSOs
PS 1104 982 0 122 949 651
CS 736 21 0 715 21 21

All pipeline outcomes, including resource limits (45 s per identified input, 1,400 MiB per process):

  • PS hardware 949 ok, 33 memory budget, WARP 651 ok, 331 memory budget.
  • CS hardware 21 ok, WARP 21 ok.

The first full frontend pass generated HLSL for 26,472 records. Two additional CS records hit the per-module time limit and both generated HLSL on isolated retry. The other 29 frontend errors concern PS MinLod.

Original first-error subgroups:

  • ps Sample: 850 reached HLSL, 814 generated DXIL, 809 hardware and 583 WARP pipelines.
  • cs SampleLevel: 702 reached HLSL, 7 generated DXIL, 7 hardware and 7 WARP pipelines.

Package output checks on RTX 4060 Laptop (32.0.16.1656) used independent CPU expectations. On the PS, two records shared identical native instructions and generated identical HLSL. Two alpha values and a discard case matched all 4,096 RGBA words per run. The CS wrote an 8 by 4 texture using two different input masks. All 128 words matched for each input. Each deliberately wrong oracle produced exactly one differing word. These controlled inputs cover the observed outputs of these programs. On WARP (10.0.26100.9818), both readback processes passed pipeline creation and submitted commands, then exited with code 2173 before yielding comparable data. No pixel or word mismatch is inferred from the exit code. Windows build 26200.9974 with the debug layer enabled.

Output samples were separately allowed up to 600 s of DXC time. Under the formal 90 s compilation and bounded PSO run, the number of records that also passed hardware readback was:

  • PS: 2 within those limits, 2 with the supplementary readback build. WARP output passes: 0.
  • CS: 1 within those limits, 1 with the supplementary readback build. WARP output passes: 0.
**@⁠R0Y00** on GitHub · 2026-11-22 23:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/676#issuecomment-7087771676) Source-only implementation at 5748b02. Replayed 26,503 archive records with the original four-entry address window and SM 6.6/native 16-bit compilation settings. Of these, 1,840 records previously stopped at an ordinary sampling call receiving a comparison sampler. Archive multiplicity is preserved. | Stage | Reached HLSL | New DXIL | DXC explicit errors | DXC 90 s timeouts | New hardware PSOs | New WARP PSOs | |---|---:|---:|---:|---:|---:|---:| | PS | 1104 | 982 | 0 | 122 | 949 | 651 | | CS | 736 | 21 | 0 | 715 | 21 | 21 | All pipeline outcomes, including resource limits (45 s per identified input, 1,400 MiB per process): - PS hardware 949 ok, 33 memory budget, WARP 651 ok, 331 memory budget. - CS hardware 21 ok, WARP 21 ok. The first full frontend pass generated HLSL for 26,472 records. Two additional CS records hit the per-module time limit and both generated HLSL on isolated retry. The other 29 frontend errors concern PS MinLod. Original first-error subgroups: - ps Sample: 850 reached HLSL, 814 generated DXIL, 809 hardware and 583 WARP pipelines. - cs SampleLevel: 702 reached HLSL, 7 generated DXIL, 7 hardware and 7 WARP pipelines. Package output checks on RTX 4060 Laptop (32.0.16.1656) used independent CPU expectations. On the PS, two records shared identical native instructions and generated identical HLSL. Two alpha values and a discard case matched all 4,096 RGBA words per run. The CS wrote an 8 by 4 texture using two different input masks. All 128 words matched for each input. Each deliberately wrong oracle produced exactly one differing word. These controlled inputs cover the observed outputs of these programs. On WARP (10.0.26100.9818), both readback processes passed pipeline creation and submitted commands, then exited with code 2173 before yielding comparable data. No pixel or word mismatch is inferred from the exit code. Windows build 26200.9974 with the debug layer enabled. Output samples were separately allowed up to 600 s of DXC time. Under the formal 90 s compilation and bounded PSO run, the number of records that also passed hardware readback was: - PS: 2 within those limits, 2 with the supplementary readback build. WARP output passes: 0. - CS: 1 within those limits, 1 with the supplementary readback build. WARP output passes: 0.
This discussion has been locked. Commenting is limited to contributors.
No description provided.