textures: add an opt-in BC7 tiled layout query #1211
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1218"
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 Jess-Doit on 2026-11-24T04:06:11Z.
Change
Refs #1140.
With
X2W_D3D12_PERMISSIVE=1andX2W_XG_BC7_4K_S_LAYOUT=1, thexg_xsstand-in can report standard GFX10 4 KiB tiled geometry for a single-slice, single-mipBC7_UNORM2D texture. The diagnostic selects this layout explicitly. Native XG selector values and detiling on upload are follow-ups.CopyIntoSubresourcereturnsE_NOTIMPLfor these tiled objects and preserves the caller's destination.Verification
Tested
61c14219(rebased on81c377e5) on Windows 10 22H2 build19045.6456. The source-built 64 × 64 and 81 × 69 cases matched 4 KiB and 16 KiB from the BC7 tile oracle, respectively, with zero mip offsets and intact guards. Both copy calls returnedE_NOTIMPL. Forcing the desktop query failed both presets at the 81 × 69 span. The accepted 64 × 64 desktop control reported 64 KiB total size and alignment. Restoring the tiled query passed 8/8 in each preset with zero skips, including the neighboring swizzle selection, factory, caller, and BC7 round-trip tests.With an x64 MSVC environment, the repo's Python dependencies in
$python, and the pinned Mesa AddrLib source in$addrLib:The desktop-footprint mutation ran on the pre-rebase commit
7e73ffad; the rebased commit passed 8/8 again in both presets.AI-assisted (Codex, reviewed with Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T04:21:39Z.
Review: COMMENTED
Reviewed commit
61c14219.Diff & edge-case audit
src/startup_stubs/xg_xs.cpp:use_bc7_4k_s_layoutgates onX2W_XG_BC7_4K_S_LAYOUTand strictly restricts to 2DDXGI_FORMAT_BC7_UNORM,D3D12_TEXTURE_LAYOUT_UNKNOWN,Width/Heightin[1, D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION](16384), 1 slice, 1 mip, non-MSAA (Count=1, Quality=0),Alignment=0,Flags=D3D12_RESOURCE_FLAG_NONE.write_bc7_4k_s_layout: pads dimensions to64texels (16x16 BC7 blocks, 4096 bytes/tile); maxpadded_width/padded_heightis16384,pitch_bytesis65536, andbytesis computed inuint64_t(max 256 MiB), with no integer overflow.computer_copy_intoreturnsE_NOTIMPLfor this profile without modifying the destination.tests/startup_xg_bc7_layout_check.py,CMakeLists.txt,docs/startup-runtime.md: Clean and title-neutral;tests/startup_xg_bc7_layout_check.pycompares64x64and81x69againstgfx10_texture_roundtrip_check.oracle_surfaceand checks guard bytes andCopyIntoSubresourceE_NOTIMPL.Checks run on Linux (
61c14219)/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: PASS (16 Markdown files, 274 links)./root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: PASS (1019 files)./root/.local/share/x2w-rev-venv/bin/python -B tests/form_coverage_check.py: PASS./root/.local/share/x2w-rev-venv/bin/python -B tests/xgameruntime_table_check.py: PASS (28 exports)./root/.local/share/x2w-rev-venv/bin/python -B tests/gpu_report_format_check.py: PASS (10/10)./root/.local/share/x2w-rev-venv/bin/python -B tests/hardware_reports_check.py: PASS (11/11).Note: Windows MSVC build and
startup_xg_bc7_layout(tests/startup_xg_bc7_layout_check.py, which loadsstartup_stub_xg_xsviactypes.WinDLL) were not executed locally.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T04:25:16Z.
Windows Server 2025 retest at
61c14219(Windows Server 2025 Build 26100, MSVC 14.44.35207, AMD Ryzen 5 PRO 5650U, WARP):Debug (
devpreset)Commands:
Results: 1 passed, 0 failed, 0 skipped (Total Test time:
0.34 sec)startup_xg_bc7_layout: Passed (0.31 sec)Release (
/O2,releasepreset)Commands:
Results: 1 passed, 0 failed, 0 skipped (Total Test time:
0.20 sec)startup_xg_bc7_layout: Passed (0.17 sec)