Repository navigation
startup: read one-dimensional linear (0x100) textures in slot 70 - #2929
Conversation
KelboLive
left a comment
There was a problem hiding this comment.
PR #2929 by @pigalot — startup: read one-dimensional linear (0x100) textures in slot 70
What works
- 1D textures in linear mode are handled correctly: single-row height validated, block-compressed formats refused (addrlib returns INVALIDPARAMS for 1D BC formats)
- 1D array guard DepthOrArraySize != 1 is consistent with how the draw path uploads 1D (no array variant)
- address_view_fits properly checks dimension match: D3D12_SRV_DIMENSION_TEXTURE1D returns true only when resource is also 1D
- desktop_address_view_supported now covers 1D, 2D, and 3D with correct format support queries
- Experiment notes in startup-gfx10-linear-1d.md are thorough with addrlib-derived layout rules and full test matrix
Issues
- address_view_fits checks r.DepthOrArraySize == 1 for 1D but does not verify v.Texture1D.MostDetailedMip is a valid index — the mips_fit closure handles bounds, but consider adding a guard for MostDetailedMip >= r.MipLevels for symmetry with the 2D case
- The D3D12_RESOURCE_DIMENSION_TEXTURE1D check could use a brief comment clarifying "not an array" intent
Recommendations
- Consider adding an explicit D3D12_SRV_DIMENSION_TEXTURE1D_ARRAY check in address_view_fits (returns false by fallthrough, but explicit is better)
- Verify the gfx10::supports change for 1D in gfx10_layout.h explicitly rejects 1D array textures to match the main path guard
Overall
A clean extension of the linear layout path to 1D textures. The layout derivation from addrlib is well-documented and the test matrix covers accepted, refused, and control cases. Ready to merge once the minor view-dimension explicitness items are addressed.
KelboLive
left a comment
There was a problem hiding this comment.
PR #2929 by @pigalot -- startup: read one-dimensional linear (0x100) textures in slot 70
What works
- Clean, well-documented addition that extends slot 70 0x100 linear layout support from 2D to 1D textures
- The gfx10_layout.h supports() check is precise -- one-dimensional linear only when height and element are 1, block-compressed formats and tiled modes stay refused
- address_view_fits() correctly rejects 1D arrays and adds mip-level/LOD clamp validation for the 1D view dimension
- d3d12_memory_srv.inl properly routes to D3D12_FORMAT_SUPPORT1_TEXTURE1D for the format capability check
- Documentation is thorough -- both the new experiment note and the updated startup-runtime.md are accurate and thorough
- The stacked-on note (#2926) is clear and helpful for reviewers
Issues
- The supports() check in gfx10_layout.h should probably assert or add an unreachable() for the new fallback path -- currently returns false for any case not explicitly handled, which is safe but a future regression hazard if a new dimension is added to the switch
- Consider adding a small unit test in startup_gfx10_layout for a 1D BC1 texture in the linear layout to formally confirm the refusal behavior rather than depending on integration tests
Recommendations
- The new code path is correct and the test matrix (round trips, refusals, addrlib verification, address_console draws) gives strong confidence
- When stacking order lands, verify the tests still pass after rebasing on main
Overall
A focused, well-tested extension to the linear layout path. The code is clean and consistent with the existing 2D linear work. No blocking issues.
Take a 1D, non-array texture in the console linear layout through the console-layout path: one row per mip, each padded to 256 bytes, smallest mip first (addrlib HwlComputeSurfaceInfoLinear). Add a TEXTURE1D view check, the 1D format-support bit, 1D unit and addrlib cases, three 1D draws and a 1D unpadded control.
Slot 70 refused a 2D texture whose Layout is the ADDR_SW_LINEAR word 0x100 because the extent of its rows was not established. Restate addrlib's Gfx10Lib::HwlComputeSurfaceInfoLinear in gfx10_layout.h: each mip's pitch is its rounded-up width aligned to 256 bytes, and the mips are packed from the smallest to the largest with no tail. Such textures then take the existing console-layout path. 1D and 3D linear textures stay refused. Tests: linear round trips, a hand-worked chain with a mip-order control, an optional comparison of every element address with addrlib, four exact linear draws in startup_address_console and an unpadded-pitch control.
address_view_fits already refused a 1D array, but gfx10::supports took one. Refuse it there too, so the layout check and the view check agree, and name the case in startup_gfx10_layout's refusals.
42c3bff to
146bf76
Compare
|
This PR is stacked on #2926 and no longer merges cleanly with main (it carries #2926's commit, which now conflicts in Order: #2926 merges first, then this one, then #2938. Please resolve #2926 first, then merge main into this branch once #2926 has landed. AI-assisted; commands listed were executed locally. (Trial merge against origin/main.) |
Keeps the volume (0x105) support from main next to the linear (0x100) mode: supports() checks volumes first, then 2D linear and tiled modes; the console check keeps both the volume cases and the linear cases.
…near-1d
Keeps the 1D linear texture parsing (",1d") and the volume depth field in the
console view test, both in one description string; supports() checks volumes
first, then 1D linear and 2D textures.
tedin7
left a comment
There was a problem hiding this comment.
No bug found.
Reviewed the diff against the D3D12 and console layout rules. One-dimensional linear textures: 1D arrays are refused consistently in supports() and console_address_texture, and the 1D view and format-support checks match D3D12.
Verification (Windows Server 2025, MSVC 14.44, D3D12 WARP, aws-1, exact head 1fc9058, dev and release run in parallel):
x2w_pipe.py win2025 2929 --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 and release both pass (149 of 149 in the first, broader run; skips are capability skips).- PR CI at this head: all required checks green. No open change request. No conflict with main.
AI-assisted; commands listed were executed locally.
Main now carries the linear (0x100) change as one squashed commit; the old copy in this branch is replaced by main's files and only the 1D linear change remains on top.
tedin7
left a comment
There was a problem hiding this comment.
Merged main into this branch again after #2926 landed (merge commit 59584e5, no rebase); main now holds #2926 as one squashed commit, so its files replace the old copy here and only the 1D linear change remains.
Reviewed the diff against the D3D12 and console layout rules. No bug found. 1D arrays are refused consistently in supports() and console_address_texture; the 1D view and format-support checks match D3D12; tests extend the layout check, the SRV check and the console check.
Verification (Windows Server 2025, MSVC 14.44, D3D12 WARP, aws-1, exact head 59584e5, dev and release in parallel):
x2w_pipe.py win2025 2929 --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 125 of 125 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.
Stacked on #2926. This branch contains its commit (80443a7); the change here is the next two commits, a8cf51a and 146bf76. Rebased on main 3e9542a on 27 Nov. Please review #2926 first. I will rebase this onto main once that one merges.
Summary
#2926 reads two-dimensional textures in the console linear layout (
0x100) throughdevice slot 70. A one-dimensional
0x100description is still refused withreason=unsupported_description:gfx10::supportstakes only 2D textures andaddress_view_fitshas no1D view.
AMD addrlib's
Gfx10Lib::HwlComputeSurfaceInfoLinearlays out a 1D surface with the same linear rule,one row per mip (each mip padded to 256 bytes, the smallest first), and refuses a 1D surface taller than
one row. This change takes such textures through the existing console-layout path. The draw already
uploads a 1D texture that is not an array.
src/startup_stubs/gfx10_layout.h:supportstakes a 1D texture in the linear mode with a height ofone and an element of one texel. Block-compressed formats and the tiled modes stay refused for 1D.
src/startup_stubs/address_texture.h: a 1D array is refused.address_view_fitstakes aTEXTURE1Dview of a 1D texture that fits the mip range with no LOD clamp.
src/startup_stubs/d3d12_memory_srv.inl: the desktop format check asks for theTEXTURE1Dsupportbit for a 1D texture.
tests/startup_gfx10_layout_check.cpp:gfx10::supportsrefuses it asaddress_view_fitsalready did), 3 new address descriptions and 6 new view checks.--addrlibrun gains three 1D textures (ADDR_RSRC_TEX_1D).tests/startup_address_srv.cpp:X2W_TEST_CONSOLE_DESCtakes an optional trailing1d, whichcreates a 1D description with a 1D view.
tests/startup_address_console_check.py:Texture1Dview: RGBA8 300 with one mip, and a 4-mip chain viewed at mips 0 and 2.linear-unpaddedcontrol also checks the 1D chain with its mips packed without padding.docs/startup-runtime.md: the description rule names 1D linear textures.docs/experiments/startup-gfx10-linear-1d.md: the note (linked from the 2D note).Tests
Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 5090 (driver 32.0.16.1088), Microsoft WARP. Debug layer
on (dev preset). addrlib: Mesa 25.1.0 via
tools/fetch_addrlib.py.startup_gfx10_layout: PASS (15 round trips, 1 linear chain, 15 refusals, 22 address descriptions, 33 views). Negative control for 146bf76: without its guard,FAIL accepted: 1D array.ctest --preset dev --no-tests=error -R 'address|gfx10|memory_srv|xg_|bc64|tile64|small_texture|bc7|slot70|texture|console|1d|draw|translated|sampler|d16' -E '_hardware$|startup_audio' -j 8: 228 of 228 passed, 9 capability skips (spirv_*_warp,bc7_mode6_multiblock_warp). The same filter on_hardwaretests at-j 1: 130 of 130 passed, 9 capability skips. The--addrlibcomparison was not rerun after the rebase (that build had no addrlib); the layout code it checks did not change in the rebase.startup_gfx10_layout_linear_order_control: expected failure (unchanged).startup_gfx10_layout_linear_addrlib: PASS,349547 linear sizes and addresses compared, 0 mismatches.startup_address_console_warp,_hardware: PASS. The 3 new 1D draws match all 65,536 pixelsexactly; the earlier draws and the held/late cases are unchanged.
startup_address_console_linear_unpadded_warp,_hardware: PASS. The unpadded 1D chain (mip 2 at152 instead of 256) is published and 65,536 of 65,536 pixels differ. The 2D case is unchanged
(63,488 differ).
00000000, and010300ffwas expected.ctest --preset dev -R 'address|gfx10|memory_srv|xg_|bc64|tile64|small_texture|bc7|slot70|texture|console|1d'.-j 8,_hardwareandstartup_audioexcluded): 124 tests, 0 failed, 7 skipped(
spirv_address_window*_warpandbc7_mode6_multiblock_warp, all capability skips, 77).-j 1): 49 tests, 0 failed, 7 skipped (the same capability skips).A local 600 s real-world run (release build, same change on top of the slot-70 stack) ended at the
timeout with exit 0. The two 1D
0x100shapes the previous run refused asunsupported_description(R8G8B8A8_UNORM_SRGB and R8_UNORM, one mip each) were not refused, and no
0x100description wasrefused.
The addressing rule is addrlib's desktop GFX10 rule. That console memory uses it for
0x100isinferred from the layout word, not measured on console hardware.
This change was AI-assisted.