Repository navigation
fix(shader): answer image_get_resinfo on 2D MSAA T#s under DIM 2D - #25723
Conversation
RuntimeImageModes offers the multisampled view a query-only 2D image needs, as boykopovar#19682 did for DIM 1D, so DIM 2D now answers (width, height, 0, 1) instead of throwing. A query-only slot also accepts a 16-fragment T#, which every other access still refuses as an invalid descriptor, and DescribeSurface models a 16-fragment multisampled colour footprint so that query can be bound where the device samples colour attachments at 16 samples. A 2D MSAA-array T# keeps throwing: the driver binds no type-15 texture, and MultisampleTarget requires single-layer targets.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the focused code review supports merging, though I did not run the checks described in the PR body.
What I ran
Reviewed head 4ff7964af977cf94da9ef94c78f52ae5a0989ce4 using repo_read.py to inspect the prepared diff and relevant source. No build or test commands were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | Reviewed three changed code paths |
| Build and tests | not run | PR body reports author-run checks |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded because it was too large for the review folder; its changed hunks were visible in the diff, but surrounding test context was not read. I did not run builds, tests, mutation controls, convention checks, or debt checks. Hardware behavior and the author-reported RDNA2 measurements were not independently verified. core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp, core/libs/prx/libSceAgcDriver/tests/execution/ImageResinfoDimension.cpp, core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp, and docs/dev/debt/changes/fix-shader-resinfo-msaa-remainder.md were read; the only excluded changed file was core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp.
To get this to a good state
Nothing is required.
|
NVIDIA and lavapipe run on Linux: Setup: RTX 3070 8 GB, NVIDIA 610.57.04, Ryzen 5 5600X, Debian 13 (kernel 6.12.115), GCC 13.3.0 Release, validation layer 1.4.335. Base is the merge-base b7d463d, head is 4ff7964.
Every Vulkan test's log selects the requested device and shows the layer inserted, none reports it missing, and no log has a AI-assisted: yes |
|
Windows AMD run of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, AMD Radeon RX 6700 XT, driver 32.0.21045.29003.
AI-assisted: yes. |
|
A Windows + NVIDIA run of the current head 4ff7964. The focused tests pass and the control behaves as described, but three existing tests fail with this PR and pass on main, every time, also when run one at a time. System: Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 4060 (10de:2882, Ada), driver 621.01, Intel Core i5-12400F, WinLibs GCC 15.2.0 r7 (UCRT), Release, Trees: main 2cf8308; main + 4ff7964 ( Focused set,
Regressions. In
No AI-assisted: yes (Claude Code). It merged the PR, ran the builds, the test sets and the serial reruns, and drafted and posted this comment. |
GPU test run: ❌ 3 tests fail with this PR and pass without it (Windows / NVIDIA)Basis: built and ran · this PR's head Failing tests:
All runs were on an idle card (no other GPU work), so the failures are not load-induced. The parent-commit runs point at this PR's own commit ( Output on this PR's head
Checked
AI-assisted test run (Claude Code) · head |
|
@4le22io @throny Thank you both. You were right, and the reports were precise. Head
On llvmpipe all three pass, along with @Doorriiaann @JJenkx The 16-fragment leg is gone from |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reviewed change at abe0f2dab3e37ac9c33b827c8a3b32d214c5ec08 adds a query-only 2D MSAA runtime view while retaining the descriptor validation that rejects 16-fragment descriptors; no blocking defects were found in the inspected code.
What I ran
No build or tests were run by this review. I read the prepared description, commits, manifest and diff, then inspected the changed runtime-mode logic, its descriptor validation, and changed test context at the pinned head.
Results
| Check | Result | Note |
|---|---|---|
| Changed behavior and descriptor validation | passed | Inspected relevant code and tests |
| Build or tests run by review | not run | Author-reported runs are not review runs |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not read the full ShaderMemory.cpp (excluded from the prepared review folder because it was too large); I inspected only the changed section through the repository reader. I did not independently run the reported test matrix or verify console behavior. The other changed files listed in the manifest were read.
To get this to a good state
Nothing is required.
GPU re-run: ✅ fixed at
|
|
Confirmed on the RTX 4060 as well. At abe0f2d, the three regressions from my earlier run are fixed. Run on Windows 11 + RTX 4060 (Ada, driver 621.01), WinLibs GCC 15.2.0 r7, Release, with
This PR doesn't touch AI-assisted: yes (Claude Code). It merged the PR, ran the builds and the test sets, and drafted and posted this comment. |
|
GPU run on RDNA4 (gfx1201) with the AMD Windows driver and the validation layer: the change looks correct. On What this run adds. Five runs already exist:
Mine adds the following:
Code. The production change is one condition in Finding (non-blocking). The debt fragment still contains " Evidence. The rule comes from the author's hardware-oracle measurement on RDNA2 gfx1036 (#18467), not on the PS5's gfx1013, and there is no console measurement. The GPU runs, including this one, are self-consistency: the test checks that the recompiler's Vulkan query returns the Negative control. On
Both fail with GPU. Head
Each of the three execution tests selected Validation. Each log has Host:
AI-assisted: yes |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
What
image_get_resinfoanswers a query on a 2D MSAA T# (TYPE 14) with 2, 4 or 8 fragments under DIM 2D, as RDNA2 does. Onmainit throws: a query-only 2D image is offered no multisampled runtime mode, so DIM 2D on a 2D MSAA T# dies with
image descriptor is incompatible with the static runtime image interface: … decodes to {class 1, dim 6, …}.RuntimeImageModesnow offers the multisampled 2D view to a query-only 2D image, exactly as #19682 did for DIM 1D and DIM 2D_MSAA,so DIM 2D returns
(width, height, 0, 1). Every other access keeps its rule: a T# the program also reads keeps the shared 2D view,and nothing else changes.
Not in this PR, and still throwing:
image descriptor is invalid. The measurement covers the query's answer, but the guestfootprint of a 16-fragment surface was never measured, so
DescribeSurfacekeeps rejecting it (the pinned{0, 3, 16}case intests/GuestTextureResource.cppis unchanged);resolveDimensioninGraphics/src/GuestTextureResource.cpphas no case 15). That is a separate driver topic.The debt fragment
docs/dev/debt/changes/fix-shader-resinfo-msaa-remainder.mdrewrites only the still-throws entry and says both.The rule implemented is our own RDNA2 gfx1036 measurement (driver 31.0.22044.1, hardware oracle, wave32 and wave64, #18467), not a
measurement on the PS5's gfx1013.
Second commit (
abe0f2dab3): the first head also widenedvalidImageDescriptorandDescribeSurfaceto 16 fragments. Thatbroke
agc_driver_graphics,agc_graphics_profile_draw(the pinned 16-fragment rejection) andagc_spirv_branch_targets(itsfixture leaves
dimensionQueryOnlyat its defaulttrueon an image it samples), as @4le22io and @throny reported. The 16-fragmentpart is dropped, the fixture states
dimensionQueryOnly = false, and the unit case now expects the 16-fragment query to be refused.Tested
Head
abe0f2dab3(commit 2 on top of4ff7964af9, parentb7d463d438). Linux (Ubuntu 26.04.1), Release, gcc, llvmpipe(
LLVM 21.1.8, 256 bits), Khronos validation layer 1.4.363.1 inserted.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1.b7d463d438(main)4ff7964af9abe0f2dab3agc_shader_memoryagc_driver_image_resinfo_dimensionagc_driver_graphics,agc_graphics_profile_draw,agc_driver_graphics_maps_fallbackfragment count)agc_spirv_branch_targetsdescriptor group was not allocated)agc_driver_image_msaa_address_on_plane,agc_driver_msaa_enable_single_sample0
VUID-lines in every run; the validation-layer loader line is in each of the three execution-test logs and no log reports it missing (the graphics unit suites log no loader layer lines, onmaintoo). On llvmpipe,resinfo_dimensionrunsthe 4- and 8-fragment legs, plain and under DIM 2D. The 2-fragment legs skip because the device has no 2-sample colour
attachments (the skip lines are printed).
agc_shader_memorycovers the 2/4/8 descriptor cases without a device.Mutation control (first head): returning level 0 instead of level 1 from
QueryDimensionsfails the execution test at exactly the4-fragment multisampled case (
returned 8x8x0 levels 0, RDNA 2 returns 8x8x0 levels 1); restored, it is green again.tools/check_conventions.pyandtools/debt_fold.py --checkpass. The folded entry is 605 characters, and the measured entrybelow it is byte-identical.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)3fc5088db0)Overlap:
tools/pr_overlap.py --branchfound no verified hunk-level overlap (it fails closed on 45 PRs whose bases conflict); #22724 is the neighbouring rule (mip past the last level) and does not touch the multisampled level component or the DIM 2D mode.