startup: read block-compressed 0x105 volumes in slot 70 #2881
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2881
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2881"
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?
@pigalot on GitHub · 2026-11-26 16:19 UTC · original
pigalot:slot70/console-3d-bc→main· +175 −53 · 7 files · 4 commits · merged 2026-11-28 08:25 UTCDepends on #2876 (and through it #2871). Until those merge, this PR's diff includes their commits. Review the last commit only.
A Texture3D description in
0x105with a block-compressed format (BC1 to BC7) was still refused asunsupported_description. This change reads those volumes too, with one mip or a mip chain. The rest of the accepted shape is unchanged. The largest mip must be whole 4x4 blocks across and down, as for 2D BC textures; the depth can be any value.addrlib's rule for a block-compressed surface (
ElemLib::AdjustSurfaceInfofromAddr2ComputeSurfaceInfo):A BC volume therefore takes the thick layout of the volume of its blocks, each block one depth layer deep. As before, the rule is restated in our own code; no addrlib code is included.
Changes:
gfx10_layout.h:supports_volumetakes block-compressed formats.Layout::thicksizes the mips, tail and blocks from the element sides (texel sides rounded up to blocks) instead of the texel sides.Still refused, unchanged: volumes in every other mode, cube views, and layout
0/0x100without a live texture.Tests:
startup_gfx10_volume:startup_gfx10_volume_bc_control(WILL_FAIL): sizes a BC volume's blocks and mips by its texel sides. It fails 4 checks.startup_gfx10_volume_addrlib: passes each BC format to addrlib as itself (ADDR_FMT_BC1toADDR_FMT_BC7) and the coordinates in blocks. It now also compares every mip count of four chains for each of BC1 to BC7: 501 volumes, 13,205,290 element addresses, 0 mismatches (305 volumes before).startup_address_console_{warp,hardware}: also draws three BC1 volume mips: 48x40x12 with one mip, and mips 1 and 3 (the second in the tail) of 64x64x8 with five mips. The Python oracle builds the backing from the 8-byte S3 row. Each block is one solid colour, and all 65,536 pixels of each draw must match.startup_gfx10_layout: two checks asserted that a BC volume in0x105is refused. That is the behaviour this PR changes. They now check a BC volume in0x109, which is still refused.Negative control run once by hand, not registered: sizing the thick layout by texels instead of blocks in
gfx10_layout.hfailsstartup_address_console_warpon the first BC volume.Checks (Windows 11 build 26200, MSVC 14.52, debug layer off; the
_hardwarerun's adapter on this host was Microsoft Basic Render Driver 10.0.26100.9818, so no physical-GPU result is claimed):Only BC1 volumes are drawn. BC2 to BC7 volumes are checked against addrlib and by round trip, not by a draw. The layout is checked against addrlib, not against console memory.
This change was AI-assisted.
@RonLogic on GitHub · 2026-11-26 16:37 UTC · original
Independent physical-GPU verification at
5ac7ed06673bd3ccca659c08ef563796465d4645on Windows26300.10075, MSVC x64 Release. The registered layout/volume and address tests produced 10 passes and one addrlib skip. The three registered BC1 draws matched all 65,536 pixels each on in-box WARP10.0.26100.10068and RTX 407032.0.16.2124.I also ran a local source-built BC7 mode-6 probe through the same slot-70 draw path. It reused the existing Python volume address oracle with the 16-byte S3 row and generated distinct block contents per slice and mip using
bc7_draw_check.make_block. The 48×20×9 single mip and the 64×64×8 chain's mip 1 and tail mip 3 each matched 65,536/65,536 pixels on both adapters. Swapping backing layers 0 and 1 failed at(0,0)on each (expected 0000183c,actual 3812183c). The BC7 probe was local and did not change the PR or its registered tests.@tedin7 on GitHub · 2026-11-27 21:53 UTC · original
This PR is stacked on #2876 (and carries the old #2871 commit, which has since merged as a squash) and no longer merges cleanly with main.
Order: #2876 first, then this one. Please merge main into the branch after #2876 lands; expect conflicts in
src/startup_stubs/gfx10_layout.h,tests/startup_address_console_check.py,tests/startup_gfx10_volume_check.cppand the docs.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-28 00:09 UTC · original
Merged main into this branch after #2876 landed (merge commit
fd41d5a70, no rebase); main's files replace the old copies of #2871 and #2876 here and only the block-compressed volume change remains. Testing on Windows now.AI-assisted; commands listed were executed locally.
@JohnConnorNPC on GitHub · 2026-11-28 08:03 UTC · original
Thanks for this. I reviewed head
fd41d5a7and found nothing blocking: it looks ready from our side, with one suggestion and two nits below. We ran a clang-cl cross build under Wine on the CPU only. We had no WARP and no GPU, sostartup_address_console_{warp,hardware}were not run here.fd41d5a7merges main after #2876 without a rebase (parents5ac7ed06andb1e92256), as requested.git diff --shortstat b1e92256 fd41d5a7gives7 files changed, 175 insertions(+), 53 deletions(-), which matches5ac7ed06's own diff apart from one docstring line.git merge-tree --write-tree origin/main fd41d5a7againstmainc3204a9creturns rc=0.startup_gfx10_volumePASS (27 volumes round-tripped, 2 block-compressed volumes against their blocks). With addrlib:501 volumes, 13205290 element addresses compared, 0 mismatches, the same as your numbers. The thin, tail and bc controls each fail, bc with exactly the 4 FAILs the body describes.startup_gfx10_layoutPASS.thick()by texel sides (plain run fails, 153 addrlib mismatches), refusing BC volumes again (11 FAILs), and a tail test that uses texel sides (plain run fails, 736 addrlib mismatches).fd41d5a7, butctest --preset prdoesn't run the touched tests (grep -c startup_gfx10_volumeon the Windows job log gives 0), so local runs are their only coverage so far.Suggestion (not blocking):
columns(mip)/rows(mip)) instead ofshifted(columns0, mip)passes everything, addrlib included. The PR is correct here. With an added shape{260,32,8,BC1,9}, your code gives 0 mismatches and the mutant givesFAIL 260x32x8 8-byte 9 mips: size 0x13000, addrlib 0x14000. For a case that doesn't need addrlib, thecheck_block_compressedpair{volume(260,32,8,BC1,0x105,7), volume(65,8,8,R16G16B16A16_UNORM,0x105,7)}passes on your code and fails the mutant withblock-compressed 260x32: size 73728.Nits:
2. The body and experiments.md describe "round trips for every mip of seven BC volumes (BC1 to BC7 …)". The round-trip
shapesarray has no BC2 and has BC5 twice, so BC2 is covered only by the addrlib chains.3. The body still says it depends on #2876 and to review the last commit only, but #2876 has merged. No Windows result has been posted for
fd41d5a7yet. The WARP + RTX 4070 pass in this thread was for5ac7ed06.This comment was AI-assisted.