Skip to content

startup: general GFX10 texture tiling and detiling runtime - #1469

Open
Holastor wants to merge 22 commits into
R0Y00:mainfrom
Holastor:textures/gfx10-tiling-runtime
Open

Holastor wants to merge 22 commits into
R0Y00:mainfrom
Holastor:textures/gfx10-tiling-runtime

Conversation

@Holastor

@Holastor Holastor commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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, mip-tail layout, and GetMipSize (ShiftCeil) surface extent calculations in Mesa (src/amd/addrlib, SPDX-License-Identifier: MIT, Copyright (C) 2007-2024 Advanced Micro Devices, Inc.).
  • Support Thin S and Thin D 256-byte micro-tiles across 1B, 2B, 4B, 8B, and 16B color and block-compressed formats (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.
  • Support explicit console layout modes (0x100 SW_LINEAR, 0x101 SW_256B_S, 0x102 SW_256B_D, 0x105 SW_4KB_S, 0x106 SW_4KB_D, 0x109 SW_64KB_S, 0x10a SW_64KB_D).
  • 256-entry coordinate bit tables (x_table, y_table), mip-tail placement, and linear<->tiled subresource transfers (copy_subresource<into>).
  • Wire xg_xs.dll TextureComputer slots for explicit 0x100–0x10a color/BC descriptors:
    • slot 2: GetResourceLayout
    • slot 3: GetResourceSize
    • slot 4: GetResourceAlignment
    • slot 5: GetSubresourceOffset
    • slot 6: GetSubresourceElementAddress
    • slot 8: CopyIntoSubresource (tiling)
    • slot 9: CopyFromSubresource (detiling)
    • slot 10: GetResourceTiling
  • Integrate Gfx10Texture detiling into D3D12 runtime upload_texture for explicit GFX10 tiled modes and multi-mip or array linear (0x100) textures (with rows_match footprint guard before copy).
  • Wire startup_xg_gfx10_runtime, xg_gfx10_tiling_reference, and startup_xg_bc7_draw_warp into CMakePresets.json pull request smoke test filter and build targets.
  • Verification suites:
    • tests/startup_xg_gfx10_check.py (startup_xg_gfx10_runtime): 24 synthetic cases across BC1–BC7, R8, RG8, R16, R32, RGBA8, BGRA8, RGBA16, RGBA32, explicit SW_LINEAR (0x100) through SW_64KB_D (0x10a) including multi-mip/multi-slice non-power-of-two RGBA16 100x10 3m 2s LINEAR, hard-coded Mesa 25.1.0 addrlib expected 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 23 cases (including RGBA8 64x64 3m LINEAR and RGBA16 100x10 3m 2s LINEAR to pin linear mip ordering and ShiftCeil strides) against pinned Mesa 25.1.0 addrlib with 0 mismatches.
    • tests/startup_xg_bc7_draw_check.py (startup_xg_bc7_draw_warp / _hardware): tests BC7 64x64 / 81x69 linear & tiled draws, 512x256 display64k draw, non-BC64 RGBA8 64x64 0x105 (4KB_S) draw with negative swizzle control (4064/4096 pixels differ), and multi-mip RGBA8 64x64 3-mip 0x100 (LINEAR) draw detiled via is_gfx10_tiled with negative layout control (4096/4096 pixels differ).

Documentation

  • docs/experiments.md ("Nine-mip BC5/BC7 tile queries") now states that the general computer answers slots 2, 3, 6, 8, 9 and 10 for explicit layouts 0x100–0x10a, and keeps that section's pins specific to the earlier 0x109 BC5/BC7 shape.
  • docs/startup-runtime.md names the scope of Gfx10Texture instead of describing it as future work: it tiles explicit GFX10 layouts, while the UNKNOWN + 4096-alignment small-texture path keeps its compact linear plan pending a follow-up.

Verification

Measured at ae9a7e44 (current main 36914379 merged, including #3410) on Windows 11 x64 build 26300, MSVC, AMD Radeon RX 6600M + D3D12 WARP + Mesa 25.1.0 addrlib from tools/fetch_addrlib.py:

cmake --build --preset release
ctest --preset release --no-tests=error --output-on-failure -R '^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$'
  • 34 passed, 0 failed, 0 skipped in 137.8 s:
    • addrlib references: xg_gfx10_tiling_reference (23 shapes), xg_bc64_tiling_reference, startup_gfx10_layout_linear_addrlib.
    • layout and stubs: startup_xg_gfx10_runtime, startup_xg_bc_tiling, startup_xg_tile64_tiling, startup_xg_bc7_layout, startup_gfx10_layout, startup_gfx10_layout_display_control, startup_gfx10_layout_linear_order_control, startup_stubs, xg_swizzle_select(_mutation), xg_swizzle_factory(_no_write).
    • draws (WARP + RX 6600M): startup_xg_bc7_draw_warp/_hardware, startup_xg_bc_chain_warp/_hardware, startup_xg_bc_array_warp/_hardware.
    • address paths: startup_address_srv_warp, single_element, buffer_srv, volume_srv, bc_view, console, console_gate, console_gate_ring, console_gate_ring_reuse, console_gate_ring_keep, console_gate_ring_keep_release, console_linear_unpadded, console_cube_order.

Mergeability:

Pure-Python checks:

python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py
git diff --check
  • 175 Markdown files / 711 links checked; 2670 tracked files checked for bidirectional controls; diff clean.

Earlier evidence remains in the thread: the 27-test run at 00c53f91 and the matched baseline/candidate title run reported on 2026-11-26 (local candidate 85e4df30, which is not in the branch history after rebases; the change itself is unchanged).

@Holastor
Holastor force-pushed the textures/gfx10-tiling-runtime branch from 7bbd7f5 to a92ea12 Compare November 24, 2026 12:18

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed PR #1469 (a92ea122):

Verification

  • Win2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at a92ea122:
    • Debug (--preset dev): built startup_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_*); 2 capability-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, 2 capability-skipped (bc7_mode6_multiblock_*).
  • Linux checks at a92ea122:
    • tests/docs_links_check.py, tests/bidi_controls_check.py, git diff --check origin/main..HEAD: PASS
    • tests/gfx10_texture_roundtrip_check.py: PASS (6/6)
    • git merge-tree --write-tree origin/main HEAD: merges cleanly.

Code Audit Findings

  1. columns(mip) / rows(mip) returns 0 for non-square BC mips (src/startup_stubs/gfx10_texture.h):
    return (std::max)(1u, (width >> mip) + block_dim - 1) / block_dim;
    When width >> mip == 0 (e.g., 128x64 BC7 at mip = 7 where height >> 7 == 0), (std::max)(1u, 0 + 4 - 1) / 4 evaluates to 3 / 4 == 0. In gfx10_copy (src/startup_stubs/xg_bc64.inl), u64{tex.rows(level) - 1} then underflows UINT to 0xffffffff.
    It should be ((std::max)(1u, width >> mip) + block_dim - 1) / block_dim (and similarly for rows(mip)).
  2. Missing d.MipLevels <= 16 guard in Gfx10Texture::supports():
    mip_start, tiles_w, tiles_h, tail_origin_x, and tail_origin_y are fixed std::array<UINT, 16>. If d.MipLevels > 16 is passed, Gfx10Texture will index out of bounds (and width >> mip for mip >= 32 is UB). Adding d.MipLevels > 16 to supports() prevents that.
  3. 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, overlapping src/dst, or unsupported format).

@Holastor
Holastor force-pushed the textures/gfx10-tiling-runtime branch from a92ea12 to eb3e418 Compare November 24, 2026 12:42
@Holastor

Copy link
Copy Markdown
Contributor Author

