Desc: audit GFX10 to DXGI format mappings, depth SRVs, and byte sizing #1422
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1432"
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 ivall/xcl. Originally posted by slopgobblercobbler on 2026-11-24T15:54:14Z.
Summary
Audits and completes GFX10 resource descriptor format mappings, depth SRV views, and format byte sizing in
crates/xcl/src/gpu/desc.rs:dxgi_format):GFX10_FORMAT_8_24_UNORM->DXGI_FORMAT_R24_UNORM_X8_TYPELESS) and 146 (GFX10_FORMAT_X24_8_32_FLOAT->DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS).gfx10_format):DXGI_FORMAT_B8G8R8A8_UNORM/B8G8R8X8_UNORM-> 56 (8_8_8_8_UNORM) andB8G8R8A8_UNORM_SRGB/B8G8R8X8_UNORM_SRGB-> 130 (8_8_8_8_SRGB).D32_FLOAT-> 22,D16_UNORM-> 7,D24_UNORM_S8_UINT-> 141,D32_FLOAT_S8X24_UINT-> 146).format_bytes):gfx10_format_mappings_and_bit_depths_auditand expandedpacked_formats_reorder_channels.Changes
crates/xcl/src/gpu/desc.rs:dxgi_format: depth SRV typeless mappings.gfx10_format: swapchain BGRA and depth reverse lookups.format_bytes: comprehensive byte sizing for GFX10 formats >= 128.Tested
cargo test -p xcl -- desc: 21 passed, 0 failed (100% pass rate).Not Tested
AI Use
Co-Authored-By: Claude Code (Claude Opus 5.5) / Gemini Antigravity
Imported from ivall/xcl. Originally posted by CuteBooty on 2026-11-24T16:21:13Z.
d4381e2: with the newformat_bytes,real::texture_memoryfinds no memory for some large BC textures, and theirGetGPUVirtualAddresswould be 0 again.texture_memorytakesformat_bytesas bytes per texel (Width * Height * DepthOrArraySize * bits / 8 * 4 / 3).format_bytesnow gives BC formats their bytes per 4x4 block, so a BC7 / BC2 / BC3 / BC5 / BC6H texture is counted 16 times too large (BC1 / BC4 too), where the base counted 4 bytes per texel. Past 1 GiB the function returnsNone.Seen (one mip,
texture_memorycalled directly on reserved textures of these shapes):930e8b4d4381e2It matters for a texture the title did not place itself and whose address XCL has not recorded (a committed one): the function's comment names a title that wrote at address 0 that way. The memory is only reserved, so the larger size costs address space until the cap is hit.
Possible fix: in
texture_memory, divide by the block's 16 texels for the BC formats (169 to 182), with a test of the size. The other callers offormat_bytesinreal.rs(buffer_view,buffer_words_at) are for buffers.Also, #1165 (open) changes the 133 to 136 rows of
format_bytes.Tested: one scratch test on both commits; RTX 3070, NVIDIA 621.24, Windows 11 Pro 26200, rustc 1.100.0 MSVC, debug.
Not tested: the call through
GetGPUVirtualAddress, the whole suite, a retail title, whether any title asks for the address of a BC texture this large.AI use: Claude Code (Claude Opus 5.5) found this, ran the test and wrote the comment; Codex (GPT-6.2 Astra) checked it by reading the code, without running anything.
Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-24T16:55:24Z.
Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32), including a 60 s retail regression smoke run on clean head
d4381e2c0df5e6527851309b2e1d00ea7a91c1e1.No crash or device removal occurred during the 60 s menu smoke run (matching
@CuteBooty's note that oversized BC textures triggering thereal::texture_memoryformat_bytesmismatch were not hit in this window).Tested
d4381e2c0df5e6527851309b2e1d00ea7a91c1e1(clean tree, merge-base930e8b4)8024 MiB VRAM, driver32.0.16.2101),rustc 1.100.0(x86_64-pc-windows-msvc, MSVC14.44.35207), DXC1.9.2602.17(SDK10.0.26100.0),--releasecargo build --release --workspace: ok (exit 0)cargo test --workspace --release --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignored, exit0SKIPPED(no wave64):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardwareRegression run
mainbaseline (b7aa9f3bd212088e0d927439284dc5ed325ce3c7):PR head (
d4381e2c0df5e6527851309b2e1d00ea7a91c1e1):Not tested: debug build,
XCL_SAMPLE_*tests on this branch, AMD / wave64 hardware, interactive world loading with committed textures large enough to hittexture_memory's 1 GiB cap.AI use: Antigravity (
Gemini 4 Hydrogen) ran the build, tests, and smoke runs and drafted this report from the command outputs.Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T17:18:16Z.
An AMD run to go with the reports above, which are NVIDIA. Tested exact head
d4381e2(on its base930e8b4).Tested
XCL_ADAPTER=radeon cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, nothing skipped.gfx10_format_mappings_and_bit_depths_auditran and passed.XCL_REQUIRE_GPU=mesh: 752 passed, 0 failed (the usual two wave64-only skips).texture_memorycase @CuteBooty describes above, so this run neither confirms nor rules it out.Not tested
AI use
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T18:58:52Z.
Review: COMMENTED
CONTRIBUTING.md requires paired real-title
scripts/smoke.ps1runs for changes undercrates/xcl/src, withmainand this head tested on the same title and for the same duration. The current description does not include those regression blocks. Please add both smoke results before merge; if the title does not reach the format-mapping path, document that under Not tested. AI-assisted review; I checked the diff scope and description against the guide.Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T19:01:21Z.
Review: COMMENTED
AI-assisted review; I traced format_bytes into the texture-size calculation.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:52:22Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T19:01:21Z.
Code review location:
crates/xcl/src/gpu/desc.rs; line 740These BC values are bytes per 4×4 block, not bytes per texel, but real.rs uses format_bytes() directly with width × height × depth to estimate texture bytes and has no block rounding. For BC1, 8 bytes/block is 0.5 bytes/texel; returning 8 overestimates by 16×. BC2–BC7 similarly return 16 where the texel average is 1 byte. Large valid compressed textures can therefore exceed the 1 GiB guard and be rejected. Could block dimensions be handled at the sizing call site so this helper keeps consistent units? AI-assisted review; I verified the caller and arithmetic.
upstream-sync referenced this pull request2026-11-25 06:04:27 +00:00
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-27T21:26:29Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:43:59Z.
Triage (#1607) – head
d4381e2The format_bytes change for the packed formats (133..=136 -> 2, 130/132 -> 4) is the same as #1165, which was opened first and does only that; this PR also adds 141/146 depth SRV formats in dxgi_format, explicit reverse mappings in gfx10_format (BGRA/BGRX -> 56/130, D32/D16/D24S8/D32S8) and sizes for the other 128+ formats.
format_bytes now returns 8/16 for BC1-BC7, i.e. bytes per 4x4 block, but real.rs (title_address of a texture) multiplies format_bytes by the texel count, so a BC7 texture is now reserved at 128 bits per texel (previously 32 through the default arm); an 8192x8192 BC7 texture goes over the 1 GiB cap there and no longer gets a title address. Either keep BC at the old value or make that caller block-aware.
gfx10_format(B8G8R8A8_UNORM) -> 56 gives a BGRA view the RGBA8 code in its T#; that is fine for the image class but worth a sentence in the description.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View 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.