Repository navigation
Conversation
…2 does Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The past-last-mip guard wraps each size component in an OpSelect, so QueryReportsDepth now follows the select's in-range operand back to the size query.
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
|
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.
|
What
image_get_resinfopassed the guest mip straight toOpImageQuerySizeLod. Vulkan leaves that undefined for a lod at or past the view's level count. AMD's driver then returned the halved size of the last level, e.g. 1×1 for mip 4 of an 8×8 T# with 4 levels, and 32×16 for mip 1 of a single-level 64×32 one. RDNA2 hardware returns 0 for width, height and depth or layers there, and the level count as usual.SpirvImageEmitter.cpp(QueryDimensions): the level count is read first, the size is queried at the guest mip when it is below the level count and at level 0 otherwise, and the three size components are zero past the last level. The fourth component is the level count as before. Multisampled queries are unchanged.test:
ImageResinfoDimension.cppgainsCheckMips, which queries mips 0 to 5, 15 and 0xffffffff of:The expected values are the hardware's (below). The query program takes its mip from a literal (
MipCode), andDescriptortakes an optional level count; the existing cube/3D/2D-array checks keep their single-level descriptors.debt: a new
shader.mdentry (fragmentdocs/dev/debt/changes/fix-resinfo-mip-past-last-level.md).Source of the semantics:
tools/hw-oracleon gfx1036 (AMD Windows driver 32.0.21045.16010). The test's three T#s on hardware:A wider differential sweep against
agc_oracle_runnercovered 1D, 2D, 3D, 2D-array and 1D-array T#s of 1×1 to 100×1×12 with up to 7 levels, base levels 0 to 2 and array bases 0 and 2. It gave the same rule everywhere: before this change AMD returned a computed size for every mip at or past the level count. NVIDIA's driver already returned zeros there.Tested
Windows 11 Pro 10.0.26200,
ctest --test-dir build -R agc_driver_image_resinfo_dimension -VwithANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer, validation layer 1.4.363, once per GPU:VUID-image_get_resinfo: mip 4 of a 2D T# with 4 levels returned 1x1x0 levels 4, RDNA 2 returns 0x0x0 levels 4VUID-Each log shows
Insert instance layer "VK_LAYER_KHRONOS_validation"and none showswas not found but was requested. The other execution tests that query dimensions also pass on both GPUs:image_cache_bits,image_texel_status,image_volume_address_planar_texture,ds_swizzleandimage_address_dimension, 6/6 with the resinfo test.pr_overlap.py --branchfailed closed on 14 open PRs that conflict withmain; I compared their diffs by hand:QueryDimensions, for guest levels the host view lacks, so they and this PR need a textual merge. They report size 1 for those levels and do not zero a mip past the T#'s last level, which is what this PR fixes.OpImageQueryLevelselsewhere.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)🤖 Generated with Claude Code
Summary by CodeRabbit