Report XG tile ranges for nine-mip BC5 and BC7 arrays #1304
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1311"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T07:31:53Z.
Refs #874. Follows #1300.
XG slot 10 now reports the standard and packed 64 KiB tile ranges for single-sample BC5_UNORM and BC7_UNORM textures at 1024×512 and 1024×1024 with nine mips, one or two slices, layout 0x109, default alignment and zero flags. The added profile covers tile queries only. The six-mip profile from #1300 uses the same query implementation.
A packed mip at the beginning of a request retains its caller-owned slot. Subsequent standard mips in the next slice use their original positions and their per-slice tile offset. Eighty source-built queries cover output guards, packed-only requests, partial ranges, array crossings, null outputs and unsigned count/first boundaries.
The optional pinned Mesa AddrLib oracle checks eight combinations of width/height, slice count and format on the Navi21 configuration. A separate source-built comparison with XCL at 64b3f355 agreed on packing and the sparse output contract. For 1024×512 the old desktop fallback yielded 11 tiles, two standard mips and standard starts 0 and 8. Both references give 12 tiles, three standard mips and starts 4, 2 and 1.
Tested on x64 Windows 11 26200.9974, MSVC Release, with the optional AMD dependency configured from
tools/fetch_addrlib.py. The six-mip GPU regressions used WARP and RTX 4060 Laptop (32.0.16.1656), debug layer off.5/5 tests passed, zero skips. The documentation check passed for 289 links.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:39:09Z.
Review: COMMENTED
Reviewed at commit
976540cc5407bda9715f290ed2d3eb5f572531cd.Code Review
src/startup_stubs/bc64_chain.h/xg_bc64.inl/xg_xs.cpp:supports_nine_mip_tiling()cleanly isolates 1024×512 and 1024×1024, 1–2 slice, 9-mip BC5_UNORM/BC7_UNORM (0x109layout) descriptors ontobc_tiling_table(slot 10 only), preservingbc_tablefor the 6-mip 1024×1024 single-slice case.bc64_tiling(): bottom-up standard mip tile allocation (12tiles/slice for 1024×512 with starts{4, 2, 1},22tiles/slice for 1024×1024 with starts{6, 2, 1}), overflow-safeavailable = first < subresources ? subresources - first : 0clamping, original-index placement intilings[i], and packed-mip / out-of-range sentinel preservation match the documented behavior.tests/startup_xg_bc_tiling_check.py&tests/xg_swizzle_select_check.cpp: 80 subresource queries (including cross-slice packed-to-standard boundaries,count == nullptr,tilings == nullptr, and0xffffffffbounds) plus the optional AddrLib--bc64-tilingreference check are well-structured.Verification
976540cc):git diff --check origin/main...HEAD: pass/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: pass (16 Markdown files, 289 links)/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: pass (1092 files)--target startup_stub_xg_xs xg_swizzle_select_check):--preset dev):ctest --preset dev -R '^(startup_xg_bc_tiling|xg_bc64_tiling_reference|xg_swizzle_select|startup_xg_bc7_layout)$' --parallel 4 --no-tests=error --output-on-failure— 2/4 passed (startup_xg_bc_tiling,startup_xg_bc7_layout), 2 skipped (exit 77:xg_bc64_tiling_reference,xg_swizzle_select, AddrLib not configured on VM)/O2(--preset release):ctest --preset release -R '^(startup_xg_bc_tiling|xg_bc64_tiling_reference|xg_swizzle_select|startup_xg_bc7_layout)$' --parallel 4 --no-tests=error --output-on-failure— 2/4 passed (startup_xg_bc_tiling,startup_xg_bc7_layout), 2 skipped (exit 77: AddrLib not configured on VM)