Addressed review feedback at eb3e418b:

  1. Non-square BC mips (columns / rows calculation):

    • Updated columns(mip) and rows(mip) in src/startup_stubs/gfx10_texture.h to ((std::max)(1u, width >> mip) + block_dim - 1) / block_dim and ((std::max)(1u, height >> mip) + block_dim - 1) / block_dim. This ensures columns and rows evaluate to at least 1 when (width|height) >> mip == 0, avoiding UINT underflow in gfx10_copy.
    • Added synthetic test case BC7 128x64 8-mip 4KB_S in tests/startup_xg_gfx10_check.py, which validates exact linear<->tiled roundtrip across all 8 mips (including mip 7 where height >> 7 == 0).
  2. MipLevels bounds guard in Gfx10Texture::supports():

    • Added d.MipLevels > 16 guard to supports() (rejecting d.MipLevels < 1 || d.MipLevels > 16), preventing fixed-size table out-of-bounds indexing or undefined bit-shift behavior.
  3. Negative control test coverage (tests/startup_xg_gfx10_check.py):

    • Added test_negative_controls(create) covering:
      • pitch < row_bytes: ensures E_INVALIDARG (0x80070057) on both CopyIntoSubresource (slot 8) and CopyFromSubresource (slot 9).
      • Out-of-range plane (plane > 0 on single-plane resource): ensures E_INVALIDARG.
      • Out-of-range subresource (subresource >= mips * slices): ensures E_INVALIDARG.
      • Overlapping source and destination buffers: ensures E_INVALIDARG.
      • Null destination or source pointers: ensures E_INVALIDARG.
      • MipLevels > 16: ensures descriptor is rejected from GFX10 tiling path.

Verification

  • ctest --preset dev --no-tests=error -R '^(startup_xg_|bc7_|texture_bc|bcpack)' -V
    • 17 passed, 2 capability-skipped (bc7_mode6_multiblock_*), 0 failed (100%).
    • startup_xg_gfx10_runtime: 13 synthetic test cases + negative controls all PASS.
  • Pure-Python checks:
    • python -B tests/docs_links_check.py (PASS)
    • python -B tests/bidi_controls_check.py (PASS)
    • python -B tests/gfx10_texture_roundtrip_check.py (PASS)
    • git diff --check (clean)

@Holastor
Holastor requested a review from tedin7 November 24, 2026 12:45
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%)
@Holastor
Holastor force-pushed the textures/gfx10-tiling-runtime branch from eb3e418 to 88c391e Compare November 24, 2026 13:09
@ChazY11

ChazY11 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Built, ran, and probed with two mutations on the new tiler

Independent reviewer, not the author. Reviewed 88c391e2; nothing pushed to the branch. Mutations were made locally in
src/startup_stubs/gfx10_texture.h, rebuilt, reverted; working tree is clean.

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)$' -V

Unmodified branch — startup_xg_gfx10_runtime reports all 13 cases passing, each with layout, tiling, slot 8 tile and
slot 9 detile roundtrip exact, across BC1/BC4/BC5/BC7/R8/R16/RGBA8, 64KB_S, 64KB_D, 4KB_S, 4KB_D, 256B_S and
LINEAR, including the two-slice and 8-mip cases; the negative controls (pitch < row_bytes, out-of-range
plane/subresource, overlap, null, mips > 16) pass. The three older tests are unchanged and green.

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));
startup_xg_gfx10_runtime ........... ***Failed
bc7_tile_swizzle ................... Passed
gfx10_texture_roundtrip ............ Passed
gfx10_texture_roundtrip_controls ... Passed

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;
startup_xg_gfx10_runtime ........... ***Failed
gfx10_texture_roundtrip ............ Passed

What the second result implies

gfx10_texture_roundtrip and _controls run tests/gfx10_texture_roundtrip_check.py, i.e. the Python tiler in
tools/bc7_tiles.py. They cannot see a change in this new C++ header. So startup_xg_gfx10_runtime is currently the
only check that exercises gfx10_texture.h
, and both mutations above are invisible to everything else. That is not a
defect in this PR — it is the reason the new test matters — but it does mean the C++ tiler has a single guard, and any
future edit to it should keep that test in every job.

If it would help, a second oracle would be cheap: the Python tiler already knows these modes, so one case could compare
the C++ layout output against bc7_tiles.py's tiling for the same surface rather than round-tripping the C++ path
against itself. I am not asking for it in this PR.

Verdict

Reviewed 88c391e2. Builds clean, 13 cases and the negative controls pass, the older tests are unaffected, and two
independent mutations in the coordinate table and the mode dispatch are both caught. No objection from me.

R0Y00 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Independent Windows check at 88c391e2, using source-built inputs. For 1024×1024 BC7_UNORM and BC7_UNORM_SRGB with nine mips, and BC6H_UF16 with eleven, slot 10 reported 22 tiles, a packed tail at tile 0, and the three standard mips beginning at tiles 6, 2 and 1. Per-block addressing and two-way copies matched our independent comparison for all 87,381 blocks of each BC7 chain and all 87,383 blocks of the BC6H chain. Padding sentinels and rejected short pitches were also checked. We will use this PR as the shared implementation for that path.

One ABI question remains. For packed mips, the slot 2 layout record's 32-bit field at +0x48 was 1 here and 2 in our local implementation. Does the field have an identified consumer or an independent expected value? The slot 10 and copy results above agree with either value.

R0Y00 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

A regression surfaced in a one-DLL A/B at 88c391e2. With the same runtime and warmed shader cache, the previous XG path rendered the full Latin text on a mixed-script page. After replacing only XG, the same text lost individual Latin glyphs; the language selection capture still matched pixel for pixel. The sparse BC1 mip ranges improved in that same run.

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.

@Holastor

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough independent verification on BC7 and BC6H!

