Desc: audit GFX10 to DXGI format mappings, depth SRVs, and byte sizing #1432
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1432
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@slopgobblercobbler on GitHub · 2026-11-24 15:54 UTC · original
slopgobblercobbler:fix/desc-format-audit→main· +84 −11 · 1 files · 1 commits · openSummary
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
@CuteBooty on GitHub · 2026-11-24 16:21 UTC · original
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.
@LocranKing on GitHub · 2026-11-24 16:55 UTC · original
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.@futurepro62 on GitHub · 2026-11-24 17:18 UTC · original
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
@DavidM1911 on GitHub · 2026-11-24 18:52 UTC · original
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!
@ -668,0 +737,4 @@1..=6 | 128 | 137..=139 => 1,7..=19 | 129 | 131 | 133..=136 => 2,20..=61 | 130 | 132 | 140..=144 | 147..=154 => 4,62..=71 | 145..=146 | 169 | 170 | 175 | 176 => 8,@gut0to on GitHub · 2026-11-24 19:01 UTC · original
These 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.
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.