Repository navigation
fix(shader): answer image_get_resinfo on 2D MSAA T#s - #19682
Conversation
A size query on a 2D MSAA texture with 2, 4 or 8 fragments returned 0 levels under DIM 2D_MSAA and threw under DIM 1D. Report one level, as measured on RDNA2 with the hardware oracle (boykopovar#18467), and give DIM 1D queries a 2D MSAA view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified on three AMD generations on Linux (RADV, Mesa 26.2.6), validation layer 1.4.363 (no
Without the fix, all three generations fail deterministically: i.e. the 2D MSAA T# resinfo query reports a mip-level count of 0 instead of the hardware's 1. With the fix it answers AI-assisted: yes. |
|
An NVIDIA run, next to the AMD runs: 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,
Negative control: this PR's AI-assisted: yes |
|
Windows check of head
AI-assisted: yes. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Two new commits:
The text is unchanged except for the new lead-ins. It is now three entries:
AI-assisted: yes. |
|
Ran the resinfo test and the MSAA image tests on NVIDIA's proprietary Linux driver with the Khronos validation layer at the current head; the earlier NVIDIA run in this thread was on Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor
Negative control: this PR's build with No new AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the read code and supplied checks support merging.
What I ran
Reviewed head 5c9cc0632165d052c989ee24bc80270e2e7a8bbc using the pinned repo_read.py reader. No commands or tests were run by me; the environment and toolchain were not independently verified.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Four changed files read |
| Automated tests | not run | Results below are author-reported |
| Negative control | not run | Not independently reproduced |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports the execution check on RDNA3 and the hardware behavior measurement on RDNA2; neither was run by me. Linux and PS5 gfx1013 behavior were not verified. The review bundle contained no excluded changed files; all four files listed in the manifest as reviewed were read: ImageResinfoDimension.cpp, ResourceMaterializer.cpp, SpirvImageEmitter.cpp, and shader.md.
To get this to a good state
Nothing is required.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
RuntimeImageModes offers the multisampled view a query-only 2D image needs, as #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.
What
image_get_resinfoon a 2D MSAA T# with 2, 4 or 8 fragments returned 0 levels under DIM 2D_MSAA and threwimage address has too few coordinate componentsunder DIM 1D. It now returns (width, height, 0, 1), the level component measured on RDNA2 with the hardware oracle in #18467 (recorded indocs/dev/debt/shader.md).SpirvImageEmitter.cpp: the level component of a multisampled dimension query starts at 1 instead of 0 (SPIR-V has no level query on multisampled images).ResourceMaterializer.cpp: a query-only DIM 1D image also gets a 2D MSAA view, gated like the existing query-only 2D/2D-array/3D/cube views (plain, non-depth, no conversion or packing), so read modes are unchanged.Still throwing, as the debt entry now says: DIM 2D on a 2D MSAA T# (its views are shared with 2D reads), 2D MSAA-array T#s (the driver binds no type-15 texture) and 16-fragment T#s (refused as invalid descriptors). Not measured on the PS5's gfx1013.
Tested
Windows 11, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh r7), Release, rebased on
main135da47.agc_driver_image_resinfo_dimensionnow also checks 2D MSAA T#s (SW_MODE 64KB_S, 2/4/8 fragments) under DIM 2D_MSAA and DIM 1D against (8, 8, 0, 1). It fails with each fix reverted: levels 0, andimage address has too few coordinate components.ctest -R "agc_driver|shader|recompiler": 1258/1267 pass. The 9 failures (agc_driver_f16_conversion_float_mode,float16_misc,float16_modifiers,float16_rounding,fp16_overflow,ldexp_f16_inline_constants,sdwa_ldexp_f16,vop2_modifier_forms,sample_order_grid_reference) were already failing onmainon this machine in an earlier run today and do not involve image queries.python tools/check_conventions.py --base origin/main: 0 errors; one warning that the existing debt entry is over 1000 characters (it already was onmain).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)