Repository navigation
Conversation
KelboLive
reviewed
Nov 27, 2026
KelboLive
left a comment
Contributor
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
reviewed
Nov 27, 2026
KelboLive
left a comment
Contributor
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.
This was referenced Nov 27, 2026
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.
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.
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.
pigalot
force-pushed
the
slot70/linear-1d
branch
from
November 27, 2026 09:17
42c3bff to
146bf76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.