Support one-dimensional textures in translated startup draws #1630

Manually merged
github merged 2 commits from gh-pr/1630/head into gh-pr/1630/base 2026-11-26 23:22:00 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 15:27 UTC · original
R0Y00:codex/startup-texture1d-on-windows → main · +140 −28 · 12 files · 2 commits · merged 2026-11-24 15:56 UTC

Refs #874

Support ordinary, single-coordinate 1D image samples in the startup shader translator. The Windows draw path binds explicit and default 1D SRVs and uploads source-built, single-slice CPU textures using desktop copy footprints.

The translator fixture samples two distinct alpha values and changes the channel selector to red as a negative control. The runtime fixture checks rebinding and a mismatched 2D view across 32 output pixels. Existing 3D, array and address-SRV controls run alongside them.

Tested on Windows x64 Release with NVIDIA GeForce RTX 4060 Laptop GPU (32.0.16.1656) and Microsoft WARP. Seven tests passed, zero failures, zero capability skips at 9c40e65f. Inputs and expected outputs are synthetic.

cmake --build out/build/release --target startup_stream_consumer offscreen_check
ctest --test-dir out/build/release --no-tests=error --output-on-failure -R '^startup_((1d_srv|address_srv)_(warp|hardware)|image_3d_(controls|warp|hardware))$'
**@⁠R0Y00** on GitHub · 2026-11-24 15:27 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1630) `R0Y00:codex/startup-texture1d-on-windows` → `main` · +140 −28 · 12 files · 2 commits · merged 2026-11-24 15:56 UTC Refs #874 Support ordinary, single-coordinate 1D image samples in the startup shader translator. The Windows draw path binds explicit and default 1D SRVs and uploads source-built, single-slice CPU textures using desktop copy footprints. The translator fixture samples two distinct alpha values and changes the channel selector to red as a negative control. The runtime fixture checks rebinding and a mismatched 2D view across 32 output pixels. Existing 3D, array and address-SRV controls run alongside them. Tested on Windows x64 Release with NVIDIA GeForce RTX 4060 Laptop GPU (32.0.16.1656) and Microsoft WARP. Seven tests passed, zero failures, zero capability skips at 9c40e65f. Inputs and expected outputs are synthetic. ```powershell cmake --build out/build/release --target startup_stream_consumer offscreen_check ctest --test-dir out/build/release --no-tests=error --output-on-failure -R '^startup_((1d_srv|address_srv)_(warp|hardware)|image_3d_(controls|warp|hardware))$' ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:21:58 +00:00
github manually merged commit 2469f68833 into gh-pr/1630/base 2026-11-26 23:22:00 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 15:46 UTC · original

2469f688 updates only the diagnostic asserted by the explicit-LOD 1D refusal case. Ordinary single-coordinate sampling stays covered separately, and the unsupported explicit-LOD form still has to fail. I reproduced the Linux assertion and verified the explicit LOD, 1D/3D and array Python controls on the corrected sources.

**@⁠R0Y00** on GitHub · 2026-11-24 15:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1630#issuecomment-7136578313) 2469f688 updates only the diagnostic asserted by the explicit-LOD 1D refusal case. Ordinary single-coordinate sampling stays covered separately, and the unsupported explicit-LOD form still has to fail. I reproduced the Linux assertion and verified the explicit LOD, 1D/3D and array Python controls on the corrected sources.
Author
Owner

@⁠Lifither on GitHub · 2026-11-24 19:38 UTC · original

Independent Polaris retest on bbadc76deae60a3e7fa3e81b883ee27ca31af183. Windows 11 x64 build 26300.9974, Release, clang-cl 23.1.6 with /EHa, Windows SDK 10.0.26100. Radeon RX 590 Series (1002:67df), driver 31.0.21923.1000. WARP: Microsoft Basic Render Driver, version 10.0.26100.9818. DXC 1.9.2609.5 and Microsoft FXC from SDK package 10.0.26100.3916. The offscreen image test reported the D3D12 debug layer as unavailable. The stream-consumer cases did not report debug-layer status.

cmake --build <build> --target startup_stream_consumer offscreen_check
$env:XBOX2WINDOWS_ADAPTER = 'RX 590'
ctest --test-dir <build> --no-tests=error -R '^startup_((1d_srv|address_srv)_(warp|hardware)|image_3d_(controls|warp|hardware))$' -V

All seven cases passed across the two runs, with zero skips. The 3D controls and both backend cases passed in the initial run. The four stream-consumer cases initially stopped before drawing because FXC was missing. They all passed after setting STARTUP_FXC at configure time and rerunning those four cases.

Both adapters matched all 32 pixels in the explicit/default 1D views and mismatched 2D view fixture. The address-SRV fixture also matched all 32 RGBA pixels on both adapters across its valid and invalid update cases.

Source-built fixtures only. Codex assisted with build, testing and reporting.

