Repository navigation
startup: read 0x105 volume mip chains in slot 70 - #2876
Conversation
A Texture3D description in the 4 KiB standard layout with one mip and an uncompressed format is now detiled from its thick blocks (GFX10_SW_4K_S3_PATINFO rows) instead of refused. The XG-size hold counts a volume as one slice, since its footprints already span every depth layer.
A Texture3D description in the 4 KiB standard layout with a mip chain is now detiled instead of refused. Each layer of thick blocks holds that layer of every mip: the shared tail block, then the mips from the smallest to the largest, with the tail mips at the origins addrlib gives them. The mip-count check counts a volume's depth.
KelboLive
left a comment
There was a problem hiding this comment.
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
- The thick layout code faithfully follows the documented addrlib patterns: the nibble01/row patterns for each element size, the tail mip positioning at
(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. - The
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 iterates for (UINT mip = 0; mips > 1 && mip < mips; ++mip) — the condition mips > 1 && mip < mips is logically just mip < mips once you subtract (the < check dominates). This is either intentional (the mips > 1 guards against zero) or could be cleaned up to mips > 1 && mip < mips → mips > 1 outer 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.
|
Independent Windows Release verification at |
|
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: 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.) |
Main carries the single-mip volume change as one squashed commit, so the old copy of that commit in this branch is replaced by main's files; only the mip chain change remains on top.
|
Merged main into this branch to clear the conflicts (merge commit c7b10b1, 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. |
Main now holds the linear (0x100) change; the volume docs and the console check keep both the linear cases and the volume mip cases.
Main now holds the cube view change; the address check keeps the 1D array refusal next to the depth-aware mip count, and the console check keeps the cubes and the volume mips.
tedin7
left a comment
There was a problem hiding this comment.
Merged main into this branch once more after #2938 landed (merge commit d09ad54, 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 d09ad54, 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).- PR CI at this head green; no open change request; no conflict with main.
AI-assisted; commands listed were executed locally.
Depends on #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.