Regarding the +0x48 field in the subresource layout record:

  1. In our implementation, 1 corresponds to SW_256B_S (ADDR_SW_256B_S in addrlib), representing the 256-byte micro-tile mode for the _S (Standard) macro-tile flavor, whereas 2 corresponds to SW_256B_D (ADDR_SW_256B_D).
  2. We checked runtime stubs, callers, and observed traces: we haven't identified any consumer reading mip + 0x48 (callers rely on mip->Offset, RowPitch, extents, or the slot 10 D3D12_SUBRESOURCE_TILING records).
  3. Since both values produce identical layout extents, slot 10 tiling, and two-way copies, we have no preference and are happy to align with your local implementation (2, or selecting SW_256B_S (1) / SW_256B_D (2) based on the parent mode's S/D flavor) if you prefer consistency with your local tooling.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and gfx10_swizzle_from_desc returns SW_64KB_S for any layout that is neither explicit nor row-major, including layout 0. The old bc64::supports accepted only 1024-wide BC5/BC7 with layout 0x109. Textures that used the desktop-footprint path (slots 2, 8, 10) now take the tiled path, while upload_texture still 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 0 gives size=40000 align=10000 at 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) or bc64::supports) and add an implicit-layout test.

P2

  1. Linear (0x100) is accepted but its metadata is wrong: init_linear() in xg_bc64.inl never fills tiles_w/tiles_h. dump 28 256 256 1 1 0x100 gives mip0 span=0 pitchB=0 padw=0, tiles=1024 shape=64x1x1. The roundtrip test passes anyway because it never reads those fields.
  2. 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_addr in slot 6 is never asserted, layout records are never read, and the MipLevels=17 control only asserts align != 65536. addrlib is already an optional dependency (tools/fetch_addrlib.py, xg_swizzle_select_check.cpp); compare addresses and sizes against it.
  3. 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 (no ctypes.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 the rows() 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). A columns()-only edit was also not caught; the height case needs the rows() change.

Non-blocking

  • After the merge the new gfx10_tiling and main's tile64::Plan both 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_srv still gates on bc64::supports); gfx10_swizzle_from_desc reads X2W_XG_BC7_4K_S_LAYOUT through GetEnvironmentVariableA on every construction; about 2.4 KB of tables are rebuilt per call; total_slice_bytes and address() are 32-bit and overflow above 4 GiB; the +0x48 offset 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.

@Holastor

Copy link
Copy Markdown
Contributor Author

Addressed the P1, P2, and merge-conflict feedback from @tedin7 and @R0Y00 at eca1f09e:

  1. P1 — Gate Gfx10Texture routing on explicit console layouts (0x100–0x10a):

    • Updated gfx10_swizzle_from_desc() in src/startup_stubs/gfx10_texture.h so only explicit (layout & 0xFF00) == 0x100 descriptors are accepted; implicit layouts (D3D12_TEXTURE_LAYOUT_UNKNOWN = 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR = 1) now return 0xFFu and route to the desktop footprint table in xg_xs.cpp (and removed the per-construction GetEnvironmentVariableA("X2W_XG_BC7_4K_S_LAYOUT", ...) call from gfx10_swizzle_from_desc).
    • Added test_implicit_and_unsupported_routing() in tests/startup_xg_gfx10_check.py covering UNKNOWN layout RGBA8, R8, RG8, BC3, BC7 and ROW_MAJOR RGBA8, asserting desktop stub routing (and verifying RGBA8 64x64 UNKNOWN reports desktop span=16384, pitch=256 instead of 64KB_S).
  2. P2 Run the native wave64 BVH fixture on a supported Windows GPU #1 — Fix SW_LINEAR (0x100) metadata in init_linear():

    • Populated tiles_w[i] = (cols + tile_width - 1) / tile_width and tiles_h[i] = r in Gfx10Texture::init_linear(), so slot 2 (span, pitchB, padw, padh) and slot 10 (tilings) report valid 256-byte-aligned linear metadata instead of zeros.
    • Added multi-mip RGBA8 256x256 3-mip LINEAR and slot 2 / slot 10 assertions for all cases in tests/startup_xg_gfx10_check.py.
  3. P2 Check the first build from a fresh Windows checkout #2 — Strengthen tests & add addrlib address/size oracle (xg_gfx10_tiling_reference):

    • tests/startup_xg_gfx10_check.py now checks slot 2 plane & mip records, slot 5 (GetSubresourceOffset) including out-of-range checks, slot 6 (GetSubresourceElementAddress) first_addr and sampled coordinates matched byte-for-byte against slot 8 output, slot 10 (GetResourceTiling) entries, and tightens the MipLevels=17 control to assert desktop fallback (slots[3]/[9] no-op and l_mips == 15).
    • Added --gfx10-tiling (xg_gfx10_tiling_reference, SKIP_RETURN_CODE 77) in tests/xg_swizzle_select_check.cpp comparing surfSize, sliceSize, baseAlign, firstMipIdInTail, mip offsets, and every texel/block address across 20 cases against pinned Mesa 25.1.0 addrlib (Addr2ComputeSurfaceInfo / Addr2ComputeSurfaceAddrFromCoord).
  4. P2 Publish English contributor guides and scope the GTA VI XSX case study #3 & Non-blocking cleanups:

    • Merged upstream/main (67758cba, including be98528a tile64_plan.h, single_element_srv, and partial_tiled_bc in d3d12_draw.inl / d3d12_memory_srv.inl).
    • Removed depth/stencil formats (D16_UNORM, D24_UNORM_S8_UINT, D32_FLOAT, R24G8_*) from gfx10_format_info and rejected D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL in Gfx10Texture::supports(), keeping depth resources on the desktop path (tested in test_implicit_and_unsupported_routing()).
    • Added test cases covering BC2, BC3, BC6H, RG8, R32, BGRA8, RGBA16, and RGBA32, and updated the PR body to match the tested formats, exact counts, and MIT/Mesa addrlib attribution.
    • Changed total_slice_bytes, mip_start, and address() in Gfx10Texture to UINT64 to avoid 32-bit overflow above 4 GiB.

Verification at eca1f09e

  • ctest --preset dev --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_bc_view|startup_stubs|bc7_|texture_bc)" (with XBOX2WINDOWS_ADDRLIB_DIR from tools/fetch_addrlib.py): 22 passed, 2 capability-skipped (bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp), 0 failed.
    • xg_gfx10_tiling_reference: PASS (20/20 cases matched Mesa 25.1.0 addrlib).
    • startup_xg_gfx10_runtime: PASS (22 cases + implicit/depth routing + negative controls).
    • startup_xg_tile64_tiling, startup_xg_bc_tiling, startup_xg_bc7_layout, startup_stubs, startup_xg_bc*_warp/hardware, startup_address_bc_view_warp/hardware, bc7_*, texture_bc_volume: PASS.
  • Pure-Python & diff checks: docs_links_check.py (18 files, 407 links), bidi_controls_check.py (1497 files), gfx10_texture_roundtrip_check.py (6/6), and git diff --check upstream/main..HEAD all PASS.

@Holastor
Holastor requested a review from tedin7 November 25, 2026 05:12

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, so supports() is false and XGCreateTextureComputer (xg_xs.cpp:409) keeps the desktop table for them.
  • init_linear() now fills tiles_w/tiles_h for 0x100.
  • test_implicit_and_unsupported_routing covers UNKNOWN RGBA8/R8/RG8/BC3/BC7, ROW_MAJOR RGBA8 and D24S8/D32F, and checks desktop span=16384 pitch=256 for 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_texture and device_memory_srv gate on Gfx10Texture::is_tiled, so upload and XG routing agree for implicit layouts.

P2

  1. 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 swapped y0y1 to y1y0. startup_xg_* on Win2025 stayed green (10/10 passed). The roundtrip and slot checks accept any bijective permutation. xg_gfx10_tiling_reference is 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 into startup_xg_gfx10_check.py.

