Repository navigation
Conversation
7bbd7f5 to
a92ea12
Compare
tedin7
left a comment
There was a problem hiding this comment.
Reviewed PR #1469 (a92ea122):
Verification
- Win2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at
a92ea122:- Debug (
--preset dev): builtstartup_stub_xg_xs,startup_stub_consumer,offscreen_check, and downstream targets;ctest --preset dev -R '^(startup_xg_|startup_stub|bc7_)'14/16 passed (startup_xg_gfx10_runtime,startup_xg_bc_tiling,startup_xg_bc7_layout,startup_stubs,startup_xg_bc_chain_*,startup_xg_bc_array_*,startup_xg_bc7_draw_*,bc7_tile_swizzle,bc7_block_reference,bc7_draw_*);2capability-skipped (bc7_mode6_multiblock_hardware,bc7_mode6_multiblock_warp). - Release
/O2(--preset release): built same targets;ctest --preset release -R '^(startup_xg_|startup_stub|bc7_)'14/16 passed,2capability-skipped (bc7_mode6_multiblock_*).
- Debug (
- Linux checks at
a92ea122:tests/docs_links_check.py,tests/bidi_controls_check.py,git diff --check origin/main..HEAD: PASStests/gfx10_texture_roundtrip_check.py: PASS (6/6)git merge-tree --write-tree origin/main HEAD: merges cleanly.
Code Audit Findings
columns(mip)/rows(mip)returns0for non-square BC mips (src/startup_stubs/gfx10_texture.h):Whenreturn (std::max)(1u, (width >> mip) + block_dim - 1) / block_dim;
width >> mip == 0(e.g.,128x64BC7 atmip = 7whereheight >> 7 == 0),(std::max)(1u, 0 + 4 - 1) / 4evaluates to3 / 4 == 0. Ingfx10_copy(src/startup_stubs/xg_bc64.inl),u64{tex.rows(level) - 1}then underflowsUINTto0xffffffff.
It should be((std::max)(1u, width >> mip) + block_dim - 1) / block_dim(and similarly forrows(mip)).- Missing
d.MipLevels <= 16guard inGfx10Texture::supports():
mip_start,tiles_w,tiles_h,tail_origin_x, andtail_origin_yare fixedstd::array<UINT, 16>. Ifd.MipLevels > 16is passed,Gfx10Texturewill index out of bounds (andwidth >> mipformip >= 32is UB). Addingd.MipLevels > 16tosupports()prevents that. - Negative control in
tests/startup_xg_gfx10_check.py:
The 12 positive roundtrip cases pass, but there is no negative/failure control yet (e.g.pitch < row_bytes, out-of-range subresource/plane, overlappingsrc/dst, or unsupported format).
a92ea12 to
eb3e418
Compare
|
Addressed review feedback at
Verification
|
Add clean-room GFX10 texture tiling and detiling runtime in src/startup_stubs/: - Implement src/startup_stubs/gfx10_texture.h using AMD GFX10 addrlib micro-tile equations (SPDX-License-Identifier: MIT, derived from Mesa src/amd/addrlib). - Support Thin S and Thin D 256-byte micro-tiles across 1B, 2B, 4B, 8B, and 16B elements (BC1-BC7, R8, R16, R32, RG8, RGBA8, BGRA8, RGBA16, RGBA32, D16, D24S8, D32F). - Support non-XOR swizzle modes: SW_64KB_S, SW_64KB_D, SW_4KB_S, SW_4KB_D, SW_256B_S, SW_256B_D, and SW_LINEAR. - Implement mip tail packing, origin placement, and linear<->tiled subresource transfers (copy_subresource<into>). - Wire TextureComputer slots in xg_xs.dll (slots 2, 3, 4, 5, 6, 8, 9, 10), including functional slot 9 (CopyFromSubresource detile). - Integrate general GFX10 detiling into D3D12 runtime upload_texture and publish_tiled_texture. - Add synthetic verification test suite tests/startup_xg_gfx10_check.py covering 12 texture shapes, formats, and swizzle configurations. Verification: ctest --preset dev --no-tests=error -R '^(startup_xg_|bc7_|texture_bc|bcpack)' -V 19/19 tests passed (100%)
eb3e418 to
88c391e
Compare
Built, ran, and probed with two mutations on the new tilerIndependent reviewer, not the author. Reviewed Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100. cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R '^(startup_xg_gfx10_runtime|gfx10_texture_roundtrip|gfx10_texture_roundtrip_controls|bc7_tile_swizzle)$' -VUnmodified branch — Mutation 1 — y coordinate table redirects every bit-if ((y >> bit) & 1) val |= (1u << y_target_bit[bit]);
+if ((y >> bit) & 1) val |= (1u << (y_target_bit[bit] ^ 1));Mutation 2 — 4 KB modes report a 64 KB block case SW_4KB_S:
-case SW_4KB_D: return 12;
+case SW_4KB_D: return 16;What the second result implies
If it would help, a second oracle would be cheap: the Python tiler already knows these modes, so one case could compare VerdictReviewed |
|
Independent Windows check at One ABI question remains. For packed mips, the slot 2 layout record's 32-bit field at |
|
A regression surfaced in a one-DLL A/B at The distinction is reproducible without title data. For descriptors with UNKNOWN layout, 2D R8, RG8, RGBA, BC3 and BC7 uploads produced different bytes from the previous path; both planes of an explicit NV12 sample agreed. A local selective build keeps the previous behavior for those five implicit-layout cases while matching your slot 10 output for all 133 sampled explicit sparse descriptors. Could we keep the proven explicit layout routing and cover implicit layout selection in separate source-built upload tests? I am also checking an intro color regression separately. Completed the single-DLL retest on RTX 4060 Laptop. The previous intro produced a uniform green client image. The selective build produced consecutive distinct full-color intro frames. A 712 × 80 mixed-script text region on each of two UI pages matched the previous known-good build pixel for pixel (maximum channel error 0 on both). The later letterboxed image still became magenta in the selective build; that later rendering failure remains open. No private inputs or captures are needed for the five upload comparisons above. |
|
Thanks for the thorough independent verification on BC7 and BC6H! Regarding the
|
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head 88c391e (comment only, not an approval). My earlier review was at a92ea12.
Verdict: 1 P1, 3 P2. The tiler itself looks correct (below); the problem is where it is routed.
Earlier points: the rows/columns underflow, the MipLevels > 16 guard and the negative controls are all fixed at this head.
P1: every implicit-layout 2D texture now gets the swizzled 64 KiB computer (src/startup_stubs/xg_xs.cpp:378, with gfx10_swizzle_from_desc in gfx10_texture.h)
Gfx10Texture::supports()is true for any 2D texture with a known format, andgfx10_swizzle_from_descreturnsSW_64KB_Sfor any layout that is neither explicit nor row-major, including layout 0. The oldbc64::supportsaccepted only 1024-wide BC5/BC7 with layout 0x109. Textures that used the desktop-footprint path (slots 2, 8, 10) now take the tiled path, whileupload_texturestill reads implicit-layout memory as linear (is_tiled()is false for layout 0). This fits R0Y00's field report (comment 7134312424) that implicit-layout R8, RG8, RGBA, BC3 and BC7 uploads differ from the previous path.- Reproduction: the real xg_xs.cpp built into a DLL with mingw and run under wine. Slot 8 on an RGBA8 64x64 layout-0 texture returns
size=65536 output_is_row_major=0;dump 28 256 256 1 1 0givessize=40000 align=10000at the PR head. Wine has no D3D12 device, so the base path was read from source rather than run. - Fix: gate the table swap on explicit layouts (
is_tiled(desc)orbc64::supports) and add an implicit-layout test.
P2
- Linear (0x100) is accepted but its metadata is wrong:
init_linear()in xg_bc64.inl never fillstiles_w/tiles_h.dump 28 256 256 1 1 0x100gives mip0span=0 pitchB=0 padw=0,tiles=1024 shape=64x1x1. The roundtrip test passes anyway because it never reads those fields. - tests/startup_xg_gfx10_check.py only checks tile-then-detile gives the input back, so any bijective permutation passes. Slot 5 is never called,
first_addrin slot 6 is never asserted, layout records are never read, and theMipLevels=17control only assertsalign != 65536. addrlib is already an optional dependency (tools/fetch_addrlib.py, xg_swizzle_select_check.cpp); compare addresses and sizes against it. - Claims versus tests: the body lists D16, D24S8, D32F, RG8, BGRA8, RGBA16 and RGBA32, but no test case covers them (and D24S8 is not S/D swizzle for depth on this hardware); the body says 19/19 tests and 12 cases while a comment says 17 passed, 2 skipped, 13 cases; "clean-room" conflicts with "derived from Mesa addrlib" and the AMD copyright line in the header. Against origin/main cea8af5 it no longer merges cleanly (CMakeLists.txt and xg_xs.cpp, trivial; from be98528, which added a tile64_plan.h answer for slot 10 layout 0x10a).
What I ran
git diff --check, docs_links_check (16 files, 334 links) and bidi_controls_check: pass. gfx10_texture_roundtrip_check roundtrip and controls pass, but they test tools/bc7_tiles.py, which this PR does not touch. startup_xg_gfx10_check.py cannot run on Linux (noctypes.WINFUNCTYPE); I ran a C++ port of it (13 cases plus negatives) against the real DLL under wine: all pass.- Base DLL versus PR DLL on the shapes the old code supported (BC7/BC5, 1024 wide, layout 0x109): layout, size, offsets, tiling and all texel addresses identical. Against an addrlib build (Mesa 25.1.0, navi21 config), 30 cases across BC1/3/4/5/7, R8, R16, RG8, RGBA8, RGBA16, RGBA32, R32 and 256B/4KB/64KB S and D match on size, alignment, mip offsets and every texel address.
- Mutations (each restored with
git checkout --): block log2 of SW_4KB_D 12 -> 16, tail x/y bit sources swapped, reverting therows()fix and slot 10 reporting one more standard mip are caught by the port. NOT caught by it: swapping x1 and x2 in the 4-byte S pattern (a wrong but bijective swizzle; only the addrlib comparison sees it,pr=32896 addrlib=32832), and a linear mip pitch no longer 256-aligned (neither sees it). Acolumns()-only edit was also not caught; the height case needs therows()change.
Non-blocking
- After the merge the new
gfx10_tilingand main'stile64::Planboth answer slot 10; they matched on 7 of 7 valid 0x10a shapes I compared and differ only for an invalid 256x256 with 16 mips. - The d3d12_memory_srv.inl edit is dead for now (
supports_memory_srvstill gates onbc64::supports);gfx10_swizzle_from_descreadsX2W_XG_BC7_4K_S_LAYOUTthroughGetEnvironmentVariableAon every construction; about 2.4 KB of tables are rebuilt per call;total_slice_bytesandaddress()are 32-bit and overflow above 4 GiB; the+0x48offset question was answered in a comment only and stays unverified. - #1641, #1567, #1701, #1441 and #1277 touch the same stub files, mostly the include area.
Not run: any ctest preset, the real startup_xg_gfx10_check.py, a D3D12 device, llvm-mc-19 (no shader forms in the diff). The wine harness shims __try, so unreadable-memory probes were inert.
Linux limits: no Windows, MSVC, DXC or D3D12 device here; LLVM 19 only. Anything that needs them was not run.
AI-assisted; commands listed were executed locally.
|
Addressed the P1, P2, and merge-conflict feedback from @tedin7 and @R0Y00 at
Verification at
|
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head eca1f09 (comment only, not an approval). Earlier reviews were at a92ea12 and 88c391e.
Verdict: 0 P1, 1 P2. The earlier P1 (implicit-layout textures routed to the swizzled computer) is fixed at this head.
Fixed since 88c391e
gfx10_swizzle_from_desc(src/startup_stubs/gfx10_texture.h:136) now accepts only(layout & 0xFF00) == 0x100. Layout 0 and 1 return 0xFF, sosupports()is false andXGCreateTextureComputer(xg_xs.cpp:409) keeps the desktop table for them.init_linear()now fillstiles_w/tiles_hfor 0x100.test_implicit_and_unsupported_routingcovers UNKNOWN RGBA8/R8/RG8/BC3/BC7, ROW_MAJOR RGBA8 and D24S8/D32F, and checks desktopspan=16384 pitch=256for RGBA8 UNKNOWN.- The positive cases now cover BC1-BC7, R8, RG8, R16, R32, RGBA8, BGRA8, RGBA16, RGBA32 and linear, across 256B/4KB/64KB S and D modes (22 cases), which matches the body.
upload_textureanddevice_memory_srvgate onGfx10Texture::is_tiled, so upload and XG routing agree for implicit layouts.
P2
- The tests still do not pin the swizzle pattern, and the only address oracle is skipped where it ran. I applied one mutation to the new logic: in
PATTERN_S[2](gfx10_texture.h, 4-byte elements, the RGBA8 / BGRA8 S case) I swappedy0y1toy1y0.startup_xg_*on Win2025 stayed green (10/10 passed). The roundtrip and slot checks accept any bijective permutation.xg_gfx10_tiling_referenceis the check that compares against addrlib, but it reports Skipped on Win2025 (addrlib not configured), so this mutant survives. Please either run it with addrlib in the Windows CI job, or add a few hard-coded expected byte offsets per element size (1, 2, 4, 8, 16) taken from an addrlib run intostartup_xg_gfx10_check.py.
Nit
- Slot 10 / layout
+0x48writes the swizzle mode (9 for 64KB_S), same as the previous path. The 256B S vs D value in the thread is unread by any consumer, so no change needed.
Checks run
- Linux:
python3 tests/docs_links_check.pyPASS (18 files, 407 links);python3 tests/bidi_controls_check.pyPASS (1489 files);git diff --check origin/main...HEADclean;python3 -I -m py_compile tests/startup_xg_gfx10_check.pyOK;python3 -I tests/gfx10_texture_roundtrip_check.pyPASS (6 tests; this one covers the 4 KiB BC7 Python tool, not the new C++). - Win2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP) at eca1f09:
python3 x2w_pipe.py win2025 1469 --wait 3600 --targets startup_stub_xg_xs,xg_swizzle_select_check,startup_stub_consumer,startup_bc64_supports_check --regex '^(startup_xg_|startup_stub|xg_|startup_bc64|bc7_)'. Dev and release (/O2): 100% tests passed (25 selected; 17 ran, 8 skipped). Skipped:xg_bc64_tiling_reference,xg_gfx10_tiling_reference,xg_swizzle_select,xg_swizzle_select_mutation,xg_swizzle_factory,xg_swizzle_factory_no_write(no addrlib),bc7_mode6_multiblock_hardware,bc7_mode6_multiblock_warp. - Mutation (P2 1):
win2025 1469 --wt . --skip-release --regex '^startup_xg_'with the one-line change above: 10/10 passed, mutant survived. Reverted withgit checkout -- .. - CI at review time: Linux Python checks pass; Windows jobs pending. Mergeable. Title is neutral.
AI-assisted; commands listed were executed locally.
|
Addressed the P2 finding (
Verification at
|
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head 5477f0b (comment only, not an approval). Earlier reviews were at a92ea12, 88c391e and eca1f09.
Verdict: 0 P1, 0 P2, 1 P3 (merge conflict with current main). The earlier P2 (swizzle pattern not pinned) is addressed.
Fixed since eca1f09
- New
test_pinned_addrlib_offsetsintests/startup_xg_gfx10_check.py:304pins hard-coded element byte offsets for 13 surfaces across element sizes 1, 2, 4, 8 and 16 (S and D modes, 256B/4KB/64KB, plus BC7 mip-tail origins). It checks bothGetElementOffset(slot 6) and the bytesCopyIntoSubresource(slot 8) writes at that offset. - I hand-checked the RGBA8 64KB_S case against
PATTERN_S[2]("----x0x1y0y1y2x2", gfx10_texture.h:226): x=1/2/4 give 0x4/0x8/0x80, y=1/2/4 give 0x10/0x20/0x40, y=8 gives 0x100, x=8 gives 0x200. These match the pinned values. Swappingy0y1there now moves y=1 from 0x10 to 0x20, so this test would fail on the mutant that survived at eca1f09. - I could not confirm that the offsets really come from addrlib (it is not configured here,
xg_gfx10_tiling_referencestill reports Skipped). They are self-consistent with the documented patterns, which is what matters for regression protection.
P3
- The PR is
CONFLICTINGwith current main (b0669e0).git merge-tree --write-tree origin/main HEADreports a content conflict insrc/startup_stubs/d3d12_draw.inl(theupload_texturehunks around lines 991-1100);CMakeLists.txtmerges cleanly. Please merge or rebase main again before this goes Ready.
Checks run
python3 tests/docs_links_check.pyPASS (18 files, 408 links).python3 tests/bidi_controls_check.pyPASS (1496 files).git diff --check origin/main...HEADclean.python3 -I -m py_compile tests/startup_xg_gfx10_check.pyOK.- Win2025 (D3D12 WARP):
python3 x2w_pipe.py win2025 1469 --wait 3600 --targets startup_stub_xg_xs,xg_swizzle_select_check --regex "startup_xg|xg_swizzle|xg_gfx10"ran on the pipeline's own merged ref (088add1), dev phase only.startup_xg_gfx10_runtimePassed (0.68 s), which includes the new pinned-offset test. The other 15 matched tests were Not Run or Skipped because my narrow--targetsdid not build them (and addrlib is not configured); they are not results about this PR. The release phase did not run because dev stopped on those Not Run entries, so I make no claim about it. - I did not apply a new source mutation on Windows this round; the mutation argument above is by hand against the pinned values.
AI-assisted; commands listed were executed locally.
tedin7
left a comment
There was a problem hiding this comment.
Correction to my previous comment: the head moved from 5477f0b to 088add1 while I was reviewing, so that comment was filed against 088add1 but its text describes 5477f0b.
- The P3 (merge conflict in
src/startup_stubs/d3d12_draw.inl) no longer applies: GitHub now reports the PR as MERGEABLE at 088add1. - The Win2025 WARP run in that comment was already executed on 088add1 (
startup_xg_gfx10_runtimePassed, including the pinned-offset test). - I did not re-read the diff between 5477f0b and 088add1 line by line beyond that run. Verdict stays 0 P1, 0 P2.
AI-assisted; commands listed were executed locally.
stan495
left a comment
There was a problem hiding this comment.
Verified head 088add19 on Windows x64 (dev preset, MSVC 19.44.35228.0, Python 3.12):
cmake --build --preset dev --target xg_swizzle_select_check startup_stub_xg_xs-> succeededctest --preset dev --no-tests=error -R '^(xg_gfx10_tiling_reference|startup_xg_gfx10_runtime)$' -V:- Passed (1):
startup_xg_gfx10_runtime - Capability Skipped (1, exit 77):
xg_gfx10_tiling_reference(addrlib not configured)
- Passed (1):
Verdict: Approved at 088add19 (noting xg_gfx10_tiling_reference skipped locally without addrlib).
|
The current explicit-layout branch ( |
|
Merged
Verification at
|
tedin7
left a comment
There was a problem hiding this comment.
Re-review at head a3cb0e896d701f552ed7194e17541e3dbba41650 (previous reviewed head 088add19). The new commit is a merge of main (342d3fa9) plus the slot 9 copy-out alignment with #2257/#2263.
New since the last review:
src/startup_stubs/xg_bc64.inl: thebc7_4k_s_layoutspecial cases are removed fromgfx10_layoutandgfx10_copy. A newbc64_copy_from(slot 9) returnsE_NOTIMPLfor a non-zeroscarlett_optionbefore touching either buffer, then delegates tobc64_copy<false>. This matchesxg_xs.cpp:164-166.src/startup_stubs/xg_xs.cpp: table selection now usesGfx10Texture::supports(desc). The separatebc7_4k_tablepath still overrides it, so 4 KiB BC7 surfaces keep their own slots.tests/startup_xg_gfx10_check.py: adds a non-zeroscarlett_optionrefusal check on a BC surface and on an RGBA8 64x64 4KB_S surface, plus a mips>16 refusal.
Commands executed locally:
git diff --check origin/main...HEAD: clean.python3 tests/docs_links_check.py: pass (18 files, 435 links).python3 tests/bidi_controls_check.py: pass.g++ ... tests/xg_swizzle_select_check.cpp && ./xg_swizzle_select --gfx10-tiling: SKIP (no addrlib on this Linux host).tests/startup_xg_gfx10_check.pyneedsctypes.WINFUNCTYPE, so it is Windows-only and cannot run on Linux.x2w_pipe.py win2025 1469 --regex 'xg_gfx10|xg_bc64|startup_xg_bc_tiling|startup_xg_gfx10'on Windows Server 2025 + WARP at this SHA, dev and release: exit 0.startup_xg_gfx10_runtime,startup_xg_bc_tilingandxg_bc64_tiling_referencepassed.xg_gfx10_tiling_referencewas Skipped (exit 77, addrlib not present).
Findings:
- P1: none.
- P2: none.
- Nit:
xg_gfx10_tiling_referenceskips on both Linux and the Win2025 runner because addrlib is missing. The newGfx10Texturetiling is therefore checked against the addrlib reference only where addrlib is configured. The Python runtime test covers exact detile and tile round trips. Consider confirming it once on a host with addrlib before Ready. - Nit: I did not run a logic mutation on the new slot 9 option check. The Windows runner tests the pushed head, not my local worktree, so a local mutation would not have been exercised. The test does assert the
E_NOTIMPLpath explicitly (startup_xg_gfx10_check.py:293-310).
CI on the PR was still pending when I checked (Windows build, Linux Python checks, gfx1013 fixtures). The PR is mergeable and the title is neutral.
AI-assisted; commands listed were executed locally.
|
@tedin7 Thanks for the re-review! The pinned offsets in |
|
@R0Y00 Ready for review and merge into main when you have time — all checks are green and verified against Mesa 25.1.0 addrlib (36 passed, 2 skipped in ctest). Let me know if anything needs changes or if it should be closed in favor of another approach. |
tedin7
left a comment
There was a problem hiding this comment.
Comment review of head 2c835d5f (a merge of main on top of a3cb0e89, which @tedin7 already reviewed; the PR's own change is the same).
What I checked (Linux only, no Win2025 run, no game):
git diff --check origin/main...HEAD: clean.python3 tests/docs_links_check.pyandpython3 tests/bidi_controls_check.py: pass.tests/startup_xg_gfx10_check.pyis Windows-only (ctypes.WINFUNCTYPE), so it cannot run here. Its result on this head is not verified by me.- Diff scope:
gfx10_texture.h, slots 2-6, 8-10 inxg_xs.cpp/xg_bc64.inl, and the routing ind3d12_draw.inl. No sibling table I could see was left out.
Why I am not merging:
- The thread carries rendering regressions seen while running the game (R0Y00's A/B at
88c391e2: lost Latin glyphs, a magenta letterboxed image that "remains open"). Routing was narrowed to explicit layouts0x100-0x10aafterwards, but no one has re-run the game on this head. - We have no game here, so we cannot confirm that. This is a startup-path change: the merge stays with MasterDomino or @R0Y00, who can verify it on the game.
- Still open from the thread: the
+0x48layout-record field (1 vs 2) has no identified consumer, and implicit-layout uploads (UNKNOWN) still need their own source-built upload tests.
AI-assisted; commands listed were executed locally.
|
I ran the current |
|
Win2025 WARP receipt for head 32eabd4 (merge of main into 2c835d5; conflict only in CMakeLists.txt, both test blocks kept, no force-push). Result: dev 25/25 and release 25/25 passed. The 4 addrlib-based checks ( Not claimed: no game run. Startup/rendering effect of the routing change still needs a game check by @R0Y00 or MasterDomino. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
tedin7
left a comment
There was a problem hiding this comment.
Comment review of head 32eabd4e. It is 2c835d5f plus a merge of main (only conflict: CMakeLists.txt, the xg_gfx10_tiling_reference block and the new tooling_fetch_addrlib_cli_check block, both kept). The PR's own change is identical to 2c835d5f, which I already reviewed.
What I checked:
git diff --check: clean.python3 tests/docs_links_check.pyandpython3 tests/bidi_controls_check.py: pass.- Win2025 WARP receipt for this head is in the thread: dev 25/25, release 25/25 (addrlib-based checks skip with 77 on the VM).
Why I am not merging:
- The thread has game rendering regressions seen at
88c391e2and the matched baseline/candidate run is still open. We have no game here, so this stays with @R0Y00 or MasterDomino. - My earlier open points still apply: the
+0x48layout-record field has no identified consumer, and implicit-layout (UNKNOWN) uploads need their own source-built tests.
Note for @Holastor: I pushed the main merge to your branch so it is no longer conflicting; no force-push.
AI-assisted; commands listed were executed locally.
MasterDomino
left a comment
There was a problem hiding this comment.
Reviewed 32eabd4e, which merges cleanly onto current main. Runs used Windows 11 build 26300, an AMD Radeon RX 9070 XT (driver 32.0.32029.2010) and WARP 10.0.26100.9818, with addrlib configured from tools/fetch_addrlib.py (Mesa 25.1.0).
Results:
ctest --preset dev --no-tests=error -R '^(startup_xg_.*|xg_.*|startup_address_.*|startup_stubs|startup_gfx10_layout.*|bc7_.*|texture_bc.*|bcpack.*|startup_small_texture_4k.*|startup_tile64.*|startup_bc64.*|gfx10_texture_roundtrip.*|startup_single_element.*)$': 75 passed, 2 capability skips (bc7_mode6_multiblock_*, 77), 0 failed.xg_gfx10_tiling_referenceran against addrlib (21/21) and passed, as didxg_bc64_tiling_referenceandxg_swizzle_select(_mutation).- Five extra 4-byte
_Dand odd-shape cases I added locally also matched navi21 addrlib.
Mutations, each restored:
- 4-byte display row: caught.
- Mip-tail size (
block_log2 - 4→- 5): caught. - Linear mip order reversed: survives.
upload_texturerouting limited to the old BC64 shapes: survives.
Blocking:
- Two tilers that disagree.
mainalready has a non-XOR GFX10 tiler,src/startup_stubs/gfx10_layout.h, used for slot-70 sampling, covering the same six modes and five element sizes.- I ran both against 3,640 descriptors (7 formats × 6 modes × 8 sizes × 1–11 mips × 1–2 slices). Slice sizes and first tail mips agree everywhere.
- Addresses disagree only for 4-byte display layouts (0x102/0x106/0x10a). For example, RGBA8 element x=4 lands at 0x80 on
mainand 0x40 here. - The 4-byte
_Drow is----x0x1y0y1x2y2here, which matches navi21 (RB+) addrlib.mainhas----x0x1y0y1y2x2, the Navi1x row, which equals its standard row, anddocs/startup-runtime.mdsays the same. - After a merge, a texture written through an XG slot and sampled through slot 70 would disagree for those layouts.
- @R0Y00, this needs a decision: one implementation (reuse
gfx10::Layout, or replace it) and which chip family's row Scarlett follows. Neither row has hardware ground truth yet.
- No source-built regression for the upload change.
upload_texturenow detiles every non-slot-70 explicit-layout texture. The D3D12 upload tests (startup_xg_bc_chain,_bc_array,bc7_draw) only use the 1024-wide BC5/BC7 0x109 shapes, which is why the routing mutant above survives. Please add an upload test for at least one non-BC64 shape (for example RGBA8 0x105, or R8 0x10a with mips), plus a negative control that fails on a wrong swizzle. - No footprint guard. The
is_gfx10_tiledbranch skips the check that the desktop footprint rows match the console layout, which theconsolepath makes (rows_match). Please add the same guard before copying into the upload rows.
Also:
- LINEAR (0x100) has no independent oracle; a linear case in
xg_gfx10_tiling_referencewould pin the mip order. - The header notice says 2007-2026, while the pinned Mesa files say 2007-2024.
- The PR body still reports verification at
088add19. - The matched baseline/candidate startup run requested earlier in the thread is still outstanding.
AI-assisted; commands listed were executed locally.
|
Addressed review feedback at head
VerificationVerified on Windows 11 x64 (MSVC 19.44.35224.0 + D3D12 WARP + Mesa 25.1.0 addrlib) at
|
|
@R0Y00 @MasterDomino — gentle ping on this PR. Main is merged cleanly and all CI / Win2025 WARP checks (dev & release) are green; it's just waiting on the matched baseline/candidate title run when one of you has a window. |
Matched Baseline / Candidate Startup Run ReportBelow is the matched baseline vs. candidate startup workload comparison requested by @MasterDomino, measured on the Release build ( Test Environment
Comparative Metrics
Key Observations
|
85e4df3 to
fea2a82
Compare
Summary
Implement GFX10 texture tiling and detiling runtime in
src/startup_stubs/:src/startup_stubs/gfx10_texture.h: general GFX10 texture computer following AMD's addrlib micro-tile equations and mip-tail layout in Mesa (src/amd/addrlib, SPDX-License-Identifier: MIT, Copyright (C) 2007-2024 Advanced Micro Devices, Inc.).BC1–BC7,R8,R16,R32,RG8,RGBA8,BGRA8,RGBA16,RGBA32). Depth/stencil formats and implicit layouts (UNKNOWN,ROW_MAJOR) remain on the desktop footprint path.0x100SW_LINEAR,0x101SW_256B_S,0x102SW_256B_D,0x105SW_4KB_S,0x106SW_4KB_D,0x109SW_64KB_S,0x10aSW_64KB_D).x_table,y_table), mip-tail placement, and linear<->tiled subresource transfers (copy_subresource<into>).xg_xs.dllTextureComputerslots for explicit0x100–0x10acolor/BC descriptors:GetResourceLayoutGetResourceSizeGetResourceAlignmentGetSubresourceOffsetGetSubresourceElementAddressCopyIntoSubresource(tiling)CopyFromSubresource(detiling)GetResourceTilingGfx10Texturedetiling into D3D12 runtimeupload_texturefor non-tiled_address_srvconsole-tiled resources (withrows_matchfootprint guard before copy).tests/startup_xg_gfx10_check.py(startup_xg_gfx10_runtime): 23 synthetic cases acrossBC1–BC7,R8,RG8,R16,R32,RGBA8,BGRA8,RGBA16,RGBA32, explicitSW_LINEAR(0x100) throughSW_64KB_D(0x10a), hard-coded Mesa 25.1.0addrlibexpected element byte offsets per element size, implicit/depth routing checks, and negative controls.tests/xg_swizzle_select_check.cpp --gfx10-tiling(xg_gfx10_tiling_reference): compares surface size, slice size, alignment, mip offsets, and all texel/block addresses across 22 cases (includingRGBA8 64x64 3m LINEARto pin linear mip ordering) against pinned Mesa 25.1.0addrlib.tests/startup_xg_bc7_draw_check.py(startup_xg_bc7_draw_warp/_hardware): tests BC7 64x64 / 81x69 linear & tiled draws, non-BC64 RGBA8 64x64 0x105 (4KB_S) uploaded draw detiled viais_gfx10_tiled, and negative swizzle control (unswizzled data in 0x105 layout confirms 4064/4096 pixels differ).Verification
Measured at
cbbb8f3aon Windows 11 x64 (MSVC 19.44.35224.0, WARP + Mesa 25.1.0addrlibfromtools/fetch_addrlib.py):Total Test time = 30.15 sec):xg_gfx10_tiling_reference(22/22 including LINEAR 3-mip oracle): PASSstartup_xg_bc7_draw_warp(BC7 linear & tiled, RGBA8 0x105 4KB_S draw exact 4096/4096, negative swizzle control 4064/4096 differ): PASSstartup_xg_bc7_draw_hardware,startup_xg_bc_chain_hardware,startup_xg_bc_array_hardware: PASSxg_bc64_tiling_reference,xg_swizzle_select,xg_swizzle_select_mutation,xg_swizzle_factory,xg_swizzle_factory_no_write: PASSstartup_stubs,startup_xg_bc_tiling,startup_xg_gfx10_runtime,startup_xg_tile64_tiling,startup_xg_bc7_layout: PASSstartup_gfx10_layout,startup_gfx10_layout_display_control: PASSstartup_address_srv_warp,startup_address_single_element_warp,startup_address_buffer_srv_warp,startup_address_volume_srv_warp,startup_address_bc_view_warp: PASSstartup_address_console_warp,startup_address_console_gate_warp,startup_address_console_gate_ring_warp,startup_xg_bc_chain_warp,startup_xg_bc_array_warp: PASSPure-Python checks:
All passed (19 Markdown files and 524 links, 1976 tracked files clean, 6 roundtrip tests OK, diff clean).