**@⁠Lifither** on GitHub · 2026-11-24 19:38 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1630#issuecomment-7142378862) Independent Polaris retest on `bbadc76deae60a3e7fa3e81b883ee27ca31af183`. Windows 11 x64 build 26300.9974, Release, clang-cl 23.1.6 with `/EHa`, Windows SDK 10.0.26100. Radeon RX 590 Series (1002:67df), driver 31.0.21923.1000. WARP: Microsoft Basic Render Driver, version 10.0.26100.9818. DXC 1.9.2609.5 and Microsoft FXC from SDK package 10.0.26100.3916. The offscreen image test reported the D3D12 debug layer as unavailable. The stream-consumer cases did not report debug-layer status. ```powershell cmake --build <build> --target startup_stream_consumer offscreen_check $env:XBOX2WINDOWS_ADAPTER = 'RX 590' ctest --test-dir <build> --no-tests=error -R '^startup_((1d_srv|address_srv)_(warp|hardware)|image_3d_(controls|warp|hardware))$' -V ``` All seven cases passed across the two runs, with zero skips. The 3D controls and both backend cases passed in the initial run. The four stream-consumer cases initially stopped before drawing because FXC was missing. They all passed after setting `STARTUP_FXC` at configure time and rerunning those four cases. Both adapters matched all 32 pixels in the explicit/default 1D views and mismatched 2D view fixture. The address-SRV fixture also matched all 32 RGBA pixels on both adapters across its valid and invalid update cases. Source-built fixtures only. Codex assisted with build, testing and reporting.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 15:46 UTC · original · reviewed

Reviewed at 9c40e65fe4d355a76c51e970f8cc1ee7daff3e2b.

Summary

  • Translator (tools/startup/gfx2hlsl.py): Adds SQ_RSRC_IMG_1D (tex1d -> Texture1D<float4>), conservatively gated to sample with a single coordinate, non-zero dmask, and no modifiers other than dim: / dmask:.
  • Runtime (src/startup_stubs/d3d12_draw.inl): Maps tex1d to D3D12_SRV_DIMENSION_TEXTURE1D, enables upload_texture for single-slice TEXTURE1D (DepthOrArraySize == 1 && Height == 1), and binds null when a tex1d slot sees a non-1D resource or DepthOrArraySize != 1 (or mismatched view dimension).
  • Tests: tests/startup_image_3d_check.py covers 1D alpha sampling and a channel-swizzle mutant; tests/startup_1d_srv_check.py + tests/startup_address_srv.cpp cover explicit 1D views, default (nullptr) views, and a mismatched 2D resource/view.

No blocking issues found.

Verification

  • Linux:
    • python3 -B tests/startup_image_3d_check.py: passed
    • python3 -B tests/docs_links_check.py: passed (16 Markdown files, 348 links)
    • python3 -B tests/bidi_controls_check.py: passed (1266 files)
  • Windows Server 2025 (MSVC 14.44.35207, D3D12 WARP):
    • Debug (--preset dev): ctest --preset dev -R '^(startup_1d_srv_warp|startup_image_3d_warp|startup_image_3d_controls|startup_address_srv_warp|startup_stream_draw_warp|startup_translator)$' --parallel 4 --no-tests=error — 6/6 passed (startup_1d_srv_warp 1.16s, startup_image_3d_warp 1.65s)
    • Release /O2 (--preset release): same regex — 6/6 passed (startup_1d_srv_warp 1.09s, startup_image_3d_warp 1.50s)

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 15:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1630#pullrequestreview-6042553560) · **reviewed** Reviewed at `9c40e65fe4d355a76c51e970f8cc1ee7daff3e2b`. ### Summary - **Translator (`tools/startup/gfx2hlsl.py`)**: Adds `SQ_RSRC_IMG_1D` (`tex1d` -> `Texture1D<float4>`), conservatively gated to `sample` with a single coordinate, non-zero `dmask`, and no modifiers other than `dim:` / `dmask:`. - **Runtime (`src/startup_stubs/d3d12_draw.inl`)**: Maps `tex1d` to `D3D12_SRV_DIMENSION_TEXTURE1D`, enables `upload_texture` for single-slice `TEXTURE1D` (`DepthOrArraySize == 1 && Height == 1`), and binds null when a `tex1d` slot sees a non-1D resource or `DepthOrArraySize != 1` (or mismatched view dimension). - **Tests**: `tests/startup_image_3d_check.py` covers 1D alpha sampling and a channel-swizzle mutant; `tests/startup_1d_srv_check.py` + `tests/startup_address_srv.cpp` cover explicit 1D views, default (`nullptr`) views, and a mismatched 2D resource/view. No blocking issues found. ### Verification - **Linux**: - `python3 -B tests/startup_image_3d_check.py`: passed - `python3 -B tests/docs_links_check.py`: passed (16 Markdown files, 348 links) - `python3 -B tests/bidi_controls_check.py`: passed (1266 files) - **Windows Server 2025 (MSVC 14.44.35207, D3D12 WARP)**: - Debug (`--preset dev`): `ctest --preset dev -R '^(startup_1d_srv_warp|startup_image_3d_warp|startup_image_3d_controls|startup_address_srv_warp|startup_stream_draw_warp|startup_translator)$' --parallel 4 --no-tests=error` — **6/6 passed** (`startup_1d_srv_warp` 1.16s, `startup_image_3d_warp` 1.65s) - Release `/O2` (`--preset release`): same regex — **6/6 passed** (`startup_1d_srv_warp` 1.09s, `startup_image_3d_warp` 1.50s) AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.