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

Merged
R0Y00 merged 1 commit from upstream-pr/676 into main 2026-11-22 19:50:45 +00:00
R0Y00 commented 2026-11-22 19:23:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T19:23:26Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6546672758 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/676). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T19:23:26Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:44:16 +00:00
R0Y00 commented 2026-11-24 06:48:51 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T23:42:19Z.


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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7087771676 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/676#issuecomment-7087771676). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T23:42:19Z. --- 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.
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!670
No description provided.