Nit

  • Slot 10 / layout +0x48 writes 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.py PASS (18 files, 407 links); python3 tests/bidi_controls_check.py PASS (1489 files); git diff --check origin/main...HEAD clean; python3 -I -m py_compile tests/startup_xg_gfx10_check.py OK; python3 -I tests/gfx10_texture_roundtrip_check.py PASS (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 with git checkout -- ..
  • CI at review time: Linux Python checks pass; Windows jobs pending. Mergeable. Title is neutral.

AI-assisted; commands listed were executed locally.

@Holastor

Holastor commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the P2 finding (eca1f09e review) and merged upstream/main (b0669e06, including #2015 and #2214) at commit 088add19:

  1. P2 — Pin expected element byte offsets per element size in tests/startup_xg_gfx10_check.py:

    • Added test_pinned_addrlib_offsets(create) with hard-coded element byte offsets collected from xg_gfx10_tiling_reference (Mesa 25.1.0 addrlib, navi21) covering all 5 element sizes (1, 2, 4, 8, 16 bytes) across both _S and _D modes (R8 64KB_S, R8 4KB_D, R16 4KB_S, RG8 4KB_D, BGRA8 4KB_S, RGBA8 64KB_S, R32 256B_D, BC1 64KB_S, RGBA16 64KB_D, RGBA32 4KB_S, BC5 64KB_D, and BC7 64x64 7-mip 4KB_S including mips 2–6 in the mip tail).
    • For each coordinate, asserts both slot 6 (GetSubresourceElementAddress) equals the pinned offset and slot 8 (CopyIntoSubresource) writes the expected element bytes at that pinned offset.
    • Added R8 64x64 1-mip 4KB_D to both tests/startup_xg_gfx10_check.py (23 cases) and tests/xg_swizzle_select_check.cpp (--gfx10-tiling, 21 cases) so _S and _D are covered for all 5 element sizes.
    • Confirmed the exact PATTERN_S[2] mutation (y0y1 -> y1y0) is now caught by startup_xg_gfx10_runtime (AssertionError: BGRA8 64x64 3-mip 4KB_S mip 0 (0,1): slot6 addr=0x2020, expected 0x2010), then restored.
  2. Clean merge with upstream/main (b0669e06) & drop d3d12_memory_srv.inl diff:

    • Merged upstream/main cleanly and reverted the earlier dead condition in src/startup_stubs/d3d12_memory_srv.inl, keeping upstream/main's slot-70 console_layout_srv path unmodified and gating Gfx10Texture in upload_texture (d3d12_draw.inl) on !tiled_address.

Verification at 088add19

  • ctest --preset dev --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_|startup_stubs|startup_gfx10_layout|bc7_|texture_bc)": 36 passed, 2 capability-skipped (bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp — exit 77), 0 failed (51.63 sec), including startup_xg_gfx10_runtime, xg_gfx10_tiling_reference, startup_address_console*_warp/hardware, and startup_gfx10_layout*.
  • Pure-Python & diff checks: docs_links_check.py (18 Markdown files and 409 links), bidi_controls_check.py (1499 files), gfx10_texture_roundtrip_check.py (6/6), and git diff --check upstream/main..HEAD all PASS.

@Holastor
Holastor requested a review from tedin7 November 25, 2026 05:41

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_offsets in tests/startup_xg_gfx10_check.py:304 pins 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 both GetElementOffset (slot 6) and the bytes CopyIntoSubresource (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. Swapping y0y1 there 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_reference still reports Skipped). They are self-consistent with the documented patterns, which is what matters for regression protection.

P3

  1. The PR is CONFLICTING with current main (b0669e0). git merge-tree --write-tree origin/main HEAD reports a content conflict in src/startup_stubs/d3d12_draw.inl (the upload_texture hunks around lines 991-1100); CMakeLists.txt merges cleanly. Please merge or rebase main again before this goes Ready.

Checks run

  • python3 tests/docs_links_check.py PASS (18 files, 408 links).
  • python3 tests/bidi_controls_check.py PASS (1496 files).
  • git diff --check origin/main...HEAD clean.
  • python3 -I -m py_compile tests/startup_xg_gfx10_check.py OK.
  • 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_runtime Passed (0.68 s), which includes the new pinned-offset test. The other 15 matched tests were Not Run or Skipped because my narrow --targets did 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.

@pigalot

pigalot commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

I tried merging main b1e92256 into fea2a82a to clear the conflict. I stopped without pushing, because one conflict changes the same logic on both sides.

Semantic conflict: src/startup_stubs/d3d12_draw.inl, upload_texture.

  • This branch adds the general GFX10 path, is_gfx10_tiled. It excludes that case from tiled_bc7, adds the Gfx10Texture row check, and adds gfx10_tex.bytes() as the first case of total.
  • main, from runtime: restore menu sampler bindings and BC7 display uploads #3153, adds placed_display_bc7. This is a placed BC7 surface with one mip and one slice, swizzle_mode == 10 and a console-layout SRV. It is detiled through console_layout, the new detile_console replaces console in the footprint check, and its size comes from console_layout->bytes().
  • A placed BC7 surface can meet both conditions. It is not obvious which path should own it: Gfx10Texture with its own row check, or console_layout, or whether is_gfx10_tiled should exclude placed_display_bc7. So I left the resolution to you.

Other conflicts, both additive.

  • tests/startup_stream_consumer.cpp and tests/startup_stream_draw.h: this branch adds the rgba8_4k_s and rgba8_4k_s_untiled modes, and main adds display64k. Keeping both looks safe.

This reply was AI-assisted.

@Holastor

Copy link
Copy Markdown
Contributor Author

Thanks @pigalot! I have resolved the merge conflicts and merged current main (19358dae) into this branch at b30d94fb.

Resolution Summary

  1. Semantic conflict in src/startup_stubs/d3d12_draw.inl (upload_texture):

    • We gave explicit precedence to #3153's placed_display_bc7 path by gating is_gfx10_tiled with !placed_display_bc7:
      const bool is_gfx10_tiled = !placed_display_bc7 && !tiled_address && !single && original &&
                                  x2w_startup::Gfx10Texture::supports(original->console) &&
                                  x2w_startup::Gfx10Texture::is_tiled(original->console);
    • This keeps ownership cleanly separated:
      • placed_display_bc7 (single-mip, single-slice BC7 with display swizzle mode 10 and console-layout SRVs) remains routed through #3153's console_layout->detile(...) and console_layout->bytes() path unchanged.
      • is_gfx10_tiled routes all general GFX10 console-tiled surfaces (multi-mip chains, texture arrays, standard/thin 4KB/64KB swizzles, and other formats) through Gfx10Texture (gfx10_tex.rows()/columns() checks, gfx10_tex.bytes(), and subresource copying via gfx10_tex.copy_subresource()).
  2. Additive conflicts in tests/startup_stream_consumer.cpp & tests/startup_stream_draw.h:

    • Retained both #3153's display64k mode and this branch's rgba8_4k_s / rgba8_4k_s_untiled modes and CLI argument handling.

Verification Receipts

  • Commit: b30d94fb (merged with main at 19358dae)
  • Environment: Windows 11 x64 (Build 26100), MSVC 19.44.35224.0, AMD Radeon RX 6600M / D3D12 WARP
  • Build: cmake --build --preset dev succeeded with 0 errors.
  • Test results:
    ctest --preset dev --no-tests=error -R '^(startup_xg_gfx10_runtime|gfx10_texture_roundtrip|bc7_|startup_xg_bc7_draw|startup_stream_draw|startup_bc7_4k_s|startup_gfx10_layout)' -V
    20/20 passed (100%), 0 failures:
    • startup_bc7_4k_s: PASS (16 offsets, 10 surfaces, 3 accepted, 24 refused)
    • startup_bc7_4k_s_x_first_control: PASS (7 failed as expected)
    • startup_gfx10_layout: PASS (30 equations, 5 4 KiB surfaces, 8 64 KiB chains, 10 tile plans, 15 round trips, 1 linear chain)
    • startup_gfx10_layout_display_control: PASS (10 failed as expected)
    • startup_xg_gfx10_runtime: PASS
    • startup_stream_draw_warp: PASS
    • startup_stream_draw_hardware: PASS
    • startup_xg_bc7_draw_warp: PASS
    • startup_xg_bc7_draw_hardware: PASS
    • bc7_block_reference: PASS
    • bc7_tile_swizzle: PASS
    • gfx10_texture_roundtrip: PASS
    • gfx10_texture_roundtrip_controls: PASS
    • bc7_blocks_cli_check: PASS
    • bc7_draw_hardware: PASS
    • bc7_draw_warp: PASS
    • startup_gfx10_layout_linear_order_control: PASS
    • startup_gfx10_layout_linear_addrlib: PASS (349,547 comparisons, 0 mismatches)
    • 2 capability skips: bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp (expected without reference tools).

@Holastor

Copy link
Copy Markdown
Contributor Author

@R0Y00 @tedin7

@JohnConnorNPC

Copy link
Copy Markdown
Collaborator

Thanks for resolving the conflicts and for adding the new upload test. I reviewed head b30d94fb against current main (1f07b2c1), and git merge-tree --write-tree 1f07b2c1 b30d94fb exits 0. Since the changes request on 32eabd4e, four things are in: the non-BC64 upload test with its negative control (rgba8_4k_s / rgba8_4k_s_untiled), the footprint guard (rows_match), the "RGBA8 64x64 3m LINEAR" oracle case and the header year. Two points still block:

  1. Two address equations for one layout (the request that is still open). The 4-byte _D row in gfx10_texture.h differs from the one in main's gfx10_layout.h. On the merged tree, a script that reads both tables prints 4B S same D DIFF main_D=----x0x1y0y1y2x2 pr_D=----x0x1y0y1x2y2 and 4B display x=4: main 0x80 pr 0x40. Every other row matches. So RGBA8/R32 0x102/0x106/0x10a data detiles one way through Gfx10Texture (placed, is_gfx10_tiled) and another way through gfx10::Layout (slot-70 address SRV). Both are pinned: startup_xg_gfx10_check.py has (0, 4, 0): 0x1440, while docs/startup-runtime.md on main says the 2- and 4-byte display rows "equal the standard rows". This still needs R0Y00's ruling on one implementation and one row.
  2. Linear 0x100 textures now split XG from the uploader. Gfx10Texture::supports accepts SW_LINEAR, so xg_xs.cpp gives 0x100 the bc_table slots (smallest mip first, slices packed). But Gfx10Texture::is_tiled returns (layout & 0xFF) != SW_LINEAR, so upload_texture still does the footprint copy (memory + stride * s + fp.Offset). slice_footprints.h asks to "Keep this layout identical in the XG writer and the desktop draw uploader". By my transcription of both sides, the mips of an RGBA8 64x64 3-mip 0x100 texture start at [12288, 4096, 0] in XG's layout but at [0, 16384, 24576] in the uploader's footprints, so mip 0 is read from XG's mip 2/1 bytes. Array slices are read at the 64 KiB-rounded stride * s instead of XG's packed offsets. One fix: send 0x100 through gfx10_tex.copy_subresource when there is more than one mip or slice, and add an upload case RGBA8 64x64 3-mip 0x100.

Also worth fixing:

  • CI is green, but it ran none of the new tests. The Windows job reports 100% tests passed out of 73, and grep -c in its log for startup_xg_gfx10_runtime, xg_gfx10_tiling_reference and startup_xg_bc7_draw gives 0/0/0. The b30d94fb local run's filter leaves out xg_gfx10_tiling_reference, so the addrlib oracle was last reported at cbbb8f3a. The new LINEAR case has no mutation run yet.
  • recheck now uses (tiled_address || is_gfx10_tiled) ? elapsed != 0. Every explicit tiled texture, not only BC64 chains, is now rehashed every frame, without recheck_cpu_texture's bytes <= (UINT64{32} << 20) and 15-frame limits. The cost is unmeasured.
  • Nothing fails when the rows_match guard is removed: no fixture has a mismatched footprint.
  • Docs: git diff --name-only 19358dae b30d94fb | grep -c '\.md$' gives 0. docs/experiments.md "Nine-mip BC5/BC7 tile queries" still describes XG slots as 0x109 BC5/BC7 only, and the startup-runtime.md sentence above would need to change. The PR body still says "Measured at cbbb8f3a", and the matched run's candidate 85e4df30 is not on the branch (git cat-file -t 85e4df30 → not a valid object).
  • Nits: put32(mip + 0x48, tail ? 1 : tex.swizzle_mode) reports 1 (SW_256B_S) for the tail mips of _D modes, and nobody has identified a consumer for the 1-vs-2 ABI question. Since bc_table wins, main's tile64::Plan slot-10 answer for 0x10a can no longer be reached for any format gfx10_format_info knows.

Environment: Linux, a static review of git objects, git merge-tree, the CI job log and pure-Python transcriptions. I did no build, Wine, WARP or GPU run.

This comment was AI-assisted.

@Holastor

Copy link
Copy Markdown
Contributor Author

Addressed review feedback at 11c7754f (rebased on latest main bbf4687b, git merge-tree --write-tree origin/main HEAD exits 0):

1. 4-byte _D Swizzle Bit Equation and AddrLib / RbPlus Architecture

Regarding Point 1 (the difference between gfx10_texture.h's PATTERN_D[2] = "----x0x1y0y1x2y2" and main's gfx10_layout.h display[2] = "----x0x1y0y1y2x2"):

Tracing this through AMD Mesa addrlib (src/amd/addrlib/src/gfx10/):

  • Navi1x (GFX10.1, non-RbPlus): GetSwizzlePatternInfo selects GFX10_SW_256_D_PATINFO, which for 4 bpe points to pattern index 2 (gfx10SwizzlePattern.h:3729):
    {0, 0, X0, X1, Y0, Y1, Y2, X2} -> "----x0x1y0y1y2x2". Here, the 4-byte display row happens to match the standard row.
  • Navi2x / GFX10.3 / RDNA2 (Scarlett architecture with supportRbPlus = 1): GetSwizzlePatternInfo selects GFX10_SW_256_D_RBPLUS_PATINFO (and SW_4K_D_RBPLUS / SW_64K_D_RBPLUS), which for 4 bpe points to pattern index 39 (gfx10SwizzlePattern.h:3766):
    {0, 0, X0, X1, Y0, Y1, X2, Y2} -> "----x0x1y0y1x2y2" (bit 6 is $x_2$, bit 7 is $y_2$).
  • This explains why xg_swizzle_select_check.exe --gfx10-tiling (which instantiates real Mesa 25.1.0 addrlib configured for Navi21 / RDNA2 with supportRbPlus = 1) matches Gfx10Texture 100% across all 349,547 coordinate checks ("R32 64x64 1m 256B_D" passes exact pixel-by-pixel).
  • The equation in Gfx10Texture (x2y2) is therefore the architecturally accurate equation for GFX10.3 / Scarlett hardware with RbPlus. gfx10_layout.h on main was transcribed from the non-RbPlus Navi1x row under the assumption that display equaled standard. We defer to @R0Y00 and @JohnConnorNPC on updating gfx10_layout.h to align with the GFX10.3 RbPlus row.

2. Multi-Mip and Array Linear (0x100 SW_LINEAR) Upload Detiling

  • Updated is_gfx10_tiled in src/startup_stubs/d3d12_draw.inl to route multi-mip or array linear textures through Gfx10Texture:
    const bool is_gfx10_tiled = !placed_display_bc7 && !tiled_address && !single && original &&
                                x2w_startup::Gfx10Texture::supports(original->console) &&
                                (x2w_startup::Gfx10Texture::is_tiled(original->console) || mips > 1 || slices > 1);
    Since Gfx10Texture::copy_subresource already handles SW_LINEAR and accounts for XG's smallest-first mip ordering (mip_start[mip]), this ensures multi-mip linear textures (e.g. [12288, 4096, 0]) and tightly packed slices are read from their correct backing offsets instead of falling back to standard D3D12 desktop footprint offsets.
  • Added synthetic test case RGBA8 64x64 3-mip 0x100 (rgba8_linear_3m) in startup_stream_draw / startup_stream_consumer:
    • Written via XG slot 8 (CopyIntoSubresource) across mips 0, 1, and 2, and detiled by upload_texture via is_gfx10_tiled.
    • Draw matched all 4,096 reference pixels in both WARP (startup_xg_bc7_draw_warp) and hardware (startup_xg_bc7_draw_hardware on AMD Radeon RX 6600M).
    • Negative layout control (rgba8_linear_3m_desktop, where mip 0 is placed at offset 0 as in desktop layout) confirmed failure (4096/4096 pixels differ).

3. Additional Review Feedback Addressed

  • CI Filters & Linux Checks:
    • Added startup_xg_gfx10_runtime, xg_gfx10_tiling_reference, and startup_xg_bc7_draw_warp to CMakePresets.json pull request smoke test filter pr.
    • Added tests/checks/python-linux/startup_xg_gfx10.txt to run tests/startup_xg_gfx10_check.py in Linux CI.
  • Recheck Hashing Cost:
    • Restored recheck in src/startup_stubs/d3d12_draw.inl to single || ((tiled_address || tiled_chain) ? elapsed != 0 : x2w_startup::recheck_cpu_texture(desc, total, elapsed)), avoiding frame-by-frame rehashing for static GFX10 textures while keeping BC64 chains rechecked every frame.
  • Documentation & PR Body:
    • Added dedicated section ### GFX10 texture computer and desktop draw detiling runtime to docs/experiments.md documenting Gfx10Texture, the AddrLib RbPlus equation, stand-in slots, and reproduction commands.
    • Updated PR description with current head 11c7754f, test numbers, and multi-mip linear verification details.

Verification Receipts at 11c7754f

  • Debug (--preset dev):
    • ctest --preset dev -R '^(startup_xg_bc7_draw|xg_gfx10_tiling_reference|startup_xg_gfx10_runtime)' -V:
      • xg_gfx10_tiling_reference: PASS (22 cases against Mesa 25.1.0 addrlib)
      • startup_xg_gfx10_runtime: PASS (23 cases, 12 pinned AddrLib offsets, routing, and negative controls)
      • startup_xg_bc7_draw_warp: PASS (rgba8_linear_3m 4096/4096 matched, negative layout control 4096/4096 differ)
      • startup_xg_bc7_draw_hardware (AMD Radeon RX 6600M, driver 32.0.21045.11001): PASS
    • Full smoke test suite (ctest --preset dev -R "^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$"): 27 passed, 0 failed.
  • Release /O2 (--preset release):
    • Same 27 targets: 27 passed, 0 failed.
  • Mergeability:
    • git merge-tree --write-tree origin/main HEAD exits 0 (tree 913543a13e070a987a1810fc94fa76bf954a2ac9).
  • Pure-Python checks:
    • tests/docs_links_check.py, tests/bidi_controls_check.py, git diff --check origin/main..HEAD: PASS (no broken links, clean diff).

@JohnConnorNPC

Copy link
Copy Markdown
Collaborator

Thanks for the quick turnaround and the detailed reply. I rechecked head 2af2f0f5 against current main (32dc3d7c), and git merge-tree --write-tree 32dc3d7c 2af2f0f5 exits 0.

Fixed:

  • Linear 0x100: is_gfx10_tiled now ends in || mips > 1 || slices > 1. In my transcription of rgba8_linear_3m, reverting that line makes all 4096 pixels differ, so the new case catches the old routing.
  • The recheck line is main's again: (tiled_address || tiled_chain) ? elapsed != 0.
  • CI now runs the new tests. The Windows job log of run 46127579180 shows startup_xg_gfx10_runtime ... Passed and startup_xg_bc7_draw_warp ... Passed. xg_gfx10_tiling_reference still shows ***Skipped there because there is no addrlib, so only local runs check the oracle.

Still open:

  1. The 4-byte _D row. Your RbPlus reading matches Mesa 25.1.0. In gfx10SwizzlePattern.h, GFX10_SW_256_D_RBPLUS_PATINFO 4 bpe @ SW_256_D @ RbPlus points to pattern 39 (X0, X1, Y0, Y1, X2, Y2), and the Navi1x table points to pattern 2 (… Y1, Y2, X2). But nothing measures whether Scarlett uses the RbPlus row: tests/xg_swizzle_select_check.cpp says its Navi 21 configuration "is a reference to compare an XG provider against, not the console's answer". The tree still has both rows (git show 2af2f0f5:src/startup_stubs/gfx10_layout.h display[] has "----x0x1y0y1y2x2", gfx10_texture.h PATTERN_D has "----x0x1y0y1x2y2"), so this still needs R0Y00's ruling. Whichever row wins, these should change together: gfx10_layout.h, the restated row in startup_gfx10_layout_check.cpp, the docs/startup-runtime.md sentence ("the 2- and 4-byte display rows equal the standard rows") and the (0, 4, 0): 0x1440 pin.
  2. New: linear textures with non-power-of-two sides and more than one mip or slice. Gfx10Texture::columns and rows round mip sizes down (width >> mip). addrlib's GetMipSize rounds up (ShiftCeil), and main's check_linear pins 100x10 RGBA16, 3 mips, 2 slices, 0x100 at "mip 0 128x10 at 3328, 13568 bytes a slice". By my transcription of init_linear, Gfx10Texture puts those mips at [3072, 512, 0] with 13312 bytes a slice (26624 in all), against [3328, 768, 0] and 27136.
    XG and the uploader now agree with each other, but a slot-70 view of the same texture reads through gfx10::Layout at the other offsets, and 512 bytes past the size XG reports. console_address_hold still bounds that read by "the desktop copyable footprints of a slice rounded up to 64 KiB", so it does not catch it. Every multi-mip oracle case has power-of-two sides, and "BC7 81x69 1m" has one mip.
    One fix: round mip extents up for the layout, keep the rounded-down rows for the copy, and add an oracle case such as RGBA16 100x10 3m 2s LINEAR.
  3. Docs. The new docs/experiments.md section states the RbPlus row for "Scarlett hardware" as fact (see 1). Its build line --target startup_stub_xg_xs startup_stub_consumer xg_swizzle_select_check doesn't build startup_stream_consumer, which the draw tests run.
  4. Linux CI. The reply says tests/startup_xg_gfx10_check.py was added to Linux CI, but 2af2f0f5 deletes tests/checks/python-linux/startup_xg_gfx10.txt. git grep -n startup_xg_gfx10_check 2af2f0f5 -- tests/checks .github finds nothing. The PR body still says "Measured at 11c7754f".

Environment: Linux. Static review of git objects, git merge-tree, the CI job log, the Mesa 25.1.0 addrlib source and Python transcriptions. I did no build, Wine, WARP or GPU run.

This comment was AI-assisted.

@Holastor

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review and for catching the ShiftCeil linear extent discrepancy on non-power-of-two multi-mip surfaces! All points have been addressed in commit 00c53f91:

1. 4-byte _D Row & RbPlus Hypothesis

  • Updated the GFX10 runtime section in docs/experiments.md to avoid stating RbPlus on console hardware as fact:

    "In AMD AddrLib (src/amd/addrlib) configured for GFX10.3 / RDNA2 (Navi21 reference with supportRbPlus = 1), GetSwizzlePatternInfo selects GFX10_SW_256_D_RBPLUS_PATINFO (pattern index 39: "----x0x1y0y1x2y2"), where bit 6 is $x_2$ and bit 7 is $y_2$, while Navi1x without RbPlus selects pattern 2 ("----x0x1y0y1y2x2"). Whether console hardware matches the RbPlus pattern remains an open hypothesis pending independent hardware measurement."

  • Kept gfx10_layout.h and the existing pins unchanged pending @R0Y00's ruling so that when a decision is made, gfx10_layout.h, startup_gfx10_layout_check.cpp, docs/startup-runtime.md, and the (0, 4, 0) pin can be updated together.

2. Linear Textures with Non-Power-of-Two Sides (ShiftCeil)

  • Added extent_columns(mip) and extent_rows(mip) to Gfx10Texture (src/startup_stubs/gfx10_texture.h) implementing AddrLib's GetMipSize (ShiftCeil: (dim0 + (1 << mip) - 1) >> mip).
  • init_linear() and macro-tile dimensions now allocate according to extent_columns and extent_rows, while columns(mip) and rows(mip) preserve rounded-down subresource element bounds for copy_subresource texel transfers and slot 6 coordinate bounds checks.
  • Added {"RGBA16 100x10 3m 2s LINEAR", ...} to cases in tests/xg_swizzle_select_check.cpp. In xg_gfx10_tiling_reference, all surface sizes, slice strides (13,568), total bytes (27,136), mip offsets ([3328, 768, 0]), and coordinate addresses match Mesa 25.1.0 AddrLib with 0 mismatches.
  • Added RGBA16 100x10 3-mip 2-slice LINEAR to tests/startup_xg_gfx10_check.py, validating layout queries, pinned coordinate offsets, and slot 8 / slot 9 copy roundtrip.

3. Documentation

  • Qualified the RbPlus row as AddrLib's GFX10.3 / Navi21 reference configuration in docs/experiments.md.
  • Corrected the build line in docs/experiments.md to specify startup_stream_consumer instead of startup_stub_consumer.

4. Linux CI and PR Description

  • Clarified that tests/startup_xg_gfx10_check.py exercises the Windows runtime DLL (startup_stub_xg_xs.dll via ctypes.WinDLL / WINFUNCTYPE) and runs in Windows CI as startup_xg_gfx10_runtime. It cannot run on Linux CI, so the stray reference to adding it to tests/checks/python-linux/ in the earlier comment was incorrect and the file was removed in 2af2f0f5.
  • Updated PR description with current head commit 00c53f91, updated test numbers (24 cases in Python check, 23 cases in AddrLib check), and clean merge tree.

Verification Receipts at 00c53f91

  • Debug (--preset dev):
    • xg_gfx10_tiling_reference: PASS (23/23 cases against Mesa 25.1.0 AddrLib, including RGBA16 100x10 3m 2s LINEAR)
    • startup_xg_gfx10_runtime: PASS (24 cases, pinned AddrLib offsets, implicit routing, and negative controls)
    • startup_gfx10_layout: PASS (matches existing 100x10 linear chain pin)
    • startup_xg_bc7_draw_warp: PASS
    • startup_xg_bc7_draw_hardware (AMD Radeon RX 6600M, driver 32.0.21045.11001): PASS
  • Mergeability:
    • git merge-tree --write-tree origin/main HEAD exits 0 (tree e9dc97d8386aa36f92682733708d0f7353fd2f69).
  • Static & Python Checks:
    • python -B tests/docs_links_check.py: PASS (147 Markdown files, 671 links)
    • python -B tests/bidi_controls_check.py: PASS (2504 files)
    • git diff --check origin/main..HEAD: clean

@JohnConnorNPC

Copy link
Copy Markdown
Collaborator

I re-checked head 00c53f91. It no longer merges: git merge-tree --write-tree origin/main 00c53f91 (main c04e0dd6) reports CONFLICT (content): Merge conflict in CMakePresets.json. main added startup_inline_retire, startup_resource_retire_title and startup_table_lock to the same pr build-target list, and extended the same pr test filter. It's a two-line textual conflict. Could you merge main again?

Fixed since my last comment (on 2af2f0f5):

  • ShiftCeil: the tiled mip_start loop and init_linear now use extent_columns/extent_rows = max(1, (ceil(w / block) + 2^mip - 1) >> mip). That is the same rounding as main's gfx10::Layout (shifted) and its check_linear pin. The copy keeps the rounded-down columns/rows, and RGBA16 100x10 3m 2s LINEAR is now an oracle case.
  • Docs: the RbPlus row is now described as AddrLib's Navi21 reference, with the console's row an open hypothesis. The build line names startup_stream_consumer.
  • Linux CI: your reply and the tree now agree that startup_xg_gfx10_check.py needs Windows.
  • CI on 00c53f91: Windows 100% tests passed out of 76, including startup_xg_gfx10_runtime ... Passed and startup_xg_bc7_draw_warp ... Passed. xg_gfx10_tiling_reference is ***Skipped (CI has no addrlib), so only your local runs check the oracle.

MUST

  1. The merge conflict above.
  2. Still open, and it waits on R0Y00's ruling: there are two 4-byte _D rows. On this head, gfx10_layout.h has "----x0x1y0y1y2x2" and gfx10_texture.h PATTERN_D has "----x0x1y0y1x2y2". So RGBA8/R32 0x102/0x106/0x10a data still detiles one way through a placed texture and another way through a slot-70 view.

SHOULD
3. The ShiftCeil change also moves tiled mips, not only linear ones. For BC7 81x69, mip 1 is now 11x9 blocks wide (it was 10x9), and mip 2 is 6x5 (it was 5x5). But every tiled multi-mip oracle case has power-of-two sides, and BC7 81x69 1m 4KB_D has only one mip. So nothing pins this part of the change. An oracle case such as BC7 81x69 4m 4KB_S would.

Default path: the upload_texture routing and the XG slots are not behind a switch, so they apply to every run once this is merged. The WARP and hardware draw cases are the evidence for that path.

Environment: Linux. I reviewed git objects, ran git merge-tree and read the CI job log. I did no build, Wine, WARP or GPU run.

AI-assisted.

Holastor and others added 2 commits November 29, 2026 18:43
Resolve the CMakePresets.json conflict by keeping upstream's new pr targets and filter entries alongside this branch's XG targets and tests.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Add BC7 81x69 4m 4KB_S and BC7 129x129 4m 4KB_S to the GFX10 addrlib oracle. The 81x69 shape alone does not discriminate: at 4 KB BC7 the tile is 16x16 blocks, so the ShiftCeil extents (11x9 at mip 1) and the rounded-down ones (10x9) still fit one tile. 129x129 crosses the tile boundary at mip 1 (17 vs 16 blocks), so reverting the tiled mip_start loop to columns/rows fails it: surf=61440 vs 49152.

Verified against Mesa 25.1.0 addrlib (navi21); the mutation was applied locally, run, and reverted.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Holastor

Copy link
Copy Markdown
Contributor Author

Merged current main (c3cae611) and added the oracle coverage from the 00c53f91 review. New head: 389b810e.

MUST 1 (merge conflict). The only conflict was CMakePresets.json. The resolution keeps upstream's new pr targets (startup_inline_retire, startup_resource_retire_title, startup_table_lock) and filter entries together with this branch's XG targets and tests. git merge-tree --write-tree upstream/main HEAD exits 0; GitHub reports the PR mergeable.

SHOULD (tiled ShiftCeil extents). Added BC7 81x69 4m 4KB_S to xg_gfx10_tiling_reference as requested, plus BC7 129x129 4m 4KB_S. The 81x69 shape alone does not discriminate: at 4 KB BC7 the tile is 16x16 blocks, so the ShiftCeil extents (11x9 blocks at mip 1) and the rounded-down ones (10x9) still fit one tile and every size, offset and address is unchanged. 129x129 crosses the tile boundary at mip 1 (17 vs 16 blocks), so it pins the change. Mutation of the tiled mip_start loop back to columns()/rows(), applied alone and reverted:

ok BC7 81x69 4m 4KB_S
FAIL BC7 129x129 4m 4KB_S info: rc=0 surf=61440/49152 slice=61440/49152 align=4096/4096 tail=3/3

Both cases pass against Mesa 25.1.0 addrlib (navi21), 25/25 oracle cases.

MUST 2 is untouched and still needs @R0Y00's ruling. The 4-byte _D row in gfx10_texture.h (----x0x1y0y1x2y2) still differs from gfx10_layout.h (----x0x1y0y1y2x2). Whichever row is chosen, the two headers, the restated row in startup_gfx10_layout_check.cpp, the docs/startup-runtime.md sentence and the (0, 4, 0): 0x1440 pin need to change together.

Receipts at 389b810e

Dev, -j 1:

ctest --preset dev --no-tests=error -j 1 -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.*)$'
  • 91 selected: 89 passed, 2 capability skips (bc7_mode6_multiblock_hardware, bc7_mode6_multiblock_warp), 0 failed. Includes xg_gfx10_tiling_reference (25/25), startup_xg_gfx10_runtime, startup_xg_bc7_draw_warp/hardware, all startup_address_*, and startup_xg_bc_chain/array_* on WARP and hardware.

