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

Merged
R0Y00 merged 1 commit from upstream-pr/1318 into main 2026-11-24 07:54:35 +00:00
R0Y00 commented 2026-11-24 07:50:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T07:50:45Z.


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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6577157067 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1318). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T07:50:45Z. --- 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).
upstream-sync closed this pull request 2026-11-24 08:01:36 +00:00
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!1311
No description provided.