Repository navigation
gpuav: Validate mesh draws with device address commands - #13260
Merged
Merged
Conversation
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.
Collaborator
|
Author apollo-2006 not on autobuild list. Waiting for curator authorization before starting CI build. |
Collaborator
|
CI Vulkan-ValidationLayers build queued with queue ID 137078. |
Collaborator
|
CI Vulkan-ValidationLayers build # 24719 running. |
Contributor
CI will run with self-validation, the is the main thing, so if it fails with it, not worth turning it on |
spencer-lunarg
approved these changes
Sep 29, 2026
Collaborator
|
CI Vulkan-ValidationLayers build # 24719 passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12255.
As the issue describes,
vkCmdDrawMeshTasksIndirect2EXTdidn't have a GPU-AV hook yet, andvkCmdDrawMeshTasksIndirectCount2EXTwas going through thevkCmdDrawIndirectCountpath instead ofvalcmd::DrawMeshIndirect. While digging into the second one, I noticed it also ran thefirstInstancecheck withVkDrawIndirectCommandsizes over the 12-byte mesh commands, so with tightly packed commands the next command'sgroupCountXgot reported as an invalidfirstInstance(00501).Rather than teaching
DrawMeshIndirectto take aVkDeviceAddress, I went with the approachvkCmdDrawIndirect2KHRandvkCmdDrawIndirectCount2KHRalready use: resolve the address ranges to a buffer and offset withGetBuffersByAddressRange, then reuse the existingvkCmdDrawMeshTasksIndirectEXT/vkCmdDrawMeshTasksIndirectCountEXTpaths. The count check now reportsVUID-VkDrawIndirectCount2InfoKHR-countAddressRange-13116for the 2EXT command. If you'd prefer theVkDeviceAddressroute 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:groupCountXabovemaxMeshWorkGroupCount[0]reports 07326 for both commands. On main, neither reports it.NegativeGpuAVIndirectBuffer.MeshDeviceAddressCommandsDrawCountDeviceLimit: a count above the (lowered)maxDrawIndirectCountreports 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_KHRbecause 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_DrawMeshTasksIndirect2EXTalso 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.