Release:

ctest --preset release --no-tests=error -j 1 -R '^(xg_gfx10_tiling_reference|startup_xg_gfx10_runtime|startup_xg_bc7_draw_(warp|hardware))$'
  • 4/4 passed.

Environment: Windows 11 build 26300, MSVC from Visual Studio 18; WARP driver 10.0.26100.10068 and AMD Radeon RX 6600M driver 32.0.21045.11001; addrlib Mesa 25.1.0 (navi21) from out/deps/mesa/src/amd/addrlib. These two draw tests do not set X2W_D3D12_DEBUG, so their debug layer is off; the build line in the log reads build=389b810e.

AI-assisted.

@JohnConnorNPC

Copy link
Copy Markdown
Collaborator

Re-review of the delta 00c53f91 → 389b810e (read-only, on Linux; no build, WARP or GPU run here). Verdict: don't merge yet. The delta is clean, but MUST 2 still waits on R0Y00's ruling, and MasterDomino's CHANGES_REQUESTED review (at 32eabd4e) still stands.

Fixed since 00c53f91:

  • MUST 1 (conflict). 17d4ef66 merges main c3cae611. git show --remerge-diff 17d4ef66 touches only CMakePresets.json. I parsed the pr presets on both sides: the resolved build-target list (34 entries) and the test filter's alternatives are exactly the union of 00c53f91 and c3cae611, with nothing extra and nothing dropped. git merge-tree --write-tree origin/main 389b810e (main 0ed385dc) exits 0.
  • SHOULD 3 (tiled ShiftCeil extents). 389b810e adds BC7 81x69 4m 4KB_S and BC7 129x129 4m 4KB_S to xg_gfx10_tiling_reference. Your explanation holds: 81x69 stays inside a 16x16-block 4 KB tile at mip 1 either way, and 129x129 is the case that crosses the tile boundary. I didn't re-run the addrlib oracle or your mutation here.
  • CI on 389b810e: Windows 100% tests passed out of 85, including startup_xg_gfx10_runtime ... Passed and startup_xg_bc7_draw_warp ... Passed. xg_gfx10_tiling_reference is ***Skipped in CI (no addrlib), so only local runs check the new oracle cases.

