Repository: KhronosGroup/Vulkan-ValidationLayers
Pull request #9772: gpuav: Improve perf for draw indexed indirect val
Author: login: arno-lunarg
Created: 2025-03-24T16:23:28Z | Merged: 2025-03-24T18:16:57Z

Closes https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/9721


Diff:
diff --git a/BUILD.gn b/BUILD.gn
index b529b4aaa2d..02bd15f642d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -378,6 +378,8 @@ vvl_sources = [
   "layers/vulkan/generated/validation_cmd_first_instance_comp.cpp",
   "layers/vulkan/generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.h",
   "layers/vulkan/generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.cpp",
+  "layers/vulkan/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.h",
+  "layers/vulkan/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.cpp",
   "layers/vulkan/generated/validation_cmd_draw_mesh_indirect_comp.h",
   "layers/vulkan/generated/validation_cmd_draw_mesh_indirect_comp.cpp",
   "layers/vulkan/generated/validation_cmd_trace_rays_rgen.cpp",
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index 1c6be02f041..4b6fd957c94 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -250,6 +250,8 @@ target_sources(vvl PRIVATE
     ${API_TYPE}/generated/validation_cmd_first_instance_comp.cpp
     ${API_TYPE}/generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.h
     ${API_TYPE}/generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.cpp
+    ${API_TYPE}/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.h
+    ${API_TYPE}/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.cpp
     ${API_TYPE}/generated/validation_cmd_draw_mesh_indirect_comp.h
     ${API_TYPE}/generated/validation_cmd_draw_mesh_indirect_comp.cpp
     ${API_TYPE}/generated/validation_cmd_trace_rays_rgen.h
diff --git a/layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp b/layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp
index e73a0186fe1..3c5d5d51305 100644
--- a/layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp
+++ b/layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp
@@ -41,16 +41,18 @@ const uint kFirstIndex = 2;
 const uint kVertexOffset = 3;
 const uint kFirstInstance = 4;
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) readonly buffer DrawBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) 
+readonly buffer DrawBuffer {
     uint draw_indexed_indirect_cmds[];
 };
 
 // CountBuffer won't be bound for non-count draws
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) readonly buffer CountBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
     uint count_buffer[];
 };
 
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+layout(local_size_x = DrawIndexedIndirect_LocalWorkGroupSizeX, local_size_y = 1, local_size_z = 1) in;
 void main() {
     uint draw_count = 0;
     if ((pc.flags & kIndexedIndirectDrawFlags_DrawCountFromBuffer) == 0) {
@@ -62,13 +64,16 @@ void main() {
         draw_count = min(count_buffer[pc.api_count_buffer_offset_dwords], pc.api_draw_count);
     }
 
-    for (uint draw_i = 0; draw_i < draw_count; ++draw_i) {
-        const uint draw_indexed_indirect_cmd_i = draw_i * pc.api_stride_dwords + pc.api_offset_dwords;
-        const uint draw_i_index_count = draw_indexed_indirect_cmds[ draw_indexed_indirect_cmd_i + kIndexCount ];
-        const uint draw_i_first_index = draw_indexed_indirect_cmds[ draw_indexed_indirect_cmd_i + kFirstIndex ];
+    const uint draw_i = gl_GlobalInvocationID.x;
+    if (draw_i >= draw_count) {
+        return;
+    }
+    
+    const uint draw_indexed_indirect_cmd_i = draw_i * pc.api_stride_dwords + pc.api_offset_dwords;
+    const uint draw_i_index_count = draw_indexed_indirect_cmds[ draw_indexed_indirect_cmd_i + kIndexCount ];
+    const uint draw_i_first_index = draw_indexed_indirect_cmds[ draw_indexed_indirect_cmd_i + kFirstIndex ];
 
-        if ((draw_i_first_index + draw_i_index_count) > pc.bound_index_buffer_indices_count) {
-            GpuavLogError4(kErrorGroupGpuPreDraw, kErrorSubCode_OobIndexBuffer, draw_i, draw_i_first_index, draw_i_index_count, 0);
-        }
+    if ((draw_i_first_index + draw_i_index_count) > pc.bound_index_buffer_indices_count) {
+        GpuavLogError4(kErrorGroupGpuPreDraw, kErrorSubCode_OobIndexBuffer, draw_i, draw_i_first_index, draw_i_index_count, 0);
     }
 }
diff --git a/layers/gpuav/shaders/validation_cmd/draw_mesh_indirect.comp b/layers/gpuav/shaders/validation_cmd/draw_mesh_indirect.comp
index 351eac65e13..329d656fb7f 100644
--- a/layers/gpuav/shaders/validation_cmd/draw_mesh_indirect.comp
+++ b/layers/gpuav/shaders/validation_cmd/draw_mesh_indirect.comp
@@ -37,11 +37,13 @@ const uint kGroupCountX = 0;
 const uint kGroupCountY = 1;
 const uint kGroupCountZ = 2;
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) readonly buffer DrawBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) 
+readonly buffer DrawBuffer {
     uint draw_buffer[];
 };
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) readonly buffer CountBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
     uint count_buffer[];
 };
 
diff --git a/layers/gpuav/shaders/validation_cmd/draw_push_data.h b/layers/gpuav/shaders/validation_cmd/draw_push_data.h
index 1a9ed55e84b..b0a2f7b35c7 100644
--- a/layers/gpuav/shaders/validation_cmd/draw_push_data.h
+++ b/layers/gpuav/shaders/validation_cmd/draw_push_data.h
@@ -35,8 +35,11 @@ using uint = unsigned int;
 const uint kPreDrawBinding_IndirectBuffer = 0;
 const uint kPreDrawBinding_CountBuffer = 1;
 const uint kPreDrawBinding_IndexBuffer = 2;
+const uint kPreDrawBinding_DispatchIndirectBuffer = 3;
 
 const uint kIndexedIndirectDrawFlags_DrawCountFromBuffer = uint(1) << 0;
+// Most implementations have wave sizes of 32 or 64, so 64 is a good default
+const uint DrawIndexedIndirect_LocalWorkGroupSizeX = 64;
 struct DrawIndexedIndirectIndexBufferPushData {
     uint flags;
     uint api_stride_dwords;
diff --git a/layers/gpuav/shaders/validation_cmd/first_instance.comp b/layers/gpuav/shaders/validation_cmd/first_instance.comp
index 19135031043..29dfe073aa2 100644
--- a/layers/gpuav/shaders/validation_cmd/first_instance.comp
+++ b/layers/gpuav/shaders/validation_cmd/first_instance.comp
@@ -25,11 +25,13 @@ uniform PushConstants {
     FirstInstancePushData pc;
 };
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) readonly buffer DrawBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) 
+readonly buffer DrawBuffer {
     uint draw_indexed_indirect_cmds[];
 };
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) readonly buffer CountBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
     uint count_buffer[];
 };
 
diff --git a/layers/gpuav/shaders/validation_cmd/setup_draw_indexed_indirect_index_buffer.comp b/layers/gpuav/shaders/validation_cmd/setup_draw_indexed_indirect_index_buffer.comp
new file mode 100644
index 00000000000..dd7ac61972f
--- /dev/null
+++ b/layers/gpuav/shaders/validation_cmd/setup_draw_indexed_indirect_index_buffer.comp
@@ -0,0 +1,58 @@
+// Copyright (c) 2021-2025 The Khronos Group Inc.
+// Copyright (c) 2021-2025 Valve Corporation
+// Copyright (c) 2021-2025 LunarG, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#version 450
+
+#extension GL_GOOGLE_include_directive : enable
+
+#include "common.h"
+#include "draw_push_data.h"
+
+layout(push_constant) uniform UniformInfo {
+    DrawIndexedIndirectIndexBufferPushData pc;
+};
+
+// CountBuffer won't be bound for non-count draws
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
+    uint count_buffer[];
+};
+
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_DispatchIndirectBuffer) 
+buffer DipatchIndirectBuffer {
+    uint dispatch_indirect_x;
+    uint dispatch_indirect_y;
+    uint dispatch_indirect_z;
+};
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+    uint draw_count = 0;
+    if ((pc.flags & kIndexedIndirectDrawFlags_DrawCountFromBuffer) == 0) {
+        draw_count = pc.api_draw_count;
+    } else {
+        // Need to clamp draw count value stored in count buffer to the maxDrawCount
+        // that was specified at vkCmdDrawIndexedIndirect time.
+        // pc.api_draw_count is used to store maxDrawCount
+        draw_count = min(count_buffer[pc.api_count_buffer_offset_dwords], pc.api_draw_count);
+    }
+    
+    dispatch_indirect_x = 
+        (draw_count / DrawIndexedIndirect_LocalWorkGroupSizeX) + 
+        uint((draw_count % DrawIndexedIndirect_LocalWorkGroupSizeX) > 0);
+    dispatch_indirect_y = 1;
+    dispatch_indirect_z = 1;
+}
diff --git a/layers/gpuav/validation_cmd/gpuav_draw.cpp b/layers/gpuav/validation_cmd/gpuav_draw.cpp
index b7ee3ef8611..c0a2296af4e 100644
--- a/layers/gpuav/validation_cmd/gpuav_draw.cpp
+++ b/layers/gpuav/validation_cmd/gpuav_draw.cpp
@@ -34,6 +34,7 @@
 #include "generated/validation_cmd_first_instance_comp.h"
 #include "generated/validation_cmd_count_buffer_comp.h"
 #include "generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.h"
+#include "generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.h"
 
 #include "profiling/profiling.h"
 
@@ -827,6 +828,50 @@ struct DrawIndexedIndirectIndexBufferShader {
     }
 };
 
