runtime: bind 1D, 2D-array, 3D and cube texture SRVs in native compute #3777

Manually merged
github merged 2 commits from github-bot/gh-3775 into gh-pr/3775/base 2026-12-02 02:00:56 +00:00 AGit
Owner

@⁠R0D4X on GitHub · 2026-12-01 18:28 UTC · original
R0D4X:runtime/native-compute-tex-dims → main · +152 −39 · 5 files · 2 commits · merged 2026-12-02 01:56 UTC

Refs #3226

Summary

Enables live in-process native compute translation (translate_compute_natively in src/startup_stubs/d3d12_compute_dispatch.inl) to bind 1D, 2D-array, 3D, and cube texture SRVs (plus d16_sample_srv and 2D-array comparison_texture_srv), matching the dimensions already published by format_compute_runtime_manifest and already supported by list_dispatch:

  • src/startup_stubs/d3d12_compute_dispatch.inl (translate_compute_natively):
    • texture_srv / d16_sample_srv: maps image_dimension 0 -> TEXTURE1D, 1 -> TEXTURE2D, 2 -> TEXTURE3D, 5 -> TEXTURE2DARRAY.
    • comparison_texture_srv: maps image_dimension 1 -> TEXTURE2D, 5 -> TEXTURE2DARRAY (1D/3D comparisons remain refused, matching format_compute_runtime_manifest).
    • cube_sample_srv (image_dimension == 3): maps to TEXTURECUBE (bound as a one-cube TextureCubeArray by list_dispatch).
  • Hardware live-native tests (tests/startup_compute_dispatch_cube_check.py, tests/startup_compute_dispatch_texture_dims_check.py, tests/cmake/startup_compute_native_tex_dims.cmake):
    • Added native mode (X2W_NATIVE_SHADERS + X2W_NATIVE_SHADERS_ONLY=1, no published .txt manifest) exercising 1d, 2da, 3d, and cube texture SRVs end-to-end on hardware, including view-dimension mismatch, undescribed view, and out-of-bounds/clamped view refusal controls with D3D12 debug layer enabled.

Verification

Environment: Windows 11 x64 (10.0.26300.9974), MSVC 19.44.35230, Windows SDK / DXC 10.0.26100.0, NVIDIA GeForce RTX 5080 (10de:2c02, driver 32.0.16.2140), D3D12 debug layer enabled.

Commit under test: 7f9ee63d.

ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R "^startup_compute_dispatch_(cube|texture_dims)(_native)?_hardware$"
ctest --test-dir out/build/release --no-tests=error -j 1 -V -R "^startup_compute_dispatch_(cube|texture_dims)(_native)?_hardware$"
  • dev: 4/4 passed (0 skipped), RTX 5080, debug layer enabled, 0 debug errors.
  • release: 4/4 passed (0 skipped), RTX 5080, debug layer enabled, 0 debug errors.
  • Mutation check: Temporarily removing the cube_sample_srv branch in translate_compute_natively caused startup_compute_dispatch_cube_native_hardware to fail (cube samples: word 0 expected 42c80000, read c5c5c5c5 (288 words differ)); after reverting src/, the test passed again.

No game files, dumps, or private paths included.

**@⁠R0D4X** on GitHub · 2026-12-01 18:28 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3775) `R0D4X:runtime/native-compute-tex-dims` → `main` · +152 −39 · 5 files · 2 commits · merged 2026-12-02 01:56 UTC Refs #3226 ## Summary Enables live in-process native compute translation (`translate_compute_natively` in `src/startup_stubs/d3d12_compute_dispatch.inl`) to bind 1D, 2D-array, 3D, and cube texture SRVs (plus `d16_sample_srv` and 2D-array `comparison_texture_srv`), matching the dimensions already published by `format_compute_runtime_manifest` and already supported by `list_dispatch`: - **`src/startup_stubs/d3d12_compute_dispatch.inl` (`translate_compute_natively`):** - `texture_srv` / `d16_sample_srv`: maps `image_dimension` `0` -> `TEXTURE1D`, `1` -> `TEXTURE2D`, `2` -> `TEXTURE3D`, `5` -> `TEXTURE2DARRAY`. - `comparison_texture_srv`: maps `image_dimension` `1` -> `TEXTURE2D`, `5` -> `TEXTURE2DARRAY` (1D/3D comparisons remain refused, matching `format_compute_runtime_manifest`). - `cube_sample_srv` (`image_dimension == 3`): maps to `TEXTURECUBE` (bound as a one-cube `TextureCubeArray` by `list_dispatch`). - **Hardware live-native tests (`tests/startup_compute_dispatch_cube_check.py`, `tests/startup_compute_dispatch_texture_dims_check.py`, `tests/cmake/startup_compute_native_tex_dims.cmake`):** - Added `native` mode (`X2W_NATIVE_SHADERS` + `X2W_NATIVE_SHADERS_ONLY=1`, no published `.txt` manifest) exercising `1d`, `2da`, `3d`, and `cube` texture SRVs end-to-end on hardware, including view-dimension mismatch, undescribed view, and out-of-bounds/clamped view refusal controls with D3D12 debug layer enabled. ## Verification Environment: Windows 11 x64 (`10.0.26300.9974`), MSVC `19.44.35230`, Windows SDK / DXC `10.0.26100.0`, NVIDIA GeForce RTX 5080 (`10de:2c02`, driver `32.0.16.2140`), D3D12 debug layer enabled. Commit under test: `7f9ee63d`. ```powershell ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R "^startup_compute_dispatch_(cube|texture_dims)(_native)?_hardware$" ctest --test-dir out/build/release --no-tests=error -j 1 -V -R "^startup_compute_dispatch_(cube|texture_dims)(_native)?_hardware$" ``` - `dev`: **4/4 passed** (0 skipped), RTX 5080, debug layer enabled, 0 debug errors. - `release`: **4/4 passed** (0 skipped), RTX 5080, debug layer enabled, 0 debug errors. - **Mutation check:** Temporarily removing the `cube_sample_srv` branch in `translate_compute_natively` caused `startup_compute_dispatch_cube_native_hardware` to fail (`cube samples: word 0 expected 42c80000, read c5c5c5c5 (288 words differ)`); after reverting `src/`, the test passed again. No game files, dumps, or private paths included.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 18:33:55 +00:00
github-bot force-pushed github-bot/gh-3775 from 7f9ee63d19 to 4be65468a6 2026-12-01 18:45:44 +00:00 Compare
github-bot changed target branch from main to gh-pr/3775/base 2026-12-02 02:00:51 +00:00
github manually merged commit 4be65468a6 into gh-pr/3775/base 2026-12-02 02:00:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.