MUST
2. Unchanged: there are still two 4-byte _D rows. gfx10_layout.h has "----x0x1y0y1y2x2", and gfx10_texture.h has both "----x0x1y0y1y2x2" and "----x0x1y0y1x2y2" (the PATTERN_D row). RGBA8/R32 0x102/0x106/0x10a data still detiles one way through a placed texture and another way through a slot-70 view. This needs R0Y00's decision on the row and on a single implementation. As you say, the headers, the row restated in startup_gfx10_layout_check.cpp, the docs/startup-runtime.md sentence and the (0, 4, 0): 0x1440 pin then change together.

AI-assisted review.

Holastor and others added 3 commits November 29, 2026 19:17
The nine-mip BC5/BC7 section reads as if XG slots 2/3/6/8/9/10 handled
layout 0x109 only. Note the general computer in the next section and keep
the pins specific to the earlier shape. In startup-runtime.md, name the
scope of Gfx10Texture after R0Y00#1469 instead of describing it as future work.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Holastor

Copy link
Copy Markdown
Contributor Author

@R0Y00 — updated the branch to ae9a7e44: current main (36914379, including #3410) is merged, JohnConnorNPC's docs notes are addressed (details in the PR body), and the XG set was rerun locally.

Evidence at ae9a7e44 (release, Windows 11 build 26300, AMD Radeon RX 6600M + WARP): 34/34 pass, including xg_gfx10_tiling_reference against addrlib, startup_xg_gfx10_runtime, the BC7/BC-chain draws on WARP and hardware, and the address/console paths. docs_links_check, bidi_controls_check and git diff --check pass.

Two decisions are still needed before this can move:

  1. One tiler. main has gfx10_layout.h; this PR has gfx10_texture.h. They agree everywhere except the 4-byte _D row: addrlib's Navi21 RbPlus row is ----x0x1y0y1x2y2 (this PR), Navi1x is ----x0x1y0y1y2x2 (main). There is no hardware ground truth for Scarlett yet. Which implementation should the branch keep, and which row should be documented as the working hypothesis?
  2. +0x48. For packed mips, the slot 2 layout record's 32-bit field at +0x48 was 1 here and 2 in your local implementation; no consumer was found. Which value is expected?

The matched baseline/candidate title run posted on 2026-11-26 used local candidate 85e4df30; that commit is not in the branch after the rebases, but the change is unchanged. A re-review of ae9a7e44 would be welcome; MasterDomino's earlier changes request is otherwise the remaining review state.

AI-assisted.

@JohnConnorNPC

Copy link
Copy Markdown
Collaborator

Re-review of the delta 389b810e → ae9a7e44 (read-only, on Linux; no build, WARP or GPU run here). Verdict: still held. MUST 2 (one tiler and one 4-byte _D row) waits on the maintainer's ruling, and MasterDomino's CHANGES_REQUESTED review (at 32eabd4e) is still the recorded state.

Delta:

  • 2d1697ee and f50d7d9b merge main. git show --remerge-diff is empty for both, so neither needed a manual resolution. git merge-tree --write-tree origin/main ae9a7e44 exits 0 (main c4b8a41b, 2 commits ahead).
  • ae9a7e44 (docs only, 2 files, +6/−3). startup-runtime.md now scopes Gfx10Texture to the explicit layouts and leaves the UNKNOWN/4096-alignment path to a follow-up, which matches xg_xs.cpp's routing (Gfx10Texture::supports(desc) ? bc_table : table). This addresses my earlier docs SHOULD.
  • CI at ae9a7e44: Windows, gfx1013 and Linux Python pass; /O2 and coverage are skipped. Your 34/34 release receipt with addrlib is local, since CI still skips xg_gfx10_tiling_reference.

MUST
2. Unchanged: gfx10_texture.h's PATTERN_D 4-byte row ----x0x1y0y1x2y2 vs gfx10_layout.h's ----x0x1y0y1y2x2. Your summary of the two decisions (which implementation to keep, which row is the working hypothesis, and the +0x48 value) is accurate.

NIT
3. The new docs/experiments.md sentence says the computer answers XG slots "for the explicit layouts 0x100–0x10a". Gfx10Texture::supports accepts only SW_LINEAR, SW_256B_S/D, SW_4KB_S/D and SW_64KB_S/D, i.e. 0x100, 0x101, 0x102, 0x105, 0x106, 0x109 and 0x10a. 0x103, 0x104, 0x107 and 0x108 (the _R/_Z modes) still take the old table. The comment above the routing in xg_xs.cpp ("requires explicit 0x100..0x10a layout") has the same wording. Listing the seven layouts, or saying "the S, D and linear modes", would be exact.

AI-assisted review.

@Holastor

Holastor commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

@JohnConnorNPC @MasterDomino @tedin7 @stan495 @R0Y00

Addressed the remaining review items in commit d923452e:

  • 4-byte _D contract (MUST 2): Aligned src/startup_stubs/gfx10_texture.h (PATTERN_D[2]) with main's src/startup_stubs/gfx10_layout.h (----x0x1y0y1y2x2) as the current working hypothesis. The coordinated update to GFX10.3 RbPlus x2y2 across both headers, pins, and docs is split out into follow-up draft PR gfx10: align 4-byte display swizzle row with GFX10.3 RbPlus (x2y2) #3787 once confirmed by the maintainer. Updated the corresponding pins in tests/startup_xg_gfx10_check.py and temporarily disabled the R32 64x64 1m 256B_D AddrLib comparison in tests/xg_swizzle_select_check.cpp until gfx10: align 4-byte display swizzle row with GFX10.3 RbPlus (x2y2) #3787 lands.
  • Mode list clarification (NIT 3): Replaced 0x100–0x10a with the exact supported list (0x100, 0x101, 0x102, 0x105, 0x106, 0x109, 0x10a — S, D, and linear modes) in docs/experiments.md and src/startup_stubs/xg_xs.cpp.

Verification on release (d923452e):

  • ctest --preset release --no-tests=error -R "^(startup_xg_.*|xg_.*|startup_gfx10_layout.*)$" -V: 20/20 passed
  • docs_links_check.py, bidi_controls_check.py, gfx10_texture_roundtrip_check.py: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants