Skip to content

layers: Add 3D subresource checks for CopyMemoryToImageIndirect - #13572

Merged
spencer-lunarg merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:vvl-11332-3d-indirect-copy
Oct 28, 2026
Merged

spencer-lunarg merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:vvl-11332-3d-indirect-copy

Conversation

@apollo-2006

@apollo-2006 apollo-2006 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #11332.

This fills in the TODO in the 3D branch of ValidateCopyMemoryToImageIndirectInfo with 12289 to 12292. The depth comes from GetEffectiveSubresourceExtent, so it follows the mip level, and the checks are skipped when mipLevel is already out of range (07670).

Tests:

  • NegativeCopyBufferImage.MemoryToImageIndirectSubresource3D: ranges past the depth, including one that fits mip 0 but not mip 1 (12289, 12292).
  • NegativeCopyBufferImage.MemoryToImageIndirectSubresource3DBlockDepth: ASTC 4x4x4 for the block depth checks (12290, 12291).
  • PositiveCopyBufferImage.MemoryToImageIndirect3D: in-range copies at both mips.

Both negative tests fail on main. The ASTC one skips on max_profile.json since it has no 3D ASTC format, but passes with a local copy that adds one. I'm happy to add it to the profile here if you'd like it running in CI. Full suite on the test ICD: 0 failures (excluding NegativeMemory.AllocationCount, which aborts on GCC 16 for a reason which I believe is unrelated).

@apollo-2006
apollo-2006 requested a review from a team as a code owner October 27, 2026 00:13
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

User apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build.

@apollo-2006
apollo-2006 force-pushed the vvl-11332-3d-indirect-copy branch from 188e04d to 9c8f4ef Compare October 27, 2026 15:23
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

User apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build.

@spencer-lunarg spencer-lunarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few nits, otherwise looks good to me!

if (!IsIntegerMultipleOf(base_layer, block_depth)) {
skip |= LogError("VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-12291", dst_objlist,
subresource_loc.dot(Field::baseArrayLayer),
"(%" PRIu32 ") must be a multiple of the texel block extent depth (%" PRIu32 ") of %s.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

word this more like 00207

must be a multiple of the image format (%s) texel block depth (%" PRIu32 ")

} else if (layer_end != depth && !IsIntegerMultipleOf(layer_count, block_depth)) {
skip |= LogError("VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-12290", dst_objlist,
subresource_loc.dot(Field::layerCount),
"(%" PRIu32 ") must be a multiple of the texel block extent depth (%" PRIu32

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing above

image format (%s) texel block depth (%" PRIu32 ")

@apollo-2006
apollo-2006 force-pushed the vvl-11332-3d-indirect-copy branch from 9c8f4ef to 3c64fa8 Compare October 28, 2026 15:32
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

User apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build.

@apollo-2006

Copy link
Copy Markdown
Contributor Author

thanks for the review, all addressed. good catch on 12292, I switched it to < ahead of your spec MR and added a test for baseArrayLayer == depth

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 174343.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 25107 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 25107 failed.

For a 3D dstImage, baseArrayLayer and layerCount select depth slices,
so check them against the depth of the mip level being copied to
(12289, 12292) and against the texel block depth of the format
(12290, 12291).
@spencer-lunarg
spencer-lunarg force-pushed the vvl-11332-3d-indirect-copy branch from 3c64fa8 to 9aaee5a Compare October 28, 2026 19:52
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 174754.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 25108 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 25108 passed.

@spencer-lunarg
spencer-lunarg merged commit 458e7db into KhronosGroup:main Oct 28, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new 3D VkCopyMemoryToImageIndirectInfoKHR VUs

3 participants