Sample address-only 4 KiB tiled BC3/BC7 views in translated draws #1272

Manually merged
github merged 5 commits from gh-pr/1272/head into gh-pr/1272/base 2026-11-26 22:54:06 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 06:24 UTC · original
R0Y00:codex/address-bc-4ks → main · +290 −50 · 11 files · 5 commits · merged 2026-11-24 06:51 UTC

Refs #1146 and #1150. Stacked on #1263. After #1263 lands, retarget this PR to main for integration.

For a read-only, single-sample, single-layer, single-mip BC3_UNORM or BC7_UNORM texture with layout 0x105 and complete 64×64 texel tiles, slot 70 can publish an SRV from guest memory without a placed resource. Translated draws create the desktop texture on first use and copy the compressed blocks into D3D12 footprint rows. The XG layout probe and the uploader share the block addressing formula. The guest address and allocation must remain valid while sampled. Direct submission through a persistent desktop heap is outside the translated-draw profile. No package inputs or recorded textures are included.

Each source-built test samples four complete 128×128 images for each format. Two addresses contain different tile arrangements. Address zero retains the second view, and republishing the first address restores it. The test compares all 65,536 RGBA pixels per format on each adapter. Exchanging neighboring tiles changes 16,384/16,384 pixels for BC3 and 15,360/16,384 for BC7. On #1263 alone the first BC3 pixel was 00000000 instead of ff000070.

Windows 11 build 26200.9974, RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818, debug layer off. Six tests passed, zero skips, 9.41 s on candidate 06673a11.

cmake --build --preset release --target startup_stream_consumer startup_stub_consumer d3d12_xs_shim
ctest --preset release --no-tests=error --output-on-failure -R '^(startup_address_(bc_view|srv)_(hardware|warp)|startup_xg_bc7_layout|bc7_tile_swizzle)$'
**@⁠R0Y00** on GitHub · 2026-11-24 06:24 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1272) `R0Y00:codex/address-bc-4ks` → `main` · +290 −50 · 11 files · 5 commits · merged 2026-11-24 06:51 UTC Refs #1146 and #1150. Stacked on #1263. After #1263 lands, retarget this PR to main for integration. For a read-only, single-sample, single-layer, single-mip BC3_UNORM or BC7_UNORM texture with layout 0x105 and complete 64×64 texel tiles, slot 70 can publish an SRV from guest memory without a placed resource. Translated draws create the desktop texture on first use and copy the compressed blocks into D3D12 footprint rows. The XG layout probe and the uploader share the block addressing formula. The guest address and allocation must remain valid while sampled. Direct submission through a persistent desktop heap is outside the translated-draw profile. No package inputs or recorded textures are included. Each source-built test samples four complete 128×128 images for each format. Two addresses contain different tile arrangements. Address zero retains the second view, and republishing the first address restores it. The test compares all 65,536 RGBA pixels per format on each adapter. Exchanging neighboring tiles changes 16,384/16,384 pixels for BC3 and 15,360/16,384 for BC7. On #1263 alone the first BC3 pixel was 00000000 instead of ff000070. Windows 11 build 26200.9974, RTX 4060 Laptop 32.0.16.1656 and WARP 10.0.26100.9818, debug layer off. Six tests passed, zero skips, 9.41 s on candidate 06673a11. ```powershell cmake --build --preset release --target startup_stream_consumer startup_stub_consumer d3d12_xs_shim ctest --preset release --no-tests=error --output-on-failure -R '^(startup_address_(bc_view|srv)_(hardware|warp)|startup_xg_bc7_layout|bc7_tile_swizzle)$' ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:54:05 +00:00
github manually merged commit 62f86d5582 into gh-pr/1272/base 2026-11-26 22:54:06 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 06:42 UTC · original

#1263 has landed. This PR now targets main. The placed-BC7 and address-only BC3/BC7 paths share the same 4 KiB block addressing and upload helper, with their separate eligibility checks intact. The combined Release run passed 12 tests, including R8/SRV and BC3/BC7 pixel readbacks on RTX 4060 Laptop and WARP. The sole skip was WARP's logical-heap fallback test, since WARP accepts the requested heap directly.

ctest --preset release --no-tests=error --output-on-failure -R '^(startup_(address_(bc_view|srv)|logical_view|stream_(draw|request)|xg_bc7_(draw|layout))|bc7_tile_swizzle)'

**@⁠R0Y00** on GitHub · 2026-11-24 06:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1272#issuecomment-7124202615) #1263 has landed. This PR now targets main. The placed-BC7 and address-only BC3/BC7 paths share the same 4 KiB block addressing and upload helper, with their separate eligibility checks intact. The combined Release run passed 12 tests, including R8/SRV and BC3/BC7 pixel readbacks on RTX 4060 Laptop and WARP. The sole skip was WARP's logical-heap fallback test, since WARP accepts the requested heap directly. `ctest --preset release --no-tests=error --output-on-failure -R '^(startup_(address_(bc_view|srv)|logical_view|stream_(draw|request)|xg_bc7_(draw|layout))|bc7_tile_swizzle)'`
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 06:29 UTC · original · reviewed

Dual-platform review at commit 06673a11b931ff024909881defd163f9dbfe949b:

Findings

  • Non-UTF-8 bytes in docs/experiments.md (breaks docs_links_check.py): lines 8283 (16\xa1\xc116) and 8295 (128\xa1\xc1128) contain invalid UTF-8 byte sequences (0xa1 0xc1) instead of × (\xc3\x97), causing tests/docs_links_check.py to fail with UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1.

Verification

  • Linux:
    • git diff --check origin/main...HEAD: passed
    • python -B tests/bidi_controls_check.py: passed (1060 files)
    • python -B tests/docs_links_check.py: failed (UnicodeDecodeError in docs/experiments.md)
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target startup_stream_consumer startup_stub_consumer d3d12_xs_shim -- -j 6 + ctest --preset dev -R '^(startup_address_(bc_view|srv)_warp|startup_xg_bc7_layout|bc7_tile_swizzle)$' --parallel 4 --no-tests=error --output-on-failure -> 4/4 passed (3.57s: startup_xg_bc7_layout, bc7_tile_swizzle, startup_address_srv_warp, startup_address_bc_view_warp)
    • Release /O2 (--preset release): cmake --build --preset release --target startup_stream_consumer startup_stub_consumer d3d12_xs_shim -- -j 6 + ctest --preset release -R '^(startup_address_(bc_view|srv)_warp|startup_xg_bc7_layout|bc7_tile_swizzle)$' --parallel 4 --no-tests=error --output-on-failure -> 4/4 passed (3.58s)

Code Notes

  • Extracting Bc16Surface into src/startup_stubs/bc16_surface.h cleanly shares the 4 KiB standard non-XOR block addressing between xg_xs.cpp and the draw/memory-SRV path.
  • upload_texture calls copy_4k_s_to_rows assuming single-mip, single-slice (plan.count == 1, slices == 1), which is enforced by supports_memory_srv.
**@⁠tedin7** on GitHub · 2026-11-24 06:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1272#pullrequestreview-6034674675) · **reviewed** Dual-platform review at commit `06673a11b931ff024909881defd163f9dbfe949b`: ### Findings - **Non-UTF-8 bytes in `docs/experiments.md` (breaks `docs_links_check.py`)**: lines 8283 (`16\xa1\xc116`) and 8295 (`128\xa1\xc1128`) contain invalid UTF-8 byte sequences (`0xa1 0xc1`) instead of `×` (`\xc3\x97`), causing `tests/docs_links_check.py` to fail with `UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1`. ### Verification - **Linux**: - `git diff --check origin/main...HEAD`: passed - `python -B tests/bidi_controls_check.py`: passed (1060 files) - `python -B tests/docs_links_check.py`: **failed** (`UnicodeDecodeError` in `docs/experiments.md`) - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: `cmake --build --preset dev --target startup_stream_consumer startup_stub_consumer d3d12_xs_shim -- -j 6` + `ctest --preset dev -R '^(startup_address_(bc_view|srv)_warp|startup_xg_bc7_layout|bc7_tile_swizzle)$' --parallel 4 --no-tests=error --output-on-failure` -> **4/4 passed** (`3.57s`: `startup_xg_bc7_layout`, `bc7_tile_swizzle`, `startup_address_srv_warp`, `startup_address_bc_view_warp`) - **Release `/O2` (`--preset release`)**: `cmake --build --preset release --target startup_stream_consumer startup_stub_consumer d3d12_xs_shim -- -j 6` + `ctest --preset release -R '^(startup_address_(bc_view|srv)_warp|startup_xg_bc7_layout|bc7_tile_swizzle)$' --parallel 4 --no-tests=error --output-on-failure` -> **4/4 passed** (`3.58s`) ### Code Notes - Extracting `Bc16Surface` into `src/startup_stubs/bc16_surface.h` cleanly shares the 4 KiB standard non-XOR block addressing between `xg_xs.cpp` and the draw/memory-SRV path. - `upload_texture` calls `copy_4k_s_to_rows` assuming single-mip, single-slice (`plan.count == 1`, `slices == 1`), which is enforced by `supports_memory_srv`.
This discussion has been locked. Commenting is limited to contributors.
No description provided.