Share nine-mip BC layout across XG copies and array SRV sampling #1318

Manually merged
github merged 1 commit from gh-pr/1318/head into gh-pr/1318/base 2026-11-26 22:57:42 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 07:50 UTC · original
R0Y00:codex/xg-nine-bc-copy → main · +335 −135 · 11 files · 1 commits · merged 2026-11-24 07:54 UTC

Refs #874. Follows #1300 and #1311.

For nine-mip 1024×512 and 1024×1024 BC5_UNORM/BC7_UNORM textures, use the same 64 KiB layout when reporting offsets, copying blocks and uploading a sampled resource. Slot 2 reports byte offsets within a slice. Slot 10 reports the enclosing tile for the packed tail. The rectangular texture's three standard offsets are 0x40000, 0x20000 and 0x10000. Slice 1 begins 0xc0000 bytes later.

On both adapters the initial array fixture exposed a second issue. Binding a Texture2DArray shader as a Texture2D produced zero at pixel (0,0). A typed array SRV manifest entry now preserves the array view when validating and materializing the descriptor. The fixture supplies its own HLSL and typed manifest.

Verification

Windows 11 build 26200.9974, Release ffc92c06, debug layer off. NVIDIA GeForce RTX 4060 Laptop GPU 32.0.16.1656 and Microsoft WARP 10.0.26100.9818. No skips. Both backends drew all four format/shape combinations. Each draw compared 12,288 RGBA pixels with the CPU reference and each swapped-slice draw matched the independently reversed reference (98,304 pixels per adapter). Copy-in and copy-out covered both slices and all nine levels, padding, guard bytes and an invalid subresource. The optional pinned Mesa AddrLib comparison checked every visible BC block across 8 combinations. Slot 2's entire 0x1b40-byte result also matched the pinned XCL source for all 8 combinations in a separate local synthetic comparison.

cmake --build --preset release --target startup_stub_xg_xs startup_stream_consumer xg_swizzle_select_check
ctest --preset release --no-tests=error --output-on-failure -R '^(startup_xg_bc_(array|chain)_(hardware|warp)|startup_xg_bc_tiling|xg_bc64_tiling_reference|startup_xg_bc7_layout)$'

7/7 passed with the pinned AddrLib enabled. Documentation link check passed (290 links).

**@⁠R0Y00** on GitHub · 2026-11-24 07:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1318) `R0Y00:codex/xg-nine-bc-copy` → `main` · +335 −135 · 11 files · 1 commits · merged 2026-11-24 07:54 UTC Refs #874. Follows #1300 and #1311. For nine-mip 1024×512 and 1024×1024 BC5_UNORM/BC7_UNORM textures, use the same 64 KiB layout when reporting offsets, copying blocks and uploading a sampled resource. Slot 2 reports byte offsets within a slice. Slot 10 reports the enclosing tile for the packed tail. The rectangular texture's three standard offsets are 0x40000, 0x20000 and 0x10000. Slice 1 begins 0xc0000 bytes later. On both adapters the initial array fixture exposed a second issue. Binding a Texture2DArray shader as a Texture2D produced zero at pixel (0,0). A typed array SRV manifest entry now preserves the array view when validating and materializing the descriptor. The fixture supplies its own HLSL and typed manifest. **Verification** Windows 11 build 26200.9974, Release ffc92c06, debug layer off. NVIDIA GeForce RTX 4060 Laptop GPU 32.0.16.1656 and Microsoft WARP 10.0.26100.9818. No skips. Both backends drew all four format/shape combinations. Each draw compared 12,288 RGBA pixels with the CPU reference and each swapped-slice draw matched the independently reversed reference (98,304 pixels per adapter). Copy-in and copy-out covered both slices and all nine levels, padding, guard bytes and an invalid subresource. The optional pinned Mesa AddrLib comparison checked every visible BC block across 8 combinations. Slot 2's entire 0x1b40-byte result also matched the pinned XCL source for all 8 combinations in a separate local synthetic comparison. ```powershell cmake --build --preset release --target startup_stub_xg_xs startup_stream_consumer xg_swizzle_select_check ctest --preset release --no-tests=error --output-on-failure -R '^(startup_xg_bc_(array|chain)_(hardware|warp)|startup_xg_bc_tiling|xg_bc64_tiling_reference|startup_xg_bc7_layout)$' ``` 7/7 passed with the pinned AddrLib enabled. Documentation link check passed (290 links).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:57:39 +00:00
github manually merged commit ffc92c064a into gh-pr/1318/base 2026-11-26 22:57:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.