Repository navigation
Recompiler: image_get_resinfo gives depth 0 for 1D, 2D and 2D MSAA - #2054
Conversation
A DIM without layers reported depth 1: DIM 1D and 2D on both paths, and the direct translator's 2D MSAA query. RDNA2 reports 0 there: AnyPS5's measurements (gfx1031 #7550: the third component is 0 for every DIM without layers; gfx1036: a 2D MSAA T# under DIM 1D, 2D and 2D_MSAA gives (width, height, 0, 1)). The tests that encoded depth 1 now expect 0, and a test of DIM 2D on a 4-sample T# is added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Intel Arc A770 compatibility check for PR #2054 at Tested
$testExe = 'L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
$common = @(
'gpu::recomp::tests::gpu_image_get_resinfo_dim_2d_of_an_msaa_tsharp',
'gpu::recomp::tests::gpu_images_sample_load_store_atomic'
)
$expectedTests = $common + @(
'gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads',
'gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16'
)
& 'L:/XclTooling/Invoke-ArcTest.ps1' -WaitMinutes 60 -Test {
$env:XCL_DIRECT_DXIL = '0'
& $testExe @common --exact --nocapture --test-threads=1
$hlslExit = $LASTEXITCODE
$env:XCL_DIRECT_DXIL = '1'
& $testExe @expectedTests --exact --nocapture --test-threads=1
$directExit = $LASTEXITCODE
$global:LASTEXITCODE = if ($hlslExit -ne 0) { $hlslExit } else { $directExit }
}
Not tested DIM 1D, the separate DIM 4 array case from #2046, the AI use T3 Code / Codex ( |
|
A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, a different compiler from a native-Windows run: this PR's new test passes. Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Heads up: this PR's new tsharp test fails deterministically on RDNA3 under Linux/Wine, but not on the depth field the PR fixes. The mip count is what differs. Rig: RX 7900 XT (RDNA3, RADV NAVI31, Mesa 26.2.5), Proton Experimental (wine-11.0) + the xcl-pinned vkd3d-proton 3.1 build, DXC 1.9.2609.5, release build, tree main
Notes:
The PR's other new resinfo/MSAA tests all pass here: Counts only, no game data. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
DIM 1D and 2D queries declared a Texture1D / Texture2D handle over the multisampled view an MSAA T# (TYPE 14 / 15) binds, so the level count was the host's: 1 on native D3D12, 3 for 4 samples on RADV through vkd3d-proton (log2(samples) + 1), which failed gpu_image_get_resinfo_dim_2d_of_an_msaa_tsharp on an RX 7900 XT. Both paths now branch on the T#'s TYPE and query an MSAA T# through Texture2DMS / Texture2DMSArray, giving (width, height, 0, 1), as RDNA2 does (AnyPS5 docs/dev/debt/shader.md, gfx1036: DIM 1D, 2D and 2D_MSAA on 2D MSAA and MSAA-array T#s). DIM 1D now reports the height there too. The test covers DIM 1D and 2D on a 4-sample T# and a 4-sample array T#. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, this was a real bug, not a host difference in the test. A DIM 2D
AI-assisted (Claude Code). |
RDNA2 returns (0, 0, 0, levels) for a mip at or past the level count (AnyPS5#22724, gfx1036). D3D12 GetDimensions zeroes the sizes past the view's levels, so only the channels a translator fills in itself can differ: 2D's depth was 1 on both paths before this PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9fb040d to
a334936
Compare
|
Regression run of Against the limits in CONTRIBUTING.md: 104 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
|
Re-run done on the 7900 XT against head Rig and stack unchanged from the failing run: RX 7900 XT (RDNA3, RADV NAVI31, Mesa 26.2.5), Proton Experimental (wine-11.0) + the xcl-pinned vkd3d-proton 3.1 build, DXC 1.9.2609.5, release build, tree resinfo set by mode:
So the mip count now comes back 1 on this stack too, which fits your reading that RADV was deriving the level count from the Counts only, no game data. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Cause: AMD's D3D12 driver answers Fix (local branch, not pushed): both translators zero the sizes themselves when Tested on the fix (5478c4a + 1 commit):
Not tested: retail title / AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this comment. |
|
@Diskuss Thanks. That reading of the AMD driver matches what the test was written to catch: the SM4/5 |
image_get_resinforeported a depth (third component) of 1 for a DIM without layers: DIM 1D and 2D on both paths, and the direct translator's 2D MSAA query. RDNA2 reports 0 there. The sources are boykopovar/AnyPS5's measurements, recorded in theirdocs/dev/debt/shader.md:(width, height, 0, 1)under DIM 1D, 2D and 2D_MSAA, in wave32 and wave64 (AnyPS5 #25723).What is in it
recomp/emit.rs: DIM 1D and 2D set{t}_d = 0uinstead of1u.dxil/lower_image.rs: the same for DIM 1D and 2D, and the 2D MSAA query's depth is 0 (the MSAA array keeps its slice count).Tests: the three assertions that encoded depth 1 now expect the measured 0:
gpu_images_sample_load_store_atomic(2D), and inmsaa_tests.rs,gpu_direct_msaa_image_loads(2D MSAA) andgpu_direct_image_get_resinfo_d16. A newgpu_image_get_resinfo_dim_2d_of_an_msaa_tsharpcovers DIM 2D on a 4-sample T#. Onmainit gives[4, 2, 1, 1]on both paths.a334936: DIM 1D / 2Dimage_get_resinfoon an MSAA T# (TYPE 14 / 15) is queried throughTexture2DMS/Texture2DMSArray, giving(w, h, 0, 1)on every host. ATexture2Dhandle on the multisampled view left the level count to the host (RADV gave 3; reported by SlopTart). The test also covers DIM 1D and a 4-sample array T#.9fb040d: a newgpu_image_get_resinfo_past_last_levelqueries single-level 2D, 2D array, 3D and cube T#s at mips 0, 1, 2, 15 and 0xffffffff. Past the last level, RDNA2 gives(0, 0, 0, levels)(AnyPS5#22724, measured on gfx1036). D3D12 zeroes the sizes there too, so only the channels a translator fills in itself can differ. The 1D array case is left to Direct DXIL: image_get_resinfo of a 1D array gives the layers in y #2046, which fixes its direct-path query.Tested
9fb040d, AMD Radeon RX 7900 XT (RDNA3, RADV / Mesa 26.2.5 under Proton with the pinned vkd3d-proton 3.1), run by SlopTart (comment): theresinfoGPU tests give 5 passed, 0 failed by default and 4 passed, 0 failed withXCL_SPLIT_WAVE64=1. WithXCL_DIRECT_DXIL=1(with or without split wave64) the only failure isgpu_image_get_resinfo_1d_array(Direct DXIL: image_get_resinfo of a 1D array gives the layers in y #2046).gpu_image_get_resinfo_dim_2d_of_an_msaa_tsharpnow gives 1 level there too, where it gave 3 beforea334936.9fb040d, RTX 3070 (616.56): the new test passes withXCL_DIRECT_DXIL=0and1. With this PR'semit.rsandlower_image.rsreverted to the base, it fails on both paths (2D at mip 1:[0, 0, 1, 1]). TheresinfoGPU tests: 3 passed withXCL_DIRECT_DXIL=0; with1, 2 passed and 1 failed,gpu_image_get_resinfo_1d_array(Direct DXIL: image_get_resinfo of a 1D array gives the layers in y #2046).a334936, RTX 3070 (616.56):gpu_suite 133 passed withXCL_DIRECT_DXIL=0; with1, 132 passed and 1 failed:gpu_image_get_resinfo_1d_array, which fails onmaintoo (Direct DXIL: image_get_resinfo of a 1D array gives the layers in y #2046);dxil::units 123 passed. CI Build and test: passing. Not tested on AMD at this head.main5ce558f:gpu_tests (--skip gpu_sparse_vram): 133 passed withXCL_DIRECT_DXIL=0; with1, 132 passed and 1 failed,gpu_image_get_resinfo_1d_array, which fails the same way onmain(Direct DXIL: image_get_resinfo of a 1D array gives the layers in y #2046 fixes it; the two PRs merge cleanly).dxil::,resinfoandmsaaunits: 140 passed.Regression run
Run by Toons29 on an AMD Radeon RX 9070 (comment),
mainand this head, pasted unedited:Not tested
AI use
🤖 Generated with Claude Code