+struct SetupDrawCountDispatchIndirectShader {
+    static size_t GetSpirvSize() { return validation_cmd_setup_draw_indexed_indirect_index_buffer_comp_size * sizeof(uint32_t); }
+    static const uint32_t *GetSpirv() { return validation_cmd_setup_draw_indexed_indirect_index_buffer_comp; }
+
+    static const uint32_t desc_set_id = gpuav::glsl::kDiagPerCmdDescriptorSet;
+
+    glsl::DrawIndexedIndirectIndexBufferPushData push_constants{};
+    BoundStorageBuffer count_buffer_binding = {gpuav::glsl::kPreDrawBinding_CountBuffer};
+    BoundStorageBuffer dispatch_indirect_buffer_binding = {gpuav::glsl::kPreDrawBinding_DispatchIndirectBuffer};
+
+    static std::vector<VkDescriptorSetLayoutBinding> GetDescriptorSetLayoutBindings() {
+        std::vector<VkDescriptorSetLayoutBinding> bindings = {
+            {gpuav::glsl::kPreDrawBinding_CountBuffer, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT, nullptr},
+            {gpuav::glsl::kPreDrawBinding_IndexBuffer, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT, nullptr},
+            {gpuav::glsl::kPreDrawBinding_DispatchIndirectBuffer, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_COMPUTE_BIT,
+             nullptr},
+        };
+
+        return bindings;
+    }
+
+    std::vector<VkWriteDescriptorSet> GetDescriptorWrites(VkDescriptorSet desc_set) const {
+        std::vector<VkWriteDescriptorSet> desc_writes(2);
+
+        desc_writes[0] = vku::InitStructHelper();
+        desc_writes[0].dstSet = desc_set;
+        desc_writes[0].dstBinding = count_buffer_binding.binding;
+        desc_writes[0].dstArrayElement = 0;
+        desc_writes[0].descriptorCount = 1;
+        desc_writes[0].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
+        desc_writes[0].pBufferInfo = &count_buffer_binding.info;
+
+        desc_writes[1] = vku::InitStructHelper();
+        desc_writes[1].dstSet = desc_set;
+        desc_writes[1].dstBinding = dispatch_indirect_buffer_binding.binding;
+        desc_writes[1].dstArrayElement = 0;
+        desc_writes[1].descriptorCount = 1;
+        desc_writes[1].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
+        desc_writes[1].pBufferInfo = &dispatch_indirect_buffer_binding.info;
+
+        return desc_writes;
+    }
+};
+
 // Use "api_" prefix to make it clear which buffer/offset/etc we are talking about
 // "api" helps to distinguish it is input from the user at the API level
 void DrawIndexedIndirectIndexBuffer(Validator &gpuav, CommandBufferSubState &cb_state, const Location &loc, VkBuffer api_buffer,
@@ -870,42 +915,97 @@ void DrawIndexedIndirectIndexBuffer(Validator &gpuav, CommandBufferSubState &cb_
                                             loc](Validator &gpuav, CommandBufferSubState &cb_state) {
         SharedDrawValidationResources &shared_draw_validation_resources =
             gpuav.shared_resources_manager.Get<SharedDrawValidationResources>(gpuav, loc);
-        if (!shared_draw_validation_resources.valid) return;
+        if (!shared_draw_validation_resources.valid) {
+            return;
+        }
+        ComputeValidationPipeline<SetupDrawCountDispatchIndirectShader> &setup_validation_dispatch_pipeline =
+            gpuav.shared_resources_manager.Get<ComputeValidationPipeline<SetupDrawCountDispatchIndirectShader>>(
+                gpuav, loc, cb_state.GetErrorLoggingDescSetLayout());
+        if (!shared_draw_validation_resources.valid) {
+            return;
+        }
         ComputeValidationPipeline<DrawIndexedIndirectIndexBufferShader> &validation_pipeline =
             gpuav.shared_resources_manager.Get<ComputeValidationPipeline<DrawIndexedIndirectIndexBufferShader>>(
                 gpuav, loc, cb_state.GetErrorLoggingDescSetLayout());
-        if (!validation_pipeline.valid) return;
+        if (!validation_pipeline.valid) {
+            return;
+        }
 
         const uint32_t index_bits_size = GetIndexBitsSize(index_buffer_binding.index_type);
         const uint32_t max_indices_in_buffer = static_cast<uint32_t>(index_buffer_binding.size / (index_bits_size / 8u));
+
+        VkBufferCreateInfo validation_dispatch_params_buffer_ci = vku::InitStructHelper();
+        validation_dispatch_params_buffer_ci.size = 3 * sizeof(uint32_t);
+        validation_dispatch_params_buffer_ci.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT;
+        VmaAllocationCreateInfo alloc_info = {};
+        alloc_info.requiredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+        vko::Buffer validation_dispatch_params_buffer =
+            cb_state.gpu_resources_manager.GetManagedBuffer(gpuav, loc, validation_dispatch_params_buffer_ci, alloc_info);
+        if (validation_dispatch_params_buffer.IsDestroyed()) {
+            return;
+        }
+
+        glsl::DrawIndexedIndirectIndexBufferPushData push_constants{};
+        if (api_count_buffer != VK_NULL_HANDLE) {
+            push_constants.flags |= glsl::kIndexedIndirectDrawFlags_DrawCountFromBuffer;
+            push_constants.api_count_buffer_offset_dwords = (uint32_t)api_count_buffer_offset / sizeof(uint32_t);
+        }
+        push_constants.api_stride_dwords = api_stride / sizeof(uint32_t);
+        push_constants.bound_index_buffer_indices_count = max_indices_in_buffer;
+        push_constants.api_draw_count = api_draw_count;
+
+        // Draw count being stored in a GPU buffer,
+        // setup a compute pipeline to determine the size of the validation indirect dispatch
         {
-            DrawIndexedIndirectIndexBufferShader shader_resources;
+            SetupDrawCountDispatchIndirectShader setup_validation_shader_resources;
+            setup_validation_shader_resources.push_constants = push_constants;
             if (api_count_buffer != VK_NULL_HANDLE) {
-                shader_resources.push_constants.flags |= glsl::kIndexedIndirectDrawFlags_DrawCountFromBuffer;
-                shader_resources.count_buffer_binding.info = {api_count_buffer, 0, sizeof(uint32_t)};
-                shader_resources.push_constants.api_count_buffer_offset_dwords =
-                    (uint32_t)api_count_buffer_offset / sizeof(uint32_t);
-
+                setup_validation_shader_resources.count_buffer_binding.info = {api_count_buffer, 0, sizeof(uint32_t)};
             } else {
-                shader_resources.count_buffer_binding.info = {shared_draw_validation_resources.dummy_buffer.VkHandle(), 0,
-                                                              VK_WHOLE_SIZE};
+                setup_validation_shader_resources.count_buffer_binding.info = {
+                    shared_draw_validation_resources.dummy_buffer.VkHandle(), 0, VK_WHOLE_SIZE};
             }
 
-            shader_resources.push_constants.api_stride_dwords = api_stride / sizeof(uint32_t);
-            shader_resources.push_constants.bound_index_buffer_indices_count = max_indices_in_buffer;
-            shader_resources.push_constants.api_draw_count = api_draw_count;
+            setup_validation_shader_resources.dispatch_indirect_buffer_binding.info = {validation_dispatch_params_buffer.VkHandle(),
+                                                                                       0, VK_WHOLE_SIZE};
 
-            shader_resources.draw_buffer_binding.info = {api_buffer, 0, VK_WHOLE_SIZE};
-            shader_resources.push_constants.api_offset_dwords = (uint32_t)api_offset / sizeof(uint32_t);
+            setup_validation_dispatch_pipeline.BindShaderResources(gpuav, cb_state, draw_i, error_logger_i,
+                                                                   setup_validation_shader_resources);
 
-            validation_pipeline.BindShaderResources(gpuav, cb_state, draw_i, error_logger_i, shader_resources);
+            DispatchCmdBindPipeline(cb_state.VkHandle(), VK_PIPELINE_BIND_POINT_COMPUTE,
+                                    setup_validation_dispatch_pipeline.pipeline);
+            DispatchCmdDispatch(cb_state.VkHandle(), 1, 1, 1);
+
+            VkBufferMemoryBarrier dispatch_indirect_buffer_mem_barrier = vku::InitStructHelper();
+            dispatch_indirect_buffer_mem_barrier.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
+            dispatch_indirect_buffer_mem_barrier.dstAccessMask = VK_ACCESS_INDIRECT_COMMAND_READ_BIT;
+            dispatch_indirect_buffer_mem_barrier.buffer = validation_dispatch_params_buffer.VkHandle();
+            dispatch_indirect_buffer_mem_barrier.offset = 0;
+            dispatch_indirect_buffer_mem_barrier.size = VK_WHOLE_SIZE;
+
+            DispatchCmdPipelineBarrier(cb_state.VkHandle(), VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
+                                       VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, 0, 0, nullptr, 1, &dispatch_indirect_buffer_mem_barrier,
+                                       0, nullptr);
         }
 
+        // Setup validation pipeline
         {
+            DrawIndexedIndirectIndexBufferShader validation_shader_resources;
+            validation_shader_resources.push_constants = push_constants;
+            if (api_count_buffer != VK_NULL_HANDLE) {
+                validation_shader_resources.count_buffer_binding.info = {api_count_buffer, 0, sizeof(uint32_t)};
+            } else {
+                validation_shader_resources.count_buffer_binding.info = {shared_draw_validation_resources.dummy_buffer.VkHandle(),
+                                                                         0, VK_WHOLE_SIZE};
+            }
+            validation_shader_resources.draw_buffer_binding.info = {api_buffer, 0, VK_WHOLE_SIZE};
+
+            validation_pipeline.BindShaderResources(gpuav, cb_state, draw_i, error_logger_i, validation_shader_resources);
+
             DispatchCmdBindPipeline(cb_state.VkHandle(), VK_PIPELINE_BIND_POINT_COMPUTE, validation_pipeline.pipeline);
 
             // One draw will check all VkDrawIndexedIndirectCommand
-            DispatchCmdDispatch(cb_state.VkHandle(), 1, 1, 1);
+            DispatchCmdDispatchIndirect(cb_state.VkHandle(), validation_dispatch_params_buffer.VkHandle(), 0);
             // synchronize draw buffer validation (read) against subsequent writes
             std::array<VkBufferMemoryBarrier, 2> buffer_memory_barriers = {};
             uint32_t buffer_memory_barriers_count = 1;
diff --git a/layers/vulkan/generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.cpp b/layers/vulkan/generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.cpp
index 8dcf6f1b133..74a292a5f00 100644
--- a/layers/vulkan/generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.cpp
+++ b/layers/vulkan/generated/validation_cmd_draw_indexed_indirect_index_buffer_comp.cpp
@@ -24,142 +24,141 @@
 #include "validation_cmd_draw_indexed_indirect_index_buffer_comp.h"
 
 // To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/
-[[maybe_unused]] const uint32_t validation_cmd_draw_indexed_indirect_index_buffer_comp_size = 1352;
-[[maybe_unused]] const uint32_t validation_cmd_draw_indexed_indirect_index_buffer_comp[1352] = {
-    0x07230203, 0x00010000, 0x0008000b, 0x000000cb, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47,
-    0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0005000f, 0x00000005, 0x00000004, 0x6e69616d,
-    0x00000000, 0x00060010, 0x00000004, 0x00000011, 0x00000001, 0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001c2,
-    0x00070004, 0x415f4c47, 0x675f4252, 0x735f7570, 0x65646168, 0x6e695f72, 0x00343674, 0x000a0004, 0x475f4c47, 0x4c474f4f,
-    0x70635f45, 0x74735f70, 0x5f656c79, 0x656e696c, 0x7269645f, 0x69746365, 0x00006576, 0x00080004, 0x475f4c47, 0x4c474f4f,
-    0x6e695f45, 0x64756c63, 0x69645f65, 0x74636572, 0x00657669, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00090005,
-    0x00000008, 0x4378614d, 0x7245646d, 0x73726f72, 0x6e756f43, 0x61655274, 0x64656863, 0x00000028, 0x000b0005, 0x00000013,
-    0x61757047, 0x676f4c76, 0x6f727245, 0x75283472, 0x31753b31, 0x3b31753b, 0x753b3175, 0x31753b31, 0x0000003b, 0x00050005,
-    0x0000000d, 0x6f727265, 0x72675f72, 0x0070756f, 0x00060005, 0x0000000e, 0x6f727265, 0x75735f72, 0x6f635f62, 0x00006564,
-    0x00040005, 0x0000000f, 0x61726170, 0x00305f6d, 0x00040005, 0x00000010, 0x61726170, 0x00315f6d, 0x00040005, 0x00000011,
-    0x61726170, 0x00325f6d, 0x00040005, 0x00000012, 0x61726170, 0x00335f6d, 0x00070005, 0x00000017, 0x6f736552, 0x65637275,
-    0x65646e49, 0x66754278, 0x00726566, 0x00070006, 0x00000017, 0x00000000, 0x6f736572, 0x65637275, 0x646e695f, 0x00007865,
-    0x00030005, 0x00000019, 0x00000000, 0x00080005, 0x00000021, 0x45646d43, 0x726f7272, 0x756f4373, 0x7542746e, 0x72656666,
-    0x00000000, 0x00080006, 0x00000021, 0x00000000, 0x5f646d63, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, 0x00030005,
-    0x00000023, 0x00000000, 0x00050005, 0x00000034, 0x6f727245, 0x66754272, 0x00726566, 0x00050006, 0x00000034, 0x00000000,
-    0x67616c66, 0x00000073, 0x00070006, 0x00000034, 0x00000001, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, 0x00070006,
-    0x00000034, 0x00000002, 0x6f727265, 0x625f7372, 0x65666675, 0x00000072, 0x00030005, 0x00000036, 0x00000000, 0x00070005,
-    0x0000004f, 0x69746341, 0x6e496e6f, 0x42786564, 0x65666675, 0x00000072, 0x00070006, 0x0000004f, 0x00000000, 0x69746361,
-    0x695f6e6f, 0x7865646e, 0x00000000, 0x00030005, 0x00000051, 0x00000000, 0x00050005, 0x00000079, 0x77617264, 0x756f635f,
-    0x0000746e, 0x000c0005, 0x0000007a, 0x77617244, 0x65646e49, 0x49646578, 0x7269646e, 0x49746365, 0x7865646e, 0x66667542,
-    0x75507265, 0x61446873, 0x00006174, 0x00050006, 0x0000007a, 0x00000000, 0x67616c66, 0x00000073, 0x00080006, 0x0000007a,
-    0x00000001, 0x5f697061, 0x69727473, 0x645f6564, 0x64726f77, 0x00000073, 0x000c0006, 0x0000007a, 0x00000002, 0x6e756f62,
-    0x6e695f64, 0x5f786564, 0x66667562, 0x695f7265, 0x6369646e, 0x635f7365, 0x746e756f, 0x00000000, 0x00070006, 0x0000007a,
-    0x00000003, 0x5f697061, 0x77617264, 0x756f635f, 0x0000746e, 0x00080006, 0x0000007a, 0x00000004, 0x5f697061, 0x7366666f,
-    0x645f7465, 0x64726f77, 0x00000073, 0x000b0006, 0x0000007a, 0x00000005, 0x5f697061, 0x6e756f63, 0x75625f74, 0x72656666,
-    0x66666f5f, 0x5f746573, 0x726f7764, 0x00007364, 0x00050005, 0x0000007b, 0x66696e55, 0x496d726f, 0x006f666e, 0x00040006,
-    0x0000007b, 0x00000000, 0x00006370, 0x00030005, 0x0000007d, 0x00000000, 0x00050005, 0x0000008a, 0x6e756f43, 0x66754274,
-    0x00726566, 0x00070006, 0x0000008a, 0x00000000, 0x6e756f63, 0x75625f74, 0x72656666, 0x00000000, 0x00030005, 0x0000008c,
-    0x00000000, 0x00040005, 0x00000095, 0x77617264, 0x0000695f, 0x00050005, 0x000000a9, 0x77617244, 0x66667542, 0x00007265,
-    0x000a0006, 0x000000a9, 0x00000000, 0x77617264, 0x646e695f, 0x64657865, 0x646e695f, 0x63657269, 0x6d635f74, 0x00007364,
-    0x00030005, 0x000000ab, 0x00000000, 0x00040005, 0x000000bf, 0x61726170, 0x0000006d, 0x00040005, 0x000000c0, 0x61726170,
-    0x0000006d, 0x00040005, 0x000000c1, 0x61726170, 0x0000006d, 0x00040005, 0x000000c3, 0x61726170, 0x0000006d, 0x00040005,
-    0x000000c5, 0x61726170, 0x0000006d, 0x00040005, 0x000000c7, 0x61726170, 0x0000006d, 0x00040047, 0x00000016, 0x00000006,
-    0x00000004, 0x00030047, 0x00000017, 0x00000003, 0x00040048, 0x00000017, 0x00000000, 0x00000018, 0x00050048, 0x00000017,
-    0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000019, 0x00000018, 0x00040047, 0x00000019, 0x00000021, 0x00000002,
-    0x00040047, 0x00000019, 0x00000022, 0x00000000, 0x00040047, 0x00000020, 0x00000006, 0x00000004, 0x00030047, 0x00000021,
-    0x00000003, 0x00050048, 0x00000021, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000023, 0x00000021, 0x00000003,
-    0x00040047, 0x00000023, 0x00000022, 0x00000000, 0x00040047, 0x00000033, 0x00000006, 0x00000004, 0x00030047, 0x00000034,
-    0x00000003, 0x00050048, 0x00000034, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000034, 0x00000001, 0x00000023,
-    0x00000004, 0x00050048, 0x00000034, 0x00000002, 0x00000023, 0x00000008, 0x00040047, 0x00000036, 0x00000021, 0x00000000,
-    0x00040047, 0x00000036, 0x00000022, 0x00000000, 0x00040047, 0x0000004e, 0x00000006, 0x00000004, 0x00030047, 0x0000004f,
-    0x00000003, 0x00040048, 0x0000004f, 0x00000000, 0x00000018, 0x00050048, 0x0000004f, 0x00000000, 0x00000023, 0x00000000,
-    0x00030047, 0x00000051, 0x00000018, 0x00040047, 0x00000051, 0x00000021, 0x00000001, 0x00040047, 0x00000051, 0x00000022,
-    0x00000000, 0x00050048, 0x0000007a, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x0000007a, 0x00000001, 0x00000023,
-    0x00000004, 0x00050048, 0x0000007a, 0x00000002, 0x00000023, 0x00000008, 0x00050048, 0x0000007a, 0x00000003, 0x00000023,
-    0x0000000c, 0x00050048, 0x0000007a, 0x00000004, 0x00000023, 0x00000010, 0x00050048, 0x0000007a, 0x00000005, 0x00000023,
-    0x00000014, 0x00030047, 0x0000007b, 0x00000002, 0x00050048, 0x0000007b, 0x00000000, 0x00000023, 0x00000000, 0x00040047,
-    0x00000089, 0x00000006, 0x00000004, 0x00030047, 0x0000008a, 0x00000003, 0x00040048, 0x0000008a, 0x00000000, 0x00000018,
-    0x00050048, 0x0000008a, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x0000008c, 0x00000018, 0x00040047, 0x0000008c,
-    0x00000021, 0x00000001, 0x00040047, 0x0000008c, 0x00000022, 0x00000001, 0x00040047, 0x000000a8, 0x00000006, 0x00000004,
-    0x00030047, 0x000000a9, 0x00000003, 0x00040048, 0x000000a9, 0x00000000, 0x00000018, 0x00050048, 0x000000a9, 0x00000000,
-    0x00000023, 0x00000000, 0x00030047, 0x000000ab, 0x00000018, 0x00040047, 0x000000ab, 0x00000021, 0x00000000, 0x00040047,
-    0x000000ab, 0x00000022, 0x00000001, 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00020014, 0x00000006,
-    0x00030021, 0x00000007, 0x00000006, 0x00040015, 0x0000000a, 0x00000020, 0x00000000, 0x00040020, 0x0000000b, 0x00000007,
-    0x0000000a, 0x00090021, 0x0000000c, 0x00000002, 0x0000000b, 0x0000000b, 0x0000000b, 0x0000000b, 0x0000000b, 0x0000000b,
-    0x0003001d, 0x00000016, 0x0000000a, 0x0003001e, 0x00000017, 0x00000016, 0x00040020, 0x00000018, 0x00000002, 0x00000017,
-    0x0004003b, 0x00000018, 0x00000019, 0x00000002, 0x00040015, 0x0000001a, 0x00000020, 0x00000001, 0x0004002b, 0x0000001a,
-    0x0000001b, 0x00000000, 0x00040020, 0x0000001c, 0x00000002, 0x0000000a, 0x0003001d, 0x00000020, 0x0000000a, 0x0003001e,
-    0x00000021, 0x00000020, 0x00040020, 0x00000022, 0x00000002, 0x00000021, 0x0004003b, 0x00000022, 0x00000023, 0x00000002,
-    0x0004002b, 0x0000000a, 0x00000026, 0x00000001, 0x0004002b, 0x0000000a, 0x00000027, 0x00000000, 0x0004002b, 0x0000000a,
-    0x0000002a, 0x00000006, 0x0003001d, 0x00000033, 0x0000000a, 0x0005001e, 0x00000034, 0x0000000a, 0x0000000a, 0x00000033,
-    0x00040020, 0x00000035, 0x00000002, 0x00000034, 0x0004003b, 0x00000035, 0x00000036, 0x00000002, 0x0004002b, 0x0000001a,
-    0x00000037, 0x00000001, 0x0004002b, 0x0000000a, 0x00000039, 0x00000010, 0x0004002b, 0x0000001a, 0x00000047, 0x00000002,
-    0x0004002b, 0x0000000a, 0x0000004c, 0x00000007, 0x0003001d, 0x0000004e, 0x0000000a, 0x0003001e, 0x0000004f, 0x0000004e,
-    0x00040020, 0x00000050, 0x00000002, 0x0000004f, 0x0004003b, 0x00000050, 0x00000051, 0x00000002, 0x0004002b, 0x0000000a,
-    0x00000056, 0x00000008, 0x0004002b, 0x0000000a, 0x0000005c, 0x00000009, 0x0004002b, 0x0000000a, 0x00000061, 0x0000000a,
-    0x0004002b, 0x0000000a, 0x00000066, 0x0000000b, 0x0004002b, 0x0000000a, 0x0000006b, 0x0000000c, 0x0004002b, 0x0000000a,
-    0x00000070, 0x0000000d, 0x0004002b, 0x0000000a, 0x00000075, 0x0000000e, 0x0008001e, 0x0000007a, 0x0000000a, 0x0000000a,
-    0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0003001e, 0x0000007b, 0x0000007a, 0x00040020, 0x0000007c, 0x00000009,
-    0x0000007b, 0x0004003b, 0x0000007c, 0x0000007d, 0x00000009, 0x00040020, 0x0000007e, 0x00000009, 0x0000000a, 0x0004002b,
-    0x0000001a, 0x00000085, 0x00000003, 0x0003001d, 0x00000089, 0x0000000a, 0x0003001e, 0x0000008a, 0x00000089, 0x00040020,
-    0x0000008b, 0x00000002, 0x0000008a, 0x0004003b, 0x0000008b, 0x0000008c, 0x00000002, 0x0004002b, 0x0000001a, 0x0000008d,
-    0x00000005, 0x0004002b, 0x0000001a, 0x000000a3, 0x00000004, 0x0003001d, 0x000000a8, 0x0000000a, 0x0003001e, 0x000000a9,
-    0x000000a8, 0x00040020, 0x000000aa, 0x00000002, 0x000000a9, 0x0004003b, 0x000000aa, 0x000000ab, 0x00000002, 0x0004002b,
-    0x0000000a, 0x000000b2, 0x00000002, 0x0004002b, 0x0000000a, 0x000000be, 0x00000004, 0x00050036, 0x00000002, 0x00000004,
-    0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x0000000b, 0x00000079, 0x00000007, 0x0004003b, 0x0000000b,
-    0x00000095, 0x00000007, 0x0004003b, 0x0000000b, 0x000000bf, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c0, 0x00000007,
-    0x0004003b, 0x0000000b, 0x000000c1, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c3, 0x00000007, 0x0004003b, 0x0000000b,
-    0x000000c5, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c7, 0x00000007, 0x0003003e, 0x00000079, 0x00000027, 0x00060041,
-    0x0000007e, 0x0000007f, 0x0000007d, 0x0000001b, 0x0000001b, 0x0004003d, 0x0000000a, 0x00000080, 0x0000007f, 0x000500c7,
-    0x0000000a, 0x00000081, 0x00000080, 0x00000026, 0x000500aa, 0x00000006, 0x00000082, 0x00000081, 0x00000027, 0x000300f7,
-    0x00000084, 0x00000000, 0x000400fa, 0x00000082, 0x00000083, 0x00000088, 0x000200f8, 0x00000083, 0x00060041, 0x0000007e,
-    0x00000086, 0x0000007d, 0x0000001b, 0x00000085, 0x0004003d, 0x0000000a, 0x00000087, 0x00000086, 0x0003003e, 0x00000079,
-    0x00000087, 0x000200f9, 0x00000084, 0x000200f8, 0x00000088, 0x00060041, 0x0000007e, 0x0000008e, 0x0000007d, 0x0000001b,
-    0x0000008d, 0x0004003d, 0x0000000a, 0x0000008f, 0x0000008e, 0x00060041, 0x0000001c, 0x00000090, 0x0000008c, 0x0000001b,
-    0x0000008f, 0x0004003d, 0x0000000a, 0x00000091, 0x00000090, 0x00060041, 0x0000007e, 0x00000092, 0x0000007d, 0x0000001b,
-    0x00000085, 0x0004003d, 0x0000000a, 0x00000093, 0x00000092, 0x0007000c, 0x0000000a, 0x00000094, 0x00000001, 0x00000026,
-    0x00000091, 0x00000093, 0x0003003e, 0x00000079, 0x00000094, 0x000200f9, 0x00000084, 0x000200f8, 0x00000084, 0x0003003e,
-    0x00000095, 0x00000027, 0x000200f9, 0x00000096, 0x000200f8, 0x00000096, 0x000400f6, 0x00000098, 0x00000099, 0x00000000,
-    0x000200f9, 0x0000009a, 0x000200f8, 0x0000009a, 0x0004003d, 0x0000000a, 0x0000009b, 0x00000095, 0x0004003d, 0x0000000a,
-    0x0000009c, 0x00000079, 0x000500b0, 0x00000006, 0x0000009d, 0x0000009b, 0x0000009c, 0x000400fa, 0x0000009d, 0x00000097,
-    0x00000098, 0x000200f8, 0x00000097, 0x0004003d, 0x0000000a, 0x0000009f, 0x00000095, 0x00060041, 0x0000007e, 0x000000a0,
-    0x0000007d, 0x0000001b, 0x00000037, 0x0004003d, 0x0000000a, 0x000000a1, 0x000000a0, 0x00050084, 0x0000000a, 0x000000a2,
-    0x0000009f, 0x000000a1, 0x00060041, 0x0000007e, 0x000000a4, 0x0000007d, 0x0000001b, 0x000000a3, 0x0004003d, 0x0000000a,
-    0x000000a5, 0x000000a4, 0x00050080, 0x0000000a, 0x000000a6, 0x000000a2, 0x000000a5, 0x00060041, 0x0000001c, 0x000000ae,
-    0x000000ab, 0x0000001b, 0x000000a6, 0x0004003d, 0x0000000a, 0x000000af, 0x000000ae, 0x00050080, 0x0000000a, 0x000000b3,
-    0x000000a6, 0x000000b2, 0x00060041, 0x0000001c, 0x000000b4, 0x000000ab, 0x0000001b, 0x000000b3, 0x0004003d, 0x0000000a,
-    0x000000b5, 0x000000b4, 0x00050080, 0x0000000a, 0x000000b8, 0x000000b5, 0x000000af, 0x00060041, 0x0000007e, 0x000000b9,
-    0x0000007d, 0x0000001b, 0x00000047, 0x0004003d, 0x0000000a, 0x000000ba, 0x000000b9, 0x000500ac, 0x00000006, 0x000000bb,
-    0x000000b8, 0x000000ba, 0x000300f7, 0x000000bd, 0x00000000, 0x000400fa, 0x000000bb, 0x000000bc, 0x000000bd, 0x000200f8,
-    0x000000bc, 0x0003003e, 0x000000bf, 0x000000be, 0x0003003e, 0x000000c0, 0x00000056, 0x0004003d, 0x0000000a, 0x000000c2,
-    0x00000095, 0x0003003e, 0x000000c1, 0x000000c2, 0x0003003e, 0x000000c3, 0x000000b5, 0x0003003e, 0x000000c5, 0x000000af,
-    0x0003003e, 0x000000c7, 0x00000027, 0x000a0039, 0x00000002, 0x000000c8, 0x00000013, 0x000000bf, 0x000000c0, 0x000000c1,
-    0x000000c3, 0x000000c5, 0x000000c7, 0x000200f9, 0x000000bd, 0x000200f8, 0x000000bd, 0x000200f9, 0x00000099, 0x000200f8,
-    0x00000099, 0x0004003d, 0x0000000a, 0x000000c9, 0x00000095, 0x00050080, 0x0000000a, 0x000000ca, 0x000000c9, 0x00000037,
-    0x0003003e, 0x00000095, 0x000000ca, 0x000200f9, 0x00000096, 0x000200f8, 0x00000098, 0x000100fd, 0x00010038, 0x00050036,
-    0x00000006, 0x00000008, 0x00000000, 0x00000007, 0x000200f8, 0x00000009, 0x00060041, 0x0000001c, 0x0000001d, 0x00000019,
-    0x0000001b, 0x0000001b, 0x0004003d, 0x0000000a, 0x0000001e, 0x0000001d, 0x00060041, 0x0000001c, 0x00000025, 0x00000023,
-    0x0000001b, 0x0000001e, 0x000700ea, 0x0000000a, 0x00000028, 0x00000025, 0x00000026, 0x00000027, 0x00000026, 0x000500ae,
-    0x00000006, 0x0000002b, 0x00000028, 0x0000002a, 0x000200fe, 0x0000002b, 0x00010038, 0x00050036, 0x00000002, 0x00000013,
-    0x00000000, 0x0000000c, 0x00030037, 0x0000000b, 0x0000000d, 0x00030037, 0x0000000b, 0x0000000e, 0x00030037, 0x0000000b,
-    0x0000000f, 0x00030037, 0x0000000b, 0x00000010, 0x00030037, 0x0000000b, 0x00000011, 0x00030037, 0x0000000b, 0x00000012,
-    0x000200f8, 0x00000014, 0x00040039, 0x00000006, 0x0000002e, 0x00000008, 0x000300f7, 0x00000030, 0x00000000, 0x000400fa,
-    0x0000002e, 0x0000002f, 0x00000030, 0x000200f8, 0x0000002f, 0x000100fd, 0x000200f8, 0x00000030, 0x00050041, 0x0000001c,
-    0x00000038, 0x00000036, 0x00000037, 0x000700ea, 0x0000000a, 0x0000003a, 0x00000038, 0x00000026, 0x00000027, 0x00000039,
-    0x00050080, 0x0000000a, 0x0000003e, 0x0000003a, 0x00000039, 0x00050044, 0x0000000a, 0x0000003f, 0x00000036, 0x00000002,
-    0x0004007c, 0x0000001a, 0x00000040, 0x0000003f, 0x0004007c, 0x0000000a, 0x00000041, 0x00000040, 0x000500ac, 0x00000006,
-    0x00000042, 0x0000003e, 0x00000041, 0x000300f7, 0x00000045, 0x00000000, 0x000400fa, 0x00000042, 0x00000044, 0x00000045,
-    0x000200f8, 0x00000044, 0x000100fd, 0x000200f8, 0x00000045, 0x00060041, 0x0000001c, 0x0000004a, 0x00000036, 0x00000047,
-    0x0000003a, 0x0003003e, 0x0000004a, 0x00000039, 0x00050080, 0x0000000a, 0x0000004d, 0x0000003a, 0x0000004c, 0x00060041,
-    0x0000001c, 0x00000052, 0x00000051, 0x0000001b, 0x0000001b, 0x0004003d, 0x0000000a, 0x00000053, 0x00000052, 0x00060041,
-    0x0000001c, 0x00000054, 0x00000036, 0x00000047, 0x0000004d, 0x0003003e, 0x00000054, 0x00000053, 0x00050080, 0x0000000a,
-    0x00000057, 0x0000003a, 0x00000056, 0x00060041, 0x0000001c, 0x00000058, 0x00000019, 0x0000001b, 0x0000001b, 0x0004003d,
-    0x0000000a, 0x00000059, 0x00000058, 0x00060041, 0x0000001c, 0x0000005a, 0x00000036, 0x00000047, 0x00000057, 0x0003003e,
-    0x0000005a, 0x00000059, 0x00050080, 0x0000000a, 0x0000005d, 0x0000003a, 0x0000005c, 0x0004003d, 0x0000000a, 0x0000005e,
-    0x0000000d, 0x00060041, 0x0000001c, 0x0000005f, 0x00000036, 0x00000047, 0x0000005d, 0x0003003e, 0x0000005f, 0x0000005e,
-    0x00050080, 0x0000000a, 0x00000062, 0x0000003a, 0x00000061, 0x0004003d, 0x0000000a, 0x00000063, 0x0000000e, 0x00060041,
-    0x0000001c, 0x00000064, 0x00000036, 0x00000047, 0x00000062, 0x0003003e, 0x00000064, 0x00000063, 0x00050080, 0x0000000a,
-    0x00000067, 0x0000003a, 0x00000066, 0x0004003d, 0x0000000a, 0x00000068, 0x0000000f, 0x00060041, 0x0000001c, 0x00000069,
-    0x00000036, 0x00000047, 0x00000067, 0x0003003e, 0x00000069, 0x00000068, 0x00050080, 0x0000000a, 0x0000006c, 0x0000003a,
-    0x0000006b, 0x0004003d, 0x0000000a, 0x0000006d, 0x00000010, 0x00060041, 0x0000001c, 0x0000006e, 0x00000036, 0x00000047,
-    0x0000006c, 0x0003003e, 0x0000006e, 0x0000006d, 0x00050080, 0x0000000a, 0x00000071, 0x0000003a, 0x00000070, 0x0004003d,
-    0x0000000a, 0x00000072, 0x00000011, 0x00060041, 0x0000001c, 0x00000073, 0x00000036, 0x00000047, 0x00000071, 0x0003003e,
-    0x00000073, 0x00000072, 0x00050080, 0x0000000a, 0x00000076, 0x0000003a, 0x00000075, 0x0004003d, 0x0000000a, 0x00000077,
-    0x00000012, 0x00060041, 0x0000001c, 0x00000078, 0x00000036, 0x00000047, 0x00000076, 0x0003003e, 0x00000078, 0x00000077,
-    0x000100fd, 0x00010038,
+[[maybe_unused]] const uint32_t validation_cmd_draw_indexed_indirect_index_buffer_comp_size = 1341;
+[[maybe_unused]] const uint32_t validation_cmd_draw_indexed_indirect_index_buffer_comp[1341] = {
+    0x07230203, 0x00010000, 0x0008000b, 0x000000cd, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47,
+    0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0006000f, 0x00000005, 0x00000004, 0x6e69616d,
+    0x00000000, 0x00000098, 0x00060010, 0x00000004, 0x00000011, 0x00000040, 0x00000001, 0x00000001, 0x00030003, 0x00000002,
+    0x000001c2, 0x00070004, 0x415f4c47, 0x675f4252, 0x735f7570, 0x65646168, 0x6e695f72, 0x00343674, 0x000a0004, 0x475f4c47,
+    0x4c474f4f, 0x70635f45, 0x74735f70, 0x5f656c79, 0x656e696c, 0x7269645f, 0x69746365, 0x00006576, 0x00080004, 0x475f4c47,
+    0x4c474f4f, 0x6e695f45, 0x64756c63, 0x69645f65, 0x74636572, 0x00657669, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000,
+    0x00090005, 0x00000008, 0x4378614d, 0x7245646d, 0x73726f72, 0x6e756f43, 0x61655274, 0x64656863, 0x00000028, 0x000b0005,
+    0x00000013, 0x61757047, 0x676f4c76, 0x6f727245, 0x75283472, 0x31753b31, 0x3b31753b, 0x753b3175, 0x31753b31, 0x0000003b,
+    0x00050005, 0x0000000d, 0x6f727265, 0x72675f72, 0x0070756f, 0x00060005, 0x0000000e, 0x6f727265, 0x75735f72, 0x6f635f62,
+    0x00006564, 0x00040005, 0x0000000f, 0x61726170, 0x00305f6d, 0x00040005, 0x00000010, 0x61726170, 0x00315f6d, 0x00040005,
+    0x00000011, 0x61726170, 0x00325f6d, 0x00040005, 0x00000012, 0x61726170, 0x00335f6d, 0x00070005, 0x00000017, 0x6f736552,
+    0x65637275, 0x65646e49, 0x66754278, 0x00726566, 0x00070006, 0x00000017, 0x00000000, 0x6f736572, 0x65637275, 0x646e695f,
+    0x00007865, 0x00030005, 0x00000019, 0x00000000, 0x00080005, 0x00000021, 0x45646d43, 0x726f7272, 0x756f4373, 0x7542746e,
+    0x72656666, 0x00000000, 0x00080006, 0x00000021, 0x00000000, 0x5f646d63, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000,
+    0x00030005, 0x00000023, 0x00000000, 0x00050005, 0x00000034, 0x6f727245, 0x66754272, 0x00726566, 0x00050006, 0x00000034,
+    0x00000000, 0x67616c66, 0x00000073, 0x00070006, 0x00000034, 0x00000001, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000,
+    0x00070006, 0x00000034, 0x00000002, 0x6f727265, 0x625f7372, 0x65666675, 0x00000072, 0x00030005, 0x00000036, 0x00000000,
+    0x00070005, 0x0000004f, 0x69746341, 0x6e496e6f, 0x42786564, 0x65666675, 0x00000072, 0x00070006, 0x0000004f, 0x00000000,
+    0x69746361, 0x695f6e6f, 0x7865646e, 0x00000000, 0x00030005, 0x00000051, 0x00000000, 0x00050005, 0x00000079, 0x77617264,
+    0x756f635f, 0x0000746e, 0x000c0005, 0x0000007a, 0x77617244, 0x65646e49, 0x49646578, 0x7269646e, 0x49746365, 0x7865646e,
+    0x66667542, 0x75507265, 0x61446873, 0x00006174, 0x00050006, 0x0000007a, 0x00000000, 0x67616c66, 0x00000073, 0x00080006,
+    0x0000007a, 0x00000001, 0x5f697061, 0x69727473, 0x645f6564, 0x64726f77, 0x00000073, 0x000c0006, 0x0000007a, 0x00000002,
+    0x6e756f62, 0x6e695f64, 0x5f786564, 0x66667562, 0x695f7265, 0x6369646e, 0x635f7365, 0x746e756f, 0x00000000, 0x00070006,
+    0x0000007a, 0x00000003, 0x5f697061, 0x77617264, 0x756f635f, 0x0000746e, 0x00080006, 0x0000007a, 0x00000004, 0x5f697061,
+    0x7366666f, 0x645f7465, 0x64726f77, 0x00000073, 0x000b0006, 0x0000007a, 0x00000005, 0x5f697061, 0x6e756f63, 0x75625f74,
+    0x72656666, 0x66666f5f, 0x5f746573, 0x726f7764, 0x00007364, 0x00050005, 0x0000007b, 0x66696e55, 0x496d726f, 0x006f666e,
+    0x00040006, 0x0000007b, 0x00000000, 0x00006370, 0x00030005, 0x0000007d, 0x00000000, 0x00050005, 0x0000008a, 0x6e756f43,
+    0x66754274, 0x00726566, 0x00070006, 0x0000008a, 0x00000000, 0x6e756f63, 0x75625f74, 0x72656666, 0x00000000, 0x00030005,
+    0x0000008c, 0x00000000, 0x00080005, 0x00000098, 0x475f6c67, 0x61626f6c, 0x766e496c, 0x7461636f, 0x496e6f69, 0x00000044,
+    0x00050005, 0x000000ad, 0x77617244, 0x66667542, 0x00007265, 0x000a0006, 0x000000ad, 0x00000000, 0x77617264, 0x646e695f,
+    0x64657865, 0x646e695f, 0x63657269, 0x6d635f74, 0x00007364, 0x00030005, 0x000000af, 0x00000000, 0x00040005, 0x000000c3,
+    0x61726170, 0x0000006d, 0x00040005, 0x000000c4, 0x61726170, 0x0000006d, 0x00040005, 0x000000c5, 0x61726170, 0x0000006d,
+    0x00040005, 0x000000c7, 0x61726170, 0x0000006d, 0x00040005, 0x000000c9, 0x61726170, 0x0000006d, 0x00040005, 0x000000cb,
+    0x61726170, 0x0000006d, 0x00040047, 0x00000016, 0x00000006, 0x00000004, 0x00030047, 0x00000017, 0x00000003, 0x00040048,
+    0x00000017, 0x00000000, 0x00000018, 0x00050048, 0x00000017, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000019,
+    0x00000018, 0x00040047, 0x00000019, 0x00000021, 0x00000002, 0x00040047, 0x00000019, 0x00000022, 0x00000000, 0x00040047,
+    0x00000020, 0x00000006, 0x00000004, 0x00030047, 0x00000021, 0x00000003, 0x00050048, 0x00000021, 0x00000000, 0x00000023,
+    0x00000000, 0x00040047, 0x00000023, 0x00000021, 0x00000003, 0x00040047, 0x00000023, 0x00000022, 0x00000000, 0x00040047,
+    0x00000033, 0x00000006, 0x00000004, 0x00030047, 0x00000034, 0x00000003, 0x00050048, 0x00000034, 0x00000000, 0x00000023,
+    0x00000000, 0x00050048, 0x00000034, 0x00000001, 0x00000023, 0x00000004, 0x00050048, 0x00000034, 0x00000002, 0x00000023,
+    0x00000008, 0x00040047, 0x00000036, 0x00000021, 0x00000000, 0x00040047, 0x00000036, 0x00000022, 0x00000000, 0x00040047,
+    0x0000004e, 0x00000006, 0x00000004, 0x00030047, 0x0000004f, 0x00000003, 0x00040048, 0x0000004f, 0x00000000, 0x00000018,
+    0x00050048, 0x0000004f, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000051, 0x00000018, 0x00040047, 0x00000051,
+    0x00000021, 0x00000001, 0x00040047, 0x00000051, 0x00000022, 0x00000000, 0x00050048, 0x0000007a, 0x00000000, 0x00000023,
+    0x00000000, 0x00050048, 0x0000007a, 0x00000001, 0x00000023, 0x00000004, 0x00050048, 0x0000007a, 0x00000002, 0x00000023,
+    0x00000008, 0x00050048, 0x0000007a, 0x00000003, 0x00000023, 0x0000000c, 0x00050048, 0x0000007a, 0x00000004, 0x00000023,
+    0x00000010, 0x00050048, 0x0000007a, 0x00000005, 0x00000023, 0x00000014, 0x00030047, 0x0000007b, 0x00000002, 0x00050048,
+    0x0000007b, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000089, 0x00000006, 0x00000004, 0x00030047, 0x0000008a,
+    0x00000003, 0x00040048, 0x0000008a, 0x00000000, 0x00000018, 0x00050048, 0x0000008a, 0x00000000, 0x00000023, 0x00000000,
+    0x00030047, 0x0000008c, 0x00000018, 0x00040047, 0x0000008c, 0x00000021, 0x00000001, 0x00040047, 0x0000008c, 0x00000022,
+    0x00000001, 0x00040047, 0x00000098, 0x0000000b, 0x0000001c, 0x00040047, 0x000000ac, 0x00000006, 0x00000004, 0x00030047,
+    0x000000ad, 0x00000003, 0x00040048, 0x000000ad, 0x00000000, 0x00000018, 0x00050048, 0x000000ad, 0x00000000, 0x00000023,
+    0x00000000, 0x00030047, 0x000000af, 0x00000018, 0x00040047, 0x000000af, 0x00000021, 0x00000000, 0x00040047, 0x000000af,
+    0x00000022, 0x00000001, 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00020014, 0x00000006, 0x00030021,
+    0x00000007, 0x00000006, 0x00040015, 0x0000000a, 0x00000020, 0x00000000, 0x00040020, 0x0000000b, 0x00000007, 0x0000000a,
+    0x00090021, 0x0000000c, 0x00000002, 0x0000000b, 0x0000000b, 0x0000000b, 0x0000000b, 0x0000000b, 0x0000000b, 0x0003001d,
+    0x00000016, 0x0000000a, 0x0003001e, 0x00000017, 0x00000016, 0x00040020, 0x00000018, 0x00000002, 0x00000017, 0x0004003b,
+    0x00000018, 0x00000019, 0x00000002, 0x00040015, 0x0000001a, 0x00000020, 0x00000001, 0x0004002b, 0x0000001a, 0x0000001b,
+    0x00000000, 0x00040020, 0x0000001c, 0x00000002, 0x0000000a, 0x0003001d, 0x00000020, 0x0000000a, 0x0003001e, 0x00000021,
+    0x00000020, 0x00040020, 0x00000022, 0x00000002, 0x00000021, 0x0004003b, 0x00000022, 0x00000023, 0x00000002, 0x0004002b,
+    0x0000000a, 0x00000026, 0x00000001, 0x0004002b, 0x0000000a, 0x00000027, 0x00000000, 0x0004002b, 0x0000000a, 0x0000002a,
+    0x00000006, 0x0003001d, 0x00000033, 0x0000000a, 0x0005001e, 0x00000034, 0x0000000a, 0x0000000a, 0x00000033, 0x00040020,
+    0x00000035, 0x00000002, 0x00000034, 0x0004003b, 0x00000035, 0x00000036, 0x00000002, 0x0004002b, 0x0000001a, 0x00000037,
+    0x00000001, 0x0004002b, 0x0000000a, 0x00000039, 0x00000010, 0x0004002b, 0x0000001a, 0x00000047, 0x00000002, 0x0004002b,
+    0x0000000a, 0x0000004c, 0x00000007, 0x0003001d, 0x0000004e, 0x0000000a, 0x0003001e, 0x0000004f, 0x0000004e, 0x00040020,
+    0x00000050, 0x00000002, 0x0000004f, 0x0004003b, 0x00000050, 0x00000051, 0x00000002, 0x0004002b, 0x0000000a, 0x00000056,
+    0x00000008, 0x0004002b, 0x0000000a, 0x0000005c, 0x00000009, 0x0004002b, 0x0000000a, 0x00000061, 0x0000000a, 0x0004002b,
+    0x0000000a, 0x00000066, 0x0000000b, 0x0004002b, 0x0000000a, 0x0000006b, 0x0000000c, 0x0004002b, 0x0000000a, 0x00000070,
+    0x0000000d, 0x0004002b, 0x0000000a, 0x00000075, 0x0000000e, 0x0008001e, 0x0000007a, 0x0000000a, 0x0000000a, 0x0000000a,
+    0x0000000a, 0x0000000a, 0x0000000a, 0x0003001e, 0x0000007b, 0x0000007a, 0x00040020, 0x0000007c, 0x00000009, 0x0000007b,
+    0x0004003b, 0x0000007c, 0x0000007d, 0x00000009, 0x00040020, 0x0000007e, 0x00000009, 0x0000000a, 0x0004002b, 0x0000001a,
+    0x00000085, 0x00000003, 0x0003001d, 0x00000089, 0x0000000a, 0x0003001e, 0x0000008a, 0x00000089, 0x00040020, 0x0000008b,
+    0x00000002, 0x0000008a, 0x0004003b, 0x0000008b, 0x0000008c, 0x00000002, 0x0004002b, 0x0000001a, 0x0000008d, 0x00000005,
+    0x00040017, 0x00000096, 0x0000000a, 0x00000003, 0x00040020, 0x00000097, 0x00000001, 0x00000096, 0x0004003b, 0x00000097,
+    0x00000098, 0x00000001, 0x00040020, 0x00000099, 0x00000001, 0x0000000a, 0x0004002b, 0x0000001a, 0x000000a7, 0x00000004,
+    0x0003001d, 0x000000ac, 0x0000000a, 0x0003001e, 0x000000ad, 0x000000ac, 0x00040020, 0x000000ae, 0x00000002, 0x000000ad,
+    0x0004003b, 0x000000ae, 0x000000af, 0x00000002, 0x0004002b, 0x0000000a, 0x000000b6, 0x00000002, 0x0004002b, 0x0000000a,
+    0x000000c2, 0x00000004, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b,
+    0x0000000b, 0x00000079, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c3, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c4,
+    0x00000007, 0x0004003b, 0x0000000b, 0x000000c5, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c7, 0x00000007, 0x0004003b,
+    0x0000000b, 0x000000c9, 0x00000007, 0x0004003b, 0x0000000b, 0x000000cb, 0x00000007, 0x0003003e, 0x00000079, 0x00000027,
+    0x00060041, 0x0000007e, 0x0000007f, 0x0000007d, 0x0000001b, 0x0000001b, 0x0004003d, 0x0000000a, 0x00000080, 0x0000007f,
+    0x000500c7, 0x0000000a, 0x00000081, 0x00000080, 0x00000026, 0x000500aa, 0x00000006, 0x00000082, 0x00000081, 0x00000027,
+    0x000300f7, 0x00000084, 0x00000000, 0x000400fa, 0x00000082, 0x00000083, 0x00000088, 0x000200f8, 0x00000083, 0x00060041,
+    0x0000007e, 0x00000086, 0x0000007d, 0x0000001b, 0x00000085, 0x0004003d, 0x0000000a, 0x00000087, 0x00000086, 0x0003003e,
+    0x00000079, 0x00000087, 0x000200f9, 0x00000084, 0x000200f8, 0x00000088, 0x00060041, 0x0000007e, 0x0000008e, 0x0000007d,
+    0x0000001b, 0x0000008d, 0x0004003d, 0x0000000a, 0x0000008f, 0x0000008e, 0x00060041, 0x0000001c, 0x00000090, 0x0000008c,
+    0x0000001b, 0x0000008f, 0x0004003d, 0x0000000a, 0x00000091, 0x00000090, 0x00060041, 0x0000007e, 0x00000092, 0x0000007d,
+    0x0000001b, 0x00000085, 0x0004003d, 0x0000000a, 0x00000093, 0x00000092, 0x0007000c, 0x0000000a, 0x00000094, 0x00000001,
+    0x00000026, 0x00000091, 0x00000093, 0x0003003e, 0x00000079, 0x00000094, 0x000200f9, 0x00000084, 0x000200f8, 0x00000084,
+    0x00050041, 0x00000099, 0x0000009a, 0x00000098, 0x00000027, 0x0004003d, 0x0000000a, 0x0000009b, 0x0000009a, 0x0004003d,
+    0x0000000a, 0x0000009d, 0x00000079, 0x000500ae, 0x00000006, 0x0000009e, 0x0000009b, 0x0000009d, 0x000300f7, 0x000000a0,
+    0x00000000, 0x000400fa, 0x0000009e, 0x0000009f, 0x000000a0, 0x000200f8, 0x0000009f, 0x000100fd, 0x000200f8, 0x000000a0,
+    0x00060041, 0x0000007e, 0x000000a4, 0x0000007d, 0x0000001b, 0x00000037, 0x0004003d, 0x0000000a, 0x000000a5, 0x000000a4,
+    0x00050084, 0x0000000a, 0x000000a6, 0x0000009b, 0x000000a5, 0x00060041, 0x0000007e, 0x000000a8, 0x0000007d, 0x0000001b,
+    0x000000a7, 0x0004003d, 0x0000000a, 0x000000a9, 0x000000a8, 0x00050080, 0x0000000a, 0x000000aa, 0x000000a6, 0x000000a9,
+    0x00060041, 0x0000001c, 0x000000b2, 0x000000af, 0x0000001b, 0x000000aa, 0x0004003d, 0x0000000a, 0x000000b3, 0x000000b2,
+    0x00050080, 0x0000000a, 0x000000b7, 0x000000aa, 0x000000b6, 0x00060041, 0x0000001c, 0x000000b8, 0x000000af, 0x0000001b,
+    0x000000b7, 0x0004003d, 0x0000000a, 0x000000b9, 0x000000b8, 0x00050080, 0x0000000a, 0x000000bc, 0x000000b9, 0x000000b3,
+    0x00060041, 0x0000007e, 0x000000bd, 0x0000007d, 0x0000001b, 0x00000047, 0x0004003d, 0x0000000a, 0x000000be, 0x000000bd,
+    0x000500ac, 0x00000006, 0x000000bf, 0x000000bc, 0x000000be, 0x000300f7, 0x000000c1, 0x00000000, 0x000400fa, 0x000000bf,
+    0x000000c0, 0x000000c1, 0x000200f8, 0x000000c0, 0x0003003e, 0x000000c3, 0x000000c2, 0x0003003e, 0x000000c4, 0x00000056,
+    0x0003003e, 0x000000c5, 0x0000009b, 0x0003003e, 0x000000c7, 0x000000b9, 0x0003003e, 0x000000c9, 0x000000b3, 0x0003003e,
+    0x000000cb, 0x00000027, 0x000a0039, 0x00000002, 0x000000cc, 0x00000013, 0x000000c3, 0x000000c4, 0x000000c5, 0x000000c7,
+    0x000000c9, 0x000000cb, 0x000200f9, 0x000000c1, 0x000200f8, 0x000000c1, 0x000100fd, 0x00010038, 0x00050036, 0x00000006,
+    0x00000008, 0x00000000, 0x00000007, 0x000200f8, 0x00000009, 0x00060041, 0x0000001c, 0x0000001d, 0x00000019, 0x0000001b,
+    0x0000001b, 0x0004003d, 0x0000000a, 0x0000001e, 0x0000001d, 0x00060041, 0x0000001c, 0x00000025, 0x00000023, 0x0000001b,
+    0x0000001e, 0x000700ea, 0x0000000a, 0x00000028, 0x00000025, 0x00000026, 0x00000027, 0x00000026, 0x000500ae, 0x00000006,
+    0x0000002b, 0x00000028, 0x0000002a, 0x000200fe, 0x0000002b, 0x00010038, 0x00050036, 0x00000002, 0x00000013, 0x00000000,
+    0x0000000c, 0x00030037, 0x0000000b, 0x0000000d, 0x00030037, 0x0000000b, 0x0000000e, 0x00030037, 0x0000000b, 0x0000000f,
+    0x00030037, 0x0000000b, 0x00000010, 0x00030037, 0x0000000b, 0x00000011, 0x00030037, 0x0000000b, 0x00000012, 0x000200f8,
+    0x00000014, 0x00040039, 0x00000006, 0x0000002e, 0x00000008, 0x000300f7, 0x00000030, 0x00000000, 0x000400fa, 0x0000002e,
+    0x0000002f, 0x00000030, 0x000200f8, 0x0000002f, 0x000100fd, 0x000200f8, 0x00000030, 0x00050041, 0x0000001c, 0x00000038,
+    0x00000036, 0x00000037, 0x000700ea, 0x0000000a, 0x0000003a, 0x00000038, 0x00000026, 0x00000027, 0x00000039, 0x00050080,
+    0x0000000a, 0x0000003e, 0x0000003a, 0x00000039, 0x00050044, 0x0000000a, 0x0000003f, 0x00000036, 0x00000002, 0x0004007c,
+    0x0000001a, 0x00000040, 0x0000003f, 0x0004007c, 0x0000000a, 0x00000041, 0x00000040, 0x000500ac, 0x00000006, 0x00000042,
+    0x0000003e, 0x00000041, 0x000300f7, 0x00000045, 0x00000000, 0x000400fa, 0x00000042, 0x00000044, 0x00000045, 0x000200f8,
+    0x00000044, 0x000100fd, 0x000200f8, 0x00000045, 0x00060041, 0x0000001c, 0x0000004a, 0x00000036, 0x00000047, 0x0000003a,
+    0x0003003e, 0x0000004a, 0x00000039, 0x00050080, 0x0000000a, 0x0000004d, 0x0000003a, 0x0000004c, 0x00060041, 0x0000001c,
+    0x00000052, 0x00000051, 0x0000001b, 0x0000001b, 0x0004003d, 0x0000000a, 0x00000053, 0x00000052, 0x00060041, 0x0000001c,
+    0x00000054, 0x00000036, 0x00000047, 0x0000004d, 0x0003003e, 0x00000054, 0x00000053, 0x00050080, 0x0000000a, 0x00000057,
+    0x0000003a, 0x00000056, 0x00060041, 0x0000001c, 0x00000058, 0x00000019, 0x0000001b, 0x0000001b, 0x0004003d, 0x0000000a,
+    0x00000059, 0x00000058, 0x00060041, 0x0000001c, 0x0000005a, 0x00000036, 0x00000047, 0x00000057, 0x0003003e, 0x0000005a,
+    0x00000059, 0x00050080, 0x0000000a, 0x0000005d, 0x0000003a, 0x0000005c, 0x0004003d, 0x0000000a, 0x0000005e, 0x0000000d,
+    0x00060041, 0x0000001c, 0x0000005f, 0x00000036, 0x00000047, 0x0000005d, 0x0003003e, 0x0000005f, 0x0000005e, 0x00050080,
+    0x0000000a, 0x00000062, 0x0000003a, 0x00000061, 0x0004003d, 0x0000000a, 0x00000063, 0x0000000e, 0x00060041, 0x0000001c,
+    0x00000064, 0x00000036, 0x00000047, 0x00000062, 0x0003003e, 0x00000064, 0x00000063, 0x00050080, 0x0000000a, 0x00000067,
+    0x0000003a, 0x00000066, 0x0004003d, 0x0000000a, 0x00000068, 0x0000000f, 0x00060041, 0x0000001c, 0x00000069, 0x00000036,
+    0x00000047, 0x00000067, 0x0003003e, 0x00000069, 0x00000068, 0x00050080, 0x0000000a, 0x0000006c, 0x0000003a, 0x0000006b,
+    0x0004003d, 0x0000000a, 0x0000006d, 0x00000010, 0x00060041, 0x0000001c, 0x0000006e, 0x00000036, 0x00000047, 0x0000006c,
+    0x0003003e, 0x0000006e, 0x0000006d, 0x00050080, 0x0000000a, 0x00000071, 0x0000003a, 0x00000070, 0x0004003d, 0x0000000a,
+    0x00000072, 0x00000011, 0x00060041, 0x0000001c, 0x00000073, 0x00000036, 0x00000047, 0x00000071, 0x0003003e, 0x00000073,
+    0x00000072, 0x00050080, 0x0000000a, 0x00000076, 0x0000003a, 0x00000075, 0x0004003d, 0x0000000a, 0x00000077, 0x00000012,
+    0x00060041, 0x0000001c, 0x00000078, 0x00000036, 0x00000047, 0x00000076, 0x0003003e, 0x00000078, 0x00000077, 0x000100fd,
+    0x00010038,
 };
diff --git a/layers/vulkan/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.cpp b/layers/vulkan/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.cpp
new file mode 100644
index 00000000000..d84fa2fd6d6
--- /dev/null
+++ b/layers/vulkan/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.cpp
@@ -0,0 +1,84 @@
+// *** THIS FILE IS GENERATED - DO NOT EDIT ***
+// See generate_spirv.py for modifications
+
+/***************************************************************************
+ *
+ * Copyright (c) 2021-2025 The Khronos Group Inc.
+ * Copyright (c) 2021-2025 Valve Corporation
+ * Copyright (c) 2021-2025 LunarG, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+#include "validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.h"
+
+// To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/
+[[maybe_unused]] const uint32_t validation_cmd_setup_draw_indexed_indirect_index_buffer_comp_size = 545;
+[[maybe_unused]] const uint32_t validation_cmd_setup_draw_indexed_indirect_index_buffer_comp[545] = {
+    0x07230203, 0x00010000, 0x0008000b, 0x0000003a, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47,
+    0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0005000f, 0x00000005, 0x00000004, 0x6e69616d,
+    0x00000000, 0x00060010, 0x00000004, 0x00000011, 0x00000001, 0x00000001, 0x00000001, 0x00030003, 0x00000002, 0x000001c2,
+    0x00070004, 0x415f4c47, 0x675f4252, 0x735f7570, 0x65646168, 0x6e695f72, 0x00343674, 0x000a0004, 0x475f4c47, 0x4c474f4f,
+    0x70635f45, 0x74735f70, 0x5f656c79, 0x656e696c, 0x7269645f, 0x69746365, 0x00006576, 0x00080004, 0x475f4c47, 0x4c474f4f,
+    0x6e695f45, 0x64756c63, 0x69645f65, 0x74636572, 0x00657669, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00050005,
+    0x00000008, 0x77617264, 0x756f635f, 0x0000746e, 0x000c0005, 0x0000000a, 0x77617244, 0x65646e49, 0x49646578, 0x7269646e,
+    0x49746365, 0x7865646e, 0x66667542, 0x75507265, 0x61446873, 0x00006174, 0x00050006, 0x0000000a, 0x00000000, 0x67616c66,
+    0x00000073, 0x00080006, 0x0000000a, 0x00000001, 0x5f697061, 0x69727473, 0x645f6564, 0x64726f77, 0x00000073, 0x000c0006,
+    0x0000000a, 0x00000002, 0x6e756f62, 0x6e695f64, 0x5f786564, 0x66667562, 0x695f7265, 0x6369646e, 0x635f7365, 0x746e756f,
+    0x00000000, 0x00070006, 0x0000000a, 0x00000003, 0x5f697061, 0x77617264, 0x756f635f, 0x0000746e, 0x00080006, 0x0000000a,
+    0x00000004, 0x5f697061, 0x7366666f, 0x645f7465, 0x64726f77, 0x00000073, 0x000b0006, 0x0000000a, 0x00000005, 0x5f697061,
+    0x6e756f63, 0x75625f74, 0x72656666, 0x66666f5f, 0x5f746573, 0x726f7764, 0x00007364, 0x00050005, 0x0000000b, 0x66696e55,
+    0x496d726f, 0x006f666e, 0x00040006, 0x0000000b, 0x00000000, 0x00006370, 0x00030005, 0x0000000d, 0x00000000, 0x00050005,
+    0x0000001e, 0x6e756f43, 0x66754274, 0x00726566, 0x00070006, 0x0000001e, 0x00000000, 0x6e756f63, 0x75625f74, 0x72656666,
+    0x00000000, 0x00030005, 0x00000020, 0x00000000, 0x00080005, 0x0000002a, 0x61706944, 0x49686374, 0x7269646e, 0x42746365,
+    0x65666675, 0x00000072, 0x00080006, 0x0000002a, 0x00000000, 0x70736964, 0x68637461, 0x646e695f, 0x63657269, 0x00785f74,
+    0x00080006, 0x0000002a, 0x00000001, 0x70736964, 0x68637461, 0x646e695f, 0x63657269, 0x00795f74, 0x00080006, 0x0000002a,
+    0x00000002, 0x70736964, 0x68637461, 0x646e695f, 0x63657269, 0x007a5f74, 0x00030005, 0x0000002c, 0x00000000, 0x00050048,
+    0x0000000a, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x0000000a, 0x00000001, 0x00000023, 0x00000004, 0x00050048,
+    0x0000000a, 0x00000002, 0x00000023, 0x00000008, 0x00050048, 0x0000000a, 0x00000003, 0x00000023, 0x0000000c, 0x00050048,
+    0x0000000a, 0x00000004, 0x00000023, 0x00000010, 0x00050048, 0x0000000a, 0x00000005, 0x00000023, 0x00000014, 0x00030047,
+    0x0000000b, 0x00000002, 0x00050048, 0x0000000b, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x0000001d, 0x00000006,
+    0x00000004, 0x00030047, 0x0000001e, 0x00000003, 0x00040048, 0x0000001e, 0x00000000, 0x00000018, 0x00050048, 0x0000001e,
+    0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000020, 0x00000018, 0x00040047, 0x00000020, 0x00000021, 0x00000001,
+    0x00040047, 0x00000020, 0x00000022, 0x00000001, 0x00030047, 0x0000002a, 0x00000003, 0x00050048, 0x0000002a, 0x00000000,
+    0x00000023, 0x00000000, 0x00050048, 0x0000002a, 0x00000001, 0x00000023, 0x00000004, 0x00050048, 0x0000002a, 0x00000002,
+    0x00000023, 0x00000008, 0x00040047, 0x0000002c, 0x00000021, 0x00000003, 0x00040047, 0x0000002c, 0x00000022, 0x00000001,
+    0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00040015, 0x00000006, 0x00000020, 0x00000000, 0x00040020,
+    0x00000007, 0x00000007, 0x00000006, 0x0004002b, 0x00000006, 0x00000009, 0x00000000, 0x0008001e, 0x0000000a, 0x00000006,
+    0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x0003001e, 0x0000000b, 0x0000000a, 0x00040020, 0x0000000c,
+    0x00000009, 0x0000000b, 0x0004003b, 0x0000000c, 0x0000000d, 0x00000009, 0x00040015, 0x0000000e, 0x00000020, 0x00000001,
+    0x0004002b, 0x0000000e, 0x0000000f, 0x00000000, 0x00040020, 0x00000010, 0x00000009, 0x00000006, 0x0004002b, 0x00000006,
+    0x00000013, 0x00000001, 0x00020014, 0x00000015, 0x0004002b, 0x0000000e, 0x00000019, 0x00000003, 0x0003001d, 0x0000001d,
+    0x00000006, 0x0003001e, 0x0000001e, 0x0000001d, 0x00040020, 0x0000001f, 0x00000002, 0x0000001e, 0x0004003b, 0x0000001f,
+    0x00000020, 0x00000002, 0x0004002b, 0x0000000e, 0x00000021, 0x00000005, 0x00040020, 0x00000024, 0x00000002, 0x00000006,
+    0x0005001e, 0x0000002a, 0x00000006, 0x00000006, 0x00000006, 0x00040020, 0x0000002b, 0x00000002, 0x0000002a, 0x0004003b,
+    0x0000002b, 0x0000002c, 0x00000002, 0x0004002b, 0x00000006, 0x0000002e, 0x00000040, 0x0004002b, 0x0000000e, 0x00000036,
+    0x00000001, 0x0004002b, 0x0000000e, 0x00000038, 0x00000002, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003,
+    0x000200f8, 0x00000005, 0x0004003b, 0x00000007, 0x00000008, 0x00000007, 0x0003003e, 0x00000008, 0x00000009, 0x00060041,
+    0x00000010, 0x00000011, 0x0000000d, 0x0000000f, 0x0000000f, 0x0004003d, 0x00000006, 0x00000012, 0x00000011, 0x000500c7,
+    0x00000006, 0x00000014, 0x00000012, 0x00000013, 0x000500aa, 0x00000015, 0x00000016, 0x00000014, 0x00000009, 0x000300f7,
+    0x00000018, 0x00000000, 0x000400fa, 0x00000016, 0x00000017, 0x0000001c, 0x000200f8, 0x00000017, 0x00060041, 0x00000010,
+    0x0000001a, 0x0000000d, 0x0000000f, 0x00000019, 0x0004003d, 0x00000006, 0x0000001b, 0x0000001a, 0x0003003e, 0x00000008,
+    0x0000001b, 0x000200f9, 0x00000018, 0x000200f8, 0x0000001c, 0x00060041, 0x00000010, 0x00000022, 0x0000000d, 0x0000000f,
+    0x00000021, 0x0004003d, 0x00000006, 0x00000023, 0x00000022, 0x00060041, 0x00000024, 0x00000025, 0x00000020, 0x0000000f,
+    0x00000023, 0x0004003d, 0x00000006, 0x00000026, 0x00000025, 0x00060041, 0x00000010, 0x00000027, 0x0000000d, 0x0000000f,
+    0x00000019, 0x0004003d, 0x00000006, 0x00000028, 0x00000027, 0x0007000c, 0x00000006, 0x00000029, 0x00000001, 0x00000026,
+    0x00000026, 0x00000028, 0x0003003e, 0x00000008, 0x00000029, 0x000200f9, 0x00000018, 0x000200f8, 0x00000018, 0x0004003d,
+    0x00000006, 0x0000002d, 0x00000008, 0x00050086, 0x00000006, 0x0000002f, 0x0000002d, 0x0000002e, 0x00050089, 0x00000006,
+    0x00000031, 0x0000002d, 0x0000002e, 0x000500ac, 0x00000015, 0x00000032, 0x00000031, 0x00000009, 0x000600a9, 0x00000006,
+    0x00000033, 0x00000032, 0x00000013, 0x00000009, 0x00050080, 0x00000006, 0x00000034, 0x0000002f, 0x00000033, 0x00050041,
+    0x00000024, 0x00000035, 0x0000002c, 0x0000000f, 0x0003003e, 0x00000035, 0x00000034, 0x00050041, 0x00000024, 0x00000037,
+    0x0000002c, 0x00000036, 0x0003003e, 0x00000037, 0x00000013, 0x00050041, 0x00000024, 0x00000039, 0x0000002c, 0x00000038,
+    0x0003003e, 0x00000039, 0x00000013, 0x000100fd, 0x00010038,
+};
diff --git a/layers/vulkan/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.h b/layers/vulkan/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.h
new file mode 100644
index 00000000000..08d9c8d53b2
--- /dev/null
+++ b/layers/vulkan/generated/validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.h
@@ -0,0 +1,30 @@
+// *** THIS FILE IS GENERATED - DO NOT EDIT ***
+// See generate_spirv.py for modifications
+
+/***************************************************************************
+ *
+ * Copyright (c) 2021-2025 The Khronos Group Inc.
+ * Copyright (c) 2021-2025 Valve Corporation
+ * Copyright (c) 2021-2025 LunarG, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ****************************************************************************/
+
+#pragma once
+
+#include <cstdint>
+
+// To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/
+extern const uint32_t validation_cmd_setup_draw_indexed_indirect_index_buffer_comp_size;
+extern const uint32_t validation_cmd_setup_draw_indexed_indirect_index_buffer_comp[];
diff --git a/scripts/generate_source.py b/scripts/generate_source.py
index e63f7d7148b..50efc2c69f3 100755
--- a/scripts/generate_source.py
+++ b/scripts/generate_source.py
@@ -422,8 +422,8 @@ def main(argv):
         'validation_cmd_draw_indexed_comp.cpp',
         'validation_cmd_draw_indexed_indirect_index_buffer_comp.h',
         'validation_cmd_draw_indexed_indirect_index_buffer_comp.cpp',
-        'validation_cmd_draw_indexed_indirect_vertex_buffer_comp.h',
-        'validation_cmd_draw_indexed_indirect_vertex_buffer_comp.cpp',
+        'validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.h',
+        'validation_cmd_setup_draw_indexed_indirect_index_buffer_comp.cpp',
         'validation_cmd_draw_mesh_indirect_comp.h',
         'validation_cmd_draw_mesh_indirect_comp.cpp',
         'validation_cmd_trace_rays_rgen.h',
diff --git a/tests/unit/gpu_av_index_buffer.cpp b/tests/unit/gpu_av_index_buffer.cpp
index 31120e1a99a..c5ef1128547 100644
--- a/tests/unit/gpu_av_index_buffer.cpp
+++ b/tests/unit/gpu_av_index_buffer.cpp
@@ -54,6 +54,57 @@ TEST_F(NegativeGpuAVIndexBuffer, IndexBufferOOB) {
     m_errorMonitor->VerifyFound();
 }
 
+TEST_F(NegativeGpuAVIndexBuffer, IndexBufferOOB2) {
+    TEST_DESCRIPTION("Validate overruning the index buffer - large indirect draw");
+    AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
+    AddRequiredExtensions(VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME);
+    AddRequiredFeature(vkt::Feature::multiDrawIndirect);
+    RETURN_IF_SKIP(InitGpuAvFramework());
+
+    RETURN_IF_SKIP(InitState());
+    InitRenderTarget();
+
+    CreatePipelineHelper pipe(*this);
+    pipe.CreateGraphicsPipeline();
+
+    std::vector<VkDrawIndexedIndirectCommand> draw_params(64 * 64 + 1);
+    for (size_t i = 0; i < draw_params.size(); ++i) {
+        draw_params[i].indexCount = 3;
+        draw_params[i].instanceCount = 1;
+        draw_params[i].vertexOffset = 0;
+        draw_params[i].firstInstance = 0;
+
+        // What really needs to be tested is ability to catch an error in the last
+        // indirect draw, if validation dispatch size is computed incorrectly
+        // it will be missed
+        if (i == (draw_params.size() - 1)) {
+            draw_params[i].firstIndex = 1;
+        } else {
+            draw_params[i].firstIndex = 0;
+        }
+    }
+    vkt::Buffer draw_params_buffer = vkt::IndirectBuffer<VkDrawIndexedIndirectCommand>(*m_device, draw_params);
+
+    vkt::Buffer index_buffer = vkt::IndexBuffer<uint32_t>(*m_device, {1, 2, 3});
+
+    VkCommandBufferBeginInfo begin_info = vku::InitStructHelper();
+    m_command_buffer.Begin(&begin_info);
+    m_command_buffer.BeginRenderPass(m_renderPassBeginInfo);
+    vk::CmdBindPipeline(m_command_buffer.handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle());
+
+    m_errorMonitor->SetDesiredErrorRegex(
+        "VUID-VkDrawIndexedIndirectCommand-robustBufferAccess2-08798",
+        "Index 4 is not within the bound index buffer. Computed from VkDrawIndexedIndirectCommand\\[4096\\]");
+    vk::CmdBindIndexBuffer(m_command_buffer.handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT32);
+    vk::CmdDrawIndexedIndirect(m_command_buffer.handle(), draw_params_buffer.handle(), 0, size32(draw_params),
+                               sizeof(VkDrawIndexedIndirectCommand));
+    m_command_buffer.EndRenderPass();
+    m_command_buffer.End();
+    m_default_queue->Submit(m_command_buffer);
+    m_default_queue->Wait();
+    m_errorMonitor->VerifyFound();
+}
+
 TEST_F(NegativeGpuAVIndexBuffer, IndirectDrawBadVertexIndex32) {
     TEST_DESCRIPTION("Validate illegal index buffer values - uint32_t index");
     AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);


Reviews:
user: login: spencer-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T16:30:15Z
user: login: spencer-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T16:30:36Z
user: login: spencer-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T16:31:34Z
user: login: spencer-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T16:34:15Z
user: login: spencer-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T16:34:46Z
user: login: arno-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:08:47Z
user: login: artem-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:10:42Z
user: login: artem-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:11:29Z
user: login: arno-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:12:19Z
user: login: spencer-lunarg
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:15:47Z
user: login: spencer-lunarg
body: can confirm gets perf increase locally
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:43:40Z

Review comments:
diff_hunk: @@ -0,0 +1,72 @@
+// Copyright (c) 2021-2025 The Khronos Group Inc.
+// Copyright (c) 2021-2025 Valve Corporation
+// Copyright (c) 2021-2025 LunarG, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#version 450
+
+#extension GL_GOOGLE_include_directive : enable
+
+#include "common.h"
+#include "draw_push_data.h"
+
+layout(push_constant) uniform UniformInfo {
+    DrawIndexedIndirectIndexBufferPushData pc;
+};
+
+/*
+Matching Struct from the API
+struct VkDrawIndexedIndirectCommand {
+    uint indexCount;
+    uint instanceCount;
+    uint firstIndex;
+    uint vertexOffset;
+    uint firstInstance;
+};
+*/
+const uint kIndexCount = 0;
+const uint kInstancekCount = 1;
+const uint kFirstIndex = 2;
+const uint kVertexOffset = 3;
+const uint kFirstInstance = 4;
+
+// CountBuffer won't be bound for non-count draws
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
+    uint count_buffer[];
+};
+
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_DispatchIndirectBuffer) 
+buffer DipatchIndirectBuffer {
+    uint dispatch_indirect_x;
+    uint dispatch_indirect_y;
+    uint dispatch_indirect_z;
+};
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+    uint draw_count = 0;
+    if ((pc.flags & kIndexedIndirectDrawFlags_DrawCountFromBuffer) == 0) {
+        draw_count = pc.api_draw_count;
+    } else {
+        // Need to clamp draw count value stored in count buffer to the maxDrawCount
+        // that was specified at vkCmdDrawIndexedIndirect time.
+        // pc.api_draw_count is used to store maxDrawCount
+        draw_count = min(count_buffer[pc.api_count_buffer_offset_dwords], pc.api_draw_count);
+    }
+    
+    dispatch_indirect_x = (draw_count / 64) + uint((draw_count % 64) > 0);
path: layers/gpuav/shaders/validation_cmd/setup_draw_indexed_indirect_index_buffer.comp
user: login: spencer-lunarg
body: is this `64` just tied to the thread count in the other shader? should we at least have a comment, or better, a `shader_constant.h` they both use
created_at: 2025-03-24T16:30:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,72 @@
+// Copyright (c) 2021-2025 The Khronos Group Inc.
+// Copyright (c) 2021-2025 Valve Corporation
+// Copyright (c) 2021-2025 LunarG, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#version 450
+
+#extension GL_GOOGLE_include_directive : enable
+
+#include "common.h"
+#include "draw_push_data.h"
+
+layout(push_constant) uniform UniformInfo {
+    DrawIndexedIndirectIndexBufferPushData pc;
+};
+
+/*
+Matching Struct from the API
+struct VkDrawIndexedIndirectCommand {
+    uint indexCount;
+    uint instanceCount;
+    uint firstIndex;
+    uint vertexOffset;
+    uint firstInstance;
+};
+*/
+const uint kIndexCount = 0;
path: layers/gpuav/shaders/validation_cmd/setup_draw_indexed_indirect_index_buffer.comp
user: login: spencer-lunarg
body: remove for keeping the shader minimal?
created_at: 2025-03-24T16:30:35Z
author_association: CONTRIBUTOR
diff_hunk: @@ -41,16 +41,18 @@ const uint kFirstIndex = 2;
 const uint kVertexOffset = 3;
 const uint kFirstInstance = 4;
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) readonly buffer DrawBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) 
+readonly buffer DrawBuffer {
     uint draw_indexed_indirect_cmds[];
 };
 
 // CountBuffer won't be bound for non-count draws
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) readonly buffer CountBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
     uint count_buffer[];
 };
 
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
path: layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp
user: login: spencer-lunarg
body: why only 64? comment to at least say "just from testing" or something if there is required meaning it couldn't be updated in the future for some reason
created_at: 2025-03-24T16:31:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -870,42 +915,94 @@ void DrawIndexedIndirectIndexBuffer(Validator &gpuav, CommandBufferSubState &cb_
                                             loc](Validator &gpuav, CommandBufferSubState &cb_state) {
         SharedDrawValidationResources &shared_draw_validation_resources =
             gpuav.shared_resources_manager.Get<SharedDrawValidationResources>(gpuav, loc);
-        if (!shared_draw_validation_resources.valid) return;
+        if (!shared_draw_validation_resources.valid) {
+            return;
+        }
+        ComputeValidationPipeline<SetupDrawCountDispatchIndirectShader> &setup_validation_dispatch_pipeline =
+            gpuav.shared_resources_manager.Get<ComputeValidationPipeline<SetupDrawCountDispatchIndirectShader>>(
+                gpuav, loc, cb_state.GetErrorLoggingDescSetLayout());
+        if (!shared_draw_validation_resources.valid) {
+            return;
+        }
         ComputeValidationPipeline<DrawIndexedIndirectIndexBufferShader> &validation_pipeline =
             gpuav.shared_resources_manager.Get<ComputeValidationPipeline<DrawIndexedIndirectIndexBufferShader>>(
                 gpuav, loc, cb_state.GetErrorLoggingDescSetLayout());
-        if (!validation_pipeline.valid) return;
+        if (!validation_pipeline.valid) {
+            return;
+        }
 
         const uint32_t index_bits_size = GetIndexBitsSize(index_buffer_binding.index_type);
         const uint32_t max_indices_in_buffer = static_cast<uint32_t>(index_buffer_binding.size / (index_bits_size / 8u));
+
+        VkBufferCreateInfo validation_dispatch_params_buffer_ci = vku::InitStructHelper();
+        validation_dispatch_params_buffer_ci.size = 3 * sizeof(uint32_t);
+        validation_dispatch_params_buffer_ci.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT;
+        VmaAllocationCreateInfo alloc_info = {};
+        alloc_info.requiredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+        vko::Buffer validation_dispatch_params_buffer =
+            cb_state.gpu_resources_manager.GetManagedBuffer(gpuav, loc, validation_dispatch_params_buffer_ci, alloc_info);
+        if (validation_dispatch_params_buffer.IsDestroyed()) {
+            return;
+        }
+
+        glsl::DrawIndexedIndirectIndexBufferPushData push_constants{};
+        if (api_count_buffer != VK_NULL_HANDLE) {
+            push_constants.flags |= glsl::kIndexedIndirectDrawFlags_DrawCountFromBuffer;
+            push_constants.api_count_buffer_offset_dwords = (uint32_t)api_count_buffer_offset / sizeof(uint32_t);
+        }
+        push_constants.api_stride_dwords = api_stride / sizeof(uint32_t);
+        push_constants.bound_index_buffer_indices_count = max_indices_in_buffer;
+        push_constants.api_draw_count = api_draw_count;
+
         {
-            DrawIndexedIndirectIndexBufferShader shader_resources;
+            SetupDrawCountDispatchIndirectShader setup_validation_shader_resources;
+            setup_validation_shader_resources.push_constants = push_constants;
             if (api_count_buffer != VK_NULL_HANDLE) {
-                shader_resources.push_constants.flags |= glsl::kIndexedIndirectDrawFlags_DrawCountFromBuffer;
-                shader_resources.count_buffer_binding.info = {api_count_buffer, 0, sizeof(uint32_t)};
-                shader_resources.push_constants.api_count_buffer_offset_dwords =
-                    (uint32_t)api_count_buffer_offset / sizeof(uint32_t);
-
+                setup_validation_shader_resources.count_buffer_binding.info = {api_count_buffer, 0, sizeof(uint32_t)};
             } else {
-                shader_resources.count_buffer_binding.info = {shared_draw_validation_resources.dummy_buffer.VkHandle(), 0,
-                                                              VK_WHOLE_SIZE};
+                setup_validation_shader_resources.count_buffer_binding.info = {
+                    shared_draw_validation_resources.dummy_buffer.VkHandle(), 0, VK_WHOLE_SIZE};
             }
 
-            shader_resources.push_constants.api_stride_dwords = api_stride / sizeof(uint32_t);
-            shader_resources.push_constants.bound_index_buffer_indices_count = max_indices_in_buffer;
-            shader_resources.push_constants.api_draw_count = api_draw_count;
+            setup_validation_shader_resources.dispatch_indirect_buffer_binding.info = {validation_dispatch_params_buffer.VkHandle(),
+                                                                                       0, VK_WHOLE_SIZE};
 
-            shader_resources.draw_buffer_binding.info = {api_buffer, 0, VK_WHOLE_SIZE};
-            shader_resources.push_constants.api_offset_dwords = (uint32_t)api_offset / sizeof(uint32_t);
+            setup_validation_dispatch_pipeline.BindShaderResources(gpuav, cb_state, draw_i, error_logger_i,
+                                                                   setup_validation_shader_resources);
 
-            validation_pipeline.BindShaderResources(gpuav, cb_state, draw_i, error_logger_i, shader_resources);
+            DispatchCmdBindPipeline(cb_state.VkHandle(), VK_PIPELINE_BIND_POINT_COMPUTE,
+                                    setup_validation_dispatch_pipeline.pipeline);
+            DispatchCmdDispatch(cb_state.VkHandle(), 1, 1, 1);
path: layers/gpuav/validation_cmd/gpuav_draw.cpp
user: login: spencer-lunarg
body: maybe a quick comment for those only reading the CPU code quick that we need to do this because the draw_count is a GPU decided value we need to get out
created_at: 2025-03-24T16:34:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,72 @@
+// Copyright (c) 2021-2025 The Khronos Group Inc.
+// Copyright (c) 2021-2025 Valve Corporation
+// Copyright (c) 2021-2025 LunarG, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#version 450
+
+#extension GL_GOOGLE_include_directive : enable
+
+#include "common.h"
+#include "draw_push_data.h"
+
+layout(push_constant) uniform UniformInfo {
+    DrawIndexedIndirectIndexBufferPushData pc;
+};
+
+/*
+Matching Struct from the API
+struct VkDrawIndexedIndirectCommand {
+    uint indexCount;
+    uint instanceCount;
+    uint firstIndex;
+    uint vertexOffset;
+    uint firstInstance;
+};
+*/
+const uint kIndexCount = 0;
+const uint kInstancekCount = 1;
+const uint kFirstIndex = 2;
+const uint kVertexOffset = 3;
+const uint kFirstInstance = 4;
+
+// CountBuffer won't be bound for non-count draws
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
+    uint count_buffer[];
+};
+
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_DispatchIndirectBuffer) 
+buffer DipatchIndirectBuffer {
+    uint dispatch_indirect_x;
+    uint dispatch_indirect_y;
+    uint dispatch_indirect_z;
+};
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+    uint draw_count = 0;
+    if ((pc.flags & kIndexedIndirectDrawFlags_DrawCountFromBuffer) == 0) {
path: layers/gpuav/shaders/validation_cmd/setup_draw_indexed_indirect_index_buffer.comp
user: login: spencer-lunarg
body: quick question,  I really only saw one test before this PR, are we actually testing both code paths here?
created_at: 2025-03-24T16:34:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -41,16 +41,18 @@ const uint kFirstIndex = 2;
 const uint kVertexOffset = 3;
 const uint kFirstInstance = 4;
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) readonly buffer DrawBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) 
+readonly buffer DrawBuffer {
     uint draw_indexed_indirect_cmds[];
 };
 
 // CountBuffer won't be bound for non-count draws
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) readonly buffer CountBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
     uint count_buffer[];
 };
 
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
path: layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp
user: login: arno-lunarg
body: That's wave size on nvidia, AMD is 32 I think
created_at: 2025-03-24T17:08:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -41,16 +41,18 @@ const uint kFirstIndex = 2;
 const uint kVertexOffset = 3;
 const uint kFirstInstance = 4;
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) readonly buffer DrawBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) 
+readonly buffer DrawBuffer {
     uint draw_indexed_indirect_cmds[];
 };
 
 // CountBuffer won't be bound for non-count draws
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) readonly buffer CountBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
     uint count_buffer[];
 };
 
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
path: layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp
user: login: artem-lunarg
body: nvidia was always 32, AMD on GCN is 64 and RDNA supports both 64/32 but I guess 32 is native.
created_at: 2025-03-24T17:10:42Z
author_association: CONTRIBUTOR
diff_hunk: @@ -41,16 +41,18 @@ const uint kFirstIndex = 2;
 const uint kVertexOffset = 3;
 const uint kFirstInstance = 4;
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) readonly buffer DrawBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) 
+readonly buffer DrawBuffer {
     uint draw_indexed_indirect_cmds[];
 };
 
 // CountBuffer won't be bound for non-count draws
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) readonly buffer CountBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
     uint count_buffer[];
 };
 
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
path: layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp
user: login: artem-lunarg
body: but 64 is good default for local size group to run well on different devices.
created_at: 2025-03-24T17:11:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,72 @@
+// Copyright (c) 2021-2025 The Khronos Group Inc.
+// Copyright (c) 2021-2025 Valve Corporation
+// Copyright (c) 2021-2025 LunarG, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#version 450
+
+#extension GL_GOOGLE_include_directive : enable
+
+#include "common.h"
+#include "draw_push_data.h"
+
+layout(push_constant) uniform UniformInfo {
+    DrawIndexedIndirectIndexBufferPushData pc;
+};
+
+/*
+Matching Struct from the API
+struct VkDrawIndexedIndirectCommand {
+    uint indexCount;
+    uint instanceCount;
+    uint firstIndex;
+    uint vertexOffset;
+    uint firstInstance;
+};
+*/
+const uint kIndexCount = 0;
+const uint kInstancekCount = 1;
+const uint kFirstIndex = 2;
+const uint kVertexOffset = 3;
+const uint kFirstInstance = 4;
+
+// CountBuffer won't be bound for non-count draws
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
+    uint count_buffer[];
+};
+
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_DispatchIndirectBuffer) 
+buffer DipatchIndirectBuffer {
+    uint dispatch_indirect_x;
+    uint dispatch_indirect_y;
+    uint dispatch_indirect_z;
+};
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+    uint draw_count = 0;
+    if ((pc.flags & kIndexedIndirectDrawFlags_DrawCountFromBuffer) == 0) {
path: layers/gpuav/shaders/validation_cmd/setup_draw_indexed_indirect_index_buffer.comp
user: login: arno-lunarg
body: not here I think, this count buffer logic is the same for every check in `gpuav_draw` so I did not bother to do that here
created_at: 2025-03-24T17:12:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -41,16 +41,18 @@ const uint kFirstIndex = 2;
 const uint kVertexOffset = 3;
 const uint kFirstInstance = 4;
 
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) readonly buffer DrawBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) 
+readonly buffer DrawBuffer {
     uint draw_indexed_indirect_cmds[];
 };
 
 // CountBuffer won't be bound for non-count draws
-layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) readonly buffer CountBuffer {
+layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) 
+readonly buffer CountBuffer {
     uint count_buffer[];
 };
 
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
path: layers/gpuav/shaders/validation_cmd/draw_indexed_indirect_index_buffer.comp
user: login: spencer-lunarg
body: > That's wave size on nvidia, AMD is 32 I think

mixed up, 32 on NVIDIA and the AMD RDNA has a way to swap between 64 and 32 (there is a vendor extension to do this and its done for you)

I guess what I wanted is 

1. Say "64" because it works well across everything
2. Make sure there is something that maps this to `dispatch_indirect_x = (draw_count / 64) + uint((draw_count % 64) > 0);` as I assume those both need to be `64` in this case
created_at: 2025-03-24T17:15:47Z
author_association: CONTRIBUTOR

PR comments:
user: login: ci-tester-lunarg
created_at: 2025-03-24T16:23:32Z
body: CI Vulkan-ValidationLayers build queued with queue ID 403406.
author_association: COLLABORATOR
user: login: ci-tester-lunarg
created_at: 2025-03-24T16:25:01Z
body: CI Vulkan-ValidationLayers build # 19536 running.
author_association: COLLABORATOR
user: login: ci-tester-lunarg
created_at: 2025-03-24T16:29:57Z
body: CI Vulkan-ValidationLayers build queued with queue ID 403424.
author_association: COLLABORATOR
user: login: ci-tester-lunarg
created_at: 2025-03-24T16:30:05Z
body: CI Vulkan-ValidationLayers build # 19537 running.
author_association: COLLABORATOR
user: login: ci-tester-lunarg
created_at: 2025-03-24T17:08:20Z
body: CI Vulkan-ValidationLayers build # 19537 passed.
author_association: COLLABORATOR
user: login: ci-tester-lunarg
created_at: 2025-03-24T17:26:18Z
body: CI Vulkan-ValidationLayers build queued with queue ID 403532.
author_association: COLLABORATOR
user: login: ci-tester-lunarg
created_at: 2025-03-24T17:30:05Z
body: CI Vulkan-ValidationLayers build # 19539 running.
author_association: COLLABORATOR
user: login: ci-tester-lunarg
created_at: 2025-03-24T18:05:26Z
body: CI Vulkan-ValidationLayers build # 19539 passed.
author_association: COLLABORATOR