startup: general GFX10 texture tiling and detiling runtime #1462
Open
Holastor wants to merge 22 commits from
upstream-pr/1469 into main
pull from: upstream-pr/1469
merge into: R0Y00:main
R0Y00:main
R0Y00:codex/indirect-large-backed-views
R0Y00:codex/word3-preflight-check
R0Y00:codex/vertex-table-two-records
R0Y00:codex/live-index-alias
R0Y00:codex/copied-vertex-buffer-srv
R0Y00:codex/windows-stage-test-output
R0Y00:codex/preserve-live-srv-retirement
R0Y00:codex/share-render-target-tracking
R0Y00:codex/sgd5-negative-offset-fixture
R0Y00:coverage-dashboard
R0Y00:codex/mesh-loose-root
R0Y00:codex/mesh86-cache-padding
R0Y00:codex/xmem-scatter-preflight
R0Y00:codex/mesh-depth-ps
R0Y00:codex/indirect-dispatch-refresh
R0Y00:codex/compute-container-index
R0Y00:codex/startup-compute-formatted-load
R0Y00:codex/compute-indirect-producer
R0Y00:codex/compute-atomic-soffset
R0Y00:codex/mesh-dual-handoff
R0Y00:codex/startup-run-sh-watcher-control
R0Y00:codex/queue31-page-alias
R0Y00:codex/indexed-indirect-compute-root
R0Y00:codex/typed-buffer-view-metadata
R0Y00:codex/translated-indexed-address-alias
R0Y00:codex/fixed-mesh-create-result
R0Y00:codex/xmem-section-lease
R0Y00:codex/startup-slot86-mesh-cache
R0Y00:codex/restore-mesh-barrier-iteration
R0Y00:codex/translated-indirect-upload-index
R0Y00:codex/xapu-completion-opt-in
R0Y00:codex/translated-indexed-rect
R0Y00:codex/translated-indexed-indirect
R0Y00:codex/startup-mesh-lds-integration
R0Y00:codex/startup-console-ms24
R0Y00:codex/startup-slot57-mesh-request
R0Y00:codex/indirect-copy-provenance
R0Y00:codex/present-color-producer-trace
R0Y00:codex/compute-dispatch-binding-trace
R0Y00:codex/translated-indirect-table-buffers
R0Y00:codex/indirect-copy-provenance-base
R0Y00:codex/mix-half-literal-source
R0Y00:codex/translated-indirect-draw
R0Y00:codex/xmem-scatter-diagnostics
R0Y00:codex/slot148-recording-upload
R0Y00:codex/slot70-loading-art-verified
R0Y00:codex/command-list-upload-arena
R0Y00:codex/recover-failed-command-list
R0Y00:codex/startup-heap-timing-notes
R0Y00:codex/align-audio-input-timeline
R0Y00:codex/synthetic-depth-export-control
R0Y00:codex/startup-texture1d-on-windows
R0Y00:codex/1629-packed-position-fixture
R0Y00:codex/cpu-srv-refresh
R0Y00:codex/stream-root-srv-draw
R0Y00:codex/audio-mixer-timer
R0Y00:codex/startup-reload-published-shader
R0Y00:codex/priority-integrate-1284
R0Y00:codex/guest-sixteen-page-record
R0Y00:codex/aot-placed-dxr-batch
R0Y00:codex/guest-directory-selection
R0Y00:codex/gamesave-enumerate-read
R0Y00:codex/readme-archive-to-pixels
R0Y00:codex/pe-placed-view-draw
R0Y00:codex/archive-directory-gpu
R0Y00:codex/slot133-dxr-build
R0Y00:codex/materialize-placed-vertex-view
R0Y00:codex/dstorage-directory-offsets
R0Y00:codex/xg-nine-bc-copy
R0Y00:codex/xg-slot10-bc64-arrays
R0Y00:codex/dxr-guest-address-readback
R0Y00:codex/gpu-va-high-bits
R0Y00:codex/clarify-diagnostic-startup-scope
R0Y00:codex/xg-six-levels
R0Y00:codex/typed-derived-blend
R0Y00:codex/english-legal-text-progress
R0Y00:codex/address-bc-4ks
R0Y00:codex/dstorage-bounded-file-read
R0Y00:codex/wide-srv-offsets-menu
R0Y00:codex/startup-memory-srv
R0Y00:codex/bound-view-tail
R0Y00:codex/language-selector-readback
R0Y00:codex/setup-menu-progress
R0Y00:codex/cpu-plane-refresh
R0Y00:codex/startup-ubyte-vertex
R0Y00:codex/presenter-window-selection
R0Y00:codex/startup-uniform-buffer-lane
R0Y00:codex/intro-loop-timing
R0Y00:codex/static-clzero-loops
R0Y00:codex/document-rtx-intro
R0Y00:codex/startup-insertq
R0Y00:codex/nv12-startup-texture
R0Y00:codex/stream-stage-draw
R0Y00:codex/startup-null-uav-format
R0Y00:codex/startup-draw-capture
R0Y00:codex/shorten-windows-checks
R0Y00:codex/dstorage-rfc1950
R0Y00:codex/startup-dump-fence
R0Y00:codex/pr1135-review-base
R0Y00:codex/startup-stream-requests
R0Y00:codex/startup-chroma-view
R0Y00:codex/readme-graphics-pipeline-streams
R0Y00:codex/static-crt-free-tls
R0Y00:codex/arc-140t-rtx-5080-laptop-gpu-reports
R0Y00:codex/main-startup-progress-entry
R0Y00:codex/signed-dxil-catalogue
R0Y00:codex/reloc-free-preferred-base
R0Y00:codex/quad-dpp-bit-mask
R0Y00:codex/raw-srv-bounds
R0Y00:codex/rx9070-31044-hardware-report
R0Y00:codex/gpu-page-source-provenance
R0Y00:codex/runtime-placeholder-interior
R0Y00:codex/gpu-copy-queue-tile-order
R0Y00:codex/pe-pin-external-providers
R0Y00:codex/xmem-placeholder-reservations
R0Y00:codex/xmem-shared-physical-pages
R0Y00:codex/pe-package-startup
R0Y00:codex/xmem-tools-memory-query
R0Y00:codex/cpu-stack-output-import
R0Y00:codex/pe-load-security-cookie
R0Y00:codex/record-three-bvh-retests
R0Y00:codex/cpu-rbp-frame-anchor
R0Y00:codex/xmem-default-startup
R0Y00:codex/record-rtx-3050-ti-9597
R0Y00:codex/docs-readme-start-here
R0Y00:codex/check-compute-mad24-truncation
R0Y00:codex/docs-discord-community
R0Y00:codex/bound-rcx-branch-mutants
R0Y00:codex/rtx5060ti-bvh-62114
R0Y00:codex/837-neutral-readme-disclaimer
R0Y00:codex/record-rtx-3070-ti
R0Y00:codex/title-neutral-public-wording
R0Y00:codex/exe-shadow-frame-submissions
R0Y00:codex/exe-shadow-runtime-chain
R0Y00:codex/readme-polish
R0Y00:codex/gpu-coverage-nov23
R0Y00:codex/spirv-minlod
R0Y00:codex/shadow-shim-device
R0Y00:codex/exe-two-shadow-frames
R0Y00:codex/shim-dispatch-cleanup
R0Y00:codex/fix-spirv-cache-probe
R0Y00:codex/sampler-use
R0Y00:codex/ballot-bit-extract
R0Y00:codex/packed-fma-release
R0Y00:codex/cpu-packed-fma-o2
R0Y00:codex/publish-coverage-dashboard
R0Y00:codex/mesh-cbv-binding-order
R0Y00:codex/spirv-window-fixture
R0Y00:codex/ps-e32-float-uint
R0Y00:codex/ps-cbuffer-reads
R0Y00:codex/fixed-profile-rescan
R0Y00:codex/shim-compute-integration
R0Y00:codex/readme-visible-coverage
R0Y00:codex/readme-research-navigation
R0Y00:codex/integrate-pr-256
R0Y00:codex/indexed-mesh
R0Y00:codex/sampled-coverage
R0Y00:codex/first-ms
R0Y00:codex/dual-ps
R0Y00:codex/ps-attribute
R0Y00:codex/compute-first
R0Y00:codex/ps-export
R0Y00:codex/readme-research-status
R0Y00:codex/ps-layout
R0Y00:codex/blast-window
R0Y00:codex/chart-caption
R0Y00:codex/reviewer-roles
R0Y00:codex/blast-aot
R0Y00:codex/archive-program
R0Y00:codex/crc-stream-program
R0Y00:codex/exe-image-data-chain
R0Y00:codex/local-cpu-fixture-coverage
R0Y00:codex/exe-bound-frame-chain
R0Y00:codex/exe-mapped-comparison
R0Y00:codex/contribution-dependencies
R0Y00:codex/exe-entry-aot
R0Y00:codex/bink-frame-heap-integration
R0Y00:docs/hardware-seven-reports
R0Y00:codex/bink-custom-heap
R0Y00:codex/bink-heap-callers
R0Y00:codex/discussions-entry-points
R0Y00:codex/gpu-community-batch-64
R0Y00:codex/ffx-scratch-writers
R0Y00:codex/generic-project-documentation
R0Y00:codex/ffx-dispatch-rcas
R0Y00:codex/four-windows-gpu-reports
R0Y00:codex/title-neutral-project-wording
R0Y00:codex/community-coverage-provenance
R0Y00:codex/rcas-packed-texels
R0Y00:codex/community-gpu-retests
R0Y00:codex/community-build-and-gpu-reports
R0Y00:codex/ffx-provider-loop
R0Y00:codex/ffx-recurrent-views
R0Y00:codex/ffx-recurrent-resource
R0Y00:codex/amd-wave64-reports
R0Y00:codex/ffx-backend-slots
R0Y00:codex/upscaler-device-init
R0Y00:codex/ffx-context-lifecycle
R0Y00:codex/ffx-version-query
R0Y00:codex/ffx-provider-contract
R0Y00:codex/typed-object-callback
R0Y00:codex/cpu-ordinal-import
R0Y00:codex/chained-cpu-ranges
R0Y00:codex/cpu-import-call
R0Y00:codex/cpu-direct-call
R0Y00:codex/cpu-leaf-aot
R0Y00:codex/community-project-status
R0Y00:codex/script-state-path-replay
R0Y00:codex/script-state-evidence
R0Y00:codex/bc7-resident-tail
R0Y00:codex/bcpack-mip-tail
R0Y00:codex/bc7-texture-draw
R0Y00:codex/asset-ranges
R0Y00:codex/pixel-constants
R0Y00:codex/pixel-aot
R0Y00:codex/pre-exe-workloads
R0Y00:codex/root-signature-device-coverage
R0Y00:engineering/packed-bvh-leaves
R0Y00:engineering/bvh-build-and-update
R0Y00:engineering/intake-root-roundtrip
R0Y00:community/gpu-check-release
R0Y00:community/english-contributor-entry
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows!1462
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1469"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T12:09:14Z.
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, andGetMipSize(ShiftCeil) surface extent calculations 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 explicit GFX10 tiled modes and multi-mip or array linear (0x100) textures (withrows_matchfootprint guard before copy).startup_xg_gfx10_runtime,xg_gfx10_tiling_reference, andstartup_xg_bc7_draw_warpintoCMakePresets.jsonpull request smoke test filter and build targets.tests/startup_xg_gfx10_check.py(startup_xg_gfx10_runtime): 24 synthetic cases acrossBC1–BC7,R8,RG8,R16,R32,RGBA8,BGRA8,RGBA16,RGBA32, explicitSW_LINEAR(0x100) throughSW_64KB_D(0x10a) including multi-mip/multi-slice non-power-of-twoRGBA16 100x10 3m 2s LINEAR, 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 23 cases (includingRGBA8 64x64 3m LINEARandRGBA16 100x10 3m 2s LINEARto pin linear mip ordering andShiftCeilstrides) against pinned Mesa 25.1.0addrlibwith 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 viais_gfx10_tiledwith 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 layouts0x100–0x10a, and keeps that section's pins specific to the earlier0x109BC5/BC7 shape.docs/startup-runtime.mdnames the scope ofGfx10Textureinstead 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(currentmain36914379merged, including #3410) on Windows 11 x64 build 26300, MSVC, AMD Radeon RX 6600M + D3D12 WARP + Mesa 25.1.0addrlibfromtools/fetch_addrlib.py:xg_gfx10_tiling_reference(23 shapes),xg_bc64_tiling_reference,startup_gfx10_layout_linear_addrlib.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).startup_xg_bc7_draw_warp/_hardware,startup_xg_bc_chain_warp/_hardware,startup_xg_bc_array_warp/_hardware.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:
main(36914379, includes #3410);git merge-tree --write-tree upstream/main HEADexits 0.Pure-Python checks:
Earlier evidence remains in the thread: the 27-test run at
00c53f91and the matched baseline/candidate title run reported on 2026-11-26 (local candidate85e4df30, which is not in the branch history after rebases; the change itself is unchanged).Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:24:49Z.
Review: COMMENTED
Reviewed PR #1469 (
a92ea122):Verification
a92ea122:--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)./O2(--preset release): built same targets;ctest --preset release -R '^(startup_xg_|startup_stub|bc7_)'14/16 passed,2capability-skipped (bc7_mode6_multiblock_*).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): Whenwidth >> 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)).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.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).Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T12:43:29Z.
Addressed review feedback at
eb3e418b:Non-square BC mips (
columns/rowscalculation):columns(mip)androws(mip)insrc/startup_stubs/gfx10_texture.hto((std::max)(1u, width >> mip) + block_dim - 1) / block_dimand((std::max)(1u, height >> mip) + block_dim - 1) / block_dim. This ensurescolumnsandrowsevaluate to at least 1 when(width|height) >> mip == 0, avoidingUINTunderflow ingfx10_copy.BC7 128x64 8-mip 4KB_Sintests/startup_xg_gfx10_check.py, which validates exact linear<->tiled roundtrip across all 8 mips (including mip 7 whereheight >> 7 == 0).MipLevelsbounds guard inGfx10Texture::supports():d.MipLevels > 16guard tosupports()(rejectingd.MipLevels < 1 || d.MipLevels > 16), preventing fixed-size table out-of-bounds indexing or undefined bit-shift behavior.Negative control test coverage (
tests/startup_xg_gfx10_check.py):test_negative_controls(create)covering:pitch < row_bytes: ensuresE_INVALIDARG(0x80070057) on bothCopyIntoSubresource(slot 8) andCopyFromSubresource(slot 9).plane > 0on single-plane resource): ensuresE_INVALIDARG.subresource >= mips * slices): ensuresE_INVALIDARG.E_INVALIDARG.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)' -Vbc7_mode6_multiblock_*), 0 failed (100%).startup_xg_gfx10_runtime: 13 synthetic test cases + negative controls all PASS.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)Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T13:15:05Z.
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 insrc/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.
Unmodified branch —
startup_xg_gfx10_runtimereports all 13 cases passing, each with layout, tiling, slot 8 tile andslot 9 detile roundtrip exact, across BC1/BC4/BC5/BC7/R8/R16/RGBA8,
64KB_S,64KB_D,4KB_S,4KB_D,256B_SandLINEAR, including the two-slice and 8-mip cases; the negative controls (pitch < row_bytes, out-of-rangeplane/subresource, overlap, null, mips > 16) pass. The three older tests are unchanged and green.
Mutation 1 — y coordinate table redirects every bit
Mutation 2 — 4 KB modes report a 64 KB block
What the second result implies
gfx10_texture_roundtripand_controlsruntests/gfx10_texture_roundtrip_check.py, i.e. the Python tiler intools/bc7_tiles.py. They cannot see a change in this new C++ header. Sostartup_xg_gfx10_runtimeis currently theonly check that exercises
gfx10_texture.h, and both mutations above are invisible to everything else. That is not adefect 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++ pathagainst 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 twoindependent mutations in the coordinate table and the mode dispatch are both caught. No objection from me.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:10:25Z.
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
+0x48was 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.Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T14:26:29Z.
Thanks for the thorough independent verification on BC7 and BC6H!
Regarding the
+0x48field in the subresource layout record:1corresponds toSW_256B_S(ADDR_SW_256B_Sin addrlib), representing the 256-byte micro-tile mode for the_S(Standard) macro-tile flavor, whereas2corresponds toSW_256B_D(ADDR_SW_256B_D).mip + 0x48(callers rely onmip->Offset,RowPitch, extents, or the slot 10D3D12_SUBRESOURCE_TILINGrecords).2, or selectingSW_256B_S (1)/SW_256B_D (2)based on the parent mode's S/D flavor) if you prefer consistency with your local tooling.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:24:05Z.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T17:50:10Z.
Review: COMMENTED
Re-review of head
88c391e2d0(comment only, not an approval). My earlier review was ata92ea122d7.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 > 16guard 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_descin 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.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.is_tiled(desc)orbc64::supports) and add an implicit-layout test.P2
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.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.cea8af5bit no longer merges cleanly (CMakeLists.txt and xg_xs.cpp, trivial; frombe98528a, 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.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
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.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.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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:22:09Z.
Review: COMMENTED
Re-review of head
eca1f09e88(comment only, not an approval). Earlier reviews were ata92ea122and88c391e2.Verdict: 0 P1, 1 P2. The earlier P1 (implicit-layout textures routed to the swizzled computer) is fixed at this head.
Fixed since
88c391e2gfx10_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.upload_textureanddevice_memory_srvgate onGfx10Texture::is_tiled, so upload and XG routing agree for implicit layouts.P2
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
+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
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++).eca1f09e: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.win2025 1469 --wt . --skip-release --regex '^startup_xg_'with the one-line change above: 10/10 passed, mutant survived. Reverted withgit checkout -- ..AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:46:19Z.
Review: COMMENTED
Re-review of head
5477f0bac9(comment only, not an approval). Earlier reviews were ata92ea122,88c391e2andeca1f09e.Verdict: 0 P1, 0 P2, 1 P3 (merge conflict with current main). The earlier P2 (swizzle pattern not pinned) is addressed.
Fixed since
eca1f09etest_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.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 ateca1f09e.xg_gfx10_tiling_referencestill reports Skipped). They are self-consistent with the documented patterns, which is what matters for regression protection.P3
CONFLICTINGwith current main (b0669e06).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.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 (088add19), 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.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:46:33Z.
Review: COMMENTED
Correction to my previous comment: the head moved from
5477f0bato088add1912while I was reviewing, so that comment was filed against088add19but its text describes5477f0ba.src/startup_stubs/d3d12_draw.inl) no longer applies: GitHub now reports the PR as MERGEABLE at088add19.088add19(startup_xg_gfx10_runtimePassed, including the pinned-offset test).5477f0baand088add19line by line beyond that run. Verdict stays 0 P1, 0 P2.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T05:08:14Z.
Addressed the P1, P2, and merge-conflict feedback from @tedin7 and @R0Y00 at
eca1f09e:P1 — Gate
Gfx10Texturerouting on explicit console layouts (0x100–0x10a):gfx10_swizzle_from_desc()insrc/startup_stubs/gfx10_texture.hso only explicit(layout & 0xFF00) == 0x100descriptors are accepted; implicit layouts (D3D12_TEXTURE_LAYOUT_UNKNOWN= 0,D3D12_TEXTURE_LAYOUT_ROW_MAJOR= 1) now return0xFFuand route to the desktop footprinttableinxg_xs.cpp(and removed the per-constructionGetEnvironmentVariableA("X2W_XG_BC7_4K_S_LAYOUT", ...)call fromgfx10_swizzle_from_desc).test_implicit_and_unsupported_routing()intests/startup_xg_gfx10_check.pycoveringUNKNOWNlayoutRGBA8,R8,RG8,BC3,BC7andROW_MAJORRGBA8, asserting desktop stub routing (and verifyingRGBA8 64x64 UNKNOWNreports desktopspan=16384,pitch=256instead of64KB_S).P2 #1 — Fix
SW_LINEAR(0x100) metadata ininit_linear():tiles_w[i] = (cols + tile_width - 1) / tile_widthandtiles_h[i] = rinGfx10Texture::init_linear(), so slot 2 (span,pitchB,padw,padh) and slot 10 (tilings) report valid 256-byte-aligned linear metadata instead of zeros.RGBA8 256x256 3-mip LINEARand slot 2 / slot 10 assertions for all cases intests/startup_xg_gfx10_check.py.P2 #2 — Strengthen tests & add
addrlibaddress/size oracle (xg_gfx10_tiling_reference):tests/startup_xg_gfx10_check.pynow checks slot 2 plane & mip records, slot 5 (GetSubresourceOffset) including out-of-range checks, slot 6 (GetSubresourceElementAddress)first_addrand sampled coordinates matched byte-for-byte against slot 8 output, slot 10 (GetResourceTiling) entries, and tightens theMipLevels=17control to assert desktop fallback (slots[3]/[9]no-op andl_mips == 15).--gfx10-tiling(xg_gfx10_tiling_reference,SKIP_RETURN_CODE 77) intests/xg_swizzle_select_check.cppcomparingsurfSize,sliceSize,baseAlign,firstMipIdInTail, mip offsets, and every texel/block address across 20 cases against pinned Mesa 25.1.0addrlib(Addr2ComputeSurfaceInfo/Addr2ComputeSurfaceAddrFromCoord).P2 #3 & Non-blocking cleanups:
upstream/main(67758cba, includingbe98528atile64_plan.h,single_element_srv, andpartial_tiled_bcind3d12_draw.inl/d3d12_memory_srv.inl).D16_UNORM,D24_UNORM_S8_UINT,D32_FLOAT,R24G8_*) fromgfx10_format_infoand rejectedD3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCILinGfx10Texture::supports(), keeping depth resources on the desktop path (tested intest_implicit_and_unsupported_routing()).BC2,BC3,BC6H,RG8,R32,BGRA8,RGBA16, andRGBA32, and updated the PR body to match the tested formats, exact counts, and MIT/Mesaaddrlibattribution.total_slice_bytes,mip_start, andaddress()inGfx10TexturetoUINT64to avoid 32-bit overflow above 4 GiB.Verification at
eca1f09ectest --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)"(withXBOX2WINDOWS_ADDRLIB_DIRfromtools/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.0addrlib).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.docs_links_check.py(18 files, 407 links),bidi_controls_check.py(1497 files),gfx10_texture_roundtrip_check.py(6/6), andgit diff --check upstream/main..HEADall PASS.Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T05:40:52Z.
Addressed the P2 finding (
eca1f09ereview) and mergedupstream/main(b0669e06, including #2015 and #2214) at commit088add19:P2 — Pin expected element byte offsets per element size in
tests/startup_xg_gfx10_check.py:test_pinned_addrlib_offsets(create)with hard-coded element byte offsets collected fromxg_gfx10_tiling_reference(Mesa 25.1.0addrlib,navi21) covering all 5 element sizes (1, 2, 4, 8, 16bytes) across both_Sand_Dmodes (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, andBC7 64x64 7-mip 4KB_Sincluding mips 2–6 in the mip tail).slot 6(GetSubresourceElementAddress) equals the pinned offset andslot 8(CopyIntoSubresource) writes the expected element bytes at that pinned offset.R8 64x64 1-mip 4KB_Dto bothtests/startup_xg_gfx10_check.py(23 cases) andtests/xg_swizzle_select_check.cpp(--gfx10-tiling, 21 cases) so_Sand_Dare covered for all 5 element sizes.PATTERN_S[2]mutation (y0y1->y1y0) is now caught bystartup_xg_gfx10_runtime(AssertionError: BGRA8 64x64 3-mip 4KB_S mip 0 (0,1): slot6 addr=0x2020, expected 0x2010), then restored.Clean merge with
upstream/main(b0669e06) & dropd3d12_memory_srv.inldiff:upstream/maincleanly and reverted the earlier dead condition insrc/startup_stubs/d3d12_memory_srv.inl, keepingupstream/main's slot-70console_layout_srvpath unmodified and gatingGfx10Textureinupload_texture(d3d12_draw.inl) on!tiled_address.Verification at
088add19ctest --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— exit77), 0 failed (51.63 sec), includingstartup_xg_gfx10_runtime,xg_gfx10_tiling_reference,startup_address_console*_warp/hardware, andstartup_gfx10_layout*.docs_links_check.py(18 Markdown files and 409 links),bidi_controls_check.py(1499files),gfx10_texture_roundtrip_check.py(6/6), andgit diff --check upstream/main..HEADall PASS.Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T06:34:39Z.
Review: APPROVED
Verified head
088add19on Windows x64 (devpreset, MSVC19.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:startup_xg_gfx10_runtimexg_gfx10_tiling_reference(addrlib not configured)Verdict: Approved at
088add19(notingxg_gfx10_tiling_referenceskipped locally withoutaddrlib).Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T08:21:40Z.
The current explicit-layout branch (
088add19) uses the shared BC copy-in prototype for slot 9 insrc/startup_stubs/xg_xs.cpp. Microsoft's public Scarlett CopyFromSubresource call has an extra zero-valued UINT after the subresource index. #2257 corrects this for the existing BC mip chains on main. A Windows control restoring the old registration rejected that documented call. When integrating the general layout, the same slot-9 entry point and ctypes prototype apply to your new cases. Focused regressionImported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T10:05:07Z.
Merged
upstream/main(342d3fa9, including#2257and#2263) into the branch and aligned the general GFX10 path with the Scarlett slot-9CopyFromSubresourcesignature ata3cb0e89:src/startup_stubs/xg_bc64.inl,src/startup_stubs/xg_xs.cpp):bc64_copy_fromonbc_tableslot 9 for explicit0x100–0x10adescriptors (Gfx10Texture::supports), rejecting non-zeroscarlett_optionwithE_NOTIMPLbefore reading/touching either buffer and forwarding0tobc64_copy<false>/gfx10_copy<false>.upstream/main'sbc7_4k_table(bc7_4k_s_copy_fromfrom#2263) for the opt-inUNKNOWN4K BC7 profile andsmall_texture_4k_plan(#2133) ind3d12_draw.inl/xg_xs.cpp; removed the now-unreachablebc7_4k_s_layoutbranches fromxg_bc64.inl.tests/startup_xg_gfx10_check.py):COPY_FROM(passing0forscarlett_option, exercising bothslice_pitch = 0andlen(linear_src)).COPY_FROM(slots[9]): null pointers (E_INVALIDARG), shortslice_pitch(E_INVALIDARG), and non-zeroscarlett_option(1,0xFFFFFFFF) on bothBC7andRGBA8(E_NOTIMPL/0x80004001, verifying destination sentinel bytes are untouched and option validation runs before argument checks).Verification at
a3cb0e89MSVC 19.51.36263.0,addrlibfromout/deps/mesa/src/amd/addrlib):ctest ... --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_bc64_supports|startup_small_texture_4k|startup_tile64_plan|startup_gfx10_layout|startup_single_element_srv)"-> 33/33 passed (
xg_gfx10_tiling_reference,xg_bc64_tiling_reference,startup_xg_gfx10_runtime,startup_xg_bc_tiling,startup_xg_tile64_tiling,startup_xg_bc7_layout,startup_xg_bc7_draw_{warp,hardware},startup_xg_bc_chain_{warp,hardware},startup_xg_bc_array_{warp,hardware},startup_small_texture_4k_*, etc.)./O2,MSVC 19.51.36263.0,addrlibfromout/deps/mesa/src/amd/addrlib):ctest ... --no-tests=error --output-on-failure -R "^(startup_xg_|xg_swizzle_select|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_bc64_supports|startup_small_texture_4k|startup_tile64_plan|startup_gfx10_layout|startup_single_element_srv|startup_address_)"-> 47/47 passed (
startup_xg_gfx10_runtimepassed all 23 GFX10 cases, 12 pinned addrlib offset surfaces, implicit/depth routing, and negative controls)..\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py: PASS (18 files, 435 links).\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py: PASS (1586 files).\out\pe-env\Scripts\python.exe -B tests/gfx10_texture_roundtrip_check.py: PASS (6/6)git diff --check upstream/main: cleanImported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:08:00Z.
Review: COMMENTED
Re-review at head
a3cb0e896d701f552ed7194e17541e3dbba41650(previous reviewed head088add19). 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:
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.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.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T10:10:27Z.
@tedin7 Thanks for the re-review! The pinned offsets in
test_pinned_addrlib_offsetsalready lock down the exact Mesaaddrlib(navi21) byte addresses across 1/2/4/8/16-byte elements so CI guards the swizzle equations even whenaddrlibis not built on the runner.Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T15:30:24Z.
@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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:27:48Z.
Review: COMMENTED
Comment review of head
2c835d5f(a merge of main on top ofa3cb0e89, 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.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:
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.+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.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T20:23:09Z.
I ran the current
2c835d5fWindows Release candidate. All 23 TextureComputer cases and their implicit-route, pitch and range controls passed. Ten BC chain/array and address-upload CTests passed on WARP and RTX 4060 Laptop. The local addrlib-dependent checks skipped; your pinned Mesa run is separate. The earlier glyph regression was observed on an earlier route. For the current narrowed explicit-layout candidate, the remaining check is a matched baseline/candidate run through that same glyph transition and late frame, with the same profile/cache and first visible difference if any. Keep the input and raw captures local.Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-25T22:40:41Z.
@R0Y00, any update on the matched baseline/candidate run for
2c835d5f?Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:44:16Z.
Review: COMMENTED
Comment review of head
32eabd4e. It is2c835d5fplus a merge of main (only conflict:CMakeLists.txt, thexg_gfx10_tiling_referenceblock and the newtooling_fetch_addrlib_cli_checkblock, both kept). The PR's own change is identical to2c835d5f, which I already reviewed.What I checked:
git diff --check: clean.python3 tests/docs_links_check.pyandpython3 tests/bidi_controls_check.py: pass.Why I am not merging:
88c391e2and the matched baseline/candidate run is still open. We have no game here, so this stays with @R0Y00 or MasterDomino.+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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:44:01Z.
Win2025 WARP receipt for head
32eabd4e(merge of main into2c835d5f; 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 (
xg_bc64_tiling_reference,xg_gfx10_tiling_reference,xg_swizzle_select,xg_swizzle_select_mutation) skipped (exit 77): addrlib is not configured on this VM, so the pinned Mesa comparison is not covered by this run. Hardware-adapter variants were not run (WARP only).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
32eabd4ea04804291d1d25e492b796aaddc2f1d3:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_stub_xg_xs xg_swizzle_select_check startup_gfx10_layout_check startup_stream_consumer startup_stub_consumer startup_stub_acphal startup_stub_chad startup_stub_xapu -- -j 2):4.43s(configure0.00s)ctest --preset dev -R '^(startup_xg_.*|xg_swizzle_select.*|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --parallel 2 --no-tests=error --output-on-failure): 21/25 passed (31.13s:startup_address_srv_warp0.85s,startup_xg_bc7_draw_warp1.46s,startup_stubs1.43s,startup_xg_gfx10_runtime0.75s,startup_address_buffer_srv_warp1.83s,startup_xg_bc_tiling0.60s,startup_xg_bc7_layout0.62s,xg_bc64_tiling_reference0.02s,xg_gfx10_tiling_reference0.01s,startup_xg_tile64_tiling0.65s,startup_gfx10_layout0.53s,xg_swizzle_select0.01s,xg_swizzle_select_mutation0.01s,startup_gfx10_layout_display_control0.62s,startup_address_volume_srv_warp1.22s,startup_address_single_element_warp1.87s,startup_address_bc_view_warp2.59s,startup_address_console_gate_warp3.80s,startup_address_console_gate_ring_warp3.67s,startup_address_console_warp10.15s,startup_xg_bc_chain_warp3.36s,startup_xg_bc7_draw_hardware1.39s,startup_xg_bc_chain_hardware3.02s,startup_xg_bc_array_warp8.64s,startup_xg_bc_array_hardware6.93s); skipped (capability, not a pass):xg_bc64_tiling_reference,xg_gfx10_tiling_reference,xg_swizzle_select,xg_swizzle_select_mutation/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_stub_xg_xs xg_swizzle_select_check startup_gfx10_layout_check startup_stream_consumer startup_stub_consumer startup_stub_acphal startup_stub_chad startup_stub_xapu -- -j 2):31.14s(configure0.00s)ctest --preset release -R '^(startup_xg_.*|xg_swizzle_select.*|xg_bc64_tiling_reference|xg_gfx10_tiling_reference|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --parallel 2 --no-tests=error --output-on-failure): 21/25 passed (33.27s:startup_stubs0.73s,startup_xg_bc7_draw_warp1.51s,startup_address_buffer_srv_warp0.93s,xg_bc64_tiling_reference0.03s,xg_gfx10_tiling_reference0.01s,startup_gfx10_layout0.19s,startup_gfx10_layout_display_control0.18s,xg_swizzle_select0.01s,xg_swizzle_select_mutation0.01s,startup_address_srv_warp0.94s,startup_xg_bc_tiling0.64s,startup_xg_gfx10_runtime0.79s,startup_xg_tile64_tiling0.59s,startup_xg_bc7_layout0.67s,startup_address_volume_srv_warp1.05s,startup_address_single_element_warp1.69s,startup_address_bc_view_warp2.61s,startup_address_console_gate_warp2.56s,startup_address_console_gate_ring_warp2.45s,startup_xg_bc_chain_warp3.77s,startup_address_console_warp12.54s,startup_xg_bc7_draw_hardware1.85s,startup_xg_bc_chain_hardware3.73s,startup_xg_bc_array_warp10.54s,startup_xg_bc_array_hardware9.88s); skipped (capability, not a pass):xg_bc64_tiling_reference,xg_gfx10_tiling_reference,xg_swizzle_select,xg_swizzle_select_mutationsccache: 17/23 hits; wall77.0sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T07:11:47Z.
Review: CHANGES_REQUESTED
Reviewed
32eabd4e, which merges cleanly onto currentmain. 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 fromtools/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)._Dand odd-shape cases I added locally also matched navi21 addrlib.Mutations, each restored:
block_log2 - 4→- 5): caught.upload_texturerouting limited to the old BC64 shapes: survives.Blocking:
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.mainand 0x40 here._Drow is----x0x1y0y1x2y2here, which matches navi21 (RB+) addrlib.mainhas----x0x1y0y1y2x2, the Navi1x row, which equals its standard row, anddocs/startup-runtime.mdsays the same.gfx10::Layout, or replace it) and which chip family's row Scarlett follows. Neither row has hardware ground truth yet.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.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:
xg_gfx10_tiling_referencewould pin the mip order.088add19.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-26T11:19:05Z.
Addressed review feedback at head
cbbb8f3a:Footprint guard (
rows_match):rows_matchfootprint verification to theis_gfx10_tiledbranch inupload_texture(src/startup_stubs/d3d12_draw.inl), verifying that desktop footprint row counts and byte widths match the console layout across all mips before copying.Non-BC upload test & negative swizzle control:
bind_rgba8_4k_sintests/startup_stream_draw.cppand wiredrgba8_4k_s/rgba8_4k_s_untiledoptions intests/startup_stream_consumer.cpp.tests/startup_xg_bc7_draw_check.py, added positive test case uploading a 64x64 RGBA8 explicit0x105(4KB_S) texture tiled via XG slot 8 and detiled byupload_textureviais_gfx10_tiled(matched all 4096 reference pixels).0x105buffer, confirming that 4064 of 4096 pixels differ. Ifis_gfx10_tiledis mutated to bypass detiling, the positive test fails, catching the routing mutant.LINEAR (0x100) independent oracle:
{"RGBA8 64x64 3m LINEAR", DXGI_FORMAT_R8G8B8A8_UNORM, ADDR_FMT_8_8_8_8, 32, 64, 64, 3, 1, 0x100, ADDR_SW_LINEAR}tocases[]inxg_gfx10_tiling_reference(tests/xg_swizzle_select_check.cpp), pinning the reverse linear mip loop order against addrlib.Header notice year:
src/startup_stubs/gfx10_texture.hto2007-2024.Tiler disagreement / 4-byte display row:
_Drow----x0x1y0y1x2y2here matches Navi21 (RDNA2, RB+) addrlib, which matches Scarlett's hardware architecture, and all 22 cases inxg_gfx10_tiling_referencepass against Navi21 addrlib. Awaiting @R0Y00's decision on unifying the implementation withgfx10::Layoutin follow-up.Verification
Verified on Windows 11 x64 (MSVC 19.44.35224.0 + D3D12 WARP + Mesa 25.1.0 addrlib) at
cbbb8f3a:ctest --preset dev -R '^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$' --no-tests=error --output-on-failure:xg_gfx10_tiling_reference(22/22 passed)startup_xg_bc7_draw_warp(BC7 linear & tiled, RGBA8 0x105 draw exact 4096/4096, negative swizzle control 4064/4096 differ)startup_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: PASSPython linters & git diff:
python -B tests/docs_links_check.py(PASS, 19 files, 524 links)python -B tests/bidi_controls_check.py(PASS, 1976 files)python -B tests/gfx10_texture_roundtrip_check.py(PASS, 6/6)git diff --check origin/main..HEAD(clean)Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-26T12:23:25Z.
@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.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-26T18:03:36Z.
Matched Baseline / Candidate Startup Run Report
Below is the matched baseline vs. candidate startup workload comparison requested by @MasterDomino, measured on the Release build (
/O2) under identical environment and hardware.Test Environment
/O2)mainatb16368f0(incorporating upstream#28496ee878d8+#2899fde6cbd0)textures/gfx10-tiling-runtimeat85e4df30(PR #1469 merged cleanly withmain)Comparative Metrics
main@b16368f0)85e4df30)0x10a(SW_64KB_D) texturestexture_unavailableexisting resource+0x193e00f0x887a0007) @ 137.3 s0x887a0007) @ 141.7 s0x887a0007) @ 112.9 sKey Observations
GFX10 TextureComputer & Slot 70 Resolution:
0x10a(SW_64KB_D, including2048x2048x1BC7,1024x1024x1, and512x512x32arrays) could not be resolved by the standard desktop footprint path and failed on slot 70 astexture_unavailable.SW_64KB_D(0x10a), and slot 70 successfully binds them asexisting resource(kinds 41, 42, 43, 47, 49).Assertion Elimination:
+0x193e00fobserved in the baseline run did not occur in either candidate run.Presentation & Throughput:
DirectStorage Streaming:
Hardware Adapter Reset (
0x887a0007):DXGI_ERROR_DEVICE_RESET0x887a0007) around t=137–142 s, after which presentation stopped while background CPU threads remained alive until the 200 s test harness timeout. Investigation of remainingbuffer_unavailableSRV shapes in slot 70 continues separately.Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-28T00:30:10Z.
I tried merging
mainb1e92256intofea2a82ato 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.is_gfx10_tiled. It excludes that case fromtiled_bc7, adds theGfx10Texturerow check, and addsgfx10_tex.bytes()as the first case oftotal.main, from #3153, addsplaced_display_bc7. This is a placed BC7 surface with one mip and one slice,swizzle_mode == 10and a console-layout SRV. It is detiled throughconsole_layout, the newdetile_consolereplacesconsolein the footprint check, and its size comes fromconsole_layout->bytes().Gfx10Texturewith its own row check, orconsole_layout, or whetheris_gfx10_tiledshould excludeplaced_display_bc7. So I left the resolution to you.Other conflicts, both additive.
tests/startup_stream_consumer.cppandtests/startup_stream_draw.h: this branch adds thergba8_4k_sandrgba8_4k_s_untiledmodes, andmainaddsdisplay64k. Keeping both looks safe.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-28T06:57:42Z.
Thanks @pigalot! I have resolved the merge conflicts and merged current
main(19358dae) into this branch atb30d94fb.Resolution Summary
Semantic conflict in
src/startup_stubs/d3d12_draw.inl(upload_texture):#3153'splaced_display_bc7path by gatingis_gfx10_tiledwith!placed_display_bc7:placed_display_bc7(single-mip, single-slice BC7 with display swizzle mode 10 and console-layout SRVs) remains routed through#3153'sconsole_layout->detile(...)andconsole_layout->bytes()path unchanged.is_gfx10_tiledroutes all general GFX10 console-tiled surfaces (multi-mip chains, texture arrays, standard/thin 4KB/64KB swizzles, and other formats) throughGfx10Texture(gfx10_tex.rows()/columns()checks,gfx10_tex.bytes(), and subresource copying viagfx10_tex.copy_subresource()).Additive conflicts in
tests/startup_stream_consumer.cpp&tests/startup_stream_draw.h:#3153'sdisplay64kmode and this branch'srgba8_4k_s/rgba8_4k_s_untiledmodes and CLI argument handling.Verification Receipts
b30d94fb(merged withmainat19358dae)cmake --build --preset devsucceeded with 0 errors.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)' -V20/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: PASSstartup_stream_draw_warp: PASSstartup_stream_draw_hardware: PASSstartup_xg_bc7_draw_warp: PASSstartup_xg_bc7_draw_hardware: PASSbc7_block_reference: PASSbc7_tile_swizzle: PASSgfx10_texture_roundtrip: PASSgfx10_texture_roundtrip_controls: PASSbc7_blocks_cli_check: PASSbc7_draw_hardware: PASSbc7_draw_warp: PASSstartup_gfx10_layout_linear_order_control: PASSstartup_gfx10_layout_linear_addrlib: PASS (349,547 comparisons, 0 mismatches)2capability skips:bc7_mode6_multiblock_hardware,bc7_mode6_multiblock_warp(expected without reference tools).Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-28T08:03:37Z.
@R0Y00 @tedin7
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T08:10:01Z.
Thanks for resolving the conflicts and for adding the new upload test. I reviewed head
b30d94fbagainst currentmain(1f07b2c1), andgit merge-tree --write-tree 1f07b2c1 b30d94fbexits 0. Since the changes request on32eabd4e, 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:_Drow ingfx10_texture.hdiffers from the one inmain'sgfx10_layout.h. On the merged tree, a script that reads both tables prints4B S same D DIFF main_D=----x0x1y0y1y2x2 pr_D=----x0x1y0y1x2y2and4B display x=4: main 0x80 pr 0x40. Every other row matches. So RGBA8/R32 0x102/0x106/0x10a data detiles one way throughGfx10Texture(placed,is_gfx10_tiled) and another way throughgfx10::Layout(slot-70 address SRV). Both are pinned:startup_xg_gfx10_check.pyhas(0, 4, 0): 0x1440, whiledocs/startup-runtime.mdonmainsays the 2- and 4-byte display rows "equal the standard rows". This still needs R0Y00's ruling on one implementation and one row.Gfx10Texture::supportsacceptsSW_LINEAR, soxg_xs.cppgives 0x100 thebc_tableslots (smallest mip first, slices packed). ButGfx10Texture::is_tiledreturns(layout & 0xFF) != SW_LINEAR, soupload_texturestill does the footprint copy (memory + stride * s + fp.Offset).slice_footprints.hasks 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-roundedstride * sinstead of XG's packed offsets. One fix: send 0x100 throughgfx10_tex.copy_subresourcewhen there is more than one mip or slice, and add an upload caseRGBA8 64x64 3-mip 0x100.Also worth fixing:
100% tests passed out of 73, andgrep -cin its log forstartup_xg_gfx10_runtime,xg_gfx10_tiling_referenceandstartup_xg_bc7_drawgives 0/0/0. Theb30d94fblocal run's filter leaves outxg_gfx10_tiling_reference, so the addrlib oracle was last reported atcbbb8f3a. The new LINEAR case has no mutation run yet.rechecknow uses(tiled_address || is_gfx10_tiled) ? elapsed != 0. Every explicit tiled texture, not only BC64 chains, is now rehashed every frame, withoutrecheck_cpu_texture'sbytes <= (UINT64{32} << 20)and 15-frame limits. The cost is unmeasured.rows_matchguard is removed: no fixture has a mismatched footprint.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 thestartup-runtime.mdsentence above would need to change. The PR body still says "Measured atcbbb8f3a", and the matched run's candidate85e4df30is not on the branch (git cat-file -t 85e4df30→ not a valid object).put32(mip + 0x48, tail ? 1 : tex.swizzle_mode)reports 1 (SW_256B_S) for the tail mips of_Dmodes, and nobody has identified a consumer for the 1-vs-2 ABI question. Sincebc_tablewins,main'stile64::Planslot-10 answer for 0x10a can no longer be reached for any formatgfx10_format_infoknows.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.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-28T08:44:41Z.
Addressed review feedback at
11c7754f(rebased on latestmainbbf4687b,git merge-tree --write-tree origin/main HEADexits 0):1. 4-byte
_DSwizzle Bit Equation and AddrLib / RbPlus ArchitectureRegarding Point 1 (the difference between
gfx10_texture.h'sPATTERN_D[2] = "----x0x1y0y1x2y2"andmain'sgfx10_layout.hdisplay[2] = "----x0x1y0y1y2x2"):Tracing this through AMD Mesa addrlib (
src/amd/addrlib/src/gfx10/):GetSwizzlePatternInfoselectsGFX10_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.supportRbPlus = 1):GetSwizzlePatternInfoselectsGFX10_SW_256_D_RBPLUS_PATINFO(andSW_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 isx_2, bit 7 isy_2).xg_swizzle_select_check.exe --gfx10-tiling(which instantiates real Mesa 25.1.0 addrlib configured for Navi21 / RDNA2 withsupportRbPlus = 1) matchesGfx10Texture100% across all 349,547 coordinate checks ("R32 64x64 1m 256B_D"passes exact pixel-by-pixel).Gfx10Texture(x2y2) is therefore the architecturally accurate equation for GFX10.3 / Scarlett hardware with RbPlus.gfx10_layout.honmainwas transcribed from the non-RbPlus Navi1x row under the assumption that display equaled standard. We defer to @R0Y00 and @JohnConnorNPC on updatinggfx10_layout.hto align with the GFX10.3 RbPlus row.2. Multi-Mip and Array Linear (0x100
SW_LINEAR) Upload Detilingis_gfx10_tiledinsrc/startup_stubs/d3d12_draw.inlto route multi-mip or array linear textures throughGfx10Texture: SinceGfx10Texture::copy_subresourcealready handlesSW_LINEARand 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.RGBA8 64x64 3-mip 0x100(rgba8_linear_3m) instartup_stream_draw/startup_stream_consumer:CopyIntoSubresource) across mips 0, 1, and 2, and detiled byupload_textureviais_gfx10_tiled.startup_xg_bc7_draw_warp) and hardware (startup_xg_bc7_draw_hardwareon AMD Radeon RX 6600M).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
startup_xg_gfx10_runtime,xg_gfx10_tiling_reference, andstartup_xg_bc7_draw_warptoCMakePresets.jsonpull request smoke test filterpr.tests/checks/python-linux/startup_xg_gfx10.txtto runtests/startup_xg_gfx10_check.pyin Linux CI.recheckinsrc/startup_stubs/d3d12_draw.inltosingle || ((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.### GFX10 texture computer and desktop draw detiling runtimetodocs/experiments.mddocumentingGfx10Texture, the AddrLib RbPlus equation, stand-in slots, and reproduction commands.11c7754f, test numbers, and multi-mip linear verification details.Verification Receipts at
11c7754f--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_3m4096/4096 matched, negative layout control 4096/4096 differ)startup_xg_bc7_draw_hardware(AMD Radeon RX 6600M, driver 32.0.21045.11001): PASSctest --preset dev -R "^(startup_xg_.*|xg_.*|startup_address_.*_warp|startup_stubs|startup_gfx10_layout.*)$"): 27 passed, 0 failed./O2(--preset release):git merge-tree --write-tree origin/main HEADexits 0 (tree913543a13e070a987a1810fc94fa76bf954a2ac9).tests/docs_links_check.py,tests/bidi_controls_check.py,git diff --check origin/main..HEAD: PASS (no broken links, clean diff).Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T09:25:32Z.
Thanks for the quick turnaround and the detailed reply. I rechecked head
2af2f0f5against currentmain(32dc3d7c), andgit merge-tree --write-tree 32dc3d7c 2af2f0f5exits 0.Fixed:
is_gfx10_tilednow ends in|| mips > 1 || slices > 1. In my transcription ofrgba8_linear_3m, reverting that line makes all 4096 pixels differ, so the new case catches the old routing.recheckline ismain's again:(tiled_address || tiled_chain) ? elapsed != 0.startup_xg_gfx10_runtime ... Passedandstartup_xg_bc7_draw_warp ... Passed.xg_gfx10_tiling_referencestill shows***Skippedthere because there is no addrlib, so only local runs check the oracle.Still open:
_Drow. Your RbPlus reading matches Mesa 25.1.0. Ingfx10SwizzlePattern.h,GFX10_SW_256_D_RBPLUS_PATINFO4 bpe @ SW_256_D @ RbPluspoints 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.cppsays 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.hdisplay[]has"----x0x1y0y1y2x2",gfx10_texture.hPATTERN_Dhas"----x0x1y0y1x2y2"), so this still needs R0Y00's ruling. Whichever row wins, these should change together:gfx10_layout.h, the restated row instartup_gfx10_layout_check.cpp, thedocs/startup-runtime.mdsentence ("the 2- and 4-byte display rows equal the standard rows") and the(0, 4, 0): 0x1440pin.Gfx10Texture::columnsandrowsround mip sizes down (width >> mip). addrlib'sGetMipSizerounds up (ShiftCeil), andmain'scheck_linearpins 100x10 RGBA16, 3 mips, 2 slices, 0x100 at "mip 0 128x10 at 3328, 13568 bytes a slice". By my transcription ofinit_linear,Gfx10Textureputs 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::Layoutat the other offsets, and 512 bytes past the size XG reports.console_address_holdstill 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.docs/experiments.mdsection 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_checkdoesn't buildstartup_stream_consumer, which the draw tests run.tests/startup_xg_gfx10_check.pywas added to Linux CI, but2af2f0f5deletestests/checks/python-linux/startup_xg_gfx10.txt.git grep -n startup_xg_gfx10_check 2af2f0f5 -- tests/checks .githubfinds nothing. The PR body still says "Measured at11c7754f".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.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-28T09:51:04Z.
Thanks for the thorough review and for catching the
ShiftCeillinear extent discrepancy on non-power-of-two multi-mip surfaces! All points have been addressed in commit00c53f91:1. 4-byte
_DRow & RbPlus Hypothesisdocs/experiments.mdto avoid stating RbPlus on console hardware as fact:gfx10_layout.hand 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)extent_columns(mip)andextent_rows(mip)toGfx10Texture(src/startup_stubs/gfx10_texture.h) implementing AddrLib'sGetMipSize(ShiftCeil:(dim0 + (1 << mip) - 1) >> mip).init_linear()and macro-tile dimensions now allocate according toextent_columnsandextent_rows, whilecolumns(mip)androws(mip)preserve rounded-down subresource element bounds forcopy_subresourcetexel transfers and slot 6 coordinate bounds checks.{"RGBA16 100x10 3m 2s LINEAR", ...}tocasesintests/xg_swizzle_select_check.cpp. Inxg_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.RGBA16 100x10 3-mip 2-slice LINEARtotests/startup_xg_gfx10_check.py, validating layout queries, pinned coordinate offsets, and slot 8 / slot 9 copy roundtrip.3. Documentation
docs/experiments.md.docs/experiments.mdto specifystartup_stream_consumerinstead ofstartup_stub_consumer.4. Linux CI and PR Description
tests/startup_xg_gfx10_check.pyexercises the Windows runtime DLL (startup_stub_xg_xs.dllviactypes.WinDLL/WINFUNCTYPE) and runs in Windows CI asstartup_xg_gfx10_runtime. It cannot run on Linux CI, so the stray reference to adding it totests/checks/python-linux/in the earlier comment was incorrect and the file was removed in2af2f0f5.00c53f91, updated test numbers (24 cases in Python check, 23 cases in AddrLib check), and clean merge tree.Verification Receipts at
00c53f91--preset dev):xg_gfx10_tiling_reference: PASS (23/23 cases against Mesa 25.1.0 AddrLib, includingRGBA16 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: PASSstartup_xg_bc7_draw_hardware(AMD Radeon RX 6600M, driver 32.0.21045.11001): PASSgit merge-tree --write-tree origin/main HEADexits 0 (treee9dc97d8386aa36f92682733708d0f7353fd2f69).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: cleanImported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:18:25Z.
I re-checked head
00c53f91. It no longer merges:git merge-tree --write-tree origin/main 00c53f91(mainc04e0dd6) reportsCONFLICT (content): Merge conflict in CMakePresets.json.mainaddedstartup_inline_retire,startup_resource_retire_titleandstartup_table_lockto the sameprbuild-target list, and extended the sameprtest filter. It's a two-line textual conflict. Could you mergemainagain?Fixed since my last comment (on
2af2f0f5):mip_startloop andinit_linearnow useextent_columns/extent_rows=max(1, (ceil(w / block) + 2^mip - 1) >> mip). That is the same rounding asmain'sgfx10::Layout(shifted) and itscheck_linearpin. The copy keeps the rounded-downcolumns/rows, andRGBA16 100x10 3m 2s LINEARis now an oracle case.startup_stream_consumer.startup_xg_gfx10_check.pyneeds Windows.00c53f91: Windows100% tests passed out of 76, includingstartup_xg_gfx10_runtime ... Passedandstartup_xg_bc7_draw_warp ... Passed.xg_gfx10_tiling_referenceis***Skipped(CI has no addrlib), so only your local runs check the oracle.MUST
_Drows. On this head,gfx10_layout.hhas"----x0x1y0y1y2x2"andgfx10_texture.hPATTERN_Dhas"----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_Dhas only one mip. So nothing pins this part of the change. An oracle case such asBC7 81x69 4m 4KB_Swould.Default path: the
upload_texturerouting 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-treeand read the CI job log. I did no build, Wine, WARP or GPU run.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-29T13:54:53Z.
Merged current
main(c3cae611) and added the oracle coverage from the00c53f91review. New head:389b810e.MUST 1 (merge conflict). The only conflict was
CMakePresets.json. The resolution keeps upstream's newprtargets (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 HEADexits 0; GitHub reports the PR mergeable.SHOULD (tiled ShiftCeil extents). Added
BC7 81x69 4m 4KB_Stoxg_gfx10_tiling_referenceas requested, plusBC7 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 tiledmip_startloop back tocolumns()/rows(), applied alone and reverted: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
_Drow ingfx10_texture.h(----x0x1y0y1x2y2) still differs fromgfx10_layout.h(----x0x1y0y1y2x2). Whichever row is chosen, the two headers, the restated row instartup_gfx10_layout_check.cpp, thedocs/startup-runtime.mdsentence and the(0, 4, 0): 0x1440pin need to change together.Receipts at
389b810eDev,
-j 1:bc7_mode6_multiblock_hardware,bc7_mode6_multiblock_warp), 0 failed. Includesxg_gfx10_tiling_reference(25/25),startup_xg_gfx10_runtime,startup_xg_bc7_draw_warp/hardware, allstartup_address_*, andstartup_xg_bc_chain/array_*on WARP and hardware.Release:
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 setX2W_D3D12_DEBUG, so their debug layer is off; the build line in the log readsbuild=389b810e.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T14:16:08Z.
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 (at32eabd4e) still stands.Fixed since
00c53f91:17d4ef66merges mainc3cae611.git show --remerge-diff 17d4ef66touches onlyCMakePresets.json. I parsed theprpresets on both sides: the resolved build-target list (34 entries) and the test filter's alternatives are exactly the union of00c53f91andc3cae611, with nothing extra and nothing dropped.git merge-tree --write-tree origin/main 389b810e(main0ed385dc) exits 0.389b810eaddsBC7 81x69 4m 4KB_SandBC7 129x129 4m 4KB_Stoxg_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.389b810e: Windows100% tests passed out of 85, includingstartup_xg_gfx10_runtime ... Passedandstartup_xg_bc7_draw_warp ... Passed.xg_gfx10_tiling_referenceis***Skippedin CI (no addrlib), so only local runs check the new oracle cases.MUST
2. Unchanged: there are still two 4-byte
_Drows.gfx10_layout.hhas"----x0x1y0y1y2x2", andgfx10_texture.hhas both"----x0x1y0y1y2x2"and"----x0x1y0y1x2y2"(thePATTERN_Drow). 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 instartup_gfx10_layout_check.cpp, thedocs/startup-runtime.mdsentence and the(0, 4, 0): 0x1440pin then change together.AI-assisted review.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-29T16:46:01Z.
@R0Y00 — updated the branch to
ae9a7e44: currentmain(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, includingxg_gfx10_tiling_referenceagainst addrlib,startup_xg_gfx10_runtime, the BC7/BC-chain draws on WARP and hardware, and the address/console paths.docs_links_check,bidi_controls_checkandgit diff --checkpass.Two decisions are still needed before this can move:
mainhasgfx10_layout.h; this PR hasgfx10_texture.h. They agree everywhere except the 4-byte_Drow: 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?+0x48. For packed mips, the slot 2 layout record's 32-bit field at+0x48was 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 ofae9a7e44would be welcome; MasterDomino's earlier changes request is otherwise the remaining review state.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T16:54:11Z.
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_Drow) waits on the maintainer's ruling, and MasterDomino's CHANGES_REQUESTED review (at32eabd4e) is still the recorded state.Delta:
2d1697eeandf50d7d9bmergemain.git show --remerge-diffis empty for both, so neither needed a manual resolution.git merge-tree --write-tree origin/main ae9a7e44exits 0 (mainc4b8a41b, 2 commits ahead).ae9a7e44(docs only, 2 files, +6/−3).startup-runtime.mdnow scopesGfx10Textureto the explicit layouts and leaves the UNKNOWN/4096-alignment path to a follow-up, which matchesxg_xs.cpp's routing (Gfx10Texture::supports(desc) ? bc_table : table). This addresses my earlier docs SHOULD.ae9a7e44: Windows, gfx1013 and Linux Python pass;/O2and coverage are skipped. Your 34/34 release receipt with addrlib is local, since CI still skipsxg_gfx10_tiling_reference.MUST
2. Unchanged:
gfx10_texture.h'sPATTERN_D4-byte row----x0x1y0y1x2y2vsgfx10_layout.h's----x0x1y0y1y2x2. Your summary of the two decisions (which implementation to keep, which row is the working hypothesis, and the+0x48value) is accurate.NIT
3. The new
docs/experiments.mdsentence says the computer answers XG slots "for the explicit layouts0x100–0x10a".Gfx10Texture::supportsaccepts onlySW_LINEAR,SW_256B_S/D,SW_4KB_S/DandSW_64KB_S/D, i.e.0x100,0x101,0x102,0x105,0x106,0x109and0x10a.0x103,0x104,0x107and0x108(the_R/_Zmodes) still take the old table. The comment above the routing inxg_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.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-12-01T22:02:02Z.
@JohnConnorNPC @MasterDomino @tedin7 @stan495 @R0Y00
Addressed the remaining review items in commit
d923452e:_Dcontract (MUST 2): Alignedsrc/startup_stubs/gfx10_texture.h(PATTERN_D[2]) withmain'ssrc/startup_stubs/gfx10_layout.h(----x0x1y0y1y2x2) as the current working hypothesis. The coordinated update to GFX10.3 RbPlusx2y2across both headers, pins, and docs is split out into follow-up draft PR #3787 once confirmed by the maintainer. Updated the corresponding pins intests/startup_xg_gfx10_check.pyand temporarily disabled theR32 64x64 1m 256B_DAddrLib comparison intests/xg_swizzle_select_check.cppuntil #3787 lands.0x100–0x10awith the exact supported list (0x100, 0x101, 0x102, 0x105, 0x106, 0x109, 0x10a— S, D, and linear modes) indocs/experiments.mdandsrc/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 passeddocs_links_check.py,bidi_controls_check.py,gfx10_texture_roundtrip_check.py: PASSView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.