startup: read 0x105 volume mip chains in slot 70 #2876
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!2876
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2876"
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 15:54 UTC · original
pigalot:slot70/console-3d-mips→main· +324 −143 · 9 files · 5 commits · merged 2026-11-28 00:07 UTCDepends on R0Y00/Xbox2Windows#2871, which reads single-mip
0x105volumes; until that merges, this PR's diff includes its commit. Review the last commit only.A Texture3D description in
0x105with more than one mip was still refused asunsupported_description. This reads the mip chain too. The rest of the accepted shape is unchanged: one sample, an uncompressed format with a known element size, at most 2048 texels on each side, viewed as a Texture3D whose mips fit the chain.addrlib's thick layout for a mip chain (
Gfx10Lib::ComputeSurfaceInfoMacroTiled,ComputeSurfaceAddrFromCoordMacroTiled,GetMipTailDim,GetMaxNumMipsInTail):Block256_3d), gives its origin in x and y; z is not moved.As before, the rules are restated as data and code of our own; no addrlib code is included.
Changes:
gfx10_layout.h:supports_volumetakes 1 to 15 mips.Layout::thickcomputes the tail, the mip starts inside a layer of blocks and the tail origins;addressuses them.address_texture.h: the mip-count check counts the depth of a volume, as D3D12 does.Still refused, unchanged: block-compressed volumes, volumes in every other mode, cube views, and layout
0/0x100without a live texture.Tests (
tests/cmake/startup_gfx10_volume.cmake):startup_gfx10_volume:startup_gfx10_volume_tail_control(WILL_FAIL): puts every tail mip at the start of the tail block. It fails 14 checks.startup_gfx10_volume_addrlib: now also compares every mip count of four chains for each element size. 305 volumes, 12,704,487 element addresses, 0 mismatches.startup_address_console_{warp,hardware}: also draws four mips of two chains (RGBA8 32x32x32 with six mips, and 20x24x16 with five; mip 1 and mip 3, the second in the tail, of each). The backing holds every mip with its own texels, and all 65,536 pixels of each draw must match.startup_address_volume_srv_*: refusal 5 (a0x105description at the address of the live desktop-layout volume) is now refused asoverlapping_resourceinstead ofunsupported_description, because the shape is now one slot 70 reads. The test still checks the exact line, and that the earlier descriptor is kept.Negative control run once by hand, not registered: dropping the volume tail origins in
gfx10_layout.hfailsstartup_address_console_warpon the first tail mip, which then reads another mip's texels.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):The layout is checked against addrlib, not against console memory.
This change was AI-assisted.
@KelboLive on GitHub · 2026-11-26 16:12 UTC · original · approved these changes
Review: startup: read 0x105 volume mip chains in slot 70
Depends on #2871 (single-mip 0x105 volumes). This extends that to multi-mip chains, following addrlib's thick-block layout for 3D textures in the 4 KiB standard mode.
What changed
gfx10_layout.h— Newsupports_volume()validates D3D12_RESOURCE_DIMENSION_TEXTURE3D resources with swizzle mode 5, element size, single sample, axes ≤ 2048, and valid mip count. NewLayout::thick()computes thick-block layout (8×16×8 element blocks for 4-byte elements, followingGfx10Lib::HwlIsThick). Addeddepth,block_depth,z_bits,layer_sizefields, andlayers(mip)method.address()extended with z parameter.address_texture.h— The max-dimension check now includes depth for volumes:std::max({Width, Height, depth_or_array_size}) >> (mips - 1).d3d12_draw.inl—upload_texture()comparesplan.placed[i].Footprint.Depthagainstconsole_layout->layers(i)and passes the layer stride todetile()so depth layers follow one another rows apart.d3d12_memory_srv.inl—console_address_hold()computes slices as 1 for volumes (one slice = all depth layers), matching the layout semantics.Tests — New
startup_gfx10_volume.cmakewith--mutate thin,--mutate tail, and--addrlibtest variants. Address console check extended to six volume mips.Observations
(k << 8)in the tail block read back as micro blocks, and the first-tail calculation matching theshiftedmacro +tail_mips = 5thresholds. This is the correct approach.z_bitscomputation mirrors the x/y pattern exactly, just using the third axis from the bit pattern. Clean and consistent.console_address_hold()volume fix (slices = 1) is exactly right — a 3D resource has one slice containing all depth layers, so the footprint already spans the entire depth.Minor note
The
thick()function iteratesfor (UINT mip = 0; mips > 1 && mip < mips; ++mip)— the conditionmips > 1 && mip < mipsis logically justmip < mipsonce you subtract (the<check dominates). This is either intentional (themips > 1guards against zero) or could be cleaned up tomips > 1 && mip < mips→mips > 1outer guard +for (UINT mip = 1; mip < mips; ++mip)skipping mip 0, which the tail logic doesn't use. Looking more carefully, this skips mip 0 in the first-tail loop, which appears correct since the tail mips start from mip 1 and the first mip is never a tail mip (it's always the largest). This is a minor readability point, not a bug.Verdict
Solid, correct implementation. The thick-block layout matches addrlib, the volume semantics (1 slice, depth as z) are consistent throughout, and the test coverage is thorough with negative controls. Approving.
@RonLogic on GitHub · 2026-11-26 16:23 UTC · original
Independent Windows Release verification at
eb36ad01e6576f016df0859d36defdc515611fa0. The slot-70 volume SRV and console readback tests passed on both in-box WARP (10.0.26100.10068) and RTX 4070 (32.0.16.2124). In each console run the four mip-chain draws compared all 65,536 RGBA pixels per draw, including the tail mips of both volume shapes. Layout checks passed, and the thin and tail negative controls triggered 62 and 14 checks respectively. Totals were 7 passed and 1 skip: addrlib was unavailable locally. Windows26300.10075, MSVC 19.52 x64 Release. Builtstartup_stream_consumer startup_gfx10_volume_checkand ranctest --preset release --no-tests=error -j 1 -R '^startup_(gfx10_volume($|_)|address_(console|volume_srv)_(warp|hardware)$)' -V.@tedin7 on GitHub · 2026-11-27 21:53 UTC · original
This PR no longer merges cleanly with main. #2871 has merged (squashed), so the old #2871 commit in this branch now collides with the squashed copy (add/add).
Conflicting files:
docs/experiments.md,docs/startup-runtime.md,src/startup_stubs/gfx10_layout.h,tests/cmake/startup_gfx10_volume.cmake(add/add),tests/startup_address_console_check.py,tests/startup_gfx10_volume_check.cpp(add/add).Please merge main into the branch and keep main's version of the #2871 files, then re-apply only this PR's change. Order: this PR first, then #2881.
AI-assisted; commands listed were executed locally. (Trial merge against origin/main.)
@tedin7 on GitHub · 2026-11-27 23:43 UTC · original
Merged main into this branch to clear the conflicts (merge commit
c7b10b19d, no rebase); main carries the single-mip volume change as one squashed commit, so its files replace the old copy here and only the mip chain change stays on top. Testing on Windows now.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-27 23:57 UTC · original
Merged main into this branch again after #2926 landed (merge commit
2783c10f0, no rebase); the volume docs and the console check keep both the linear cases and the volume mip cases. Testing on Windows now.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-28 00:07 UTC · original · reviewed
Merged main into this branch once more after #2938 landed (merge commit
d09ad540e, no rebase): the 1D array refusal from main stays next to the depth-aware mip count, and the console check keeps the cubes and the volume mips.Reviewed the diff against the D3D12 and console layout rules. No bug found. Volume mip chains: each layer of blocks holds that layer of every mip, tail block first, then mips smallest to largest; the tail test, tail origins and the depth-aware mip count follow the cited addrlib rules, and the tests use hand-computed layouts.
Verification (Windows Server 2025, MSVC 14.44, D3D12 WARP, aws-1, exact head
d09ad540e, dev and release in parallel):x2w_pipe.py win2025 2876 --force --scope full --host aws-1 --regex 'startup_address|startup_resource_address|gfx10|memory_srv|slot70|volume|linear|cube|console|_1d|startup_ui_texture': dev 128 of 128 run passed, release exit 0 (capability skips only).AI-assisted; commands listed were executed locally.