Repository navigation
D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them - #470
Abdellah-Khanani wants to merge 2 commits into
Conversation
… addresses them On AMD's RDNA1 Windows driver (RX 5700 XT, 32.0.21045.29003) the packed mips of a reserved title texture with standard mips stayed unmapped and read zero. A 64x64x64 RGBA8 texture with 4 mips has 19 tiles there: mip 0 16, mip 1 2, and mips 2-3 packed into one tile (NumStandardMips 2, start 18). After the single run over the overall tiles from subresource 0 in Pages::map, mip 2 read back all zero. The packed block is now mapped again with the first packed mip as the subresource and the tile within the block as X, to the same tiles map chose. Only for a 3D texture or a 2D texture without an array (an array keeps a packed block per slice, not measured), and only when it has standard and packed mips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ved cube a6f5f7a skipped placed_title_textures_share_vram_and_preserve_pixels whole on an adapter that refuses the reserved 256x256x6 cube with 9 mips, because the cube's same-address reuse step then expected shared pages it never got. That also hid the unmapped packed mips of the 3D texture on AMD's RDNA1 driver. The reuse step now runs only when the first cube was reserved (a committed cube has no tiles to reuse); the rest of the test runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent RDNA2 validation — AMD Radeon RX 6800 Confirmed that the packed-mip issue also affects RDNA2. Environment:
Results: Revision | Passed | Failed -- | -- | -- Main (2997c9a) | 0 | 2 PR #470 (3896e4f) | 4 | 0Main fails with: The PR passes the complete For the final A/B run, I temporarily instrumented the test to print and assert the actual DXGI adapter, since it uses Both runs confirmed The diagnostic source changes were restored afterward. No retail game data was used. This confirms the fix on RDNA2 in addition to the author's RDNA1 results. AI use: ChatGPT (GPT-6.2) assisted with investigation, test planning and report preparation. All GPU tests were executed on my local hardware. |
|
Test run of Tested
So on RDNA4, where Review of the change: Not tested: no retail title or regression run (I have no unpacked game), no Run and report by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Independent two-adapter validation of Tested
Not tested AI use |
|
Tested RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed), rustc 1.100.0 MSVC, debug, Pass: 680 passed, 0 failed, 41 ignored. SKIPPED: only the 2
Run and written with Claude Code (Claude Opus 5.5). |
|
Fixes the 3D packed-mip failure on RDNA2 too: RX 6700S (Navi 22, driver 32.0.21045.29003), Windows 11 26200, debug,
Not tested: smoke.ps1 / retail title. Claude Code (Claude Opus 5.5) ran the tests and wrote this. |
On AMD's RDNA1 Windows driver, the packed mips of a reserved title texture with standard mips stay unmapped, so they read zero. Measured on an RX 5700 XT with the 64x64x64 RGBA8, 4-mip 3D texture of
placed_title_textures_share_vram_and_preserve_pixels:GetResourceTilinggives 19 tiles: mip 0 has 16 (start 0), mip 1 has 2 (start 16), and mips 2-3 are packed into 1 tile (NumStandardMips2, start 18). AfterPages::map's single run over the 19 overall tiles from subresource 0, mip 2 reads back all zero (3D 64x64x64 4 mips: subresource 2 mismatch). Mapping the packed block a second time, with the first packed mip as the subresource and the tile in the block as X (how D3D12 addresses packed mips), fixes it.That test has been SKIPPED on this adapter since a6f5f7a, because the driver refuses the reserved 256x256x6 cube too. This PR lets the test run there: only the cube's same-address reuse step is left out when the cube is committed, so it catches this bug.
What is in it
D3D12.X: map the packed mips of a one-slice title texture where D3D12 addresses them:Pages::map_packed_mipsincrates/xcl/src/hle/d3d12x/vram.rs, called aftermapinbind. Only for a 3D texture or a 2D texture without an array (an array keeps a packed block per slice; not measured here), and only when it has both standard and packed mips. It maps the same tilesmapchose, so on a driver where the run already reached them nothing changes.Tests: the title textures test runs on an adapter that makes no reserved cube:crates/xcl/src/hle/d3d12x/title_textures.rs. The whole-test skip from a6f5f7a is removed. The cubemap's same-address reuse check runs only when the first cube was reserved (a committed cube has no tiles to reuse); the existing tolerance for a committed cube stays as it was.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4onmain2997c9a + this PR: 675 passed, 1 failed, 41 ignored. The failure isgpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction, which also fails onmainon this adapter and is unrelated (the driver does not fusemad; reported separately).SKIPPED gpu::recomp::tests::gpu_geometry_mode_es_gs_strip: no mesh shaders,SKIPPED gpu::recomp::tests::gpu_mesh_mode_two_passes: no mesh shaders.placed_title_textures_share_vram_and_preserve_pixelswith the test change but without thevram.rschange: fails (3D 64x64x64 4 mips: subresource 2 mismatch). With both changes: passes.Regression run
scripts/smoke.ps1on, so this PR is a draft until someone with a title can run it, or the maintainer's batch run covers it.Not tested
AI use
GetResourceTilinglog, wrote both changes and this description, and ran the tests above on my machine. I reviewed the diff.🤖 Generated with Claude Code