Skip to content

gpuav: Validate mesh draws with device address commands - #13260

Merged
spencer-lunarg merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:gpuav-mesh-2ext
Sep 30, 2026
Merged

spencer-lunarg merged 1 commit into
KhronosGroup:mainfrom
apollo-2006:gpuav-mesh-2ext

Conversation

@apollo-2006

Copy link
Copy Markdown
Contributor

Fixes #12255.

As the issue describes, vkCmdDrawMeshTasksIndirect2EXT didn't have a GPU-AV hook yet, and vkCmdDrawMeshTasksIndirectCount2EXT was going through the vkCmdDrawIndirectCount path instead of valcmd::DrawMeshIndirect. While digging into the second one, I noticed it also ran the firstInstance check with VkDrawIndirectCommand sizes over the 12-byte mesh commands, so with tightly packed commands the next command's groupCountX got reported as an invalid firstInstance (00501).

Rather than teaching DrawMeshIndirect to take a VkDeviceAddress, I went with the approach vkCmdDrawIndirect2KHR and vkCmdDrawIndirectCount2KHR already use: resolve the address ranges to a buffer and offset with GetBuffersByAddressRange, then reuse the existing vkCmdDrawMeshTasksIndirectEXT/vkCmdDrawMeshTasksIndirectCountEXT paths. The count check now reports VUID-VkDrawIndirectCount2InfoKHR-countAddressRange-13116 for the 2EXT command. If you'd prefer the VkDeviceAddress route the issue mentions, I'm happy to rework it that way.

Tests (each one fails on main and passes with this change, on lavapipe and RADV):

  • NegativeGpuAVIndirectBuffer.MeshDeviceAddressCommands: groupCountX above maxMeshWorkGroupCount[0] reports 07326 for both commands. On main, neither reports it.
  • NegativeGpuAVIndirectBuffer.MeshDeviceAddressCommandsDrawCountDeviceLimit: a count above the (lowered) maxDrawIndirectCount reports 13116. On main, it isn't reported for this command.
  • PositiveGpuAVIndirectBuffer.DrawMeshTasksIndirectCount2EXTPackedCommands: two tightly packed commands with no errors. On main, it reports 00501 twice.

Like the existing device address command tests, these pass VK_ADDRESS_COMMAND_UNKNOWN_STORAGE_BUFFER_USAGE_BIT_KHR because of #13040.

All GPU-AV tests on lavapipe and RADV (RX 9070 XT) give the same results as main apart from the three new tests, and nothing new fails or crashes.

DISABLED_DrawMeshTasksIndirect2EXT also passes on both with this change (without the self-validation layer), so I'd be glad to enable it here if you'd like, or leave it for #13040. Either works for me.

vkCmdDrawMeshTasksIndirect2EXT had no GPU-AV hook, so its mesh group
counts were never validated. vkCmdDrawMeshTasksIndirectCount2EXT went
through the vkCmdDrawIndirectCount path, which read the 12 byte mesh
commands as VkDrawIndirectCommand, reported the next command's
groupCountX as an invalid firstInstance, and never checked the group
counts.

Resolve the address ranges to buffers, like the other *2KHR draws, and
use the vkCmdDrawMeshTasksIndirect(Count)EXT paths for both.
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

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

@apollo-2006
apollo-2006 requested a review from a team as a code owner September 29, 2026 18:42
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 137078.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24719 running.

@spencer-lunarg

Copy link
Copy Markdown
Contributor

DISABLED_DrawMeshTasksIndirect2EXT also passes on both with this change (without the self-validation layer), so I'd be glad to enable it here if you'd like, or leave it for #13040. Either works for me.

CI will run with self-validation, the is the main thing, so if it fails with it, not worth turning it on

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24719 passed.

@spencer-lunarg
spencer-lunarg merged commit 48fcff0 into KhronosGroup:main Sep 30, 2026
21 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.

Fix missing Mesh + DAC in GPU-AV

3 participants