From fb6b47811d5adca7fe3d4785c84b9a1af38d9a5d Mon Sep 17 00:00:00 2001 From: Jeremy Gebben Date: Fri, 2 Aug 2024 17:02:24 -0600 Subject: [PATCH] gpu: Check index buffer contents in pre-draw validation This involves splitting up draw.vert into separate shaders for non-indexed indirect, indexed (both indirect and direct) and mesh draw calls. Fixes #2492 --- BUILD.gn | 8 +- layers/CMakeLists.txt | 8 +- layers/gpu/cmd_validation/gpuav_draw.cpp | 834 +++++++++++++----- layers/gpu/cmd_validation/gpuav_draw.h | 18 +- layers/gpu/core/gpuav.h | 2 +- layers/gpu/core/gpuav_record.cpp | 67 +- layers/gpu/error_message/gpuav_vuids.cpp | 9 + layers/gpu/error_message/gpuav_vuids.h | 2 + layers/gpu/resources/gpu_resources.cpp | 2 +- layers/gpu/resources/gpu_resources.h | 7 +- layers/gpu/shaders/cmd_validation/draw.vert | 123 --- .../shaders/cmd_validation/draw_push_data.h | 81 ++ .../shaders/cmd_validation/indexed_draw.vert | 158 ++++ .../shaders/cmd_validation/indirect_draw.vert | 78 ++ .../gpu/shaders/cmd_validation/mesh_draw.vert | 88 ++ layers/gpu/shaders/gpu_error_codes.h | 13 +- layers/utils/vk_layer_utils.h | 15 + .../generated/cmd_validation_draw_vert.cpp | 243 ----- .../cmd_validation_indexed_draw_vert.cpp | 291 ++++++ .../cmd_validation_indexed_draw_vert.h | 30 + .../cmd_validation_indirect_draw_vert.cpp | 167 ++++ .../cmd_validation_indirect_draw_vert.h | 30 + .../cmd_validation_mesh_draw_vert.cpp | 203 +++++ ...vert.h => cmd_validation_mesh_draw_vert.h} | 4 +- scripts/generate_source.py | 8 +- tests/CMakeLists.txt | 2 + tests/framework/buffer_helper.cpp | 31 + tests/framework/buffer_helper.h | 36 + tests/unit/gpu_av_index_buffer_positive.cpp | 60 ++ tests/unit/gpu_av_indirect_buffer.cpp | 590 ++++++++++++- tests/unit/gpu_av_positive.cpp | 50 ++ 31 files changed, 2642 insertions(+), 616 deletions(-) delete mode 100644 layers/gpu/shaders/cmd_validation/draw.vert create mode 100644 layers/gpu/shaders/cmd_validation/draw_push_data.h create mode 100644 layers/gpu/shaders/cmd_validation/indexed_draw.vert create mode 100644 layers/gpu/shaders/cmd_validation/indirect_draw.vert create mode 100644 layers/gpu/shaders/cmd_validation/mesh_draw.vert delete mode 100644 layers/vulkan/generated/cmd_validation_draw_vert.cpp create mode 100644 layers/vulkan/generated/cmd_validation_indexed_draw_vert.cpp create mode 100644 layers/vulkan/generated/cmd_validation_indexed_draw_vert.h create mode 100644 layers/vulkan/generated/cmd_validation_indirect_draw_vert.cpp create mode 100644 layers/vulkan/generated/cmd_validation_indirect_draw_vert.h create mode 100644 layers/vulkan/generated/cmd_validation_mesh_draw_vert.cpp rename layers/vulkan/generated/{cmd_validation_draw_vert.h => cmd_validation_mesh_draw_vert.h} (90%) create mode 100644 tests/framework/buffer_helper.cpp create mode 100644 tests/framework/buffer_helper.h create mode 100644 tests/unit/gpu_av_index_buffer_positive.cpp diff --git a/BUILD.gn b/BUILD.gn index 8d04f68ece9..c9c251900b3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -335,8 +335,12 @@ vvl_sources = [ "layers/vulkan/generated/cmd_validation_copy_buffer_to_image_comp.h", "layers/vulkan/generated/cmd_validation_dispatch_comp.cpp", "layers/vulkan/generated/cmd_validation_dispatch_comp.h", - "layers/vulkan/generated/cmd_validation_draw_vert.cpp", - "layers/vulkan/generated/cmd_validation_draw_vert.h", + "layers/vulkan/generated/cmd_validation_indexed_draw_vert.h", + "layers/vulkan/generated/cmd_validation_indexed_draw_vert.cpp", + "layers/vulkan/generated/cmd_validation_indirect_draw_vert.h", + "layers/vulkan/generated/cmd_validation_indirect_draw_vert.cpp", + "layers/vulkan/generated/cmd_validation_mesh_draw_vert.h", + "layers/vulkan/generated/cmd_validation_mesh_draw_vert.cpp", "layers/vulkan/generated/cmd_validation_trace_rays_rgen.cpp", "layers/vulkan/generated/cmd_validation_trace_rays_rgen.h", "layers/vulkan/generated/command_validation.cpp", diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt index 2e286b3e777..fd4942bbe13 100644 --- a/layers/CMakeLists.txt +++ b/layers/CMakeLists.txt @@ -213,8 +213,12 @@ target_sources(vvl PRIVATE ${API_TYPE}/generated/cmd_validation_copy_buffer_to_image_comp.cpp ${API_TYPE}/generated/cmd_validation_dispatch_comp.h ${API_TYPE}/generated/cmd_validation_dispatch_comp.cpp - ${API_TYPE}/generated/cmd_validation_draw_vert.h - ${API_TYPE}/generated/cmd_validation_draw_vert.cpp + ${API_TYPE}/generated/cmd_validation_indexed_draw_vert.h + ${API_TYPE}/generated/cmd_validation_indexed_draw_vert.cpp + ${API_TYPE}/generated/cmd_validation_indirect_draw_vert.h + ${API_TYPE}/generated/cmd_validation_indirect_draw_vert.cpp + ${API_TYPE}/generated/cmd_validation_mesh_draw_vert.h + ${API_TYPE}/generated/cmd_validation_mesh_draw_vert.cpp ${API_TYPE}/generated/cmd_validation_trace_rays_rgen.h ${API_TYPE}/generated/cmd_validation_trace_rays_rgen.cpp gpu/core/gpu_settings.h diff --git a/layers/gpu/cmd_validation/gpuav_draw.cpp b/layers/gpu/cmd_validation/gpuav_draw.cpp index 5a7ff1b4d4a..1d28be3ee92 100644 --- a/layers/gpu/cmd_validation/gpuav_draw.cpp +++ b/layers/gpu/cmd_validation/gpuav_draw.cpp @@ -22,29 +22,37 @@ #include "state_tracker/render_pass_state.h" #include "gpu/shaders/gpu_error_header.h" #include "gpu/shaders/gpu_shaders_constants.h" -#include "generated/cmd_validation_draw_vert.h" +#include "gpu/shaders/cmd_validation/draw_push_data.h" +#include "generated/cmd_validation_indexed_draw_vert.h" +#include "generated/cmd_validation_indirect_draw_vert.h" +#include "generated/cmd_validation_mesh_draw_vert.h" // See gpu/shaders/cmd_validation/draw.vert constexpr uint32_t kPushConstantDWords = 11u; namespace gpuav { +enum ValidationShaders { IndexedDraw, IndirectDraw, MeshDraw, ValidationShadersCount }; + struct SharedDrawValidationResources final { - VkShaderModule shader_module = VK_NULL_HANDLE; + std::array shader_modules = {}; VkDescriptorSetLayout ds_layout = VK_NULL_HANDLE; VkPipelineLayout pipeline_layout = VK_NULL_HANDLE; - VkShaderEXT shader_object = VK_NULL_HANDLE; - vvl::concurrent_unordered_map renderpass_to_pipeline; + std::array shader_objects = {}; + vvl::concurrent_unordered_map> renderpass_to_pipeline; + gpu::DeviceMemoryBlock dummy_buffer; // Used to fill unused buffers in validation pipelines VkDevice device = VK_NULL_HANDLE; + VmaAllocator vma_allocator; SharedDrawValidationResources(Validator &gpuav, VkDescriptorSetLayout error_output_desc_set_layout, bool use_shader_objects, const Location &loc) - : device(gpuav.device) { + : device(gpuav.device), vma_allocator(gpuav.vma_allocator_) { VkResult result = VK_SUCCESS; std::vector bindings = { {0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT, nullptr}, // count buffer {1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT, nullptr}, // draw buffer + {2, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT, nullptr}, // index buffer }; VkDescriptorSetLayoutCreateInfo ds_layout_ci = vku::InitStructHelper(); @@ -73,38 +81,62 @@ struct SharedDrawValidationResources final { return; } - if (use_shader_objects) { - VkShaderCreateInfoEXT shader_ci = vku::InitStructHelper(); - shader_ci.stage = VK_SHADER_STAGE_VERTEX_BIT; - shader_ci.codeType = VK_SHADER_CODE_TYPE_SPIRV_EXT; - shader_ci.codeSize = cmd_validation_draw_vert_size * sizeof(uint32_t); - shader_ci.pCode = cmd_validation_draw_vert; - shader_ci.pName = "main"; - shader_ci.setLayoutCount = 1u; - shader_ci.pSetLayouts = &ds_layout; - shader_ci.pushConstantRangeCount = 1; - shader_ci.pPushConstantRanges = &push_constant_range; - result = DispatchCreateShadersEXT(device, 1u, &shader_ci, nullptr, &shader_object); - if (result != VK_SUCCESS) { - gpuav.InternalError(device, loc, "Unable to create shader object."); - return; - } - } else { - VkShaderModuleCreateInfo shader_module_ci = vku::InitStructHelper(); - shader_module_ci.codeSize = cmd_validation_draw_vert_size * sizeof(uint32_t); - shader_module_ci.pCode = cmd_validation_draw_vert; - result = DispatchCreateShaderModule(device, &shader_module_ci, nullptr, &shader_module); - if (result != VK_SUCCESS) { - gpuav.InternalError(device, loc, "Unable to create shader module."); - return; + VkBufferCreateInfo buffer_info = vku::InitStructHelper(); + buffer_info.size = 512; + buffer_info.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; + VmaAllocationCreateInfo alloc_info = {}; + buffer_info.size = buffer_info.size; + result = vmaCreateBuffer(gpuav.vma_allocator_, &buffer_info, &alloc_info, &dummy_buffer.buffer, &dummy_buffer.allocation, + nullptr); + if (result != VK_SUCCESS) { + gpuav.InternalError(gpuav.device, loc, "Unable to allocate device memory for dummy buffer.", true); + return; + } + + std::array, ValidationShadersCount> validation_shaders_spirv; + validation_shaders_spirv[IndexedDraw] = {cmd_validation_indexed_draw_vert, cmd_validation_indexed_draw_vert_size}; + validation_shaders_spirv[IndirectDraw] = {cmd_validation_indirect_draw_vert, cmd_validation_indirect_draw_vert_size}; + validation_shaders_spirv[MeshDraw] = {cmd_validation_mesh_draw_vert, cmd_validation_mesh_draw_vert_size}; + + for (int validation_shader_i = 0; validation_shader_i < int(ValidationShadersCount); ++validation_shader_i) { + const auto [spirv, spirv_dwords_count] = validation_shaders_spirv[validation_shader_i]; + + if (use_shader_objects) { + VkShaderCreateInfoEXT shader_ci = vku::InitStructHelper(); + shader_ci.stage = VK_SHADER_STAGE_VERTEX_BIT; + shader_ci.codeType = VK_SHADER_CODE_TYPE_SPIRV_EXT; + shader_ci.codeSize = spirv_dwords_count * sizeof(uint32_t); + shader_ci.pCode = spirv; + shader_ci.pName = "main"; + shader_ci.setLayoutCount = 1u; + shader_ci.pSetLayouts = &ds_layout; + shader_ci.pushConstantRangeCount = 1; + shader_ci.pPushConstantRanges = &push_constant_range; + result = DispatchCreateShadersEXT(device, 1u, &shader_ci, nullptr, &shader_objects[validation_shader_i]); + if (result != VK_SUCCESS) { + gpuav.InternalError(device, loc, "Unable to create shader object."); + return; + } + + } else { + VkShaderModuleCreateInfo shader_module_ci = vku::InitStructHelper(); + shader_module_ci.codeSize = spirv_dwords_count * sizeof(uint32_t); + shader_module_ci.pCode = spirv; + result = DispatchCreateShaderModule(device, &shader_module_ci, nullptr, &shader_modules[validation_shader_i]); + if (result != VK_SUCCESS) { + gpuav.InternalError(device, loc, "Unable to create shader module."); + return; + } } } } ~SharedDrawValidationResources() { - if (shader_module != VK_NULL_HANDLE) { - DispatchDestroyShaderModule(device, shader_module, nullptr); - shader_module = VK_NULL_HANDLE; + for (VkShaderModule &shader_module : shader_modules) { + if (shader_module != VK_NULL_HANDLE) { + DispatchDestroyShaderModule(device, shader_module, nullptr); + shader_module = VK_NULL_HANDLE; + } } if (ds_layout != VK_NULL_HANDLE) { DispatchDestroyDescriptorSetLayout(device, ds_layout, nullptr); @@ -114,107 +146,211 @@ struct SharedDrawValidationResources final { DispatchDestroyPipelineLayout(device, pipeline_layout, nullptr); pipeline_layout = VK_NULL_HANDLE; } + + dummy_buffer.Destroy(vma_allocator); + auto to_destroy = renderpass_to_pipeline.snapshot(); for (auto &entry : to_destroy) { - DispatchDestroyPipeline(device, entry.second, nullptr); + for (VkPipeline pipeline : entry.second) { + DispatchDestroyPipeline(device, pipeline, nullptr); + } renderpass_to_pipeline.erase(entry.first); } - if (shader_object != VK_NULL_HANDLE) { - DispatchDestroyShaderEXT(device, shader_object, nullptr); - shader_object = VK_NULL_HANDLE; + for (VkShaderEXT &shader_object : shader_objects) { + if (shader_object != VK_NULL_HANDLE) { + DispatchDestroyShaderEXT(device, shader_object, nullptr); + shader_object = VK_NULL_HANDLE; + } } } bool IsValid() const { - return (shader_module != VK_NULL_HANDLE || shader_object != VK_NULL_HANDLE) && ds_layout != VK_NULL_HANDLE && - pipeline_layout != VK_NULL_HANDLE && device != VK_NULL_HANDLE; + // if shader_modules[ValidationShadersCount - 1] is valid, + // it means that constructor got through constructing all its members + return shader_modules[ValidationShadersCount - 1] != VK_NULL_HANDLE; } }; // This function will add the returned VkPipeline handle to another object incharge of destroying it. Caller does NOT have to // destroy it -static VkPipeline GetDrawValidationPipeline(Validator &gpuav, SharedDrawValidationResources &shared_draw_resources, - VkRenderPass render_pass, const Location &loc) { - VkPipeline validation_pipeline = VK_NULL_HANDLE; +static VkPipeline GetDrawValidationPipeline(Validator &gpuav, SharedDrawValidationResources &shared_draw_validation_resources, + ValidationShaders validation_shader, VkRenderPass render_pass, const Location &loc) { // NOTE: for dynamic rendering, render_pass will be VK_NULL_HANDLE but we'll use that as a map // key anyways; - if (auto pipeline_entry = shared_draw_resources.renderpass_to_pipeline.find(render_pass); - pipeline_entry != shared_draw_resources.renderpass_to_pipeline.end()) { - validation_pipeline = pipeline_entry->second; - } - if (validation_pipeline != VK_NULL_HANDLE) { + if (auto pipeline_entry = shared_draw_validation_resources.renderpass_to_pipeline.find(render_pass); + pipeline_entry != shared_draw_validation_resources.renderpass_to_pipeline.end()) { + VkPipeline validation_pipeline = pipeline_entry->second[validation_shader]; + assert(validation_pipeline != VK_NULL_HANDLE); return validation_pipeline; } - VkPipelineShaderStageCreateInfo pipeline_stage_ci = vku::InitStructHelper(); - pipeline_stage_ci.stage = VK_SHADER_STAGE_VERTEX_BIT; - pipeline_stage_ci.module = shared_draw_resources.shader_module; - pipeline_stage_ci.pName = "main"; - - VkGraphicsPipelineCreateInfo pipeline_ci = vku::InitStructHelper(); - VkPipelineVertexInputStateCreateInfo vertex_input_state = vku::InitStructHelper(); - VkPipelineInputAssemblyStateCreateInfo input_assembly_state = vku::InitStructHelper(); - input_assembly_state.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; - VkPipelineRasterizationStateCreateInfo rasterization_state = vku::InitStructHelper(); - rasterization_state.rasterizerDiscardEnable = VK_TRUE; - VkPipelineColorBlendStateCreateInfo color_blend_state = vku::InitStructHelper(); - - pipeline_ci.pVertexInputState = &vertex_input_state; - pipeline_ci.pInputAssemblyState = &input_assembly_state; - pipeline_ci.pRasterizationState = &rasterization_state; - pipeline_ci.pColorBlendState = &color_blend_state; - pipeline_ci.renderPass = render_pass; - pipeline_ci.layout = shared_draw_resources.pipeline_layout; - pipeline_ci.stageCount = 1; - pipeline_ci.pStages = &pipeline_stage_ci; - - VkResult result = DispatchCreateGraphicsPipelines(gpuav.device, VK_NULL_HANDLE, 1, &pipeline_ci, nullptr, &validation_pipeline); - if (result != VK_SUCCESS) { - gpuav.InternalError(gpuav.device, loc, "Unable to create graphics pipeline."); - return VK_NULL_HANDLE; + + // Create all validation pipeline for the input render_pass + std::array validation_pipelines = {}; + for (int validation_shader_i = 0; validation_shader_i < ValidationShadersCount; ++validation_shader_i) { + VkPipelineShaderStageCreateInfo pipeline_stage_ci = vku::InitStructHelper(); + pipeline_stage_ci.stage = VK_SHADER_STAGE_VERTEX_BIT; + pipeline_stage_ci.module = shared_draw_validation_resources.shader_modules[validation_shader_i]; + pipeline_stage_ci.pName = "main"; + + VkGraphicsPipelineCreateInfo pipeline_ci = vku::InitStructHelper(); + VkPipelineVertexInputStateCreateInfo vertex_input_state = vku::InitStructHelper(); + VkPipelineInputAssemblyStateCreateInfo input_assembly_state = vku::InitStructHelper(); + input_assembly_state.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + VkPipelineRasterizationStateCreateInfo rasterization_state = vku::InitStructHelper(); + rasterization_state.rasterizerDiscardEnable = VK_TRUE; + VkPipelineColorBlendStateCreateInfo color_blend_state = vku::InitStructHelper(); + + pipeline_ci.pVertexInputState = &vertex_input_state; + pipeline_ci.pInputAssemblyState = &input_assembly_state; + pipeline_ci.pRasterizationState = &rasterization_state; + pipeline_ci.pColorBlendState = &color_blend_state; + pipeline_ci.renderPass = render_pass; + pipeline_ci.layout = shared_draw_validation_resources.pipeline_layout; + pipeline_ci.stageCount = 1; + pipeline_ci.pStages = &pipeline_stage_ci; + + VkResult result = DispatchCreateGraphicsPipelines(gpuav.device, VK_NULL_HANDLE, 1, &pipeline_ci, nullptr, + &validation_pipelines[validation_shader_i]); + if (result != VK_SUCCESS) { + gpuav.InternalError(gpuav.device, loc, "Unable to create graphics pipeline."); + return VK_NULL_HANDLE; + } } - shared_draw_resources.renderpass_to_pipeline.insert(render_pass, validation_pipeline); - return validation_pipeline; + shared_draw_validation_resources.renderpass_to_pipeline.insert(render_pass, validation_pipelines); + return validation_pipelines[validation_shader]; } void DestroyRenderPassMappedResources(Validator &gpuav, VkRenderPass render_pass) { - auto *shared_draw_resources = gpuav.shared_resources_manager.TryGet(); + auto *shared_draw_validation_resources = gpuav.shared_resources_manager.TryGet(); - if (!shared_draw_resources || !shared_draw_resources->IsValid()) { + if (!shared_draw_validation_resources || !shared_draw_validation_resources->IsValid()) { return; } - auto pipeline = shared_draw_resources->renderpass_to_pipeline.pop(render_pass); - if (pipeline != shared_draw_resources->renderpass_to_pipeline.end()) { - DispatchDestroyPipeline(gpuav.device, pipeline->second, nullptr); + auto pipelines = shared_draw_validation_resources->renderpass_to_pipeline.pop(render_pass); + if (pipelines != shared_draw_validation_resources->renderpass_to_pipeline.end()) { + for (VkPipeline pipeline : pipelines->second) { + DispatchDestroyPipeline(gpuav.device, pipeline, nullptr); + } } } -void InsertIndirectDrawValidation(Validator &gpuav, const Location &loc, CommandBuffer &cb_state, VkBuffer indirect_buffer, - VkDeviceSize indirect_offset, uint32_t draw_count, VkBuffer count_buffer, - VkDeviceSize count_buffer_offset, uint32_t stride) { - if (!gpuav.gpuav_settings.validate_indirect_draws_buffers) { - return; +struct IndirectInfo { + IndirectInfo() = default; + IndirectInfo(Validator &gpuav, const vvl::Buffer &buffer_state_, VkDeviceSize offset_, size_t indirect_cmd_byte_size_, + uint32_t stride_) { + init(gpuav, buffer_state_, offset_, indirect_cmd_byte_size_, stride_); + } + + void init(Validator &gpuav, const vvl::Buffer &buffer_state_, VkDeviceSize offset_, size_t indirect_cmd_byte_size_, + uint32_t stride_) { + buffer = buffer_state_.VkHandle(); + buffer_offset = offset_; + stride = stride_; + // Buffer size must be >= (stride * (drawCount - 1) + offset + sizeof(cmd)) + buffer_size = buffer_state_.create_info.size; + if (buffer_offset < buffer_size) { + buffer_range = buffer_size - buffer_offset; + } + if (buffer_range >= indirect_cmd_byte_size_) { + max_draw_count = 1 + uint32_t((buffer_range - indirect_cmd_byte_size_) / stride); + } + } + + bool HasInfo() const { return buffer != VK_NULL_HANDLE; } + + VkBuffer buffer = VK_NULL_HANDLE; + VkDeviceSize buffer_size = 0; + VkDeviceSize buffer_offset = 0; + VkDeviceSize buffer_range = 0; + uint32_t stride = 0; + uint32_t max_draw_count = 0; // #ARNO_TODO investigate usage +}; + +template +static void SetupIndirectBufferValidation(Validator &gpuav, const SharedDrawValidationResources &shared_draw_validation_reources, + const IndirectInfo &indirect_info, uint32_t draw_count, Push &push_constants, + std::vector &desc_writes, + std::vector &desc_buffer_infos) { + VkDescriptorBufferInfo desc_buffer_info = {}; + if (indirect_info.HasInfo()) { + push_constants.flags |= glsl::kPreDrawValidationFlags_DrawBuffer; + if (!gpuav.enabled_features.drawIndirectFirstInstance) { + push_constants.flags |= glsl::kPreDrawValidationFlags_FirstInstance; + } + push_constants.draw_count = draw_count; + push_constants.draw_stride = indirect_info.stride / sizeof(uint32_t); + desc_buffer_info.buffer = indirect_info.buffer; + desc_buffer_info.offset = indirect_info.buffer_offset; + desc_buffer_info.range = VK_WHOLE_SIZE; + } else { + // Per the Vulkan spec, a buffer has to be bound, even if it is not used + // Otherwise self validation will fail. + // Just bound the indirect buffer to the count buffer binding, + // it will not be used anyway. + desc_buffer_info.buffer = shared_draw_validation_reources.dummy_buffer.buffer; + desc_buffer_info.offset = 0; + desc_buffer_info.range = VK_WHOLE_SIZE; + } + + desc_buffer_infos.push_back(desc_buffer_info); + + auto desc_write = vku::InitStruct(); + desc_write.dstBinding = glsl::kPreDrawBinding_IndirectBuffer; + desc_write.descriptorCount = 1; + desc_write.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + desc_writes.push_back(desc_write); +} + +template +static void SetupCountBufferValidation(Validator &gpuav, const SharedDrawValidationResources &draw_validation_resources, + const IndirectInfo &indirect_info, VkBuffer count_buffer, VkDeviceSize count_buffer_offset, + Push &push_constants, std::vector &desc_writes, + std::vector &desc_buffer_infos) { + VkDescriptorBufferInfo desc_buffer_info = {}; + if (count_buffer) { + assert(gpuav.phys_dev_props.limits.maxDrawIndirectCount > 0); + push_constants.flags = glsl::kPreDrawValidationFlags_CountBuffer; + push_constants.prop_count_limit = gpuav.phys_dev_props.limits.maxDrawIndirectCount; + push_constants.buffer_count_limit = indirect_info.max_draw_count; + + desc_buffer_info.buffer = count_buffer; + desc_buffer_info.offset = count_buffer_offset; + desc_buffer_info.range = VK_WHOLE_SIZE; + } else { + // Per the Vulkan spec, a buffer has to be bound, even if it is not used + // Otherwise self validation will fail. + // Just bound the indirect buffer to the count buffer binding, + // it will not be used anyway. + desc_buffer_info.buffer = draw_validation_resources.dummy_buffer.buffer; + desc_buffer_info.offset = 0; + desc_buffer_info.range = sizeof(uint32_t); } + desc_buffer_infos.push_back(desc_buffer_info); + auto desc_write = vku::InitStruct(); + desc_write.dstBinding = glsl::kPreDrawBinding_CountBuffer; + desc_write.descriptorCount = 1; + desc_write.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + desc_writes.push_back(desc_write); +} + +static void DispatchDiagnosticDraw(Validator &gpuav, SharedDrawValidationResources &shared_draw_validation_resources, + const Location &loc, CommandBuffer &cb_state, ValidationShaders validation_shader, + const void *push_constants_data, uint32_t push_constants_data_byte_size, + std::vector &desc_writes, + std::vector &buffer_infos) { const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_GRAPHICS); auto const &last_bound = cb_state.lastBound[lv_bind_point]; const auto *pipeline_state = last_bound.pipeline_state; const bool use_shader_objects = pipeline_state == nullptr; - auto &shared_draw_resources = gpuav.shared_resources_manager.Get( - gpuav, cb_state.GetValidationCmdCommonDescriptorSetLayout(), use_shader_objects, loc); - - assert(shared_draw_resources.IsValid()); - if (!shared_draw_resources.IsValid()) { - return; - } - VkPipeline validation_pipeline = VK_NULL_HANDLE; if (!use_shader_objects) { - validation_pipeline = - GetDrawValidationPipeline(gpuav, shared_draw_resources, cb_state.activeRenderPass.get()->VkHandle(), loc); + validation_pipeline = GetDrawValidationPipeline(gpuav, shared_draw_validation_resources, validation_shader, + cb_state.activeRenderPass.get()->VkHandle(), loc); if (validation_pipeline == VK_NULL_HANDLE) { gpuav.InternalError(cb_state.VkHandle(), loc, "Could not find or create a pipeline."); return; @@ -222,142 +358,419 @@ void InsertIndirectDrawValidation(Validator &gpuav, const Location &loc, Command } const VkDescriptorSet draw_validation_desc_set = - cb_state.gpu_resources_manager.GetManagedDescriptorSet(shared_draw_resources.ds_layout); + cb_state.gpu_resources_manager.GetManagedDescriptorSet(shared_draw_validation_resources.ds_layout); if (draw_validation_desc_set == VK_NULL_HANDLE) { gpuav.InternalError(cb_state.VkHandle(), loc, "Unable to allocate descriptor set."); return; } - std::vector buffer_infos; - buffer_infos.emplace_back(VkDescriptorBufferInfo{indirect_buffer, 0, VK_WHOLE_SIZE}); - if (count_buffer) { - buffer_infos.emplace_back(VkDescriptorBufferInfo{count_buffer, 0, VK_WHOLE_SIZE}); - } - - std::vector desc_writes{}; - for (size_t i = 0; i < buffer_infos.size(); ++i) { - VkWriteDescriptorSet &desc_write = desc_writes.emplace_back(); - desc_write = vku::InitStructHelper(); - desc_write.dstBinding = uint32_t(i); - desc_write.descriptorCount = 1; - desc_write.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; - desc_write.pBufferInfo = &buffer_infos[i]; - desc_write.dstSet = draw_validation_desc_set; - } - DispatchUpdateDescriptorSets(gpuav.device, static_cast(desc_writes.size()), desc_writes.data(), 0, NULL); - // Insert a draw that can examine some device memory right before the draw we're validating (Pre Draw Validation) // // NOTE that this validation does not attempt to abort invalid api calls as most other validation does. A crash // or DEVICE_LOST resulting from the invalid call will prevent preceeding validation errors from being reported. // Save current graphics pipeline state - const vvl::Func command = loc.function; RestorablePipelineState restorable_state(cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS); - using vvl::Func; - const bool is_mesh_call = - (command == Func::vkCmdDrawMeshTasksIndirectCountEXT || command == Func::vkCmdDrawMeshTasksIndirectCountNV || - command == Func::vkCmdDrawMeshTasksIndirectEXT || command == Func::vkCmdDrawMeshTasksIndirectNV); - - const bool is_count_call = - (command == Func::vkCmdDrawIndirectCount || command == Func::vkCmdDrawIndirectCountKHR || - command == Func::vkCmdDrawIndexedIndirectCount || command == Func::vkCmdDrawIndexedIndirectCountKHR || - command == Func::vkCmdDrawMeshTasksIndirectCountEXT || command == Func::vkCmdDrawMeshTasksIndirectCountNV); - - uint32_t push_constants[kPushConstantDWords] = {}; - VkDeviceSize indirect_buffer_size = 0; - if (is_count_call) { - // Validate count buffer - if (count_buffer_offset > std::numeric_limits::max()) { - gpuav.InternalError(cb_state.VkHandle(), loc, - "Count buffer offset is larger than can be contained in an unsigned int."); - return; + + for (size_t i = 0; i < buffer_infos.size(); ++i) { + desc_writes[i].dstSet = draw_validation_desc_set; + desc_writes[i].pBufferInfo = &buffer_infos[i]; + } + DispatchUpdateDescriptorSets(gpuav.device, static_cast(desc_writes.size()), desc_writes.data(), 0, NULL); + // Insert diagnostic draw + if (use_shader_objects) { + VkShaderStageFlagBits stage = VK_SHADER_STAGE_VERTEX_BIT; + DispatchCmdBindShadersEXT(cb_state.VkHandle(), 1u, &stage, + &shared_draw_validation_resources.shader_objects[validation_shader]); + } else { + DispatchCmdBindPipeline(cb_state.VkHandle(), VK_PIPELINE_BIND_POINT_GRAPHICS, validation_pipeline); + } + // push_constants buffer size >128, need to consider maxPushConstantsSize + assert(push_constants_data_byte_size <= 128); + DispatchCmdPushConstants(cb_state.VkHandle(), shared_draw_validation_resources.pipeline_layout, VK_SHADER_STAGE_VERTEX_BIT, 0, + push_constants_data_byte_size, push_constants_data); + BindValidationCmdsCommonDescSet(cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, shared_draw_validation_resources.pipeline_layout, + cb_state.draw_index, static_cast(cb_state.per_command_error_loggers.size())); + DispatchCmdBindDescriptorSets(cb_state.VkHandle(), VK_PIPELINE_BIND_POINT_GRAPHICS, + shared_draw_validation_resources.pipeline_layout, glsl::kDiagPerCmdDescriptorSet, 1, + &draw_validation_desc_set, 0, nullptr); + DispatchCmdDraw(cb_state.VkHandle(), 3, 1, 0, 0); // TODO: this 3 assumes triangles I think, probably could be 1? +} + +void InsertIndirectDrawValidation(Validator &gpuav, const Location &loc, CommandBuffer &cb_state, + vvl::Buffer &indirect_buffer_state, VkDeviceSize indirect_offset, uint32_t draw_count, + VkBuffer count_buffer, VkDeviceSize count_buffer_offset, uint32_t stride) { + if (!gpuav.gpuav_settings.validate_indirect_draws_buffers) { + return; + } + + const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_GRAPHICS); + auto const &last_bound = cb_state.lastBound[lv_bind_point]; + const auto *pipeline_state = last_bound.pipeline_state; + const bool use_shader_objects = pipeline_state == nullptr; + + auto &shared_draw_validation_resources = gpuav.shared_resources_manager.Get( + gpuav, cb_state.GetValidationCmdCommonDescriptorSetLayout(), use_shader_objects, loc); + if (!shared_draw_validation_resources.IsValid()) { + gpuav.InternalError(cb_state.VkHandle(), loc, "Could not create shared draw resources."); + return; + } + + glsl::DrawIndirectPushData push_constants = {}; + + const IndirectInfo indirect_info(gpuav, indirect_buffer_state, indirect_offset, sizeof(VkDrawIndirectCommand), stride); + + std::vector desc_writes; + std::vector buffer_infos; + + SetupIndirectBufferValidation(gpuav, shared_draw_validation_resources, indirect_info, draw_count, push_constants, desc_writes, + buffer_infos); + SetupCountBufferValidation(gpuav, shared_draw_validation_resources, indirect_info, count_buffer, count_buffer_offset, + push_constants, desc_writes, buffer_infos); + + DispatchDiagnosticDraw(gpuav, shared_draw_validation_resources, loc, cb_state, ValidationShaders::IndirectDraw, &push_constants, + sizeof(push_constants), desc_writes, buffer_infos); + + CommandBuffer::ErrorLoggerFunc error_logger = [loc, indirect_info](Validator &gpuav, const uint32_t *error_record, + const LogObjectList &objlist) { + bool skip = false; + + using namespace glsl; + + if (error_record[kHeaderErrorGroupOffset] != kErrorGroupGpuPreDraw) { + assert(false); + return skip; } - // Buffer size must be >= (stride * (drawCount - 1) + offset + sizeof(VkDrawIndirectCommand)) - uint32_t struct_size; - if (command == Func::vkCmdDrawIndirectCount || command == Func::vkCmdDrawIndirectCountKHR) { - struct_size = sizeof(VkDrawIndirectCommand); - } else if (command == Func::vkCmdDrawIndexedIndirectCount || command == Func::vkCmdDrawIndexedIndirectCountKHR) { - struct_size = sizeof(VkDrawIndexedIndirectCommand); - } else { - assert(command == Func::vkCmdDrawMeshTasksIndirectCountEXT || command == Func::vkCmdDrawMeshTasksIndirectCountNV); - struct_size = sizeof(VkDrawMeshTasksIndirectCommandEXT); + const GpuVuid &vuids = GetGpuVuid(loc.function); + + switch (error_record[kHeaderErrorSubCodeOffset]) { + case kErrorSubCodePreDrawBufferSize: { + const uint32_t count = error_record[kPreActionParamOffset_0]; + const uint32_t offset = + static_cast(indirect_info.buffer_offset); // TODO: why cast to uin32_t? If it is changed, + // think about also doing it in the error message + const uint32_t draw_size = (indirect_info.stride * (count - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)); + + const char *vuid = nullptr; + if (count == 1) { + vuid = vuids.count_exceeds_bufsize_1; + } else { + vuid = vuids.count_exceeds_bufsize; + } + skip |= gpuav.LogError(vuid, objlist, loc, + "Indirect draw count of %" PRIu32 " would exceed buffer size %" PRIu64 + " of buffer %s " + "stride = %" PRIu32 " offset = %" PRIu32 + " (stride * (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) = %" PRIu32 ".", + count, indirect_info.buffer_size, gpuav.FormatHandle(indirect_info.buffer).c_str(), + indirect_info.stride, offset, draw_size); + break; + } + case kErrorSubCodePreDrawCountLimit: { + const uint32_t count = error_record[kPreActionParamOffset_0]; + skip |= gpuav.LogError(vuids.count_exceeds_device_limit, objlist, loc, + "Indirect draw count of %" PRIu32 " would exceed maxDrawIndirectCount limit of %" PRIu32 ".", + count, gpuav.phys_dev_props.limits.maxDrawIndirectCount); + break; + } + case kErrorSubCodePreDrawFirstInstance: { + const uint32_t index = error_record[kPreActionParamOffset_0]; + gpuav.LogError( + vuids.first_instance_not_zero, objlist, loc, + "The drawIndirectFirstInstance feature is not enabled, but the firstInstance member of the %s structure at " + "index %" PRIu32 " is not zero.", + String(loc.function), index); + break; + } + default: + break; } - auto indirect_buffer_state = gpuav.Get(indirect_buffer); - indirect_buffer_size = indirect_buffer_state->create_info.size; - const uint64_t first_command_bytes = struct_size + indirect_offset; - uint32_t max_count; - if (first_command_bytes > indirect_buffer_size) { - max_count = 0; - } else { - max_count = 1 + static_cast(std::floor(((indirect_buffer_size - first_command_bytes) / stride))); + + return skip; + }; + + cb_state.per_command_error_loggers.emplace_back(std::move(error_logger)); +} + +/* + bufferBindingAddress = buffer[binding].baseAddress + offset[binding]; + + if (bindingDesc.inputRate == VK_VERTEX_INPUT_RATE_VERTEX) + effectiveVertexOffset = vertexIndex * stride; + else + if (divisor == 0) + effectiveVertexOffset = firstInstance * stride; + else + effectiveVertexOffset = (firstInstance + ((instanceIndex - firstInstance) / divisor)) * stride; + + attribAddress = bufferBindingAddress + effectiveVertexOffset + attribDesc.offset; + + end = (size - offset[binding]) E (index * stride) + attrib.offset + attrib.size; + + max_index = (size - offset - attrib.offset - attrib.size) / stride +*/ + +// Returns the smallest vertex attributes count among the set of bound vertex buffers. +// Used to detect out of bounds indices in index buffers. +// If no vertex buffer is bound, std::numeric_limits::max() is returned, +// indicating that no index can be out of bound. +static VkDeviceSize SmallestVertexAttributesCount(const vvl::CommandBuffer &cb_state) { + // If there is no bound vertex buffers, cannot have + VkDeviceSize min_vertex_attributes_count = std::numeric_limits::max(); + + const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_GRAPHICS); + auto const &last_bound = cb_state.lastBound[lv_bind_point]; + const auto *pipeline_state = last_bound.pipeline_state; + const bool use_shader_objects = pipeline_state == nullptr; + + const bool dynamic_vertex_input = use_shader_objects || pipeline_state->IsDynamic(CB_DYNAMIC_STATE_VERTEX_INPUT_EXT); + + const auto &vertex_attribute_descriptions = dynamic_vertex_input + ? cb_state.dynamic_state_value.vertex_attribute_descriptions + : pipeline_state->vertex_input_state->vertex_attribute_descriptions; + + for (uint32_t i = 0; i < vertex_attribute_descriptions.size(); i++) { + const auto &attribute_description = vertex_attribute_descriptions[i]; + + const uint32_t vertex_binding = attribute_description.binding; + + auto find_vbb = cb_state.current_vertex_buffer_binding_info.find(vertex_binding); + if (find_vbb == cb_state.current_vertex_buffer_binding_info.cend()) { + // This is a validation error + continue; } - assert(gpuav.phys_dev_props.limits.maxDrawIndirectCount > 0); - push_constants[0] = (is_mesh_call) ? glsl::kPreDrawSelectMeshCountBuffer : glsl::kPreDrawSelectCountBuffer; - push_constants[1] = gpuav.phys_dev_props.limits.maxDrawIndirectCount; - push_constants[2] = max_count; - push_constants[3] = static_cast((count_buffer_offset / sizeof(uint32_t))); - } else if ((command == Func::vkCmdDrawIndirect || command == Func::vkCmdDrawIndexedIndirect) && - !gpuav.enabled_features.drawIndirectFirstInstance) { - // Validate buffer for firstInstance check instead of count buffer check - push_constants[0] = glsl::kPreDrawSelectDrawBuffer; - push_constants[1] = draw_count; - if (command == Func::vkCmdDrawIndirect) { - push_constants[2] = - static_cast((indirect_offset + offsetof(struct VkDrawIndirectCommand, firstInstance)) / sizeof(uint32_t)); - } else { - assert(command == Func::vkCmdDrawIndexedIndirect); - push_constants[2] = static_cast( - (indirect_offset + offsetof(struct VkDrawIndexedIndirectCommand, firstInstance)) / sizeof(uint32_t)); + const vvl::VertexBufferBinding &vbb = find_vbb->second; + VkDeviceSize actual_stride = vbb.stride; + if (actual_stride == 0) { + // Vertex attributes are tightly packed + actual_stride = vkuFormatElementSize(attribute_description.format); } - push_constants[3] = stride / sizeof(uint32_t); + + const VkDeviceSize effective_vertex_buffer_size = vbb.size - vbb.offset; + + const VkDeviceSize vertex_attributes_count = effective_vertex_buffer_size / actual_stride; + + min_vertex_attributes_count = std::min(min_vertex_attributes_count, vertex_attributes_count); } + return min_vertex_attributes_count; +} - bool emit_task_error = false; - if (is_mesh_call && gpuav.phys_dev_props.limits.maxPushConstantsSize >= kPushConstantDWords * sizeof(uint32_t)) { - if (!is_count_call) { - // Select was set in count check for count call - push_constants[0] = glsl::kPreDrawSelectMeshNoCount; +void InsertIndexedDrawValidation(Validator &gpuav, const Location &loc, CommandBuffer &cb_state, VkBuffer indirect_buffer, + VkDeviceSize indirect_offset, uint32_t draw_count, VkBuffer count_buffer, + VkDeviceSize count_buffer_offset, uint32_t stride, uint32_t first_index, uint32_t index_count) { + if (!gpuav.gpuav_settings.validate_indirect_draws_buffers) { + return; + } + + const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_GRAPHICS); + auto const &last_bound = cb_state.lastBound[lv_bind_point]; + const auto *pipeline_state = last_bound.pipeline_state; + const bool use_shader_objects = pipeline_state == nullptr; + + auto &shared_draw_validation_resources = gpuav.shared_resources_manager.Get( + gpuav, cb_state.GetValidationCmdCommonDescriptorSetLayout(), use_shader_objects, loc); + if (!shared_draw_validation_resources.IsValid()) { + gpuav.InternalError(cb_state.VkHandle(), loc, "Could not create shared draw resources."); + return; + } + + glsl::DrawIndexedPushData push_constants = {}; + + std::vector desc_writes; + std::vector buffer_infos; + + IndirectInfo indirect_info = {}; + // #ARNO_TODO same here, need to always bind ALL descriptors + if (indirect_buffer) { + auto indirect_buffer_state = gpuav.Get(indirect_buffer); + if (!indirect_buffer_state) { + gpuav.InternalError(LogObjectList(cb_state.VkHandle(), indirect_buffer), loc, "buffer must be a valid VkBuffer handle"); + return; } - const VkShaderStageFlags stages = pipeline_state->create_info_shaders; - push_constants[4] = static_cast(indirect_offset / sizeof(uint32_t)); - push_constants[5] = is_count_call ? 0 : draw_count; - push_constants[6] = stride / sizeof(uint32_t); - if (stages & VK_SHADER_STAGE_TASK_BIT_EXT) { - emit_task_error = true; - push_constants[7] = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxTaskWorkGroupCount[0]; - push_constants[8] = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxTaskWorkGroupCount[1]; - push_constants[9] = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxTaskWorkGroupCount[2]; - push_constants[10] = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxTaskWorkGroupTotalCount; - } else { - push_constants[7] = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxMeshWorkGroupCount[0]; - push_constants[8] = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxMeshWorkGroupCount[1]; - push_constants[9] = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxMeshWorkGroupCount[2]; - push_constants[10] = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxMeshWorkGroupTotalCount; + indirect_info.init(gpuav, *indirect_buffer_state, indirect_offset, sizeof(VkDrawIndexedIndirectCommand), stride); + } + SetupIndirectBufferValidation(gpuav, shared_draw_validation_resources, indirect_info, draw_count, push_constants, desc_writes, + buffer_infos); + SetupCountBufferValidation(gpuav, shared_draw_validation_resources, indirect_info, count_buffer, count_buffer_offset, + push_constants, desc_writes, buffer_infos); + + // #ARNO_TODO Not sure about disabling index buffer validation if robust buffer access is enabled? Maybe still warn + if (!gpuav.enabled_features.robustBufferAccess2 && cb_state.index_buffer_binding.buffer) { + const VkDeviceSize smallest_vertex_attributes_count = SmallestVertexAttributesCount(cb_state); + push_constants.flags |= glsl::kPreDrawValidationFlags_IndexBuffer; + push_constants.smallest_vertex_attributes_count = static_cast(smallest_vertex_attributes_count); + + // direct draw parameters will be ignored for indirect via flags + push_constants.first_index = first_index; + push_constants.index_count = index_count; + push_constants.index_width = GetIndexBitsSize(cb_state.index_buffer_binding.index_type); + if (push_constants.index_width == 0) { + gpuav.InternalError(cb_state.Handle(), loc, "Unsupported indexType"); + return; } + + push_constants.vertex_offset = 0; // #ARNO_TODO fix vertex_offset = 0 + + buffer_infos.emplace_back(VkDescriptorBufferInfo{cb_state.index_buffer_binding.buffer, cb_state.index_buffer_binding.offset, + cb_state.index_buffer_binding.size}); + auto desc_write = vku::InitStruct(); + desc_write.dstBinding = glsl::kPreDrawBinding_IndexBuffer; + desc_write.descriptorCount = 1; + desc_write.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + desc_writes.push_back(desc_write); } - // Insert diagnostic draw - if (use_shader_objects) { - VkShaderStageFlagBits stage = VK_SHADER_STAGE_VERTEX_BIT; - DispatchCmdBindShadersEXT(cb_state.VkHandle(), 1u, &stage, &shared_draw_resources.shader_object); + DispatchDiagnosticDraw(gpuav, shared_draw_validation_resources, loc, cb_state, ValidationShaders::IndexedDraw, &push_constants, + sizeof(push_constants), desc_writes, buffer_infos); + + CommandBuffer::ErrorLoggerFunc error_logger = [loc, indirect_info](Validator &gpuav, const uint32_t *error_record, + const LogObjectList &objlist) { + bool skip = false; + + using namespace glsl; + auto group = error_record[kHeaderErrorGroupOffset]; + auto subcode = error_record[kHeaderErrorSubCodeOffset]; + + if (group != kErrorGroupGpuPreDraw) { + assert(false); + return skip; + } + + const GpuVuid &vuids = GetGpuVuid(loc.function); + + switch (subcode) { + case kErrorSubCodePreDrawBufferSize: { + // Buffer size must be >= (stride * (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) + const uint32_t count = error_record[kPreActionParamOffset_0]; + const uint32_t offset = + static_cast(indirect_info.buffer_offset); // TODO: why cast to uin32_t? If it is changed, + // think about also doing it in the error message + const uint32_t draw_size = (indirect_info.stride * (count - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)); + + const char *vuid = nullptr; + if (count == 1) { + vuid = vuids.count_exceeds_bufsize_1; + } else { + vuid = vuids.count_exceeds_bufsize; + } + skip |= gpuav.LogError(vuid, objlist, loc, + "Indirect draw count of %" PRIu32 " would exceed buffer size %" PRIu64 + " of buffer %s " + "stride = %" PRIu32 " offset = %" PRIu32 + " (stride * (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) = %" PRIu32 ".", + count, indirect_info.buffer_size, gpuav.FormatHandle(indirect_info.buffer).c_str(), + indirect_info.stride, offset, draw_size); + break; + } + case kErrorSubCodePreDrawCountLimit: { + const uint32_t count = error_record[kPreActionParamOffset_0]; + skip |= gpuav.LogError(vuids.count_exceeds_device_limit, objlist, loc, + "Indirect draw count of %" PRIu32 " would exceed maxDrawIndirectCount limit of %" PRIu32 ".", + count, gpuav.phys_dev_props.limits.maxDrawIndirectCount); + break; + } + case kErrorSubCodePreDrawFirstInstance: { + const uint32_t index = error_record[kPreActionParamOffset_0]; + gpuav.LogError( + vuids.first_instance_not_zero, objlist, loc, + "The drawIndirectFirstInstance feature is not enabled, but the firstInstance member of the %s structure at " + "index %" PRIu32 " is not zero.", + String(loc.function), index); + break; + } + case kErrorSubCodePreDrawIndexBuffer: { + const uint32_t first_index = error_record[kPreActionParamOffset_0]; + const uint32_t index_count = error_record[kPreActionParamOffset_1]; + gpuav.LogError(vuids.index_buffer_size, objlist, loc, + "The robustBufferAccess2 feature is not enabled, but the firstIndex = %" PRIu32 + " plus indexCount = %" PRIu32 + " fields of a VkDrawIndexedIndirectCommand structure exceed the bounds of the index buffer", + first_index, index_count); + break; + } + case kErrorSubCodePreDrawVertexIndex: { + const uint32_t index = error_record[kPreActionParamOffset_0]; + const uint32_t vertex_index = error_record[kPreActionParamOffset_1]; + gpuav.LogError(vuids.vertex_index_oob, objlist, loc, + "The robustBufferAccess2 feature is not enabled, but the value in the index buffer at index %" PRIu32 + " is %" PRIu32 ", which is out of bounds of a vertex buffer", + index, vertex_index); + break; + } + default: + break; + } + + return skip; + }; + + cb_state.per_command_error_loggers.emplace_back(std::move(error_logger)); +} + +void InsertIndirectMeshDrawValidation(Validator &gpuav, const Location &loc, CommandBuffer &cb_state, + vvl::Buffer &indirect_buffer_state, VkDeviceSize indirect_offset, uint32_t draw_count, + VkBuffer count_buffer, VkDeviceSize count_buffer_offset, uint32_t stride) { + if (!gpuav.gpuav_settings.validate_indirect_draws_buffers) { + return; + } + + const auto lv_bind_point = ConvertToLvlBindPoint(VK_PIPELINE_BIND_POINT_GRAPHICS); + auto const &last_bound = cb_state.lastBound[lv_bind_point]; + const auto *pipeline_state = last_bound.pipeline_state; + const bool use_shader_objects = pipeline_state == nullptr; + + auto &shared_draw_validation_resources = gpuav.shared_resources_manager.Get( + gpuav, cb_state.GetValidationCmdCommonDescriptorSetLayout(), use_shader_objects, loc); + if (!shared_draw_validation_resources.IsValid()) { + gpuav.InternalError(cb_state.VkHandle(), loc, "Could not create shared draw resources."); + return; + } + + const IndirectInfo indirect_info(gpuav, indirect_buffer_state, indirect_offset, sizeof(VkDrawMeshTasksIndirectCommandEXT), + stride); + + std::vector buffer_infos; + std::vector desc_writes; + glsl::DrawMeshPushData push_constants = {}; + + SetupIndirectBufferValidation(gpuav, shared_draw_validation_resources, indirect_info, draw_count, push_constants, desc_writes, + buffer_infos); + SetupCountBufferValidation(gpuav, shared_draw_validation_resources, indirect_info, count_buffer, count_buffer_offset, + push_constants, desc_writes, buffer_infos); + + bool emit_task_error = false; + const VkShaderStageFlags stages = pipeline_state->create_info_shaders; + push_constants.draw_count = count_buffer ? 0 : draw_count; + push_constants.draw_stride = stride / sizeof(uint32_t); + if (stages & VK_SHADER_STAGE_TASK_BIT_EXT) { + emit_task_error = true; + push_constants.max_workgroup_count_x = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxTaskWorkGroupCount[0]; + push_constants.max_workgroup_count_y = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxTaskWorkGroupCount[1]; + push_constants.max_workgroup_count_z = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxTaskWorkGroupCount[2]; + push_constants.max_workgroup_total_count = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxTaskWorkGroupTotalCount; } else { - DispatchCmdBindPipeline(cb_state.VkHandle(), VK_PIPELINE_BIND_POINT_GRAPHICS, validation_pipeline); + push_constants.max_workgroup_count_x = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxMeshWorkGroupCount[0]; + push_constants.max_workgroup_count_y = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxMeshWorkGroupCount[1]; + push_constants.max_workgroup_count_z = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxMeshWorkGroupCount[2]; + push_constants.max_workgroup_total_count = gpuav.phys_dev_ext_props.mesh_shader_props_ext.maxMeshWorkGroupTotalCount; } - static_assert(sizeof(push_constants) <= 128, "push_constants buffer size >128, need to consider maxPushConstantsSize."); - DispatchCmdPushConstants(cb_state.VkHandle(), shared_draw_resources.pipeline_layout, VK_SHADER_STAGE_VERTEX_BIT, 0, - static_cast(sizeof(push_constants)), push_constants); - BindValidationCmdsCommonDescSet(cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, shared_draw_resources.pipeline_layout, - cb_state.draw_index, static_cast(cb_state.per_command_error_loggers.size())); - DispatchCmdBindDescriptorSets(cb_state.VkHandle(), VK_PIPELINE_BIND_POINT_GRAPHICS, shared_draw_resources.pipeline_layout, - glsl::kDiagPerCmdDescriptorSet, 1, &draw_validation_desc_set, 0, nullptr); - DispatchCmdDraw(cb_state.VkHandle(), 3, 1, 0, 0); // TODO: this 3 assumes triangles I think, probably could be 1? - CommandBuffer::ErrorLoggerFunc error_logger = [loc, indirect_buffer, indirect_offset, stride, indirect_buffer_size, - emit_task_error](Validator &gpuav, const uint32_t *error_record, - const LogObjectList &objlist) { + buffer_infos.emplace_back(VkDescriptorBufferInfo{indirect_buffer_state.VkHandle(), indirect_offset, VK_WHOLE_SIZE}); + + auto desc_write = vku::InitStruct(); + desc_write.dstBinding = glsl::kPreDrawBinding_IndirectBuffer; + desc_write.descriptorCount = 1; + desc_write.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + desc_writes.push_back(desc_write); + + DispatchDiagnosticDraw(gpuav, shared_draw_validation_resources, loc, cb_state, ValidationShaders::MeshDraw, &push_constants, + sizeof(push_constants), desc_writes, buffer_infos); + + CommandBuffer::ErrorLoggerFunc error_logger = [loc, indirect_info, emit_task_error](Validator &gpuav, + const uint32_t *error_record, + const LogObjectList &objlist) { bool skip = false; using namespace glsl; @@ -373,9 +786,11 @@ void InsertIndirectDrawValidation(Validator &gpuav, const Location &loc, Command case kErrorSubCodePreDrawBufferSize: { // Buffer size must be >= (stride * (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) const uint32_t count = error_record[kPreActionParamOffset_0]; - const uint32_t offset = static_cast(indirect_offset); // TODO: why cast to uin32_t? If it is changed, - // think about also doing it in the error message - const uint32_t draw_size = (stride * (count - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)); + const uint32_t offset = + static_cast(indirect_info.buffer_offset); // TODO: why cast to uin32_t? If it is changed, + // think about also doing it in the error message + const uint32_t draw_size = + (indirect_info.stride * (count - 1) + offset + sizeof(VkDrawMeshTasksIndirectCommandEXT)); const char *vuid = nullptr; if (count == 1) { @@ -387,9 +802,10 @@ void InsertIndirectDrawValidation(Validator &gpuav, const Location &loc, Command "Indirect draw count of %" PRIu32 " would exceed buffer size %" PRIu64 " of buffer %s " "stride = %" PRIu32 " offset = %" PRIu32 - " (stride * (drawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) = %" PRIu32 ".", - count, indirect_buffer_size, gpuav.FormatHandle(indirect_buffer).c_str(), stride, offset, - draw_size); + " (stride * (drawCount - 1) + offset + sizeof(VkDrawMeshTasksIndirectCommandEXT)) = %" PRIu32 + ".", + count, indirect_info.buffer_size, gpuav.FormatHandle(indirect_info.buffer).c_str(), + indirect_info.stride, offset, draw_size); break; } case kErrorSubCodePreDrawCountLimit: { diff --git a/layers/gpu/cmd_validation/gpuav_draw.h b/layers/gpu/cmd_validation/gpuav_draw.h index 2a10ee20143..fbf52cdef89 100644 --- a/layers/gpu/cmd_validation/gpuav_draw.h +++ b/layers/gpu/cmd_validation/gpuav_draw.h @@ -21,13 +21,25 @@ struct Location; +namespace vvl { +class Buffer; +} + namespace gpuav { class Validator; void DestroyRenderPassMappedResources(Validator &gpuav, VkRenderPass render_pass); -void InsertIndirectDrawValidation(Validator &gpuav, const Location &loc, CommandBuffer &cb_state, VkBuffer indirect_buffer, - VkDeviceSize indirect_offset, uint32_t draw_count, VkBuffer count_buffer, - VkDeviceSize count_buffer_offset, uint32_t stride); +void InsertIndirectDrawValidation(Validator &gpuav, const Location &loc, CommandBuffer &cb_state, + vvl::Buffer &indirect_buffer_state, VkDeviceSize indirect_offset, uint32_t draw_count, + VkBuffer count_buffer, VkDeviceSize count_buffer_offset, uint32_t stride); + +void InsertIndexedDrawValidation(Validator &gpuav, const Location &loc, CommandBuffer &cb_state, VkBuffer indirect_buffer, + VkDeviceSize indirect_offset, uint32_t draw_count, VkBuffer count_buffer, + VkDeviceSize count_buffer_offset, uint32_t stride, uint32_t first_index, uint32_t index_count); + +void InsertIndirectMeshDrawValidation(Validator &gpuav, const Location &loc, CommandBuffer &cb_state, + vvl::Buffer &indirect_buffer_state, VkDeviceSize indirect_offset, uint32_t draw_count, + VkBuffer count_buffer, VkDeviceSize count_buffer_offset, uint32_t stride); } // namespace gpuav diff --git a/layers/gpu/core/gpuav.h b/layers/gpu/core/gpuav.h index 3473df94aa8..f20222b1a08 100644 --- a/layers/gpu/core/gpuav.h +++ b/layers/gpu/core/gpuav.h @@ -321,7 +321,7 @@ class Validator : public gpu::GpuShaderInstrumentor { public: std::optional desc_heap_{}; // optional only to defer construction - gpu::SharedResourcesManager shared_resources_manager; + gpu::SharedResourcesCache shared_resources_manager; private: std::string instrumented_shader_cache_path_{}; diff --git a/layers/gpu/core/gpuav_record.cpp b/layers/gpu/core/gpuav_record.cpp index 27d51a75ca0..4ac17b9e45e 100644 --- a/layers/gpu/core/gpuav_record.cpp +++ b/layers/gpu/core/gpuav_record.cpp @@ -48,10 +48,15 @@ void Validator::PreCallRecordCreateBuffer(VkDevice device, const VkBufferCreateI // Indirect buffers will require validation shader to bind the indirect buffers as a storage buffer. if (gpuav_settings.IsBufferValidationEnabled() && - chassis_state.modified_create_info.usage & VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT) { + (chassis_state.modified_create_info.usage & (VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT))) { chassis_state.modified_create_info.usage |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; } + // Align index buffer size to 16: validation shader reads uvec4 chunks + if (gpuav_settings.IsBufferValidationEnabled()) { + chassis_state.modified_create_info.size = Align(chassis_state.modified_create_info.size, 4); + } + BaseClass::PreCallRecordCreateBuffer(device, pCreateInfo, pAllocator, pBuffer, record_obj, chassis_state); } @@ -337,6 +342,8 @@ void Validator::PreCallRecordCmdDrawIndexed(VkCommandBuffer commandBuffer, uint3 InternalError(commandBuffer, record_obj.location, "Unrecognized command buffer."); return; } + InsertIndexedDrawValidation(*this, record_obj.location, *cb_state, VK_NULL_HANDLE, 0, 0, VK_NULL_HANDLE, 0, 0, firstIndex, + indexCount); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } @@ -367,7 +374,14 @@ void Validator::PreCallRecordCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBu return; } - InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, count, VK_NULL_HANDLE, 0, stride); + auto indirect_buffer_state = Get(buffer); + if (!indirect_buffer_state) { + InternalError(LogObjectList(commandBuffer, buffer), record_obj.location, "buffer must be a valid VkBuffer handle"); + return; + } + + InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, *indirect_buffer_state, offset, count, VK_NULL_HANDLE, 0, + stride); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } @@ -381,7 +395,7 @@ void Validator::PreCallRecordCmdDrawIndexedIndirect(VkCommandBuffer commandBuffe return; } - InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, count, VK_NULL_HANDLE, 0, stride); + InsertIndexedDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, count, VK_NULL_HANDLE, 0, stride, 0, 0); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } @@ -403,7 +417,14 @@ void Validator::PreCallRecordCmdDrawIndirectCount(VkCommandBuffer commandBuffer, InternalError(commandBuffer, record_obj.location, "Unrecognized command buffer."); return; } - InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, maxDrawCount, countBuffer, + + auto indirect_buffer_state = Get(buffer); + if (!indirect_buffer_state) { + InternalError(LogObjectList(commandBuffer, buffer), record_obj.location, "buffer must be a valid VkBuffer handle"); + return; + } + + InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, *indirect_buffer_state, offset, maxDrawCount, countBuffer, countBufferOffset, stride); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } @@ -441,8 +462,8 @@ void Validator::PreCallRecordCmdDrawIndexedIndirectCount(VkCommandBuffer command InternalError(commandBuffer, record_obj.location, "Unrecognized command buffer."); return; } - InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, maxDrawCount, countBuffer, - countBufferOffset, stride); + InsertIndexedDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, maxDrawCount, countBuffer, countBufferOffset, + stride, 0, 0); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } @@ -466,7 +487,13 @@ void Validator::PreCallRecordCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandB InternalError(commandBuffer, record_obj.location, "Unrecognized command buffer."); return; } - InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, drawCount, VK_NULL_HANDLE, 0, stride); + auto indirect_buffer_state = Get(buffer); + if (!indirect_buffer_state) { + InternalError(LogObjectList(commandBuffer, buffer), record_obj.location, "buffer must be a valid VkBuffer handle"); + return; + } + InsertIndirectMeshDrawValidation(*this, record_obj.location, *cb_state, *indirect_buffer_state, offset, drawCount, + VK_NULL_HANDLE, 0, stride); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } @@ -482,8 +509,13 @@ void Validator::PreCallRecordCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer com InternalError(commandBuffer, record_obj.location, "Unrecognized command buffer."); return; } - InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, maxDrawCount, countBuffer, - countBufferOffset, stride); + auto indirect_buffer_state = Get(buffer); + if (!indirect_buffer_state) { + InternalError(LogObjectList(commandBuffer, buffer), record_obj.location, "buffer must be a valid VkBuffer handle"); + return; + } + InsertIndirectMeshDrawValidation(*this, record_obj.location, *cb_state, *indirect_buffer_state, offset, maxDrawCount, + countBuffer, countBufferOffset, stride); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } @@ -507,7 +539,13 @@ void Validator::PreCallRecordCmdDrawMeshTasksIndirectEXT(VkCommandBuffer command InternalError(commandBuffer, record_obj.location, "Unrecognized command buffer."); return; } - InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, drawCount, VK_NULL_HANDLE, 0, stride); + auto indirect_buffer_state = Get(buffer); + if (!indirect_buffer_state) { + InternalError(LogObjectList(commandBuffer, buffer), record_obj.location, "buffer must be a valid VkBuffer handle"); + return; + } + InsertIndirectMeshDrawValidation(*this, record_obj.location, *cb_state, *indirect_buffer_state, offset, drawCount, + VK_NULL_HANDLE, 0, stride); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } @@ -523,8 +561,13 @@ void Validator::PreCallRecordCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer co InternalError(commandBuffer, record_obj.location, "Unrecognized command buffer."); return; } - InsertIndirectDrawValidation(*this, record_obj.location, *cb_state, buffer, offset, maxDrawCount, countBuffer, - countBufferOffset, stride); + auto indirect_buffer_state = Get(buffer); + if (!indirect_buffer_state) { + InternalError(LogObjectList(commandBuffer, buffer), record_obj.location, "buffer must be a valid VkBuffer handle"); + return; + } + InsertIndirectMeshDrawValidation(*this, record_obj.location, *cb_state, *indirect_buffer_state, offset, maxDrawCount, + countBuffer, countBufferOffset, stride); SetupShaderInstrumentationResources(*this, *cb_state, VK_PIPELINE_BIND_POINT_GRAPHICS, record_obj.location); } diff --git a/layers/gpu/error_message/gpuav_vuids.cpp b/layers/gpu/error_message/gpuav_vuids.cpp index 140b3a3d1ed..13f6735daab 100644 --- a/layers/gpu/error_message/gpuav_vuids.cpp +++ b/layers/gpu/error_message/gpuav_vuids.cpp @@ -46,6 +46,9 @@ struct GpuVuidsCmdDrawIndexed : GpuVuid { uniform_access_oob_08612 = "VUID-vkCmdDrawIndexed-None-08612"; storage_access_oob_08613 = "VUID-vkCmdDrawIndexed-None-08613"; invalid_descriptor = "VUID-vkCmdDrawIndexed-None-08114"; + // This should be detected on the host by core validation but just in case... + index_buffer_size = "VUID-vkCmdDrawIndexedEXT-robustBufferAccess2-08798"; + vertex_index_oob = "VUID-vkCmdDrawIndexed-None-02721"; } }; @@ -56,6 +59,8 @@ struct GpuVuidsCmdDrawMultiIndexedEXT : GpuVuid { uniform_access_oob_08612 = "VUID-vkCmdDrawMultiIndexedEXT-None-08612"; storage_access_oob_08613 = "VUID-vkCmdDrawMultiIndexedEXT-None-08613"; invalid_descriptor = "VUID-vkCmdDrawMultiIndexedEXT-None-08114"; + index_buffer_size = "VUID-vkCmdDrawMultiIndexedEXT-robustBufferAccess2-08798"; + vertex_index_oob = "VUID-vkCmdDrawMultiIndexedEXT-None-02721"; } }; @@ -78,6 +83,8 @@ struct GpuVuidsCmdDrawIndexedIndirect : GpuVuid { storage_access_oob_08613 = "VUID-vkCmdDrawIndexedIndirect-None-08613"; invalid_descriptor = "VUID-vkCmdDrawIndexedIndirect-None-08114"; first_instance_not_zero = "VUID-VkDrawIndexedIndirectCommand-firstInstance-00554"; + index_buffer_size = "VUID-vkCmdDrawIndexedIndirect-robustBufferAccess2-08798"; + vertex_index_oob = "VUID-vkCmdDrawIndexedIndirect-None-02721"; } }; @@ -128,6 +135,8 @@ struct GpuVuidsCmdDrawIndexedIndirectCount : GpuVuid { count_exceeds_bufsize_1 = "VUID-vkCmdDrawIndexedIndirectCount-countBuffer-03153"; count_exceeds_bufsize = "VUID-vkCmdDrawIndexedIndirectCount-countBuffer-03154"; count_exceeds_device_limit = "VUID-vkCmdDrawIndexedIndirectCount-countBuffer-02717"; + index_buffer_size = "VUID-vkCmdDrawIndexedIndirectCount-robustBufferAccess2-08798"; + vertex_index_oob = "VUID-vkCmdDrawIndexedIndirectCount-None-02721"; } }; diff --git a/layers/gpu/error_message/gpuav_vuids.h b/layers/gpu/error_message/gpuav_vuids.h index 527aa9bbc10..a8bd10cba4a 100644 --- a/layers/gpu/error_message/gpuav_vuids.h +++ b/layers/gpu/error_message/gpuav_vuids.h @@ -46,6 +46,8 @@ struct GpuVuid { const char* trace_rays_width_exceeds_device_limit = kVUIDUndefined; const char* trace_rays_height_exceeds_device_limit = kVUIDUndefined; const char* trace_rays_depth_exceeds_device_limit = kVUIDUndefined; + const char* index_buffer_size = kVUIDUndefined; + const char* vertex_index_oob = kVUIDUndefined; }; // Getter function to provide kVUIDUndefined in case an invalid function is passed in diff --git a/layers/gpu/resources/gpu_resources.cpp b/layers/gpu/resources/gpu_resources.cpp index 3b2a9f9c031..acf0d4f1835 100644 --- a/layers/gpu/resources/gpu_resources.cpp +++ b/layers/gpu/resources/gpu_resources.cpp @@ -135,7 +135,7 @@ void DescriptorSetManager::PutBackDescriptorSet(VkDescriptorPool desc_pool, VkDe return; } -void SharedResourcesManager::Clear() { +void SharedResourcesCache::Clear() { for (auto &[key, value] : shared_validation_resources_map_) { auto &[object, destructor] = value; destructor(object); diff --git a/layers/gpu/resources/gpu_resources.h b/layers/gpu/resources/gpu_resources.h index 92a93f07470..4352630d6f5 100644 --- a/layers/gpu/resources/gpu_resources.h +++ b/layers/gpu/resources/gpu_resources.h @@ -72,7 +72,8 @@ class GpuResourcesManager { std::vector mem_blocks_; }; -class SharedResourcesManager { +// Cache a single object of type T. Key is *only* based on typeid(T) +class SharedResourcesCache { public: template T *TryGet() { @@ -84,6 +85,10 @@ class SharedResourcesManager { return t; } + // First call to Get will create the object, subsequent calls will retrieve the cached entry. + // /!\ The cache key is only based on the type T, not on the passed parameters + // => Successive calls to Get with different parameters will NOT give different objects, + // only the entry cached upon the first call to Get will be retrieved template T &Get(ConstructorTypes &&...args) { T *t = TryGet(); diff --git a/layers/gpu/shaders/cmd_validation/draw.vert b/layers/gpu/shaders/cmd_validation/draw.vert deleted file mode 100644 index 4d83e848a10..00000000000 --- a/layers/gpu/shaders/cmd_validation/draw.vert +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2021-2024 The Khronos Group Inc. -// Copyright (c) 2021-2024 Valve Corporation -// Copyright (c) 2021-2024 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 - -layout(push_constant) uniform UniformInfo { - uint push_constant_word_0; - uint push_constant_word_1; - uint push_constant_word_2; - uint push_constant_word_3; - uint push_constant_word_4; - uint push_constant_word_5; - uint push_constant_word_6; - uint push_constant_word_7; - uint push_constant_word_8; - uint push_constant_word_9; - uint push_constant_word_10; -}; - -#include "common.h" - -#define validation_select push_constant_word_0 - -// used when testing count buffer -#define count_limit push_constant_word_1 -#define max_writes push_constant_word_2 -#define count_offset push_constant_word_3 - -// used when testing draw buffer -#define draw_count push_constant_word_1 -#define first_instance_offset push_constant_word_2 -#define draw_stride push_constant_word_3 - -// used when validating mesh draw buffer -// words 0-3 could be used to validate count -#define mesh_draw_buffer_offset push_constant_word_4 -#define mesh_draw_buffer_num_draws push_constant_word_5 -#define mesh_draw_buffer_stride push_constant_word_6 -#define max_workgroup_count_x push_constant_word_7 -#define max_workgroup_count_y push_constant_word_8 -#define max_workgroup_count_z push_constant_word_9 -#define max_workgroup_total_count push_constant_word_10 - -layout(set = kDiagPerCmdDescriptorSet, binding = 0) buffer DrawBuffer { - uint draws_buffer[]; -}; - -// CountBuffer won't be bound for non-count draws -layout(set = kDiagPerCmdDescriptorSet, binding = 1) buffer CountBuffer { - uint count_buffer[]; -}; - - -void main() { - if (gl_VertexIndex == 0) { - if (validation_select == kPreDrawSelectCountBuffer || - validation_select == kPreDrawSelectMeshCountBuffer) { - // Validate count buffer - uint count_in = count_buffer[count_offset]; - if (count_in > max_writes) { - GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawBufferSize, count_in, 0); - } else if (count_in > count_limit) { - GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawCountLimit, count_in, 0); - } - } else if (validation_select == kPreDrawSelectDrawBuffer) { - // Validate firstInstances - uint fi_index = first_instance_offset; - for (uint i = 0; i < draw_count; i++) { - if (draws_buffer[fi_index] != 0) { - GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawFirstInstance, i, i); - break; - } - fi_index += draw_stride; - } - } - - if (validation_select == kPreDrawSelectMeshCountBuffer || - validation_select == kPreDrawSelectMeshNoCount) { - // Validate mesh draw buffer - uint draw_buffer_index = mesh_draw_buffer_offset; - uint stride = mesh_draw_buffer_stride; - uint draw_count; - if (validation_select == kPreDrawSelectMeshCountBuffer) { - draw_count = count_buffer[count_offset]; - } else { - draw_count = mesh_draw_buffer_num_draws; - } - for (uint i = 0; i < draw_count; i++){ - uint count_x_in = draws_buffer[draw_buffer_index]; - uint count_y_in = draws_buffer[draw_buffer_index + 1]; - uint count_z_in = draws_buffer[draw_buffer_index + 2]; - if (count_x_in > max_workgroup_count_x) { - GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawGroupCountX, count_x_in, i); - } - if (count_y_in > max_workgroup_count_y) { - GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawGroupCountY, count_y_in, i); - } - if (count_z_in > max_workgroup_count_z) { - GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawGroupCountZ, count_z_in, i); - } - uint total = count_x_in * count_y_in * count_z_in; - if (total > max_workgroup_total_count) { - GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawGroupCountTotal, total, i); - } - draw_buffer_index += stride; - } - } - } -} diff --git a/layers/gpu/shaders/cmd_validation/draw_push_data.h b/layers/gpu/shaders/cmd_validation/draw_push_data.h new file mode 100644 index 00000000000..2cb138dbae0 --- /dev/null +++ b/layers/gpu/shaders/cmd_validation/draw_push_data.h @@ -0,0 +1,81 @@ +// Copyright (c) 2021-2024 The Khronos Group Inc. +// Copyright (c) 2021-2024 Valve Corporation +// Copyright (c) 2021-2024 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. +// Values used between the GLSL shaders and the GPU-AV logic + +// NOTE: This header is included by the instrumentation shaders and glslang doesn't support #pragma once +#ifndef GPU_SHADERS_DRAW_PUSH_DATA_H +#define GPU_SHADERS_DRAW_PUSH_DATA_H + +#ifdef __cplusplus +namespace gpuav { +namespace glsl { +using uint = unsigned int; +#endif + +// Bindings for all pre draw types +const uint kPreDrawBinding_IndirectBuffer = 0; +const uint kPreDrawBinding_CountBuffer = 1; +const uint kPreDrawBinding_IndexBuffer = 2; + +// Flag values for all pre draw types + +// Set if the count buffer is bound +const uint kPreDrawValidationFlags_CountBuffer = (1 << 0); +// Set if the draw buffer is bound +const uint kPreDrawValidationFlags_DrawBuffer = (1 << 1); +// Set if firstInstance fields of draw structs must be validated +const uint kPreDrawValidationFlags_FirstInstance = (1 << 2); +// Set if the index buffer is bound +const uint kPreDrawValidationFlags_IndexBuffer = (1 << 3); + +struct DrawIndirectPushData { + uint flags; + uint prop_count_limit; + uint buffer_count_limit; + uint draw_count; + uint draw_stride; +}; + +struct DrawIndexedPushData { + uint flags; + uint prop_count_limit; + uint buffer_count_limit; + uint draw_count; + uint draw_stride; + uint first_index; + uint index_count; + uint index_width; + uint vertex_offset; + uint smallest_vertex_attributes_count; +}; + +struct DrawMeshPushData { + uint flags; + uint prop_count_limit; + uint buffer_count_limit; + uint draw_count; + uint draw_stride; + uint max_workgroup_count_x; + uint max_workgroup_count_y; + uint max_workgroup_count_z; + uint max_workgroup_total_count; +}; + +#ifdef __cplusplus +} // namespace glsl +} // namespace gpuav +#endif +#endif diff --git a/layers/gpu/shaders/cmd_validation/indexed_draw.vert b/layers/gpu/shaders/cmd_validation/indexed_draw.vert new file mode 100644 index 00000000000..5a50e99551e --- /dev/null +++ b/layers/gpu/shaders/cmd_validation/indexed_draw.vert @@ -0,0 +1,158 @@ +// Copyright (c) 2021-2024 The Khronos Group Inc. +// Copyright (c) 2021-2024 Valve Corporation +// Copyright (c) 2021-2024 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 +#extension GL_EXT_shader_16bit_storage : enable +#extension GL_EXT_shader_8bit_storage : enable + +#include "common.h" +#include "draw_push_data.h" + +layout(push_constant) uniform UniformInfo { + DrawIndexedPushData push_data; +}; + +/* +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; + +layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) buffer DrawBuffer { + uint draw_indexed_indirect_cmds[]; +}; + +// CountBuffer won't be bound for non-count draws +layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) buffer CountBuffer { + uint count_buffer; +}; + +layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndexBuffer) buffer IndexBuffer32 { + uint index_buffer[]; +}; + +// This function can cause OOB accesses per the descrptor size when dealing with +// 16 or 8 bits indices (eg if dealing with 3 16 bits indices). +// In practice it should be fine, as index buffer size +// is always aligned to 4 bytes (see Validator::PreCallRecordCreateBuffer in gpuav_record.cpp) +uint get_vertex_index(uint i) { + if (push_data.index_width == 32) { + return index_buffer[i]; + } else if (push_data.index_width == 16) { + uint load_i = i / 2; + uint packed_16_16 = index_buffer[load_i]; + // if (i % 2) == 0, take first 16 bits, else last 16 bits + uint shift = (i % 2) * 16; + return (packed_16_16 >> shift) & 0xFFFF; + } else if (push_data.index_width == 8) { + uint load_i = i / 4; + uint packed_8_8_8_8 = index_buffer[load_i]; + // if (i % 4) == 0, take first 8 bits, if == 1 take second set of 8 bits, etc... + uint shift = (i % 4) * 8; + return (packed_8_8_8_8 >> shift) & 0xFF; + } + return 0; +} + +bool check_index_buffer(uint index_count, uint first_index, uint vertex_offset) { + uint index_len = 0; + if (push_data.index_width == 32) { + index_len = index_buffer.length(); + } else if (push_data.index_width == 16) { + index_len = 2 * index_buffer.length(); + } else if (push_data.index_width == 8) { + index_len = 4 * index_buffer.length(); + } else { + // host should have caught this + return false; + } + + if ((first_index + index_count) > index_len) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawIndexBuffer, first_index, index_count); + return false; + } + + for (uint index_i = 0; index_i < index_count; index_i++) { + uint vert_index = get_vertex_index(first_index + index_i) + vertex_offset; + if (vert_index >= push_data.smallest_vertex_attributes_count) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawVertexIndex, first_index + index_i, vert_index); + return false; + } + } + return true; +} + +void main() { + if (gl_VertexIndex == 0) { + uint draw_count = 0; + uint draw_index_count = 0; + + if ((push_data.flags & kPreDrawValidationFlags_CountBuffer) != 0) { + // Validate count buffer + uint count_in = count_buffer; + if (count_in > push_data.buffer_count_limit) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawBufferSize, count_in, 0); + } else if (count_in > push_data.prop_count_limit) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawCountLimit, count_in, 0); + } else { + draw_count = count_in; + } + } else { + draw_count = push_data.draw_count; + } + if ((push_data.flags & kPreDrawValidationFlags_FirstInstance) != 0) { + // Validate firstInstances + uint draw_index = 0; + for (uint i = 0; i < draw_count; i++) { + if (draw_indexed_indirect_cmds[draw_index + kFirstInstance] != 0) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawFirstInstance, i, i); + break; + } + draw_index += push_data.draw_stride; + } + + } + if ((push_data.flags & kPreDrawValidationFlags_IndexBuffer) != 0) { + if ((push_data.flags & kPreDrawValidationFlags_DrawBuffer) != 0) { + uint draw_index = 0; + for (uint i = 0; i < draw_count; i++) { + uint index_count = draw_indexed_indirect_cmds[draw_index + kIndexCount]; + uint first_index = draw_indexed_indirect_cmds[draw_index + kFirstIndex]; + uint vertex_offset = draw_indexed_indirect_cmds[draw_index + kVertexOffset]; + + if (!check_index_buffer(index_count, first_index, vertex_offset)) { + break; + } + + draw_index += push_data.draw_stride; + } + } else { + check_index_buffer(push_data.index_count, push_data.first_index, push_data.vertex_offset); + } + } + } +} diff --git a/layers/gpu/shaders/cmd_validation/indirect_draw.vert b/layers/gpu/shaders/cmd_validation/indirect_draw.vert new file mode 100644 index 00000000000..ed6537a4894 --- /dev/null +++ b/layers/gpu/shaders/cmd_validation/indirect_draw.vert @@ -0,0 +1,78 @@ +// Copyright (c) 2021-2024 The Khronos Group Inc. +// Copyright (c) 2021-2024 Valve Corporation +// Copyright (c) 2021-2024 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 { + DrawIndirectPushData push_data; +}; + +/* +struct VkDrawIndirectCommand { + uint vertexCount; + uint instanceCount; + uint firstVertex; + uint firstInstance; +}; +*/ +const uint kFirstInstance = 3; + +// array of VkDrawIndirectCommand structs with caller defined stride +layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) buffer DrawBuffer { + uint draw_buffer[]; +}; + +// CountBuffer won't be bound for non-count draws +layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) buffer CountBuffer { + uint count_buffer; +}; + +void main() { + + if (gl_VertexIndex == 0) { + uint draw_count = 0; + + if ((push_data.flags & kPreDrawValidationFlags_CountBuffer) != 0) { + // Validate count buffer + uint count_in = count_buffer; + if (count_in > push_data.buffer_count_limit) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawBufferSize, count_in, 0); + } else if (count_in > push_data.prop_count_limit) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawCountLimit, count_in, 0); + } else { + draw_count = count_in; + } + } else { + draw_count = push_data.draw_count; + } + + if ((push_data.flags & kPreDrawValidationFlags_FirstInstance) != 0) { + // Validate firstInstances + uint draw_index = 0; + for (uint i = 0; i < draw_count; i++) { + if (draw_buffer[draw_index + kFirstInstance] != 0) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawFirstInstance, i, i); + break; + } + draw_index += push_data.draw_stride; + } + } + } +} diff --git a/layers/gpu/shaders/cmd_validation/mesh_draw.vert b/layers/gpu/shaders/cmd_validation/mesh_draw.vert new file mode 100644 index 00000000000..0ffd59a2c67 --- /dev/null +++ b/layers/gpu/shaders/cmd_validation/mesh_draw.vert @@ -0,0 +1,88 @@ +// Copyright (c) 2021-2024 The Khronos Group Inc. +// Copyright (c) 2021-2024 Valve Corporation +// Copyright (c) 2021-2024 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 { + DrawMeshPushData push_data; +}; + +/* +struct VkDrawMeshTasksIndirectCommandEXT { + uint32_t groupCountX; + uint32_t groupCountY; + uint32_t groupCountZ; +}; +*/ +const uint kGroupCountX = 0; +const uint kGroupCountY = 1; +const uint kGroupCountZ = 2; + +// array of VkDrawMeshTasksIndirectCommandEXT structs with caller defined stride +layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_IndirectBuffer) buffer DrawBuffer { + uint draw_buffer[]; +}; + +// CountBuffer won't be bound for non-count draws +layout(set = kDiagPerCmdDescriptorSet, binding = kPreDrawBinding_CountBuffer) buffer CountBuffer { + uint count_buffer; +}; + +void main() { + if (gl_VertexIndex == 0) { + // if there's a count buffer error draw_count = 0 will skip validating the draws + uint draw_count = 0; + if ((push_data.flags & kPreDrawValidationFlags_CountBuffer) != 0) { + // Validate count buffer + uint count_in = count_buffer; + if (count_in > push_data.buffer_count_limit) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawBufferSize, count_in, 0); + } else if (count_in > push_data.prop_count_limit) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawCountLimit, count_in, 0); + } else { + draw_count = count_in; + } + } else { + draw_count = push_data.draw_count; + } + + // Validate mesh draw buffer + uint draw_index = 0; + for (uint i = 0; i < draw_count; i++){ + uint x = draw_buffer[draw_index + kGroupCountX]; + uint y = draw_buffer[draw_index + kGroupCountY]; + uint z = draw_buffer[draw_index + kGroupCountZ]; + + if (x > push_data.max_workgroup_count_x) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawGroupCountX, x, i); + } else if (y > push_data.max_workgroup_count_y) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawGroupCountY, y, i); + } else if (z > push_data.max_workgroup_count_z) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawGroupCountZ, z, i); + } else { + uint total = x * y * z; + if (total > push_data.max_workgroup_total_count) { + GpuavLogError(kErrorGroupGpuPreDraw, kErrorSubCodePreDrawGroupCountTotal, total, i); + } + } + draw_index += push_data.draw_stride; + } + } +} diff --git a/layers/gpu/shaders/gpu_error_codes.h b/layers/gpu/shaders/gpu_error_codes.h index 5c80c293c86..c1d6ad3adeb 100644 --- a/layers/gpu/shaders/gpu_error_codes.h +++ b/layers/gpu/shaders/gpu_error_codes.h @@ -67,18 +67,21 @@ const int kErrorSubCodeRayQueryDirectionFinite = 12; // Pre Draw // +// The draw count exceeded the draw buffer size const int kErrorSubCodePreDrawBufferSize = 1; +// The draw count exceeded the maxDrawCount parameter to the command const int kErrorSubCodePreDrawCountLimit = 2; +// A firstInstance field was non-zero const int kErrorSubCodePreDrawFirstInstance = 3; +// Mesh limit checks const int kErrorSubCodePreDrawGroupCountX = 4; const int kErrorSubCodePreDrawGroupCountY = 5; const int kErrorSubCodePreDrawGroupCountZ = 6; const int kErrorSubCodePreDrawGroupCountTotal = 7; - -const int kPreDrawSelectCountBuffer = 1; -const int kPreDrawSelectDrawBuffer = 2; -const int kPreDrawSelectMeshCountBuffer = 3; -const int kPreDrawSelectMeshNoCount = 4; +// The index count exceeded the index buffer size +const int kErrorSubCodePreDrawIndexBuffer = 8; +// An index in the index buffer exceeded the vertex buffer size +const int kErrorSubCodePreDrawVertexIndex = 9; // Pre Dispatch // diff --git a/layers/utils/vk_layer_utils.h b/layers/utils/vk_layer_utils.h index 0d4b279827e..aa64621ec02 100644 --- a/layers/utils/vk_layer_utils.h +++ b/layers/utils/vk_layer_utils.h @@ -278,6 +278,21 @@ static inline uint32_t GetIndexAlignment(VkIndexType indexType) { } } +static inline uint32_t GetIndexBitsSize(VkIndexType indexType) { + switch (indexType) { + case VK_INDEX_TYPE_UINT16: + return 16; + case VK_INDEX_TYPE_UINT32: + return 32; + case VK_INDEX_TYPE_NONE_KHR: + return 0; + case VK_INDEX_TYPE_UINT8_KHR: + return 8; + default: + return 0; + } +} + // vkspec.html#formats-planes-image-aspect static inline bool IsValidPlaneAspect(VkFormat format, VkImageAspectFlags aspect_mask) { const uint32_t planes = vkuFormatPlaneCount(format); diff --git a/layers/vulkan/generated/cmd_validation_draw_vert.cpp b/layers/vulkan/generated/cmd_validation_draw_vert.cpp deleted file mode 100644 index 0d830a398a5..00000000000 --- a/layers/vulkan/generated/cmd_validation_draw_vert.cpp +++ /dev/null @@ -1,243 +0,0 @@ -// *** THIS FILE IS GENERATED - DO NOT EDIT *** -// See generate_spirv.py for modifications - -/*************************************************************************** - * - * Copyright (c) 2021-2024 The Khronos Group Inc. - * Copyright (c) 2021-2024 Valve Corporation - * Copyright (c) 2021-2024 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 "cmd_validation_draw_vert.h" - -// To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/ -[[maybe_unused]] const uint32_t cmd_validation_draw_vert_size = 2139; -[[maybe_unused]] const uint32_t cmd_validation_draw_vert[2139] = { - 0x07230203, 0x00010000, 0x0008000b, 0x00000151, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47, - 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0006000f, 0x00000000, 0x00000004, 0x6e69616d, - 0x00000000, 0x0000006e, 0x00030003, 0x00000002, 0x000001c2, 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, 0x00090005, 0x00000011, 0x61757047, 0x676f4c76, - 0x6f727245, 0x31752872, 0x3b31753b, 0x753b3175, 0x00003b31, 0x00050005, 0x0000000d, 0x6f727265, 0x72675f72, 0x0070756f, - 0x00060005, 0x0000000e, 0x6f727265, 0x75735f72, 0x6f635f62, 0x00006564, 0x00040005, 0x0000000f, 0x61726170, 0x00305f6d, - 0x00040005, 0x00000010, 0x61726170, 0x00315f6d, 0x00070005, 0x00000015, 0x6f736552, 0x65637275, 0x65646e49, 0x66754278, - 0x00726566, 0x00070006, 0x00000015, 0x00000000, 0x6f736572, 0x65637275, 0x646e695f, 0x00007865, 0x00030005, 0x00000017, - 0x00000000, 0x00080005, 0x0000001f, 0x45646d43, 0x726f7272, 0x756f4373, 0x7542746e, 0x72656666, 0x00000000, 0x00080006, - 0x0000001f, 0x00000000, 0x5f646d63, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, 0x00030005, 0x00000021, 0x00000000, - 0x00050005, 0x00000032, 0x6f727245, 0x66754272, 0x00726566, 0x00050006, 0x00000032, 0x00000000, 0x67616c66, 0x00000073, - 0x00070006, 0x00000032, 0x00000001, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, 0x00070006, 0x00000032, 0x00000002, - 0x6f727265, 0x625f7372, 0x65666675, 0x00000072, 0x00030005, 0x00000034, 0x00000000, 0x00070005, 0x0000004d, 0x69746341, - 0x6e496e6f, 0x42786564, 0x65666675, 0x00000072, 0x00070006, 0x0000004d, 0x00000000, 0x69746361, 0x695f6e6f, 0x7865646e, - 0x00000000, 0x00030005, 0x0000004f, 0x00000000, 0x00060005, 0x0000006e, 0x565f6c67, 0x65747265, 0x646e4978, 0x00007865, - 0x00050005, 0x00000073, 0x66696e55, 0x496d726f, 0x006f666e, 0x00090006, 0x00000073, 0x00000000, 0x68737570, 0x6e6f635f, - 0x6e617473, 0x6f775f74, 0x305f6472, 0x00000000, 0x00090006, 0x00000073, 0x00000001, 0x68737570, 0x6e6f635f, 0x6e617473, - 0x6f775f74, 0x315f6472, 0x00000000, 0x00090006, 0x00000073, 0x00000002, 0x68737570, 0x6e6f635f, 0x6e617473, 0x6f775f74, - 0x325f6472, 0x00000000, 0x00090006, 0x00000073, 0x00000003, 0x68737570, 0x6e6f635f, 0x6e617473, 0x6f775f74, 0x335f6472, - 0x00000000, 0x00090006, 0x00000073, 0x00000004, 0x68737570, 0x6e6f635f, 0x6e617473, 0x6f775f74, 0x345f6472, 0x00000000, - 0x00090006, 0x00000073, 0x00000005, 0x68737570, 0x6e6f635f, 0x6e617473, 0x6f775f74, 0x355f6472, 0x00000000, 0x00090006, - 0x00000073, 0x00000006, 0x68737570, 0x6e6f635f, 0x6e617473, 0x6f775f74, 0x365f6472, 0x00000000, 0x00090006, 0x00000073, - 0x00000007, 0x68737570, 0x6e6f635f, 0x6e617473, 0x6f775f74, 0x375f6472, 0x00000000, 0x00090006, 0x00000073, 0x00000008, - 0x68737570, 0x6e6f635f, 0x6e617473, 0x6f775f74, 0x385f6472, 0x00000000, 0x00090006, 0x00000073, 0x00000009, 0x68737570, - 0x6e6f635f, 0x6e617473, 0x6f775f74, 0x395f6472, 0x00000000, 0x00090006, 0x00000073, 0x0000000a, 0x68737570, 0x6e6f635f, - 0x6e617473, 0x6f775f74, 0x315f6472, 0x00000030, 0x00030005, 0x00000075, 0x00000000, 0x00050005, 0x00000086, 0x6e756f43, - 0x66754274, 0x00726566, 0x00070006, 0x00000086, 0x00000000, 0x6e756f63, 0x75625f74, 0x72656666, 0x00000000, 0x00030005, - 0x00000088, 0x00000000, 0x00040005, 0x00000095, 0x61726170, 0x0000006d, 0x00040005, 0x00000096, 0x61726170, 0x0000006d, - 0x00040005, 0x00000097, 0x61726170, 0x0000006d, 0x00040005, 0x00000099, 0x61726170, 0x0000006d, 0x00040005, 0x000000a3, - 0x61726170, 0x0000006d, 0x00040005, 0x000000a4, 0x61726170, 0x0000006d, 0x00040005, 0x000000a5, 0x61726170, 0x0000006d, - 0x00040005, 0x000000a7, 0x61726170, 0x0000006d, 0x00050005, 0x000000af, 0x695f6966, 0x7865646e, 0x00000000, 0x00030005, - 0x000000b2, 0x00000069, 0x00050005, 0x000000bd, 0x77617244, 0x66667542, 0x00007265, 0x00070006, 0x000000bd, 0x00000000, - 0x77617264, 0x75625f73, 0x72656666, 0x00000000, 0x00030005, 0x000000bf, 0x00000000, 0x00040005, 0x000000c6, 0x61726170, - 0x0000006d, 0x00040005, 0x000000c7, 0x61726170, 0x0000006d, 0x00040005, 0x000000c8, 0x61726170, 0x0000006d, 0x00040005, - 0x000000ca, 0x61726170, 0x0000006d, 0x00070005, 0x000000e0, 0x77617264, 0x6675625f, 0x5f726566, 0x65646e69, 0x00000078, - 0x00080005, 0x000000ed, 0x68737570, 0x6e6f635f, 0x6e617473, 0x6f775f74, 0x315f6472, 0x00000000, 0x00030005, 0x000000f6, - 0x00000069, 0x00040005, 0x00000114, 0x61726170, 0x0000006d, 0x00040005, 0x00000115, 0x61726170, 0x0000006d, 0x00040005, - 0x00000116, 0x61726170, 0x0000006d, 0x00040005, 0x00000118, 0x61726170, 0x0000006d, 0x00040005, 0x00000123, 0x61726170, - 0x0000006d, 0x00040005, 0x00000124, 0x61726170, 0x0000006d, 0x00040005, 0x00000125, 0x61726170, 0x0000006d, 0x00040005, - 0x00000127, 0x61726170, 0x0000006d, 0x00040005, 0x00000131, 0x61726170, 0x0000006d, 0x00040005, 0x00000132, 0x61726170, - 0x0000006d, 0x00040005, 0x00000133, 0x61726170, 0x0000006d, 0x00040005, 0x00000135, 0x61726170, 0x0000006d, 0x00040005, - 0x00000145, 0x61726170, 0x0000006d, 0x00040005, 0x00000146, 0x61726170, 0x0000006d, 0x00040005, 0x00000147, 0x61726170, - 0x0000006d, 0x00040005, 0x00000149, 0x61726170, 0x0000006d, 0x00040047, 0x00000014, 0x00000006, 0x00000004, 0x00030047, - 0x00000015, 0x00000003, 0x00050048, 0x00000015, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000017, 0x00000021, - 0x00000002, 0x00040047, 0x00000017, 0x00000022, 0x00000000, 0x00040047, 0x0000001e, 0x00000006, 0x00000004, 0x00030047, - 0x0000001f, 0x00000003, 0x00050048, 0x0000001f, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000021, 0x00000021, - 0x00000003, 0x00040047, 0x00000021, 0x00000022, 0x00000000, 0x00040047, 0x00000031, 0x00000006, 0x00000004, 0x00030047, - 0x00000032, 0x00000003, 0x00050048, 0x00000032, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000032, 0x00000001, - 0x00000023, 0x00000004, 0x00050048, 0x00000032, 0x00000002, 0x00000023, 0x00000008, 0x00040047, 0x00000034, 0x00000021, - 0x00000000, 0x00040047, 0x00000034, 0x00000022, 0x00000000, 0x00040047, 0x0000004c, 0x00000006, 0x00000004, 0x00030047, - 0x0000004d, 0x00000003, 0x00050048, 0x0000004d, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x0000004f, 0x00000021, - 0x00000001, 0x00040047, 0x0000004f, 0x00000022, 0x00000000, 0x00040047, 0x0000006e, 0x0000000b, 0x0000002a, 0x00030047, - 0x00000073, 0x00000002, 0x00050048, 0x00000073, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000073, 0x00000001, - 0x00000023, 0x00000004, 0x00050048, 0x00000073, 0x00000002, 0x00000023, 0x00000008, 0x00050048, 0x00000073, 0x00000003, - 0x00000023, 0x0000000c, 0x00050048, 0x00000073, 0x00000004, 0x00000023, 0x00000010, 0x00050048, 0x00000073, 0x00000005, - 0x00000023, 0x00000014, 0x00050048, 0x00000073, 0x00000006, 0x00000023, 0x00000018, 0x00050048, 0x00000073, 0x00000007, - 0x00000023, 0x0000001c, 0x00050048, 0x00000073, 0x00000008, 0x00000023, 0x00000020, 0x00050048, 0x00000073, 0x00000009, - 0x00000023, 0x00000024, 0x00050048, 0x00000073, 0x0000000a, 0x00000023, 0x00000028, 0x00040047, 0x00000085, 0x00000006, - 0x00000004, 0x00030047, 0x00000086, 0x00000003, 0x00050048, 0x00000086, 0x00000000, 0x00000023, 0x00000000, 0x00040047, - 0x00000088, 0x00000021, 0x00000001, 0x00040047, 0x00000088, 0x00000022, 0x00000001, 0x00040047, 0x000000bc, 0x00000006, - 0x00000004, 0x00030047, 0x000000bd, 0x00000003, 0x00050048, 0x000000bd, 0x00000000, 0x00000023, 0x00000000, 0x00040047, - 0x000000bf, 0x00000021, 0x00000000, 0x00040047, 0x000000bf, 0x00000022, 0x00000001, 0x00020013, 0x00000002, 0x00030021, - 0x00000003, 0x00000002, 0x00020014, 0x00000006, 0x00030021, 0x00000007, 0x00000006, 0x00040015, 0x0000000a, 0x00000020, - 0x00000000, 0x00040020, 0x0000000b, 0x00000007, 0x0000000a, 0x00070021, 0x0000000c, 0x00000002, 0x0000000b, 0x0000000b, - 0x0000000b, 0x0000000b, 0x0003001d, 0x00000014, 0x0000000a, 0x0003001e, 0x00000015, 0x00000014, 0x00040020, 0x00000016, - 0x00000002, 0x00000015, 0x0004003b, 0x00000016, 0x00000017, 0x00000002, 0x00040015, 0x00000018, 0x00000020, 0x00000001, - 0x0004002b, 0x00000018, 0x00000019, 0x00000000, 0x00040020, 0x0000001a, 0x00000002, 0x0000000a, 0x0003001d, 0x0000001e, - 0x0000000a, 0x0003001e, 0x0000001f, 0x0000001e, 0x00040020, 0x00000020, 0x00000002, 0x0000001f, 0x0004003b, 0x00000020, - 0x00000021, 0x00000002, 0x0004002b, 0x0000000a, 0x00000024, 0x00000001, 0x0004002b, 0x0000000a, 0x00000025, 0x00000000, - 0x0004002b, 0x0000000a, 0x00000028, 0x00000006, 0x0003001d, 0x00000031, 0x0000000a, 0x0005001e, 0x00000032, 0x0000000a, - 0x0000000a, 0x00000031, 0x00040020, 0x00000033, 0x00000002, 0x00000032, 0x0004003b, 0x00000033, 0x00000034, 0x00000002, - 0x0004002b, 0x00000018, 0x00000035, 0x00000001, 0x0004002b, 0x0000000a, 0x00000037, 0x00000010, 0x0004002b, 0x00000018, - 0x00000045, 0x00000002, 0x0004002b, 0x0000000a, 0x0000004a, 0x00000007, 0x0003001d, 0x0000004c, 0x0000000a, 0x0003001e, - 0x0000004d, 0x0000004c, 0x00040020, 0x0000004e, 0x00000002, 0x0000004d, 0x0004003b, 0x0000004e, 0x0000004f, 0x00000002, - 0x0004002b, 0x0000000a, 0x00000054, 0x00000008, 0x0004002b, 0x0000000a, 0x0000005a, 0x00000009, 0x0004002b, 0x0000000a, - 0x0000005f, 0x0000000a, 0x0004002b, 0x0000000a, 0x00000064, 0x0000000b, 0x0004002b, 0x0000000a, 0x00000069, 0x0000000c, - 0x00040020, 0x0000006d, 0x00000001, 0x00000018, 0x0004003b, 0x0000006d, 0x0000006e, 0x00000001, 0x000d001e, 0x00000073, - 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, - 0x0000000a, 0x00040020, 0x00000074, 0x00000009, 0x00000073, 0x0004003b, 0x00000074, 0x00000075, 0x00000009, 0x00040020, - 0x00000076, 0x00000009, 0x0000000a, 0x0004002b, 0x0000000a, 0x0000007f, 0x00000003, 0x0003001d, 0x00000085, 0x0000000a, - 0x0003001e, 0x00000086, 0x00000085, 0x00040020, 0x00000087, 0x00000002, 0x00000086, 0x0004003b, 0x00000087, 0x00000088, - 0x00000002, 0x0004002b, 0x00000018, 0x00000089, 0x00000003, 0x0004002b, 0x0000000a, 0x00000094, 0x00000004, 0x0004002b, - 0x0000000a, 0x000000a2, 0x00000002, 0x0003001d, 0x000000bc, 0x0000000a, 0x0003001e, 0x000000bd, 0x000000bc, 0x00040020, - 0x000000be, 0x00000002, 0x000000bd, 0x0004003b, 0x000000be, 0x000000bf, 0x00000002, 0x0004002b, 0x00000018, 0x000000e1, - 0x00000004, 0x0004002b, 0x00000018, 0x000000e5, 0x00000006, 0x0004002b, 0x00000018, 0x000000f3, 0x00000005, 0x0004002b, - 0x00000018, 0x0000010e, 0x00000007, 0x0004002b, 0x00000018, 0x0000011c, 0x00000008, 0x0004002b, 0x0000000a, 0x00000122, - 0x00000005, 0x0004002b, 0x00000018, 0x0000012b, 0x00000009, 0x0004002b, 0x00000018, 0x0000013f, 0x0000000a, 0x00050036, - 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x0000000b, 0x00000095, 0x00000007, - 0x0004003b, 0x0000000b, 0x00000096, 0x00000007, 0x0004003b, 0x0000000b, 0x00000097, 0x00000007, 0x0004003b, 0x0000000b, - 0x00000099, 0x00000007, 0x0004003b, 0x0000000b, 0x000000a3, 0x00000007, 0x0004003b, 0x0000000b, 0x000000a4, 0x00000007, - 0x0004003b, 0x0000000b, 0x000000a5, 0x00000007, 0x0004003b, 0x0000000b, 0x000000a7, 0x00000007, 0x0004003b, 0x0000000b, - 0x000000af, 0x00000007, 0x0004003b, 0x0000000b, 0x000000b2, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c6, 0x00000007, - 0x0004003b, 0x0000000b, 0x000000c7, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c8, 0x00000007, 0x0004003b, 0x0000000b, - 0x000000ca, 0x00000007, 0x0004003b, 0x0000000b, 0x000000e0, 0x00000007, 0x0004003b, 0x0000000b, 0x000000ed, 0x00000007, - 0x0004003b, 0x0000000b, 0x000000f6, 0x00000007, 0x0004003b, 0x0000000b, 0x00000114, 0x00000007, 0x0004003b, 0x0000000b, - 0x00000115, 0x00000007, 0x0004003b, 0x0000000b, 0x00000116, 0x00000007, 0x0004003b, 0x0000000b, 0x00000118, 0x00000007, - 0x0004003b, 0x0000000b, 0x00000123, 0x00000007, 0x0004003b, 0x0000000b, 0x00000124, 0x00000007, 0x0004003b, 0x0000000b, - 0x00000125, 0x00000007, 0x0004003b, 0x0000000b, 0x00000127, 0x00000007, 0x0004003b, 0x0000000b, 0x00000131, 0x00000007, - 0x0004003b, 0x0000000b, 0x00000132, 0x00000007, 0x0004003b, 0x0000000b, 0x00000133, 0x00000007, 0x0004003b, 0x0000000b, - 0x00000135, 0x00000007, 0x0004003b, 0x0000000b, 0x00000145, 0x00000007, 0x0004003b, 0x0000000b, 0x00000146, 0x00000007, - 0x0004003b, 0x0000000b, 0x00000147, 0x00000007, 0x0004003b, 0x0000000b, 0x00000149, 0x00000007, 0x0004003d, 0x00000018, - 0x0000006f, 0x0000006e, 0x000500aa, 0x00000006, 0x00000070, 0x0000006f, 0x00000019, 0x000300f7, 0x00000072, 0x00000000, - 0x000400fa, 0x00000070, 0x00000071, 0x00000072, 0x000200f8, 0x00000071, 0x00050041, 0x00000076, 0x00000077, 0x00000075, - 0x00000019, 0x0004003d, 0x0000000a, 0x00000078, 0x00000077, 0x000500aa, 0x00000006, 0x00000079, 0x00000078, 0x00000024, - 0x000400a8, 0x00000006, 0x0000007a, 0x00000079, 0x000300f7, 0x0000007c, 0x00000000, 0x000400fa, 0x0000007a, 0x0000007b, - 0x0000007c, 0x000200f8, 0x0000007b, 0x00050041, 0x00000076, 0x0000007d, 0x00000075, 0x00000019, 0x0004003d, 0x0000000a, - 0x0000007e, 0x0000007d, 0x000500aa, 0x00000006, 0x00000080, 0x0000007e, 0x0000007f, 0x000200f9, 0x0000007c, 0x000200f8, - 0x0000007c, 0x000700f5, 0x00000006, 0x00000081, 0x00000079, 0x00000071, 0x00000080, 0x0000007b, 0x000300f7, 0x00000083, - 0x00000000, 0x000400fa, 0x00000081, 0x00000082, 0x000000a9, 0x000200f8, 0x00000082, 0x00050041, 0x00000076, 0x0000008a, - 0x00000075, 0x00000089, 0x0004003d, 0x0000000a, 0x0000008b, 0x0000008a, 0x00060041, 0x0000001a, 0x0000008c, 0x00000088, - 0x00000019, 0x0000008b, 0x0004003d, 0x0000000a, 0x0000008d, 0x0000008c, 0x00050041, 0x00000076, 0x0000008f, 0x00000075, - 0x00000045, 0x0004003d, 0x0000000a, 0x00000090, 0x0000008f, 0x000500ac, 0x00000006, 0x00000091, 0x0000008d, 0x00000090, - 0x000300f7, 0x00000093, 0x00000000, 0x000400fa, 0x00000091, 0x00000092, 0x0000009b, 0x000200f8, 0x00000092, 0x0003003e, - 0x00000095, 0x00000094, 0x0003003e, 0x00000096, 0x00000024, 0x0003003e, 0x00000097, 0x0000008d, 0x0003003e, 0x00000099, - 0x00000025, 0x00080039, 0x00000002, 0x0000009a, 0x00000011, 0x00000095, 0x00000096, 0x00000097, 0x00000099, 0x000200f9, - 0x00000093, 0x000200f8, 0x0000009b, 0x00050041, 0x00000076, 0x0000009d, 0x00000075, 0x00000035, 0x0004003d, 0x0000000a, - 0x0000009e, 0x0000009d, 0x000500ac, 0x00000006, 0x0000009f, 0x0000008d, 0x0000009e, 0x000300f7, 0x000000a1, 0x00000000, - 0x000400fa, 0x0000009f, 0x000000a0, 0x000000a1, 0x000200f8, 0x000000a0, 0x0003003e, 0x000000a3, 0x00000094, 0x0003003e, - 0x000000a4, 0x000000a2, 0x0003003e, 0x000000a5, 0x0000008d, 0x0003003e, 0x000000a7, 0x00000025, 0x00080039, 0x00000002, - 0x000000a8, 0x00000011, 0x000000a3, 0x000000a4, 0x000000a5, 0x000000a7, 0x000200f9, 0x000000a1, 0x000200f8, 0x000000a1, - 0x000200f9, 0x00000093, 0x000200f8, 0x00000093, 0x000200f9, 0x00000083, 0x000200f8, 0x000000a9, 0x00050041, 0x00000076, - 0x000000aa, 0x00000075, 0x00000019, 0x0004003d, 0x0000000a, 0x000000ab, 0x000000aa, 0x000500aa, 0x00000006, 0x000000ac, - 0x000000ab, 0x000000a2, 0x000300f7, 0x000000ae, 0x00000000, 0x000400fa, 0x000000ac, 0x000000ad, 0x000000ae, 0x000200f8, - 0x000000ad, 0x00050041, 0x00000076, 0x000000b0, 0x00000075, 0x00000045, 0x0004003d, 0x0000000a, 0x000000b1, 0x000000b0, - 0x0003003e, 0x000000af, 0x000000b1, 0x0003003e, 0x000000b2, 0x00000025, 0x000200f9, 0x000000b3, 0x000200f8, 0x000000b3, - 0x000400f6, 0x000000b5, 0x000000b6, 0x00000000, 0x000200f9, 0x000000b7, 0x000200f8, 0x000000b7, 0x0004003d, 0x0000000a, - 0x000000b8, 0x000000b2, 0x00050041, 0x00000076, 0x000000b9, 0x00000075, 0x00000035, 0x0004003d, 0x0000000a, 0x000000ba, - 0x000000b9, 0x000500b0, 0x00000006, 0x000000bb, 0x000000b8, 0x000000ba, 0x000400fa, 0x000000bb, 0x000000b4, 0x000000b5, - 0x000200f8, 0x000000b4, 0x0004003d, 0x0000000a, 0x000000c0, 0x000000af, 0x00060041, 0x0000001a, 0x000000c1, 0x000000bf, - 0x00000019, 0x000000c0, 0x0004003d, 0x0000000a, 0x000000c2, 0x000000c1, 0x000500ab, 0x00000006, 0x000000c3, 0x000000c2, - 0x00000025, 0x000300f7, 0x000000c5, 0x00000000, 0x000400fa, 0x000000c3, 0x000000c4, 0x000000c5, 0x000200f8, 0x000000c4, - 0x0003003e, 0x000000c6, 0x00000094, 0x0003003e, 0x000000c7, 0x0000007f, 0x0004003d, 0x0000000a, 0x000000c9, 0x000000b2, - 0x0003003e, 0x000000c8, 0x000000c9, 0x0003003e, 0x000000ca, 0x000000c9, 0x00080039, 0x00000002, 0x000000cc, 0x00000011, - 0x000000c6, 0x000000c7, 0x000000c8, 0x000000ca, 0x000200f9, 0x000000b5, 0x000200f8, 0x000000c5, 0x00050041, 0x00000076, - 0x000000ce, 0x00000075, 0x00000089, 0x0004003d, 0x0000000a, 0x000000cf, 0x000000ce, 0x0004003d, 0x0000000a, 0x000000d0, - 0x000000af, 0x00050080, 0x0000000a, 0x000000d1, 0x000000d0, 0x000000cf, 0x0003003e, 0x000000af, 0x000000d1, 0x000200f9, - 0x000000b6, 0x000200f8, 0x000000b6, 0x0004003d, 0x0000000a, 0x000000d2, 0x000000b2, 0x00050080, 0x0000000a, 0x000000d3, - 0x000000d2, 0x00000035, 0x0003003e, 0x000000b2, 0x000000d3, 0x000200f9, 0x000000b3, 0x000200f8, 0x000000b5, 0x000200f9, - 0x000000ae, 0x000200f8, 0x000000ae, 0x000200f9, 0x00000083, 0x000200f8, 0x00000083, 0x00050041, 0x00000076, 0x000000d4, - 0x00000075, 0x00000019, 0x0004003d, 0x0000000a, 0x000000d5, 0x000000d4, 0x000500aa, 0x00000006, 0x000000d6, 0x000000d5, - 0x0000007f, 0x000400a8, 0x00000006, 0x000000d7, 0x000000d6, 0x000300f7, 0x000000d9, 0x00000000, 0x000400fa, 0x000000d7, - 0x000000d8, 0x000000d9, 0x000200f8, 0x000000d8, 0x00050041, 0x00000076, 0x000000da, 0x00000075, 0x00000019, 0x0004003d, - 0x0000000a, 0x000000db, 0x000000da, 0x000500aa, 0x00000006, 0x000000dc, 0x000000db, 0x00000094, 0x000200f9, 0x000000d9, - 0x000200f8, 0x000000d9, 0x000700f5, 0x00000006, 0x000000dd, 0x000000d6, 0x00000083, 0x000000dc, 0x000000d8, 0x000300f7, - 0x000000df, 0x00000000, 0x000400fa, 0x000000dd, 0x000000de, 0x000000df, 0x000200f8, 0x000000de, 0x00050041, 0x00000076, - 0x000000e2, 0x00000075, 0x000000e1, 0x0004003d, 0x0000000a, 0x000000e3, 0x000000e2, 0x0003003e, 0x000000e0, 0x000000e3, - 0x00050041, 0x00000076, 0x000000e6, 0x00000075, 0x000000e5, 0x0004003d, 0x0000000a, 0x000000e7, 0x000000e6, 0x00050041, - 0x00000076, 0x000000e8, 0x00000075, 0x00000019, 0x0004003d, 0x0000000a, 0x000000e9, 0x000000e8, 0x000500aa, 0x00000006, - 0x000000ea, 0x000000e9, 0x0000007f, 0x000300f7, 0x000000ec, 0x00000000, 0x000400fa, 0x000000ea, 0x000000eb, 0x000000f2, - 0x000200f8, 0x000000eb, 0x00050041, 0x00000076, 0x000000ee, 0x00000075, 0x00000089, 0x0004003d, 0x0000000a, 0x000000ef, - 0x000000ee, 0x00060041, 0x0000001a, 0x000000f0, 0x00000088, 0x00000019, 0x000000ef, 0x0004003d, 0x0000000a, 0x000000f1, - 0x000000f0, 0x0003003e, 0x000000ed, 0x000000f1, 0x000200f9, 0x000000ec, 0x000200f8, 0x000000f2, 0x00050041, 0x00000076, - 0x000000f4, 0x00000075, 0x000000f3, 0x0004003d, 0x0000000a, 0x000000f5, 0x000000f4, 0x0003003e, 0x000000ed, 0x000000f5, - 0x000200f9, 0x000000ec, 0x000200f8, 0x000000ec, 0x0003003e, 0x000000f6, 0x00000025, 0x000200f9, 0x000000f7, 0x000200f8, - 0x000000f7, 0x000400f6, 0x000000f9, 0x000000fa, 0x00000000, 0x000200f9, 0x000000fb, 0x000200f8, 0x000000fb, 0x0004003d, - 0x0000000a, 0x000000fc, 0x000000f6, 0x0004003d, 0x0000000a, 0x000000fd, 0x000000ed, 0x000500b0, 0x00000006, 0x000000fe, - 0x000000fc, 0x000000fd, 0x000400fa, 0x000000fe, 0x000000f8, 0x000000f9, 0x000200f8, 0x000000f8, 0x0004003d, 0x0000000a, - 0x00000100, 0x000000e0, 0x00060041, 0x0000001a, 0x00000101, 0x000000bf, 0x00000019, 0x00000100, 0x0004003d, 0x0000000a, - 0x00000102, 0x00000101, 0x00050080, 0x0000000a, 0x00000105, 0x00000100, 0x00000024, 0x00060041, 0x0000001a, 0x00000106, - 0x000000bf, 0x00000019, 0x00000105, 0x0004003d, 0x0000000a, 0x00000107, 0x00000106, 0x00050080, 0x0000000a, 0x0000010a, - 0x00000100, 0x000000a2, 0x00060041, 0x0000001a, 0x0000010b, 0x000000bf, 0x00000019, 0x0000010a, 0x0004003d, 0x0000000a, - 0x0000010c, 0x0000010b, 0x00050041, 0x00000076, 0x0000010f, 0x00000075, 0x0000010e, 0x0004003d, 0x0000000a, 0x00000110, - 0x0000010f, 0x000500ac, 0x00000006, 0x00000111, 0x00000102, 0x00000110, 0x000300f7, 0x00000113, 0x00000000, 0x000400fa, - 0x00000111, 0x00000112, 0x00000113, 0x000200f8, 0x00000112, 0x0003003e, 0x00000114, 0x00000094, 0x0003003e, 0x00000115, - 0x00000094, 0x0003003e, 0x00000116, 0x00000102, 0x0004003d, 0x0000000a, 0x00000119, 0x000000f6, 0x0003003e, 0x00000118, - 0x00000119, 0x00080039, 0x00000002, 0x0000011a, 0x00000011, 0x00000114, 0x00000115, 0x00000116, 0x00000118, 0x000200f9, - 0x00000113, 0x000200f8, 0x00000113, 0x00050041, 0x00000076, 0x0000011d, 0x00000075, 0x0000011c, 0x0004003d, 0x0000000a, - 0x0000011e, 0x0000011d, 0x000500ac, 0x00000006, 0x0000011f, 0x00000107, 0x0000011e, 0x000300f7, 0x00000121, 0x00000000, - 0x000400fa, 0x0000011f, 0x00000120, 0x00000121, 0x000200f8, 0x00000120, 0x0003003e, 0x00000123, 0x00000094, 0x0003003e, - 0x00000124, 0x00000122, 0x0003003e, 0x00000125, 0x00000107, 0x0004003d, 0x0000000a, 0x00000128, 0x000000f6, 0x0003003e, - 0x00000127, 0x00000128, 0x00080039, 0x00000002, 0x00000129, 0x00000011, 0x00000123, 0x00000124, 0x00000125, 0x00000127, - 0x000200f9, 0x00000121, 0x000200f8, 0x00000121, 0x00050041, 0x00000076, 0x0000012c, 0x00000075, 0x0000012b, 0x0004003d, - 0x0000000a, 0x0000012d, 0x0000012c, 0x000500ac, 0x00000006, 0x0000012e, 0x0000010c, 0x0000012d, 0x000300f7, 0x00000130, - 0x00000000, 0x000400fa, 0x0000012e, 0x0000012f, 0x00000130, 0x000200f8, 0x0000012f, 0x0003003e, 0x00000131, 0x00000094, - 0x0003003e, 0x00000132, 0x00000028, 0x0003003e, 0x00000133, 0x0000010c, 0x0004003d, 0x0000000a, 0x00000136, 0x000000f6, - 0x0003003e, 0x00000135, 0x00000136, 0x00080039, 0x00000002, 0x00000137, 0x00000011, 0x00000131, 0x00000132, 0x00000133, - 0x00000135, 0x000200f9, 0x00000130, 0x000200f8, 0x00000130, 0x00050084, 0x0000000a, 0x0000013b, 0x00000102, 0x00000107, - 0x00050084, 0x0000000a, 0x0000013d, 0x0000013b, 0x0000010c, 0x00050041, 0x00000076, 0x00000140, 0x00000075, 0x0000013f, - 0x0004003d, 0x0000000a, 0x00000141, 0x00000140, 0x000500ac, 0x00000006, 0x00000142, 0x0000013d, 0x00000141, 0x000300f7, - 0x00000144, 0x00000000, 0x000400fa, 0x00000142, 0x00000143, 0x00000144, 0x000200f8, 0x00000143, 0x0003003e, 0x00000145, - 0x00000094, 0x0003003e, 0x00000146, 0x0000004a, 0x0003003e, 0x00000147, 0x0000013d, 0x0004003d, 0x0000000a, 0x0000014a, - 0x000000f6, 0x0003003e, 0x00000149, 0x0000014a, 0x00080039, 0x00000002, 0x0000014b, 0x00000011, 0x00000145, 0x00000146, - 0x00000147, 0x00000149, 0x000200f9, 0x00000144, 0x000200f8, 0x00000144, 0x0004003d, 0x0000000a, 0x0000014d, 0x000000e0, - 0x00050080, 0x0000000a, 0x0000014e, 0x0000014d, 0x000000e7, 0x0003003e, 0x000000e0, 0x0000014e, 0x000200f9, 0x000000fa, - 0x000200f8, 0x000000fa, 0x0004003d, 0x0000000a, 0x0000014f, 0x000000f6, 0x00050080, 0x0000000a, 0x00000150, 0x0000014f, - 0x00000035, 0x0003003e, 0x000000f6, 0x00000150, 0x000200f9, 0x000000f7, 0x000200f8, 0x000000f9, 0x000200f9, 0x000000df, - 0x000200f8, 0x000000df, 0x000200f9, 0x00000072, 0x000200f8, 0x00000072, 0x000100fd, 0x00010038, 0x00050036, 0x00000006, - 0x00000008, 0x00000000, 0x00000007, 0x000200f8, 0x00000009, 0x00060041, 0x0000001a, 0x0000001b, 0x00000017, 0x00000019, - 0x00000019, 0x0004003d, 0x0000000a, 0x0000001c, 0x0000001b, 0x00060041, 0x0000001a, 0x00000023, 0x00000021, 0x00000019, - 0x0000001c, 0x000700ea, 0x0000000a, 0x00000026, 0x00000023, 0x00000024, 0x00000025, 0x00000024, 0x000500ae, 0x00000006, - 0x00000029, 0x00000026, 0x00000028, 0x000200fe, 0x00000029, 0x00010038, 0x00050036, 0x00000002, 0x00000011, 0x00000000, - 0x0000000c, 0x00030037, 0x0000000b, 0x0000000d, 0x00030037, 0x0000000b, 0x0000000e, 0x00030037, 0x0000000b, 0x0000000f, - 0x00030037, 0x0000000b, 0x00000010, 0x000200f8, 0x00000012, 0x00040039, 0x00000006, 0x0000002c, 0x00000008, 0x000300f7, - 0x0000002e, 0x00000000, 0x000400fa, 0x0000002c, 0x0000002d, 0x0000002e, 0x000200f8, 0x0000002d, 0x000100fd, 0x000200f8, - 0x0000002e, 0x00050041, 0x0000001a, 0x00000036, 0x00000034, 0x00000035, 0x000700ea, 0x0000000a, 0x00000038, 0x00000036, - 0x00000024, 0x00000025, 0x00000037, 0x00050080, 0x0000000a, 0x0000003c, 0x00000038, 0x00000037, 0x00050044, 0x0000000a, - 0x0000003d, 0x00000034, 0x00000002, 0x0004007c, 0x00000018, 0x0000003e, 0x0000003d, 0x0004007c, 0x0000000a, 0x0000003f, - 0x0000003e, 0x000500ac, 0x00000006, 0x00000040, 0x0000003c, 0x0000003f, 0x000300f7, 0x00000043, 0x00000000, 0x000400fa, - 0x00000040, 0x00000042, 0x00000043, 0x000200f8, 0x00000042, 0x000100fd, 0x000200f8, 0x00000043, 0x00060041, 0x0000001a, - 0x00000048, 0x00000034, 0x00000045, 0x00000038, 0x0003003e, 0x00000048, 0x00000037, 0x00050080, 0x0000000a, 0x0000004b, - 0x00000038, 0x0000004a, 0x00060041, 0x0000001a, 0x00000050, 0x0000004f, 0x00000019, 0x00000019, 0x0004003d, 0x0000000a, - 0x00000051, 0x00000050, 0x00060041, 0x0000001a, 0x00000052, 0x00000034, 0x00000045, 0x0000004b, 0x0003003e, 0x00000052, - 0x00000051, 0x00050080, 0x0000000a, 0x00000055, 0x00000038, 0x00000054, 0x00060041, 0x0000001a, 0x00000056, 0x00000017, - 0x00000019, 0x00000019, 0x0004003d, 0x0000000a, 0x00000057, 0x00000056, 0x00060041, 0x0000001a, 0x00000058, 0x00000034, - 0x00000045, 0x00000055, 0x0003003e, 0x00000058, 0x00000057, 0x00050080, 0x0000000a, 0x0000005b, 0x00000038, 0x0000005a, - 0x0004003d, 0x0000000a, 0x0000005c, 0x0000000d, 0x00060041, 0x0000001a, 0x0000005d, 0x00000034, 0x00000045, 0x0000005b, - 0x0003003e, 0x0000005d, 0x0000005c, 0x00050080, 0x0000000a, 0x00000060, 0x00000038, 0x0000005f, 0x0004003d, 0x0000000a, - 0x00000061, 0x0000000e, 0x00060041, 0x0000001a, 0x00000062, 0x00000034, 0x00000045, 0x00000060, 0x0003003e, 0x00000062, - 0x00000061, 0x00050080, 0x0000000a, 0x00000065, 0x00000038, 0x00000064, 0x0004003d, 0x0000000a, 0x00000066, 0x0000000f, - 0x00060041, 0x0000001a, 0x00000067, 0x00000034, 0x00000045, 0x00000065, 0x0003003e, 0x00000067, 0x00000066, 0x00050080, - 0x0000000a, 0x0000006a, 0x00000038, 0x00000069, 0x0004003d, 0x0000000a, 0x0000006b, 0x00000010, 0x00060041, 0x0000001a, - 0x0000006c, 0x00000034, 0x00000045, 0x0000006a, 0x0003003e, 0x0000006c, 0x0000006b, 0x000100fd, 0x00010038, -}; diff --git a/layers/vulkan/generated/cmd_validation_indexed_draw_vert.cpp b/layers/vulkan/generated/cmd_validation_indexed_draw_vert.cpp new file mode 100644 index 00000000000..e5a98f5e7cb --- /dev/null +++ b/layers/vulkan/generated/cmd_validation_indexed_draw_vert.cpp @@ -0,0 +1,291 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See generate_spirv.py for modifications + +/*************************************************************************** + * + * Copyright (c) 2021-2024 The Khronos Group Inc. + * Copyright (c) 2021-2024 Valve Corporation + * Copyright (c) 2021-2024 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 "cmd_validation_indexed_draw_vert.h" + +// To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/ +[[maybe_unused]] const uint32_t cmd_validation_indexed_draw_vert_size = 2615; +[[maybe_unused]] const uint32_t cmd_validation_indexed_draw_vert[2615] = { + 0x07230203, 0x00010000, 0x0008000b, 0x000001b5, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47, + 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0006000f, 0x00000000, 0x00000004, 0x6e69616d, + 0x00000000, 0x00000115, 0x00030003, 0x00000002, 0x000001c2, 0x00080004, 0x455f4c47, 0x735f5458, 0x65646168, 0x36315f72, + 0x5f746962, 0x726f7473, 0x00656761, 0x00080004, 0x455f4c47, 0x735f5458, 0x65646168, 0x62385f72, 0x735f7469, 0x61726f74, + 0x00006567, 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, 0x00090005, 0x00000011, 0x61757047, 0x676f4c76, 0x6f727245, 0x31752872, 0x3b31753b, 0x753b3175, + 0x00003b31, 0x00050005, 0x0000000d, 0x6f727265, 0x72675f72, 0x0070756f, 0x00060005, 0x0000000e, 0x6f727265, 0x75735f72, + 0x6f635f62, 0x00006564, 0x00040005, 0x0000000f, 0x61726170, 0x00305f6d, 0x00040005, 0x00000010, 0x61726170, 0x00315f6d, + 0x00080005, 0x00000015, 0x5f746567, 0x74726576, 0x695f7865, 0x7865646e, 0x3b317528, 0x00000000, 0x00030005, 0x00000014, + 0x00000069, 0x000a0005, 0x0000001b, 0x63656863, 0x6e695f6b, 0x5f786564, 0x66667562, 0x75287265, 0x31753b31, 0x3b31753b, + 0x00000000, 0x00050005, 0x00000018, 0x65646e69, 0x6f635f78, 0x00746e75, 0x00050005, 0x00000019, 0x73726966, 0x6e695f74, + 0x00786564, 0x00060005, 0x0000001a, 0x74726576, 0x6f5f7865, 0x65736666, 0x00000074, 0x00070005, 0x0000001f, 0x6f736552, + 0x65637275, 0x65646e49, 0x66754278, 0x00726566, 0x00070006, 0x0000001f, 0x00000000, 0x6f736572, 0x65637275, 0x646e695f, + 0x00007865, 0x00030005, 0x00000021, 0x00000000, 0x00080005, 0x00000029, 0x45646d43, 0x726f7272, 0x756f4373, 0x7542746e, + 0x72656666, 0x00000000, 0x00080006, 0x00000029, 0x00000000, 0x5f646d63, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, + 0x00030005, 0x0000002b, 0x00000000, 0x00050005, 0x0000003c, 0x6f727245, 0x66754272, 0x00726566, 0x00050006, 0x0000003c, + 0x00000000, 0x67616c66, 0x00000073, 0x00070006, 0x0000003c, 0x00000001, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, + 0x00070006, 0x0000003c, 0x00000002, 0x6f727265, 0x625f7372, 0x65666675, 0x00000072, 0x00030005, 0x0000003e, 0x00000000, + 0x00070005, 0x00000057, 0x69746341, 0x6e496e6f, 0x42786564, 0x65666675, 0x00000072, 0x00070006, 0x00000057, 0x00000000, + 0x69746361, 0x695f6e6f, 0x7865646e, 0x00000000, 0x00030005, 0x00000059, 0x00000000, 0x00070005, 0x00000077, 0x77617244, + 0x65646e49, 0x50646578, 0x44687375, 0x00617461, 0x00050006, 0x00000077, 0x00000000, 0x67616c66, 0x00000073, 0x00080006, + 0x00000077, 0x00000001, 0x706f7270, 0x756f635f, 0x6c5f746e, 0x74696d69, 0x00000000, 0x00080006, 0x00000077, 0x00000002, + 0x66667562, 0x635f7265, 0x746e756f, 0x6d696c5f, 0x00007469, 0x00060006, 0x00000077, 0x00000003, 0x77617264, 0x756f635f, + 0x0000746e, 0x00060006, 0x00000077, 0x00000004, 0x77617264, 0x7274735f, 0x00656469, 0x00060006, 0x00000077, 0x00000005, + 0x73726966, 0x6e695f74, 0x00786564, 0x00060006, 0x00000077, 0x00000006, 0x65646e69, 0x6f635f78, 0x00746e75, 0x00060006, + 0x00000077, 0x00000007, 0x65646e69, 0x69775f78, 0x00687464, 0x00070006, 0x00000077, 0x00000008, 0x74726576, 0x6f5f7865, + 0x65736666, 0x00000074, 0x000c0006, 0x00000077, 0x00000009, 0x6c616d73, 0x7473656c, 0x7265765f, 0x5f786574, 0x72747461, + 0x74756269, 0x635f7365, 0x746e756f, 0x00000000, 0x00050005, 0x00000078, 0x66696e55, 0x496d726f, 0x006f666e, 0x00060006, + 0x00000078, 0x00000000, 0x68737570, 0x7461645f, 0x00000061, 0x00030005, 0x0000007a, 0x00000000, 0x00060005, 0x00000084, + 0x65646e49, 0x66754278, 0x33726566, 0x00000032, 0x00070006, 0x00000084, 0x00000000, 0x65646e69, 0x75625f78, 0x72656666, + 0x00000000, 0x00030005, 0x00000086, 0x00000000, 0x00050005, 0x000000bd, 0x65646e69, 0x656c5f78, 0x0000006e, 0x00040005, + 0x000000e5, 0x61726170, 0x0000006d, 0x00040005, 0x000000e6, 0x61726170, 0x0000006d, 0x00040005, 0x000000e7, 0x61726170, + 0x0000006d, 0x00040005, 0x000000e9, 0x61726170, 0x0000006d, 0x00040005, 0x000000ed, 0x65646e69, 0x00695f78, 0x00040005, + 0x000000fa, 0x61726170, 0x0000006d, 0x00040005, 0x00000108, 0x61726170, 0x0000006d, 0x00040005, 0x00000109, 0x61726170, + 0x0000006d, 0x00040005, 0x0000010a, 0x61726170, 0x0000006d, 0x00040005, 0x0000010b, 0x61726170, 0x0000006d, 0x00060005, + 0x00000115, 0x565f6c67, 0x65747265, 0x646e4978, 0x00007865, 0x00050005, 0x0000011a, 0x77617264, 0x756f635f, 0x0000746e, + 0x00050005, 0x00000123, 0x6e756f43, 0x66754274, 0x00726566, 0x00070006, 0x00000123, 0x00000000, 0x6e756f63, 0x75625f74, + 0x72656666, 0x00000000, 0x00030005, 0x00000125, 0x00000000, 0x00040005, 0x0000012e, 0x61726170, 0x0000006d, 0x00040005, + 0x0000012f, 0x61726170, 0x0000006d, 0x00040005, 0x00000130, 0x61726170, 0x0000006d, 0x00040005, 0x00000132, 0x61726170, + 0x0000006d, 0x00040005, 0x0000013b, 0x61726170, 0x0000006d, 0x00040005, 0x0000013c, 0x61726170, 0x0000006d, 0x00040005, + 0x0000013d, 0x61726170, 0x0000006d, 0x00040005, 0x0000013f, 0x61726170, 0x0000006d, 0x00050005, 0x0000014d, 0x77617264, + 0x646e695f, 0x00007865, 0x00030005, 0x0000014e, 0x00000069, 0x00050005, 0x00000158, 0x77617244, 0x66667542, 0x00007265, + 0x000a0006, 0x00000158, 0x00000000, 0x77617264, 0x646e695f, 0x64657865, 0x646e695f, 0x63657269, 0x6d635f74, 0x00007364, + 0x00030005, 0x0000015a, 0x00000000, 0x00040005, 0x00000163, 0x61726170, 0x0000006d, 0x00040005, 0x00000164, 0x61726170, + 0x0000006d, 0x00040005, 0x00000165, 0x61726170, 0x0000006d, 0x00040005, 0x00000167, 0x61726170, 0x0000006d, 0x00050005, + 0x0000017d, 0x77617264, 0x646e695f, 0x00007865, 0x00030005, 0x0000017e, 0x00000069, 0x00040005, 0x00000196, 0x61726170, + 0x0000006d, 0x00040005, 0x00000198, 0x61726170, 0x0000006d, 0x00040005, 0x0000019a, 0x61726170, 0x0000006d, 0x00040005, + 0x000001ab, 0x61726170, 0x0000006d, 0x00040005, 0x000001ae, 0x61726170, 0x0000006d, 0x00040005, 0x000001b1, 0x61726170, + 0x0000006d, 0x00040047, 0x0000001e, 0x00000006, 0x00000004, 0x00030047, 0x0000001f, 0x00000003, 0x00050048, 0x0000001f, + 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000021, 0x00000021, 0x00000002, 0x00040047, 0x00000021, 0x00000022, + 0x00000000, 0x00040047, 0x00000028, 0x00000006, 0x00000004, 0x00030047, 0x00000029, 0x00000003, 0x00050048, 0x00000029, + 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x0000002b, 0x00000021, 0x00000003, 0x00040047, 0x0000002b, 0x00000022, + 0x00000000, 0x00040047, 0x0000003b, 0x00000006, 0x00000004, 0x00030047, 0x0000003c, 0x00000003, 0x00050048, 0x0000003c, + 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x0000003c, 0x00000001, 0x00000023, 0x00000004, 0x00050048, 0x0000003c, + 0x00000002, 0x00000023, 0x00000008, 0x00040047, 0x0000003e, 0x00000021, 0x00000000, 0x00040047, 0x0000003e, 0x00000022, + 0x00000000, 0x00040047, 0x00000056, 0x00000006, 0x00000004, 0x00030047, 0x00000057, 0x00000003, 0x00050048, 0x00000057, + 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000059, 0x00000021, 0x00000001, 0x00040047, 0x00000059, 0x00000022, + 0x00000000, 0x00050048, 0x00000077, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000077, 0x00000001, 0x00000023, + 0x00000004, 0x00050048, 0x00000077, 0x00000002, 0x00000023, 0x00000008, 0x00050048, 0x00000077, 0x00000003, 0x00000023, + 0x0000000c, 0x00050048, 0x00000077, 0x00000004, 0x00000023, 0x00000010, 0x00050048, 0x00000077, 0x00000005, 0x00000023, + 0x00000014, 0x00050048, 0x00000077, 0x00000006, 0x00000023, 0x00000018, 0x00050048, 0x00000077, 0x00000007, 0x00000023, + 0x0000001c, 0x00050048, 0x00000077, 0x00000008, 0x00000023, 0x00000020, 0x00050048, 0x00000077, 0x00000009, 0x00000023, + 0x00000024, 0x00030047, 0x00000078, 0x00000002, 0x00050048, 0x00000078, 0x00000000, 0x00000023, 0x00000000, 0x00040047, + 0x00000083, 0x00000006, 0x00000004, 0x00030047, 0x00000084, 0x00000003, 0x00050048, 0x00000084, 0x00000000, 0x00000023, + 0x00000000, 0x00040047, 0x00000086, 0x00000021, 0x00000002, 0x00040047, 0x00000086, 0x00000022, 0x00000001, 0x00040047, + 0x00000115, 0x0000000b, 0x0000002a, 0x00030047, 0x00000123, 0x00000003, 0x00050048, 0x00000123, 0x00000000, 0x00000023, + 0x00000000, 0x00040047, 0x00000125, 0x00000021, 0x00000001, 0x00040047, 0x00000125, 0x00000022, 0x00000001, 0x00040047, + 0x00000157, 0x00000006, 0x00000004, 0x00030047, 0x00000158, 0x00000003, 0x00050048, 0x00000158, 0x00000000, 0x00000023, + 0x00000000, 0x00040047, 0x0000015a, 0x00000021, 0x00000000, 0x00040047, 0x0000015a, 0x00000022, 0x00000001, 0x00020013, + 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00020014, 0x00000006, 0x00030021, 0x00000007, 0x00000006, 0x00040015, + 0x0000000a, 0x00000020, 0x00000000, 0x00040020, 0x0000000b, 0x00000007, 0x0000000a, 0x00070021, 0x0000000c, 0x00000002, + 0x0000000b, 0x0000000b, 0x0000000b, 0x0000000b, 0x00040021, 0x00000013, 0x0000000a, 0x0000000b, 0x00060021, 0x00000017, + 0x00000006, 0x0000000b, 0x0000000b, 0x0000000b, 0x0003001d, 0x0000001e, 0x0000000a, 0x0003001e, 0x0000001f, 0x0000001e, + 0x00040020, 0x00000020, 0x00000002, 0x0000001f, 0x0004003b, 0x00000020, 0x00000021, 0x00000002, 0x00040015, 0x00000022, + 0x00000020, 0x00000001, 0x0004002b, 0x00000022, 0x00000023, 0x00000000, 0x00040020, 0x00000024, 0x00000002, 0x0000000a, + 0x0003001d, 0x00000028, 0x0000000a, 0x0003001e, 0x00000029, 0x00000028, 0x00040020, 0x0000002a, 0x00000002, 0x00000029, + 0x0004003b, 0x0000002a, 0x0000002b, 0x00000002, 0x0004002b, 0x0000000a, 0x0000002e, 0x00000001, 0x0004002b, 0x0000000a, + 0x0000002f, 0x00000000, 0x0004002b, 0x0000000a, 0x00000032, 0x00000006, 0x0003001d, 0x0000003b, 0x0000000a, 0x0005001e, + 0x0000003c, 0x0000000a, 0x0000000a, 0x0000003b, 0x00040020, 0x0000003d, 0x00000002, 0x0000003c, 0x0004003b, 0x0000003d, + 0x0000003e, 0x00000002, 0x0004002b, 0x00000022, 0x0000003f, 0x00000001, 0x0004002b, 0x0000000a, 0x00000041, 0x00000010, + 0x0004002b, 0x00000022, 0x0000004f, 0x00000002, 0x0004002b, 0x0000000a, 0x00000054, 0x00000007, 0x0003001d, 0x00000056, + 0x0000000a, 0x0003001e, 0x00000057, 0x00000056, 0x00040020, 0x00000058, 0x00000002, 0x00000057, 0x0004003b, 0x00000058, + 0x00000059, 0x00000002, 0x0004002b, 0x0000000a, 0x0000005e, 0x00000008, 0x0004002b, 0x0000000a, 0x00000064, 0x00000009, + 0x0004002b, 0x0000000a, 0x00000069, 0x0000000a, 0x0004002b, 0x0000000a, 0x0000006e, 0x0000000b, 0x0004002b, 0x0000000a, + 0x00000073, 0x0000000c, 0x000c001e, 0x00000077, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, + 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0003001e, 0x00000078, 0x00000077, 0x00040020, 0x00000079, 0x00000009, + 0x00000078, 0x0004003b, 0x00000079, 0x0000007a, 0x00000009, 0x0004002b, 0x00000022, 0x0000007b, 0x00000007, 0x00040020, + 0x0000007c, 0x00000009, 0x0000000a, 0x0004002b, 0x0000000a, 0x0000007f, 0x00000020, 0x0003001d, 0x00000083, 0x0000000a, + 0x0003001e, 0x00000084, 0x00000083, 0x00040020, 0x00000085, 0x00000002, 0x00000084, 0x0004003b, 0x00000085, 0x00000086, + 0x00000002, 0x0004002b, 0x0000000a, 0x00000093, 0x00000002, 0x0004002b, 0x0000000a, 0x000000a0, 0x0000ffff, 0x0004002b, + 0x0000000a, 0x000000ab, 0x00000004, 0x0004002b, 0x0000000a, 0x000000b8, 0x000000ff, 0x0004002b, 0x00000022, 0x000000d6, + 0x00000004, 0x0003002a, 0x00000006, 0x000000dc, 0x0004002b, 0x00000022, 0x000000ff, 0x00000009, 0x00030029, 0x00000006, + 0x00000111, 0x00040020, 0x00000114, 0x00000001, 0x00000022, 0x0004003b, 0x00000114, 0x00000115, 0x00000001, 0x0003001e, + 0x00000123, 0x0000000a, 0x00040020, 0x00000124, 0x00000002, 0x00000123, 0x0004003b, 0x00000124, 0x00000125, 0x00000002, + 0x0004002b, 0x00000022, 0x00000144, 0x00000003, 0x0003001d, 0x00000157, 0x0000000a, 0x0003001e, 0x00000158, 0x00000157, + 0x00040020, 0x00000159, 0x00000002, 0x00000158, 0x0004003b, 0x00000159, 0x0000015a, 0x00000002, 0x0004002b, 0x0000000a, + 0x00000162, 0x00000003, 0x0004002b, 0x00000022, 0x000001a8, 0x00000006, 0x0004002b, 0x00000022, 0x000001a9, 0x00000005, + 0x0004002b, 0x00000022, 0x000001aa, 0x00000008, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, + 0x00000005, 0x0004003b, 0x0000000b, 0x0000011a, 0x00000007, 0x0004003b, 0x0000000b, 0x0000012e, 0x00000007, 0x0004003b, + 0x0000000b, 0x0000012f, 0x00000007, 0x0004003b, 0x0000000b, 0x00000130, 0x00000007, 0x0004003b, 0x0000000b, 0x00000132, + 0x00000007, 0x0004003b, 0x0000000b, 0x0000013b, 0x00000007, 0x0004003b, 0x0000000b, 0x0000013c, 0x00000007, 0x0004003b, + 0x0000000b, 0x0000013d, 0x00000007, 0x0004003b, 0x0000000b, 0x0000013f, 0x00000007, 0x0004003b, 0x0000000b, 0x0000014d, + 0x00000007, 0x0004003b, 0x0000000b, 0x0000014e, 0x00000007, 0x0004003b, 0x0000000b, 0x00000163, 0x00000007, 0x0004003b, + 0x0000000b, 0x00000164, 0x00000007, 0x0004003b, 0x0000000b, 0x00000165, 0x00000007, 0x0004003b, 0x0000000b, 0x00000167, + 0x00000007, 0x0004003b, 0x0000000b, 0x0000017d, 0x00000007, 0x0004003b, 0x0000000b, 0x0000017e, 0x00000007, 0x0004003b, + 0x0000000b, 0x00000196, 0x00000007, 0x0004003b, 0x0000000b, 0x00000198, 0x00000007, 0x0004003b, 0x0000000b, 0x0000019a, + 0x00000007, 0x0004003b, 0x0000000b, 0x000001ab, 0x00000007, 0x0004003b, 0x0000000b, 0x000001ae, 0x00000007, 0x0004003b, + 0x0000000b, 0x000001b1, 0x00000007, 0x0004003d, 0x00000022, 0x00000116, 0x00000115, 0x000500aa, 0x00000006, 0x00000117, + 0x00000116, 0x00000023, 0x000300f7, 0x00000119, 0x00000000, 0x000400fa, 0x00000117, 0x00000118, 0x00000119, 0x000200f8, + 0x00000118, 0x0003003e, 0x0000011a, 0x0000002f, 0x00060041, 0x0000007c, 0x0000011c, 0x0000007a, 0x00000023, 0x00000023, + 0x0004003d, 0x0000000a, 0x0000011d, 0x0000011c, 0x000500c7, 0x0000000a, 0x0000011e, 0x0000011d, 0x0000002e, 0x000500ab, + 0x00000006, 0x0000011f, 0x0000011e, 0x0000002f, 0x000300f7, 0x00000121, 0x00000000, 0x000400fa, 0x0000011f, 0x00000120, + 0x00000143, 0x000200f8, 0x00000120, 0x00050041, 0x00000024, 0x00000126, 0x00000125, 0x00000023, 0x0004003d, 0x0000000a, + 0x00000127, 0x00000126, 0x00060041, 0x0000007c, 0x00000129, 0x0000007a, 0x00000023, 0x0000004f, 0x0004003d, 0x0000000a, + 0x0000012a, 0x00000129, 0x000500ac, 0x00000006, 0x0000012b, 0x00000127, 0x0000012a, 0x000300f7, 0x0000012d, 0x00000000, + 0x000400fa, 0x0000012b, 0x0000012c, 0x00000134, 0x000200f8, 0x0000012c, 0x0003003e, 0x0000012e, 0x000000ab, 0x0003003e, + 0x0000012f, 0x0000002e, 0x0003003e, 0x00000130, 0x00000127, 0x0003003e, 0x00000132, 0x0000002f, 0x00080039, 0x00000002, + 0x00000133, 0x00000011, 0x0000012e, 0x0000012f, 0x00000130, 0x00000132, 0x000200f9, 0x0000012d, 0x000200f8, 0x00000134, + 0x00060041, 0x0000007c, 0x00000136, 0x0000007a, 0x00000023, 0x0000003f, 0x0004003d, 0x0000000a, 0x00000137, 0x00000136, + 0x000500ac, 0x00000006, 0x00000138, 0x00000127, 0x00000137, 0x000300f7, 0x0000013a, 0x00000000, 0x000400fa, 0x00000138, + 0x00000139, 0x00000141, 0x000200f8, 0x00000139, 0x0003003e, 0x0000013b, 0x000000ab, 0x0003003e, 0x0000013c, 0x00000093, + 0x0003003e, 0x0000013d, 0x00000127, 0x0003003e, 0x0000013f, 0x0000002f, 0x00080039, 0x00000002, 0x00000140, 0x00000011, + 0x0000013b, 0x0000013c, 0x0000013d, 0x0000013f, 0x000200f9, 0x0000013a, 0x000200f8, 0x00000141, 0x0003003e, 0x0000011a, + 0x00000127, 0x000200f9, 0x0000013a, 0x000200f8, 0x0000013a, 0x000200f9, 0x0000012d, 0x000200f8, 0x0000012d, 0x000200f9, + 0x00000121, 0x000200f8, 0x00000143, 0x00060041, 0x0000007c, 0x00000145, 0x0000007a, 0x00000023, 0x00000144, 0x0004003d, + 0x0000000a, 0x00000146, 0x00000145, 0x0003003e, 0x0000011a, 0x00000146, 0x000200f9, 0x00000121, 0x000200f8, 0x00000121, + 0x00060041, 0x0000007c, 0x00000147, 0x0000007a, 0x00000023, 0x00000023, 0x0004003d, 0x0000000a, 0x00000148, 0x00000147, + 0x000500c7, 0x0000000a, 0x00000149, 0x00000148, 0x000000ab, 0x000500ab, 0x00000006, 0x0000014a, 0x00000149, 0x0000002f, + 0x000300f7, 0x0000014c, 0x00000000, 0x000400fa, 0x0000014a, 0x0000014b, 0x0000014c, 0x000200f8, 0x0000014b, 0x0003003e, + 0x0000014d, 0x0000002f, 0x0003003e, 0x0000014e, 0x0000002f, 0x000200f9, 0x0000014f, 0x000200f8, 0x0000014f, 0x000400f6, + 0x00000151, 0x00000152, 0x00000000, 0x000200f9, 0x00000153, 0x000200f8, 0x00000153, 0x0004003d, 0x0000000a, 0x00000154, + 0x0000014e, 0x0004003d, 0x0000000a, 0x00000155, 0x0000011a, 0x000500b0, 0x00000006, 0x00000156, 0x00000154, 0x00000155, + 0x000400fa, 0x00000156, 0x00000150, 0x00000151, 0x000200f8, 0x00000150, 0x0004003d, 0x0000000a, 0x0000015b, 0x0000014d, + 0x00050080, 0x0000000a, 0x0000015c, 0x0000015b, 0x000000ab, 0x00060041, 0x00000024, 0x0000015d, 0x0000015a, 0x00000023, + 0x0000015c, 0x0004003d, 0x0000000a, 0x0000015e, 0x0000015d, 0x000500ab, 0x00000006, 0x0000015f, 0x0000015e, 0x0000002f, + 0x000300f7, 0x00000161, 0x00000000, 0x000400fa, 0x0000015f, 0x00000160, 0x00000161, 0x000200f8, 0x00000160, 0x0003003e, + 0x00000163, 0x000000ab, 0x0003003e, 0x00000164, 0x00000162, 0x0004003d, 0x0000000a, 0x00000166, 0x0000014e, 0x0003003e, + 0x00000165, 0x00000166, 0x0003003e, 0x00000167, 0x00000166, 0x00080039, 0x00000002, 0x00000169, 0x00000011, 0x00000163, + 0x00000164, 0x00000165, 0x00000167, 0x000200f9, 0x00000151, 0x000200f8, 0x00000161, 0x00060041, 0x0000007c, 0x0000016b, + 0x0000007a, 0x00000023, 0x000000d6, 0x0004003d, 0x0000000a, 0x0000016c, 0x0000016b, 0x0004003d, 0x0000000a, 0x0000016d, + 0x0000014d, 0x00050080, 0x0000000a, 0x0000016e, 0x0000016d, 0x0000016c, 0x0003003e, 0x0000014d, 0x0000016e, 0x000200f9, + 0x00000152, 0x000200f8, 0x00000152, 0x0004003d, 0x0000000a, 0x0000016f, 0x0000014e, 0x00050080, 0x0000000a, 0x00000170, + 0x0000016f, 0x0000003f, 0x0003003e, 0x0000014e, 0x00000170, 0x000200f9, 0x0000014f, 0x000200f8, 0x00000151, 0x000200f9, + 0x0000014c, 0x000200f8, 0x0000014c, 0x00060041, 0x0000007c, 0x00000171, 0x0000007a, 0x00000023, 0x00000023, 0x0004003d, + 0x0000000a, 0x00000172, 0x00000171, 0x000500c7, 0x0000000a, 0x00000173, 0x00000172, 0x0000005e, 0x000500ab, 0x00000006, + 0x00000174, 0x00000173, 0x0000002f, 0x000300f7, 0x00000176, 0x00000000, 0x000400fa, 0x00000174, 0x00000175, 0x00000176, + 0x000200f8, 0x00000175, 0x00060041, 0x0000007c, 0x00000177, 0x0000007a, 0x00000023, 0x00000023, 0x0004003d, 0x0000000a, + 0x00000178, 0x00000177, 0x000500c7, 0x0000000a, 0x00000179, 0x00000178, 0x00000093, 0x000500ab, 0x00000006, 0x0000017a, + 0x00000179, 0x0000002f, 0x000300f7, 0x0000017c, 0x00000000, 0x000400fa, 0x0000017a, 0x0000017b, 0x000001a7, 0x000200f8, + 0x0000017b, 0x0003003e, 0x0000017d, 0x0000002f, 0x0003003e, 0x0000017e, 0x0000002f, 0x000200f9, 0x0000017f, 0x000200f8, + 0x0000017f, 0x000400f6, 0x00000181, 0x00000182, 0x00000000, 0x000200f9, 0x00000183, 0x000200f8, 0x00000183, 0x0004003d, + 0x0000000a, 0x00000184, 0x0000017e, 0x0004003d, 0x0000000a, 0x00000185, 0x0000011a, 0x000500b0, 0x00000006, 0x00000186, + 0x00000184, 0x00000185, 0x000400fa, 0x00000186, 0x00000180, 0x00000181, 0x000200f8, 0x00000180, 0x0004003d, 0x0000000a, + 0x00000188, 0x0000017d, 0x00060041, 0x00000024, 0x0000018a, 0x0000015a, 0x00000023, 0x00000188, 0x0004003d, 0x0000000a, + 0x0000018b, 0x0000018a, 0x00050080, 0x0000000a, 0x0000018e, 0x00000188, 0x00000093, 0x00060041, 0x00000024, 0x0000018f, + 0x0000015a, 0x00000023, 0x0000018e, 0x0004003d, 0x0000000a, 0x00000190, 0x0000018f, 0x00050080, 0x0000000a, 0x00000193, + 0x00000188, 0x00000162, 0x00060041, 0x00000024, 0x00000194, 0x0000015a, 0x00000023, 0x00000193, 0x0004003d, 0x0000000a, + 0x00000195, 0x00000194, 0x0003003e, 0x00000196, 0x0000018b, 0x0003003e, 0x00000198, 0x00000190, 0x0003003e, 0x0000019a, + 0x00000195, 0x00070039, 0x00000006, 0x0000019c, 0x0000001b, 0x00000196, 0x00000198, 0x0000019a, 0x000400a8, 0x00000006, + 0x0000019d, 0x0000019c, 0x000300f7, 0x0000019f, 0x00000000, 0x000400fa, 0x0000019d, 0x0000019e, 0x0000019f, 0x000200f8, + 0x0000019e, 0x000200f9, 0x00000181, 0x000200f8, 0x0000019f, 0x00060041, 0x0000007c, 0x000001a1, 0x0000007a, 0x00000023, + 0x000000d6, 0x0004003d, 0x0000000a, 0x000001a2, 0x000001a1, 0x0004003d, 0x0000000a, 0x000001a3, 0x0000017d, 0x00050080, + 0x0000000a, 0x000001a4, 0x000001a3, 0x000001a2, 0x0003003e, 0x0000017d, 0x000001a4, 0x000200f9, 0x00000182, 0x000200f8, + 0x00000182, 0x0004003d, 0x0000000a, 0x000001a5, 0x0000017e, 0x00050080, 0x0000000a, 0x000001a6, 0x000001a5, 0x0000003f, + 0x0003003e, 0x0000017e, 0x000001a6, 0x000200f9, 0x0000017f, 0x000200f8, 0x00000181, 0x000200f9, 0x0000017c, 0x000200f8, + 0x000001a7, 0x00060041, 0x0000007c, 0x000001ac, 0x0000007a, 0x00000023, 0x000001a8, 0x0004003d, 0x0000000a, 0x000001ad, + 0x000001ac, 0x0003003e, 0x000001ab, 0x000001ad, 0x00060041, 0x0000007c, 0x000001af, 0x0000007a, 0x00000023, 0x000001a9, + 0x0004003d, 0x0000000a, 0x000001b0, 0x000001af, 0x0003003e, 0x000001ae, 0x000001b0, 0x00060041, 0x0000007c, 0x000001b2, + 0x0000007a, 0x00000023, 0x000001aa, 0x0004003d, 0x0000000a, 0x000001b3, 0x000001b2, 0x0003003e, 0x000001b1, 0x000001b3, + 0x00070039, 0x00000006, 0x000001b4, 0x0000001b, 0x000001ab, 0x000001ae, 0x000001b1, 0x000200f9, 0x0000017c, 0x000200f8, + 0x0000017c, 0x000200f9, 0x00000176, 0x000200f8, 0x00000176, 0x000200f9, 0x00000119, 0x000200f8, 0x00000119, 0x000100fd, + 0x00010038, 0x00050036, 0x00000006, 0x00000008, 0x00000000, 0x00000007, 0x000200f8, 0x00000009, 0x00060041, 0x00000024, + 0x00000025, 0x00000021, 0x00000023, 0x00000023, 0x0004003d, 0x0000000a, 0x00000026, 0x00000025, 0x00060041, 0x00000024, + 0x0000002d, 0x0000002b, 0x00000023, 0x00000026, 0x000700ea, 0x0000000a, 0x00000030, 0x0000002d, 0x0000002e, 0x0000002f, + 0x0000002e, 0x000500ae, 0x00000006, 0x00000033, 0x00000030, 0x00000032, 0x000200fe, 0x00000033, 0x00010038, 0x00050036, + 0x00000002, 0x00000011, 0x00000000, 0x0000000c, 0x00030037, 0x0000000b, 0x0000000d, 0x00030037, 0x0000000b, 0x0000000e, + 0x00030037, 0x0000000b, 0x0000000f, 0x00030037, 0x0000000b, 0x00000010, 0x000200f8, 0x00000012, 0x00040039, 0x00000006, + 0x00000036, 0x00000008, 0x000300f7, 0x00000038, 0x00000000, 0x000400fa, 0x00000036, 0x00000037, 0x00000038, 0x000200f8, + 0x00000037, 0x000100fd, 0x000200f8, 0x00000038, 0x00050041, 0x00000024, 0x00000040, 0x0000003e, 0x0000003f, 0x000700ea, + 0x0000000a, 0x00000042, 0x00000040, 0x0000002e, 0x0000002f, 0x00000041, 0x00050080, 0x0000000a, 0x00000046, 0x00000042, + 0x00000041, 0x00050044, 0x0000000a, 0x00000047, 0x0000003e, 0x00000002, 0x0004007c, 0x00000022, 0x00000048, 0x00000047, + 0x0004007c, 0x0000000a, 0x00000049, 0x00000048, 0x000500ac, 0x00000006, 0x0000004a, 0x00000046, 0x00000049, 0x000300f7, + 0x0000004d, 0x00000000, 0x000400fa, 0x0000004a, 0x0000004c, 0x0000004d, 0x000200f8, 0x0000004c, 0x000100fd, 0x000200f8, + 0x0000004d, 0x00060041, 0x00000024, 0x00000052, 0x0000003e, 0x0000004f, 0x00000042, 0x0003003e, 0x00000052, 0x00000041, + 0x00050080, 0x0000000a, 0x00000055, 0x00000042, 0x00000054, 0x00060041, 0x00000024, 0x0000005a, 0x00000059, 0x00000023, + 0x00000023, 0x0004003d, 0x0000000a, 0x0000005b, 0x0000005a, 0x00060041, 0x00000024, 0x0000005c, 0x0000003e, 0x0000004f, + 0x00000055, 0x0003003e, 0x0000005c, 0x0000005b, 0x00050080, 0x0000000a, 0x0000005f, 0x00000042, 0x0000005e, 0x00060041, + 0x00000024, 0x00000060, 0x00000021, 0x00000023, 0x00000023, 0x0004003d, 0x0000000a, 0x00000061, 0x00000060, 0x00060041, + 0x00000024, 0x00000062, 0x0000003e, 0x0000004f, 0x0000005f, 0x0003003e, 0x00000062, 0x00000061, 0x00050080, 0x0000000a, + 0x00000065, 0x00000042, 0x00000064, 0x0004003d, 0x0000000a, 0x00000066, 0x0000000d, 0x00060041, 0x00000024, 0x00000067, + 0x0000003e, 0x0000004f, 0x00000065, 0x0003003e, 0x00000067, 0x00000066, 0x00050080, 0x0000000a, 0x0000006a, 0x00000042, + 0x00000069, 0x0004003d, 0x0000000a, 0x0000006b, 0x0000000e, 0x00060041, 0x00000024, 0x0000006c, 0x0000003e, 0x0000004f, + 0x0000006a, 0x0003003e, 0x0000006c, 0x0000006b, 0x00050080, 0x0000000a, 0x0000006f, 0x00000042, 0x0000006e, 0x0004003d, + 0x0000000a, 0x00000070, 0x0000000f, 0x00060041, 0x00000024, 0x00000071, 0x0000003e, 0x0000004f, 0x0000006f, 0x0003003e, + 0x00000071, 0x00000070, 0x00050080, 0x0000000a, 0x00000074, 0x00000042, 0x00000073, 0x0004003d, 0x0000000a, 0x00000075, + 0x00000010, 0x00060041, 0x00000024, 0x00000076, 0x0000003e, 0x0000004f, 0x00000074, 0x0003003e, 0x00000076, 0x00000075, + 0x000100fd, 0x00010038, 0x00050036, 0x0000000a, 0x00000015, 0x00000000, 0x00000013, 0x00030037, 0x0000000b, 0x00000014, + 0x000200f8, 0x00000016, 0x00060041, 0x0000007c, 0x0000007d, 0x0000007a, 0x00000023, 0x0000007b, 0x0004003d, 0x0000000a, + 0x0000007e, 0x0000007d, 0x000500aa, 0x00000006, 0x00000080, 0x0000007e, 0x0000007f, 0x000300f7, 0x00000082, 0x00000000, + 0x000400fa, 0x00000080, 0x00000081, 0x0000008b, 0x000200f8, 0x00000081, 0x0004003d, 0x0000000a, 0x00000087, 0x00000014, + 0x00060041, 0x00000024, 0x00000088, 0x00000086, 0x00000023, 0x00000087, 0x0004003d, 0x0000000a, 0x00000089, 0x00000088, + 0x000200fe, 0x00000089, 0x000200f8, 0x0000008b, 0x00060041, 0x0000007c, 0x0000008c, 0x0000007a, 0x00000023, 0x0000007b, + 0x0004003d, 0x0000000a, 0x0000008d, 0x0000008c, 0x000500aa, 0x00000006, 0x0000008e, 0x0000008d, 0x00000041, 0x000300f7, + 0x00000090, 0x00000000, 0x000400fa, 0x0000008e, 0x0000008f, 0x000000a3, 0x000200f8, 0x0000008f, 0x0004003d, 0x0000000a, + 0x00000092, 0x00000014, 0x00050086, 0x0000000a, 0x00000094, 0x00000092, 0x00000093, 0x00060041, 0x00000024, 0x00000097, + 0x00000086, 0x00000023, 0x00000094, 0x0004003d, 0x0000000a, 0x00000098, 0x00000097, 0x0004003d, 0x0000000a, 0x0000009a, + 0x00000014, 0x00050089, 0x0000000a, 0x0000009b, 0x0000009a, 0x00000093, 0x00050084, 0x0000000a, 0x0000009c, 0x0000009b, + 0x00000041, 0x000500c2, 0x0000000a, 0x0000009f, 0x00000098, 0x0000009c, 0x000500c7, 0x0000000a, 0x000000a1, 0x0000009f, + 0x000000a0, 0x000200fe, 0x000000a1, 0x000200f8, 0x000000a3, 0x00060041, 0x0000007c, 0x000000a4, 0x0000007a, 0x00000023, + 0x0000007b, 0x0004003d, 0x0000000a, 0x000000a5, 0x000000a4, 0x000500aa, 0x00000006, 0x000000a6, 0x000000a5, 0x0000005e, + 0x000300f7, 0x000000a8, 0x00000000, 0x000400fa, 0x000000a6, 0x000000a7, 0x000000a8, 0x000200f8, 0x000000a7, 0x0004003d, + 0x0000000a, 0x000000aa, 0x00000014, 0x00050086, 0x0000000a, 0x000000ac, 0x000000aa, 0x000000ab, 0x00060041, 0x00000024, + 0x000000af, 0x00000086, 0x00000023, 0x000000ac, 0x0004003d, 0x0000000a, 0x000000b0, 0x000000af, 0x0004003d, 0x0000000a, + 0x000000b2, 0x00000014, 0x00050089, 0x0000000a, 0x000000b3, 0x000000b2, 0x000000ab, 0x00050084, 0x0000000a, 0x000000b4, + 0x000000b3, 0x0000005e, 0x000500c2, 0x0000000a, 0x000000b7, 0x000000b0, 0x000000b4, 0x000500c7, 0x0000000a, 0x000000b9, + 0x000000b7, 0x000000b8, 0x000200fe, 0x000000b9, 0x000200f8, 0x000000a8, 0x000200f9, 0x00000090, 0x000200f8, 0x00000090, + 0x000200f9, 0x00000082, 0x000200f8, 0x00000082, 0x000200fe, 0x0000002f, 0x00010038, 0x00050036, 0x00000006, 0x0000001b, + 0x00000000, 0x00000017, 0x00030037, 0x0000000b, 0x00000018, 0x00030037, 0x0000000b, 0x00000019, 0x00030037, 0x0000000b, + 0x0000001a, 0x000200f8, 0x0000001c, 0x0004003b, 0x0000000b, 0x000000bd, 0x00000007, 0x0004003b, 0x0000000b, 0x000000e5, + 0x00000007, 0x0004003b, 0x0000000b, 0x000000e6, 0x00000007, 0x0004003b, 0x0000000b, 0x000000e7, 0x00000007, 0x0004003b, + 0x0000000b, 0x000000e9, 0x00000007, 0x0004003b, 0x0000000b, 0x000000ed, 0x00000007, 0x0004003b, 0x0000000b, 0x000000fa, + 0x00000007, 0x0004003b, 0x0000000b, 0x00000108, 0x00000007, 0x0004003b, 0x0000000b, 0x00000109, 0x00000007, 0x0004003b, + 0x0000000b, 0x0000010a, 0x00000007, 0x0004003b, 0x0000000b, 0x0000010b, 0x00000007, 0x0003003e, 0x000000bd, 0x0000002f, + 0x00060041, 0x0000007c, 0x000000be, 0x0000007a, 0x00000023, 0x0000007b, 0x0004003d, 0x0000000a, 0x000000bf, 0x000000be, + 0x000500aa, 0x00000006, 0x000000c0, 0x000000bf, 0x0000007f, 0x000300f7, 0x000000c2, 0x00000000, 0x000400fa, 0x000000c0, + 0x000000c1, 0x000000c6, 0x000200f8, 0x000000c1, 0x00050044, 0x0000000a, 0x000000c3, 0x00000086, 0x00000000, 0x0004007c, + 0x00000022, 0x000000c4, 0x000000c3, 0x0004007c, 0x0000000a, 0x000000c5, 0x000000c4, 0x0003003e, 0x000000bd, 0x000000c5, + 0x000200f9, 0x000000c2, 0x000200f8, 0x000000c6, 0x00060041, 0x0000007c, 0x000000c7, 0x0000007a, 0x00000023, 0x0000007b, + 0x0004003d, 0x0000000a, 0x000000c8, 0x000000c7, 0x000500aa, 0x00000006, 0x000000c9, 0x000000c8, 0x00000041, 0x000300f7, + 0x000000cb, 0x00000000, 0x000400fa, 0x000000c9, 0x000000ca, 0x000000d0, 0x000200f8, 0x000000ca, 0x00050044, 0x0000000a, + 0x000000cc, 0x00000086, 0x00000000, 0x0004007c, 0x00000022, 0x000000cd, 0x000000cc, 0x00050084, 0x00000022, 0x000000ce, + 0x0000004f, 0x000000cd, 0x0004007c, 0x0000000a, 0x000000cf, 0x000000ce, 0x0003003e, 0x000000bd, 0x000000cf, 0x000200f9, + 0x000000cb, 0x000200f8, 0x000000d0, 0x00060041, 0x0000007c, 0x000000d1, 0x0000007a, 0x00000023, 0x0000007b, 0x0004003d, + 0x0000000a, 0x000000d2, 0x000000d1, 0x000500aa, 0x00000006, 0x000000d3, 0x000000d2, 0x0000005e, 0x000300f7, 0x000000d5, + 0x00000000, 0x000400fa, 0x000000d3, 0x000000d4, 0x000000db, 0x000200f8, 0x000000d4, 0x00050044, 0x0000000a, 0x000000d7, + 0x00000086, 0x00000000, 0x0004007c, 0x00000022, 0x000000d8, 0x000000d7, 0x00050084, 0x00000022, 0x000000d9, 0x000000d6, + 0x000000d8, 0x0004007c, 0x0000000a, 0x000000da, 0x000000d9, 0x0003003e, 0x000000bd, 0x000000da, 0x000200f9, 0x000000d5, + 0x000200f8, 0x000000db, 0x000200fe, 0x000000dc, 0x000200f8, 0x000000d5, 0x000200f9, 0x000000cb, 0x000200f8, 0x000000cb, + 0x000200f9, 0x000000c2, 0x000200f8, 0x000000c2, 0x0004003d, 0x0000000a, 0x000000de, 0x00000019, 0x0004003d, 0x0000000a, + 0x000000df, 0x00000018, 0x00050080, 0x0000000a, 0x000000e0, 0x000000de, 0x000000df, 0x0004003d, 0x0000000a, 0x000000e1, + 0x000000bd, 0x000500ac, 0x00000006, 0x000000e2, 0x000000e0, 0x000000e1, 0x000300f7, 0x000000e4, 0x00000000, 0x000400fa, + 0x000000e2, 0x000000e3, 0x000000e4, 0x000200f8, 0x000000e3, 0x0003003e, 0x000000e5, 0x000000ab, 0x0003003e, 0x000000e6, + 0x0000005e, 0x0004003d, 0x0000000a, 0x000000e8, 0x00000019, 0x0003003e, 0x000000e7, 0x000000e8, 0x0004003d, 0x0000000a, + 0x000000ea, 0x00000018, 0x0003003e, 0x000000e9, 0x000000ea, 0x00080039, 0x00000002, 0x000000eb, 0x00000011, 0x000000e5, + 0x000000e6, 0x000000e7, 0x000000e9, 0x000200fe, 0x000000dc, 0x000200f8, 0x000000e4, 0x0003003e, 0x000000ed, 0x0000002f, + 0x000200f9, 0x000000ee, 0x000200f8, 0x000000ee, 0x000400f6, 0x000000f0, 0x000000f1, 0x00000000, 0x000200f9, 0x000000f2, + 0x000200f8, 0x000000f2, 0x0004003d, 0x0000000a, 0x000000f3, 0x000000ed, 0x0004003d, 0x0000000a, 0x000000f4, 0x00000018, + 0x000500b0, 0x00000006, 0x000000f5, 0x000000f3, 0x000000f4, 0x000400fa, 0x000000f5, 0x000000ef, 0x000000f0, 0x000200f8, + 0x000000ef, 0x0004003d, 0x0000000a, 0x000000f7, 0x00000019, 0x0004003d, 0x0000000a, 0x000000f8, 0x000000ed, 0x00050080, + 0x0000000a, 0x000000f9, 0x000000f7, 0x000000f8, 0x0003003e, 0x000000fa, 0x000000f9, 0x00050039, 0x0000000a, 0x000000fb, + 0x00000015, 0x000000fa, 0x0004003d, 0x0000000a, 0x000000fc, 0x0000001a, 0x00050080, 0x0000000a, 0x000000fd, 0x000000fb, + 0x000000fc, 0x00060041, 0x0000007c, 0x00000100, 0x0000007a, 0x00000023, 0x000000ff, 0x0004003d, 0x0000000a, 0x00000101, + 0x00000100, 0x000500ae, 0x00000006, 0x00000102, 0x000000fd, 0x00000101, 0x000300f7, 0x00000104, 0x00000000, 0x000400fa, + 0x00000102, 0x00000103, 0x00000104, 0x000200f8, 0x00000103, 0x0004003d, 0x0000000a, 0x00000105, 0x00000019, 0x0004003d, + 0x0000000a, 0x00000106, 0x000000ed, 0x00050080, 0x0000000a, 0x00000107, 0x00000105, 0x00000106, 0x0003003e, 0x00000108, + 0x000000ab, 0x0003003e, 0x00000109, 0x00000064, 0x0003003e, 0x0000010a, 0x00000107, 0x0003003e, 0x0000010b, 0x000000fd, + 0x00080039, 0x00000002, 0x0000010d, 0x00000011, 0x00000108, 0x00000109, 0x0000010a, 0x0000010b, 0x000200fe, 0x000000dc, + 0x000200f8, 0x00000104, 0x000200f9, 0x000000f1, 0x000200f8, 0x000000f1, 0x0004003d, 0x0000000a, 0x0000010f, 0x000000ed, + 0x00050080, 0x0000000a, 0x00000110, 0x0000010f, 0x0000003f, 0x0003003e, 0x000000ed, 0x00000110, 0x000200f9, 0x000000ee, + 0x000200f8, 0x000000f0, 0x000200fe, 0x00000111, 0x00010038, +}; diff --git a/layers/vulkan/generated/cmd_validation_indexed_draw_vert.h b/layers/vulkan/generated/cmd_validation_indexed_draw_vert.h new file mode 100644 index 00000000000..cb3e3285151 --- /dev/null +++ b/layers/vulkan/generated/cmd_validation_indexed_draw_vert.h @@ -0,0 +1,30 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See generate_spirv.py for modifications + +/*************************************************************************** + * + * Copyright (c) 2021-2024 The Khronos Group Inc. + * Copyright (c) 2021-2024 Valve Corporation + * Copyright (c) 2021-2024 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 + +// To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/ +extern const uint32_t cmd_validation_indexed_draw_vert_size; +extern const uint32_t cmd_validation_indexed_draw_vert[]; diff --git a/layers/vulkan/generated/cmd_validation_indirect_draw_vert.cpp b/layers/vulkan/generated/cmd_validation_indirect_draw_vert.cpp new file mode 100644 index 00000000000..4477ea3ef19 --- /dev/null +++ b/layers/vulkan/generated/cmd_validation_indirect_draw_vert.cpp @@ -0,0 +1,167 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See generate_spirv.py for modifications + +/*************************************************************************** + * + * Copyright (c) 2021-2024 The Khronos Group Inc. + * Copyright (c) 2021-2024 Valve Corporation + * Copyright (c) 2021-2024 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 "cmd_validation_indirect_draw_vert.h" + +// To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/ +[[maybe_unused]] const uint32_t cmd_validation_indirect_draw_vert_size = 1380; +[[maybe_unused]] const uint32_t cmd_validation_indirect_draw_vert[1380] = { + 0x07230203, 0x00010000, 0x0008000b, 0x000000d1, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47, + 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0006000f, 0x00000000, 0x00000004, 0x6e69616d, + 0x00000000, 0x0000006e, 0x00030003, 0x00000002, 0x000001c2, 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, 0x00090005, 0x00000011, 0x61757047, 0x676f4c76, + 0x6f727245, 0x31752872, 0x3b31753b, 0x753b3175, 0x00003b31, 0x00050005, 0x0000000d, 0x6f727265, 0x72675f72, 0x0070756f, + 0x00060005, 0x0000000e, 0x6f727265, 0x75735f72, 0x6f635f62, 0x00006564, 0x00040005, 0x0000000f, 0x61726170, 0x00305f6d, + 0x00040005, 0x00000010, 0x61726170, 0x00315f6d, 0x00070005, 0x00000015, 0x6f736552, 0x65637275, 0x65646e49, 0x66754278, + 0x00726566, 0x00070006, 0x00000015, 0x00000000, 0x6f736572, 0x65637275, 0x646e695f, 0x00007865, 0x00030005, 0x00000017, + 0x00000000, 0x00080005, 0x0000001f, 0x45646d43, 0x726f7272, 0x756f4373, 0x7542746e, 0x72656666, 0x00000000, 0x00080006, + 0x0000001f, 0x00000000, 0x5f646d63, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, 0x00030005, 0x00000021, 0x00000000, + 0x00050005, 0x00000032, 0x6f727245, 0x66754272, 0x00726566, 0x00050006, 0x00000032, 0x00000000, 0x67616c66, 0x00000073, + 0x00070006, 0x00000032, 0x00000001, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, 0x00070006, 0x00000032, 0x00000002, + 0x6f727265, 0x625f7372, 0x65666675, 0x00000072, 0x00030005, 0x00000034, 0x00000000, 0x00070005, 0x0000004d, 0x69746341, + 0x6e496e6f, 0x42786564, 0x65666675, 0x00000072, 0x00070006, 0x0000004d, 0x00000000, 0x69746361, 0x695f6e6f, 0x7865646e, + 0x00000000, 0x00030005, 0x0000004f, 0x00000000, 0x00060005, 0x0000006e, 0x565f6c67, 0x65747265, 0x646e4978, 0x00007865, + 0x00050005, 0x00000073, 0x77617264, 0x756f635f, 0x0000746e, 0x00080005, 0x00000074, 0x77617244, 0x69646e49, 0x74636572, + 0x68737550, 0x61746144, 0x00000000, 0x00050006, 0x00000074, 0x00000000, 0x67616c66, 0x00000073, 0x00080006, 0x00000074, + 0x00000001, 0x706f7270, 0x756f635f, 0x6c5f746e, 0x74696d69, 0x00000000, 0x00080006, 0x00000074, 0x00000002, 0x66667562, + 0x635f7265, 0x746e756f, 0x6d696c5f, 0x00007469, 0x00060006, 0x00000074, 0x00000003, 0x77617264, 0x756f635f, 0x0000746e, + 0x00060006, 0x00000074, 0x00000004, 0x77617264, 0x7274735f, 0x00656469, 0x00050005, 0x00000075, 0x66696e55, 0x496d726f, + 0x006f666e, 0x00060006, 0x00000075, 0x00000000, 0x68737570, 0x7461645f, 0x00000061, 0x00030005, 0x00000077, 0x00000000, + 0x00050005, 0x00000080, 0x6e756f43, 0x66754274, 0x00726566, 0x00070006, 0x00000080, 0x00000000, 0x6e756f63, 0x75625f74, + 0x72656666, 0x00000000, 0x00030005, 0x00000082, 0x00000000, 0x00040005, 0x0000008c, 0x61726170, 0x0000006d, 0x00040005, + 0x0000008d, 0x61726170, 0x0000006d, 0x00040005, 0x0000008e, 0x61726170, 0x0000006d, 0x00040005, 0x00000090, 0x61726170, + 0x0000006d, 0x00040005, 0x0000009a, 0x61726170, 0x0000006d, 0x00040005, 0x0000009b, 0x61726170, 0x0000006d, 0x00040005, + 0x0000009c, 0x61726170, 0x0000006d, 0x00040005, 0x0000009e, 0x61726170, 0x0000006d, 0x00050005, 0x000000ac, 0x77617264, + 0x646e695f, 0x00007865, 0x00030005, 0x000000ad, 0x00000069, 0x00050005, 0x000000b7, 0x77617244, 0x66667542, 0x00007265, + 0x00060006, 0x000000b7, 0x00000000, 0x77617264, 0x6675625f, 0x00726566, 0x00030005, 0x000000b9, 0x00000000, 0x00040005, + 0x000000c2, 0x61726170, 0x0000006d, 0x00040005, 0x000000c3, 0x61726170, 0x0000006d, 0x00040005, 0x000000c4, 0x61726170, + 0x0000006d, 0x00040005, 0x000000c6, 0x61726170, 0x0000006d, 0x00040047, 0x00000014, 0x00000006, 0x00000004, 0x00030047, + 0x00000015, 0x00000003, 0x00050048, 0x00000015, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000017, 0x00000021, + 0x00000002, 0x00040047, 0x00000017, 0x00000022, 0x00000000, 0x00040047, 0x0000001e, 0x00000006, 0x00000004, 0x00030047, + 0x0000001f, 0x00000003, 0x00050048, 0x0000001f, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000021, 0x00000021, + 0x00000003, 0x00040047, 0x00000021, 0x00000022, 0x00000000, 0x00040047, 0x00000031, 0x00000006, 0x00000004, 0x00030047, + 0x00000032, 0x00000003, 0x00050048, 0x00000032, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000032, 0x00000001, + 0x00000023, 0x00000004, 0x00050048, 0x00000032, 0x00000002, 0x00000023, 0x00000008, 0x00040047, 0x00000034, 0x00000021, + 0x00000000, 0x00040047, 0x00000034, 0x00000022, 0x00000000, 0x00040047, 0x0000004c, 0x00000006, 0x00000004, 0x00030047, + 0x0000004d, 0x00000003, 0x00050048, 0x0000004d, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x0000004f, 0x00000021, + 0x00000001, 0x00040047, 0x0000004f, 0x00000022, 0x00000000, 0x00040047, 0x0000006e, 0x0000000b, 0x0000002a, 0x00050048, + 0x00000074, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000074, 0x00000001, 0x00000023, 0x00000004, 0x00050048, + 0x00000074, 0x00000002, 0x00000023, 0x00000008, 0x00050048, 0x00000074, 0x00000003, 0x00000023, 0x0000000c, 0x00050048, + 0x00000074, 0x00000004, 0x00000023, 0x00000010, 0x00030047, 0x00000075, 0x00000002, 0x00050048, 0x00000075, 0x00000000, + 0x00000023, 0x00000000, 0x00030047, 0x00000080, 0x00000003, 0x00050048, 0x00000080, 0x00000000, 0x00000023, 0x00000000, + 0x00040047, 0x00000082, 0x00000021, 0x00000001, 0x00040047, 0x00000082, 0x00000022, 0x00000001, 0x00040047, 0x000000b6, + 0x00000006, 0x00000004, 0x00030047, 0x000000b7, 0x00000003, 0x00050048, 0x000000b7, 0x00000000, 0x00000023, 0x00000000, + 0x00040047, 0x000000b9, 0x00000021, 0x00000000, 0x00040047, 0x000000b9, 0x00000022, 0x00000001, 0x00020013, 0x00000002, + 0x00030021, 0x00000003, 0x00000002, 0x00020014, 0x00000006, 0x00030021, 0x00000007, 0x00000006, 0x00040015, 0x0000000a, + 0x00000020, 0x00000000, 0x00040020, 0x0000000b, 0x00000007, 0x0000000a, 0x00070021, 0x0000000c, 0x00000002, 0x0000000b, + 0x0000000b, 0x0000000b, 0x0000000b, 0x0003001d, 0x00000014, 0x0000000a, 0x0003001e, 0x00000015, 0x00000014, 0x00040020, + 0x00000016, 0x00000002, 0x00000015, 0x0004003b, 0x00000016, 0x00000017, 0x00000002, 0x00040015, 0x00000018, 0x00000020, + 0x00000001, 0x0004002b, 0x00000018, 0x00000019, 0x00000000, 0x00040020, 0x0000001a, 0x00000002, 0x0000000a, 0x0003001d, + 0x0000001e, 0x0000000a, 0x0003001e, 0x0000001f, 0x0000001e, 0x00040020, 0x00000020, 0x00000002, 0x0000001f, 0x0004003b, + 0x00000020, 0x00000021, 0x00000002, 0x0004002b, 0x0000000a, 0x00000024, 0x00000001, 0x0004002b, 0x0000000a, 0x00000025, + 0x00000000, 0x0004002b, 0x0000000a, 0x00000028, 0x00000006, 0x0003001d, 0x00000031, 0x0000000a, 0x0005001e, 0x00000032, + 0x0000000a, 0x0000000a, 0x00000031, 0x00040020, 0x00000033, 0x00000002, 0x00000032, 0x0004003b, 0x00000033, 0x00000034, + 0x00000002, 0x0004002b, 0x00000018, 0x00000035, 0x00000001, 0x0004002b, 0x0000000a, 0x00000037, 0x00000010, 0x0004002b, + 0x00000018, 0x00000045, 0x00000002, 0x0004002b, 0x0000000a, 0x0000004a, 0x00000007, 0x0003001d, 0x0000004c, 0x0000000a, + 0x0003001e, 0x0000004d, 0x0000004c, 0x00040020, 0x0000004e, 0x00000002, 0x0000004d, 0x0004003b, 0x0000004e, 0x0000004f, + 0x00000002, 0x0004002b, 0x0000000a, 0x00000054, 0x00000008, 0x0004002b, 0x0000000a, 0x0000005a, 0x00000009, 0x0004002b, + 0x0000000a, 0x0000005f, 0x0000000a, 0x0004002b, 0x0000000a, 0x00000064, 0x0000000b, 0x0004002b, 0x0000000a, 0x00000069, + 0x0000000c, 0x00040020, 0x0000006d, 0x00000001, 0x00000018, 0x0004003b, 0x0000006d, 0x0000006e, 0x00000001, 0x0007001e, + 0x00000074, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0003001e, 0x00000075, 0x00000074, 0x00040020, + 0x00000076, 0x00000009, 0x00000075, 0x0004003b, 0x00000076, 0x00000077, 0x00000009, 0x00040020, 0x00000078, 0x00000009, + 0x0000000a, 0x0003001e, 0x00000080, 0x0000000a, 0x00040020, 0x00000081, 0x00000002, 0x00000080, 0x0004003b, 0x00000081, + 0x00000082, 0x00000002, 0x0004002b, 0x0000000a, 0x0000008b, 0x00000004, 0x0004002b, 0x0000000a, 0x00000099, 0x00000002, + 0x0004002b, 0x00000018, 0x000000a3, 0x00000003, 0x0003001d, 0x000000b6, 0x0000000a, 0x0003001e, 0x000000b7, 0x000000b6, + 0x00040020, 0x000000b8, 0x00000002, 0x000000b7, 0x0004003b, 0x000000b8, 0x000000b9, 0x00000002, 0x0004002b, 0x0000000a, + 0x000000bb, 0x00000003, 0x0004002b, 0x00000018, 0x000000ca, 0x00000004, 0x00050036, 0x00000002, 0x00000004, 0x00000000, + 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x0000000b, 0x00000073, 0x00000007, 0x0004003b, 0x0000000b, 0x0000008c, + 0x00000007, 0x0004003b, 0x0000000b, 0x0000008d, 0x00000007, 0x0004003b, 0x0000000b, 0x0000008e, 0x00000007, 0x0004003b, + 0x0000000b, 0x00000090, 0x00000007, 0x0004003b, 0x0000000b, 0x0000009a, 0x00000007, 0x0004003b, 0x0000000b, 0x0000009b, + 0x00000007, 0x0004003b, 0x0000000b, 0x0000009c, 0x00000007, 0x0004003b, 0x0000000b, 0x0000009e, 0x00000007, 0x0004003b, + 0x0000000b, 0x000000ac, 0x00000007, 0x0004003b, 0x0000000b, 0x000000ad, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c2, + 0x00000007, 0x0004003b, 0x0000000b, 0x000000c3, 0x00000007, 0x0004003b, 0x0000000b, 0x000000c4, 0x00000007, 0x0004003b, + 0x0000000b, 0x000000c6, 0x00000007, 0x0004003d, 0x00000018, 0x0000006f, 0x0000006e, 0x000500aa, 0x00000006, 0x00000070, + 0x0000006f, 0x00000019, 0x000300f7, 0x00000072, 0x00000000, 0x000400fa, 0x00000070, 0x00000071, 0x00000072, 0x000200f8, + 0x00000071, 0x0003003e, 0x00000073, 0x00000025, 0x00060041, 0x00000078, 0x00000079, 0x00000077, 0x00000019, 0x00000019, + 0x0004003d, 0x0000000a, 0x0000007a, 0x00000079, 0x000500c7, 0x0000000a, 0x0000007b, 0x0000007a, 0x00000024, 0x000500ab, + 0x00000006, 0x0000007c, 0x0000007b, 0x00000025, 0x000300f7, 0x0000007e, 0x00000000, 0x000400fa, 0x0000007c, 0x0000007d, + 0x000000a2, 0x000200f8, 0x0000007d, 0x00050041, 0x0000001a, 0x00000083, 0x00000082, 0x00000019, 0x0004003d, 0x0000000a, + 0x00000084, 0x00000083, 0x00060041, 0x00000078, 0x00000086, 0x00000077, 0x00000019, 0x00000045, 0x0004003d, 0x0000000a, + 0x00000087, 0x00000086, 0x000500ac, 0x00000006, 0x00000088, 0x00000084, 0x00000087, 0x000300f7, 0x0000008a, 0x00000000, + 0x000400fa, 0x00000088, 0x00000089, 0x00000092, 0x000200f8, 0x00000089, 0x0003003e, 0x0000008c, 0x0000008b, 0x0003003e, + 0x0000008d, 0x00000024, 0x0003003e, 0x0000008e, 0x00000084, 0x0003003e, 0x00000090, 0x00000025, 0x00080039, 0x00000002, + 0x00000091, 0x00000011, 0x0000008c, 0x0000008d, 0x0000008e, 0x00000090, 0x000200f9, 0x0000008a, 0x000200f8, 0x00000092, + 0x00060041, 0x00000078, 0x00000094, 0x00000077, 0x00000019, 0x00000035, 0x0004003d, 0x0000000a, 0x00000095, 0x00000094, + 0x000500ac, 0x00000006, 0x00000096, 0x00000084, 0x00000095, 0x000300f7, 0x00000098, 0x00000000, 0x000400fa, 0x00000096, + 0x00000097, 0x000000a0, 0x000200f8, 0x00000097, 0x0003003e, 0x0000009a, 0x0000008b, 0x0003003e, 0x0000009b, 0x00000099, + 0x0003003e, 0x0000009c, 0x00000084, 0x0003003e, 0x0000009e, 0x00000025, 0x00080039, 0x00000002, 0x0000009f, 0x00000011, + 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009e, 0x000200f9, 0x00000098, 0x000200f8, 0x000000a0, 0x0003003e, 0x00000073, + 0x00000084, 0x000200f9, 0x00000098, 0x000200f8, 0x00000098, 0x000200f9, 0x0000008a, 0x000200f8, 0x0000008a, 0x000200f9, + 0x0000007e, 0x000200f8, 0x000000a2, 0x00060041, 0x00000078, 0x000000a4, 0x00000077, 0x00000019, 0x000000a3, 0x0004003d, + 0x0000000a, 0x000000a5, 0x000000a4, 0x0003003e, 0x00000073, 0x000000a5, 0x000200f9, 0x0000007e, 0x000200f8, 0x0000007e, + 0x00060041, 0x00000078, 0x000000a6, 0x00000077, 0x00000019, 0x00000019, 0x0004003d, 0x0000000a, 0x000000a7, 0x000000a6, + 0x000500c7, 0x0000000a, 0x000000a8, 0x000000a7, 0x0000008b, 0x000500ab, 0x00000006, 0x000000a9, 0x000000a8, 0x00000025, + 0x000300f7, 0x000000ab, 0x00000000, 0x000400fa, 0x000000a9, 0x000000aa, 0x000000ab, 0x000200f8, 0x000000aa, 0x0003003e, + 0x000000ac, 0x00000025, 0x0003003e, 0x000000ad, 0x00000025, 0x000200f9, 0x000000ae, 0x000200f8, 0x000000ae, 0x000400f6, + 0x000000b0, 0x000000b1, 0x00000000, 0x000200f9, 0x000000b2, 0x000200f8, 0x000000b2, 0x0004003d, 0x0000000a, 0x000000b3, + 0x000000ad, 0x0004003d, 0x0000000a, 0x000000b4, 0x00000073, 0x000500b0, 0x00000006, 0x000000b5, 0x000000b3, 0x000000b4, + 0x000400fa, 0x000000b5, 0x000000af, 0x000000b0, 0x000200f8, 0x000000af, 0x0004003d, 0x0000000a, 0x000000ba, 0x000000ac, + 0x00050080, 0x0000000a, 0x000000bc, 0x000000ba, 0x000000bb, 0x00060041, 0x0000001a, 0x000000bd, 0x000000b9, 0x00000019, + 0x000000bc, 0x0004003d, 0x0000000a, 0x000000be, 0x000000bd, 0x000500ab, 0x00000006, 0x000000bf, 0x000000be, 0x00000025, + 0x000300f7, 0x000000c1, 0x00000000, 0x000400fa, 0x000000bf, 0x000000c0, 0x000000c1, 0x000200f8, 0x000000c0, 0x0003003e, + 0x000000c2, 0x0000008b, 0x0003003e, 0x000000c3, 0x000000bb, 0x0004003d, 0x0000000a, 0x000000c5, 0x000000ad, 0x0003003e, + 0x000000c4, 0x000000c5, 0x0003003e, 0x000000c6, 0x000000c5, 0x00080039, 0x00000002, 0x000000c8, 0x00000011, 0x000000c2, + 0x000000c3, 0x000000c4, 0x000000c6, 0x000200f9, 0x000000b0, 0x000200f8, 0x000000c1, 0x00060041, 0x00000078, 0x000000cb, + 0x00000077, 0x00000019, 0x000000ca, 0x0004003d, 0x0000000a, 0x000000cc, 0x000000cb, 0x0004003d, 0x0000000a, 0x000000cd, + 0x000000ac, 0x00050080, 0x0000000a, 0x000000ce, 0x000000cd, 0x000000cc, 0x0003003e, 0x000000ac, 0x000000ce, 0x000200f9, + 0x000000b1, 0x000200f8, 0x000000b1, 0x0004003d, 0x0000000a, 0x000000cf, 0x000000ad, 0x00050080, 0x0000000a, 0x000000d0, + 0x000000cf, 0x00000035, 0x0003003e, 0x000000ad, 0x000000d0, 0x000200f9, 0x000000ae, 0x000200f8, 0x000000b0, 0x000200f9, + 0x000000ab, 0x000200f8, 0x000000ab, 0x000200f9, 0x00000072, 0x000200f8, 0x00000072, 0x000100fd, 0x00010038, 0x00050036, + 0x00000006, 0x00000008, 0x00000000, 0x00000007, 0x000200f8, 0x00000009, 0x00060041, 0x0000001a, 0x0000001b, 0x00000017, + 0x00000019, 0x00000019, 0x0004003d, 0x0000000a, 0x0000001c, 0x0000001b, 0x00060041, 0x0000001a, 0x00000023, 0x00000021, + 0x00000019, 0x0000001c, 0x000700ea, 0x0000000a, 0x00000026, 0x00000023, 0x00000024, 0x00000025, 0x00000024, 0x000500ae, + 0x00000006, 0x00000029, 0x00000026, 0x00000028, 0x000200fe, 0x00000029, 0x00010038, 0x00050036, 0x00000002, 0x00000011, + 0x00000000, 0x0000000c, 0x00030037, 0x0000000b, 0x0000000d, 0x00030037, 0x0000000b, 0x0000000e, 0x00030037, 0x0000000b, + 0x0000000f, 0x00030037, 0x0000000b, 0x00000010, 0x000200f8, 0x00000012, 0x00040039, 0x00000006, 0x0000002c, 0x00000008, + 0x000300f7, 0x0000002e, 0x00000000, 0x000400fa, 0x0000002c, 0x0000002d, 0x0000002e, 0x000200f8, 0x0000002d, 0x000100fd, + 0x000200f8, 0x0000002e, 0x00050041, 0x0000001a, 0x00000036, 0x00000034, 0x00000035, 0x000700ea, 0x0000000a, 0x00000038, + 0x00000036, 0x00000024, 0x00000025, 0x00000037, 0x00050080, 0x0000000a, 0x0000003c, 0x00000038, 0x00000037, 0x00050044, + 0x0000000a, 0x0000003d, 0x00000034, 0x00000002, 0x0004007c, 0x00000018, 0x0000003e, 0x0000003d, 0x0004007c, 0x0000000a, + 0x0000003f, 0x0000003e, 0x000500ac, 0x00000006, 0x00000040, 0x0000003c, 0x0000003f, 0x000300f7, 0x00000043, 0x00000000, + 0x000400fa, 0x00000040, 0x00000042, 0x00000043, 0x000200f8, 0x00000042, 0x000100fd, 0x000200f8, 0x00000043, 0x00060041, + 0x0000001a, 0x00000048, 0x00000034, 0x00000045, 0x00000038, 0x0003003e, 0x00000048, 0x00000037, 0x00050080, 0x0000000a, + 0x0000004b, 0x00000038, 0x0000004a, 0x00060041, 0x0000001a, 0x00000050, 0x0000004f, 0x00000019, 0x00000019, 0x0004003d, + 0x0000000a, 0x00000051, 0x00000050, 0x00060041, 0x0000001a, 0x00000052, 0x00000034, 0x00000045, 0x0000004b, 0x0003003e, + 0x00000052, 0x00000051, 0x00050080, 0x0000000a, 0x00000055, 0x00000038, 0x00000054, 0x00060041, 0x0000001a, 0x00000056, + 0x00000017, 0x00000019, 0x00000019, 0x0004003d, 0x0000000a, 0x00000057, 0x00000056, 0x00060041, 0x0000001a, 0x00000058, + 0x00000034, 0x00000045, 0x00000055, 0x0003003e, 0x00000058, 0x00000057, 0x00050080, 0x0000000a, 0x0000005b, 0x00000038, + 0x0000005a, 0x0004003d, 0x0000000a, 0x0000005c, 0x0000000d, 0x00060041, 0x0000001a, 0x0000005d, 0x00000034, 0x00000045, + 0x0000005b, 0x0003003e, 0x0000005d, 0x0000005c, 0x00050080, 0x0000000a, 0x00000060, 0x00000038, 0x0000005f, 0x0004003d, + 0x0000000a, 0x00000061, 0x0000000e, 0x00060041, 0x0000001a, 0x00000062, 0x00000034, 0x00000045, 0x00000060, 0x0003003e, + 0x00000062, 0x00000061, 0x00050080, 0x0000000a, 0x00000065, 0x00000038, 0x00000064, 0x0004003d, 0x0000000a, 0x00000066, + 0x0000000f, 0x00060041, 0x0000001a, 0x00000067, 0x00000034, 0x00000045, 0x00000065, 0x0003003e, 0x00000067, 0x00000066, + 0x00050080, 0x0000000a, 0x0000006a, 0x00000038, 0x00000069, 0x0004003d, 0x0000000a, 0x0000006b, 0x00000010, 0x00060041, + 0x0000001a, 0x0000006c, 0x00000034, 0x00000045, 0x0000006a, 0x0003003e, 0x0000006c, 0x0000006b, 0x000100fd, 0x00010038, +}; diff --git a/layers/vulkan/generated/cmd_validation_indirect_draw_vert.h b/layers/vulkan/generated/cmd_validation_indirect_draw_vert.h new file mode 100644 index 00000000000..faa1b23d55d --- /dev/null +++ b/layers/vulkan/generated/cmd_validation_indirect_draw_vert.h @@ -0,0 +1,30 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See generate_spirv.py for modifications + +/*************************************************************************** + * + * Copyright (c) 2021-2024 The Khronos Group Inc. + * Copyright (c) 2021-2024 Valve Corporation + * Copyright (c) 2021-2024 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 + +// To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/ +extern const uint32_t cmd_validation_indirect_draw_vert_size; +extern const uint32_t cmd_validation_indirect_draw_vert[]; diff --git a/layers/vulkan/generated/cmd_validation_mesh_draw_vert.cpp b/layers/vulkan/generated/cmd_validation_mesh_draw_vert.cpp new file mode 100644 index 00000000000..4e40b51c5ea --- /dev/null +++ b/layers/vulkan/generated/cmd_validation_mesh_draw_vert.cpp @@ -0,0 +1,203 @@ +// *** THIS FILE IS GENERATED - DO NOT EDIT *** +// See generate_spirv.py for modifications + +/*************************************************************************** + * + * Copyright (c) 2021-2024 The Khronos Group Inc. + * Copyright (c) 2021-2024 Valve Corporation + * Copyright (c) 2021-2024 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 "cmd_validation_mesh_draw_vert.h" + +// To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/ +[[maybe_unused]] const uint32_t cmd_validation_mesh_draw_vert_size = 1732; +[[maybe_unused]] const uint32_t cmd_validation_mesh_draw_vert[1732] = { + 0x07230203, 0x00010000, 0x0008000b, 0x0000010c, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47, + 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0006000f, 0x00000000, 0x00000004, 0x6e69616d, + 0x00000000, 0x0000006e, 0x00030003, 0x00000002, 0x000001c2, 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, 0x00090005, 0x00000011, 0x61757047, 0x676f4c76, + 0x6f727245, 0x31752872, 0x3b31753b, 0x753b3175, 0x00003b31, 0x00050005, 0x0000000d, 0x6f727265, 0x72675f72, 0x0070756f, + 0x00060005, 0x0000000e, 0x6f727265, 0x75735f72, 0x6f635f62, 0x00006564, 0x00040005, 0x0000000f, 0x61726170, 0x00305f6d, + 0x00040005, 0x00000010, 0x61726170, 0x00315f6d, 0x00070005, 0x00000015, 0x6f736552, 0x65637275, 0x65646e49, 0x66754278, + 0x00726566, 0x00070006, 0x00000015, 0x00000000, 0x6f736572, 0x65637275, 0x646e695f, 0x00007865, 0x00030005, 0x00000017, + 0x00000000, 0x00080005, 0x0000001f, 0x45646d43, 0x726f7272, 0x756f4373, 0x7542746e, 0x72656666, 0x00000000, 0x00080006, + 0x0000001f, 0x00000000, 0x5f646d63, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, 0x00030005, 0x00000021, 0x00000000, + 0x00050005, 0x00000032, 0x6f727245, 0x66754272, 0x00726566, 0x00050006, 0x00000032, 0x00000000, 0x67616c66, 0x00000073, + 0x00070006, 0x00000032, 0x00000001, 0x6f727265, 0x635f7372, 0x746e756f, 0x00000000, 0x00070006, 0x00000032, 0x00000002, + 0x6f727265, 0x625f7372, 0x65666675, 0x00000072, 0x00030005, 0x00000034, 0x00000000, 0x00070005, 0x0000004d, 0x69746341, + 0x6e496e6f, 0x42786564, 0x65666675, 0x00000072, 0x00070006, 0x0000004d, 0x00000000, 0x69746361, 0x695f6e6f, 0x7865646e, + 0x00000000, 0x00030005, 0x0000004f, 0x00000000, 0x00060005, 0x0000006e, 0x565f6c67, 0x65747265, 0x646e4978, 0x00007865, + 0x00050005, 0x00000073, 0x77617264, 0x756f635f, 0x0000746e, 0x00070005, 0x00000074, 0x77617244, 0x6873654d, 0x68737550, + 0x61746144, 0x00000000, 0x00050006, 0x00000074, 0x00000000, 0x67616c66, 0x00000073, 0x00080006, 0x00000074, 0x00000001, + 0x706f7270, 0x756f635f, 0x6c5f746e, 0x74696d69, 0x00000000, 0x00080006, 0x00000074, 0x00000002, 0x66667562, 0x635f7265, + 0x746e756f, 0x6d696c5f, 0x00007469, 0x00060006, 0x00000074, 0x00000003, 0x77617264, 0x756f635f, 0x0000746e, 0x00060006, + 0x00000074, 0x00000004, 0x77617264, 0x7274735f, 0x00656469, 0x00090006, 0x00000074, 0x00000005, 0x5f78616d, 0x6b726f77, + 0x756f7267, 0x6f635f70, 0x5f746e75, 0x00000078, 0x00090006, 0x00000074, 0x00000006, 0x5f78616d, 0x6b726f77, 0x756f7267, + 0x6f635f70, 0x5f746e75, 0x00000079, 0x00090006, 0x00000074, 0x00000007, 0x5f78616d, 0x6b726f77, 0x756f7267, 0x6f635f70, + 0x5f746e75, 0x0000007a, 0x000a0006, 0x00000074, 0x00000008, 0x5f78616d, 0x6b726f77, 0x756f7267, 0x6f745f70, 0x5f6c6174, + 0x6e756f63, 0x00000074, 0x00050005, 0x00000075, 0x66696e55, 0x496d726f, 0x006f666e, 0x00060006, 0x00000075, 0x00000000, + 0x68737570, 0x7461645f, 0x00000061, 0x00030005, 0x00000077, 0x00000000, 0x00050005, 0x00000080, 0x6e756f43, 0x66754274, + 0x00726566, 0x00070006, 0x00000080, 0x00000000, 0x6e756f63, 0x75625f74, 0x72656666, 0x00000000, 0x00030005, 0x00000082, + 0x00000000, 0x00040005, 0x0000008c, 0x61726170, 0x0000006d, 0x00040005, 0x0000008d, 0x61726170, 0x0000006d, 0x00040005, + 0x0000008e, 0x61726170, 0x0000006d, 0x00040005, 0x00000090, 0x61726170, 0x0000006d, 0x00040005, 0x0000009a, 0x61726170, + 0x0000006d, 0x00040005, 0x0000009b, 0x61726170, 0x0000006d, 0x00040005, 0x0000009c, 0x61726170, 0x0000006d, 0x00040005, + 0x0000009e, 0x61726170, 0x0000006d, 0x00050005, 0x000000a6, 0x77617264, 0x646e695f, 0x00007865, 0x00030005, 0x000000a7, + 0x00000069, 0x00050005, 0x000000b2, 0x77617244, 0x66667542, 0x00007265, 0x00060006, 0x000000b2, 0x00000000, 0x77617264, + 0x6675625f, 0x00726566, 0x00030005, 0x000000b4, 0x00000000, 0x00040005, 0x000000ca, 0x61726170, 0x0000006d, 0x00040005, + 0x000000cb, 0x61726170, 0x0000006d, 0x00040005, 0x000000cc, 0x61726170, 0x0000006d, 0x00040005, 0x000000ce, 0x61726170, + 0x0000006d, 0x00040005, 0x000000da, 0x61726170, 0x0000006d, 0x00040005, 0x000000db, 0x61726170, 0x0000006d, 0x00040005, + 0x000000dc, 0x61726170, 0x0000006d, 0x00040005, 0x000000de, 0x61726170, 0x0000006d, 0x00040005, 0x000000e9, 0x61726170, + 0x0000006d, 0x00040005, 0x000000ea, 0x61726170, 0x0000006d, 0x00040005, 0x000000eb, 0x61726170, 0x0000006d, 0x00040005, + 0x000000ed, 0x61726170, 0x0000006d, 0x00040005, 0x000000fe, 0x61726170, 0x0000006d, 0x00040005, 0x000000ff, 0x61726170, + 0x0000006d, 0x00040005, 0x00000100, 0x61726170, 0x0000006d, 0x00040005, 0x00000102, 0x61726170, 0x0000006d, 0x00040047, + 0x00000014, 0x00000006, 0x00000004, 0x00030047, 0x00000015, 0x00000003, 0x00050048, 0x00000015, 0x00000000, 0x00000023, + 0x00000000, 0x00040047, 0x00000017, 0x00000021, 0x00000002, 0x00040047, 0x00000017, 0x00000022, 0x00000000, 0x00040047, + 0x0000001e, 0x00000006, 0x00000004, 0x00030047, 0x0000001f, 0x00000003, 0x00050048, 0x0000001f, 0x00000000, 0x00000023, + 0x00000000, 0x00040047, 0x00000021, 0x00000021, 0x00000003, 0x00040047, 0x00000021, 0x00000022, 0x00000000, 0x00040047, + 0x00000031, 0x00000006, 0x00000004, 0x00030047, 0x00000032, 0x00000003, 0x00050048, 0x00000032, 0x00000000, 0x00000023, + 0x00000000, 0x00050048, 0x00000032, 0x00000001, 0x00000023, 0x00000004, 0x00050048, 0x00000032, 0x00000002, 0x00000023, + 0x00000008, 0x00040047, 0x00000034, 0x00000021, 0x00000000, 0x00040047, 0x00000034, 0x00000022, 0x00000000, 0x00040047, + 0x0000004c, 0x00000006, 0x00000004, 0x00030047, 0x0000004d, 0x00000003, 0x00050048, 0x0000004d, 0x00000000, 0x00000023, + 0x00000000, 0x00040047, 0x0000004f, 0x00000021, 0x00000001, 0x00040047, 0x0000004f, 0x00000022, 0x00000000, 0x00040047, + 0x0000006e, 0x0000000b, 0x0000002a, 0x00050048, 0x00000074, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x00000074, + 0x00000001, 0x00000023, 0x00000004, 0x00050048, 0x00000074, 0x00000002, 0x00000023, 0x00000008, 0x00050048, 0x00000074, + 0x00000003, 0x00000023, 0x0000000c, 0x00050048, 0x00000074, 0x00000004, 0x00000023, 0x00000010, 0x00050048, 0x00000074, + 0x00000005, 0x00000023, 0x00000014, 0x00050048, 0x00000074, 0x00000006, 0x00000023, 0x00000018, 0x00050048, 0x00000074, + 0x00000007, 0x00000023, 0x0000001c, 0x00050048, 0x00000074, 0x00000008, 0x00000023, 0x00000020, 0x00030047, 0x00000075, + 0x00000002, 0x00050048, 0x00000075, 0x00000000, 0x00000023, 0x00000000, 0x00030047, 0x00000080, 0x00000003, 0x00050048, + 0x00000080, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x00000082, 0x00000021, 0x00000001, 0x00040047, 0x00000082, + 0x00000022, 0x00000001, 0x00040047, 0x000000b1, 0x00000006, 0x00000004, 0x00030047, 0x000000b2, 0x00000003, 0x00050048, + 0x000000b2, 0x00000000, 0x00000023, 0x00000000, 0x00040047, 0x000000b4, 0x00000021, 0x00000000, 0x00040047, 0x000000b4, + 0x00000022, 0x00000001, 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00020014, 0x00000006, 0x00030021, + 0x00000007, 0x00000006, 0x00040015, 0x0000000a, 0x00000020, 0x00000000, 0x00040020, 0x0000000b, 0x00000007, 0x0000000a, + 0x00070021, 0x0000000c, 0x00000002, 0x0000000b, 0x0000000b, 0x0000000b, 0x0000000b, 0x0003001d, 0x00000014, 0x0000000a, + 0x0003001e, 0x00000015, 0x00000014, 0x00040020, 0x00000016, 0x00000002, 0x00000015, 0x0004003b, 0x00000016, 0x00000017, + 0x00000002, 0x00040015, 0x00000018, 0x00000020, 0x00000001, 0x0004002b, 0x00000018, 0x00000019, 0x00000000, 0x00040020, + 0x0000001a, 0x00000002, 0x0000000a, 0x0003001d, 0x0000001e, 0x0000000a, 0x0003001e, 0x0000001f, 0x0000001e, 0x00040020, + 0x00000020, 0x00000002, 0x0000001f, 0x0004003b, 0x00000020, 0x00000021, 0x00000002, 0x0004002b, 0x0000000a, 0x00000024, + 0x00000001, 0x0004002b, 0x0000000a, 0x00000025, 0x00000000, 0x0004002b, 0x0000000a, 0x00000028, 0x00000006, 0x0003001d, + 0x00000031, 0x0000000a, 0x0005001e, 0x00000032, 0x0000000a, 0x0000000a, 0x00000031, 0x00040020, 0x00000033, 0x00000002, + 0x00000032, 0x0004003b, 0x00000033, 0x00000034, 0x00000002, 0x0004002b, 0x00000018, 0x00000035, 0x00000001, 0x0004002b, + 0x0000000a, 0x00000037, 0x00000010, 0x0004002b, 0x00000018, 0x00000045, 0x00000002, 0x0004002b, 0x0000000a, 0x0000004a, + 0x00000007, 0x0003001d, 0x0000004c, 0x0000000a, 0x0003001e, 0x0000004d, 0x0000004c, 0x00040020, 0x0000004e, 0x00000002, + 0x0000004d, 0x0004003b, 0x0000004e, 0x0000004f, 0x00000002, 0x0004002b, 0x0000000a, 0x00000054, 0x00000008, 0x0004002b, + 0x0000000a, 0x0000005a, 0x00000009, 0x0004002b, 0x0000000a, 0x0000005f, 0x0000000a, 0x0004002b, 0x0000000a, 0x00000064, + 0x0000000b, 0x0004002b, 0x0000000a, 0x00000069, 0x0000000c, 0x00040020, 0x0000006d, 0x00000001, 0x00000018, 0x0004003b, + 0x0000006d, 0x0000006e, 0x00000001, 0x000b001e, 0x00000074, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, + 0x0000000a, 0x0000000a, 0x0000000a, 0x0000000a, 0x0003001e, 0x00000075, 0x00000074, 0x00040020, 0x00000076, 0x00000009, + 0x00000075, 0x0004003b, 0x00000076, 0x00000077, 0x00000009, 0x00040020, 0x00000078, 0x00000009, 0x0000000a, 0x0003001e, + 0x00000080, 0x0000000a, 0x00040020, 0x00000081, 0x00000002, 0x00000080, 0x0004003b, 0x00000081, 0x00000082, 0x00000002, + 0x0004002b, 0x0000000a, 0x0000008b, 0x00000004, 0x0004002b, 0x0000000a, 0x00000099, 0x00000002, 0x0004002b, 0x00000018, + 0x000000a3, 0x00000003, 0x0003001d, 0x000000b1, 0x0000000a, 0x0003001e, 0x000000b2, 0x000000b1, 0x00040020, 0x000000b3, + 0x00000002, 0x000000b2, 0x0004003b, 0x000000b3, 0x000000b4, 0x00000002, 0x0004002b, 0x00000018, 0x000000c4, 0x00000005, + 0x0004002b, 0x00000018, 0x000000d3, 0x00000006, 0x0004002b, 0x0000000a, 0x000000d9, 0x00000005, 0x0004002b, 0x00000018, + 0x000000e3, 0x00000007, 0x0004002b, 0x00000018, 0x000000f8, 0x00000008, 0x0004002b, 0x00000018, 0x00000105, 0x00000004, + 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003b, 0x0000000b, 0x00000073, + 0x00000007, 0x0004003b, 0x0000000b, 0x0000008c, 0x00000007, 0x0004003b, 0x0000000b, 0x0000008d, 0x00000007, 0x0004003b, + 0x0000000b, 0x0000008e, 0x00000007, 0x0004003b, 0x0000000b, 0x00000090, 0x00000007, 0x0004003b, 0x0000000b, 0x0000009a, + 0x00000007, 0x0004003b, 0x0000000b, 0x0000009b, 0x00000007, 0x0004003b, 0x0000000b, 0x0000009c, 0x00000007, 0x0004003b, + 0x0000000b, 0x0000009e, 0x00000007, 0x0004003b, 0x0000000b, 0x000000a6, 0x00000007, 0x0004003b, 0x0000000b, 0x000000a7, + 0x00000007, 0x0004003b, 0x0000000b, 0x000000ca, 0x00000007, 0x0004003b, 0x0000000b, 0x000000cb, 0x00000007, 0x0004003b, + 0x0000000b, 0x000000cc, 0x00000007, 0x0004003b, 0x0000000b, 0x000000ce, 0x00000007, 0x0004003b, 0x0000000b, 0x000000da, + 0x00000007, 0x0004003b, 0x0000000b, 0x000000db, 0x00000007, 0x0004003b, 0x0000000b, 0x000000dc, 0x00000007, 0x0004003b, + 0x0000000b, 0x000000de, 0x00000007, 0x0004003b, 0x0000000b, 0x000000e9, 0x00000007, 0x0004003b, 0x0000000b, 0x000000ea, + 0x00000007, 0x0004003b, 0x0000000b, 0x000000eb, 0x00000007, 0x0004003b, 0x0000000b, 0x000000ed, 0x00000007, 0x0004003b, + 0x0000000b, 0x000000fe, 0x00000007, 0x0004003b, 0x0000000b, 0x000000ff, 0x00000007, 0x0004003b, 0x0000000b, 0x00000100, + 0x00000007, 0x0004003b, 0x0000000b, 0x00000102, 0x00000007, 0x0004003d, 0x00000018, 0x0000006f, 0x0000006e, 0x000500aa, + 0x00000006, 0x00000070, 0x0000006f, 0x00000019, 0x000300f7, 0x00000072, 0x00000000, 0x000400fa, 0x00000070, 0x00000071, + 0x00000072, 0x000200f8, 0x00000071, 0x0003003e, 0x00000073, 0x00000025, 0x00060041, 0x00000078, 0x00000079, 0x00000077, + 0x00000019, 0x00000019, 0x0004003d, 0x0000000a, 0x0000007a, 0x00000079, 0x000500c7, 0x0000000a, 0x0000007b, 0x0000007a, + 0x00000024, 0x000500ab, 0x00000006, 0x0000007c, 0x0000007b, 0x00000025, 0x000300f7, 0x0000007e, 0x00000000, 0x000400fa, + 0x0000007c, 0x0000007d, 0x000000a2, 0x000200f8, 0x0000007d, 0x00050041, 0x0000001a, 0x00000083, 0x00000082, 0x00000019, + 0x0004003d, 0x0000000a, 0x00000084, 0x00000083, 0x00060041, 0x00000078, 0x00000086, 0x00000077, 0x00000019, 0x00000045, + 0x0004003d, 0x0000000a, 0x00000087, 0x00000086, 0x000500ac, 0x00000006, 0x00000088, 0x00000084, 0x00000087, 0x000300f7, + 0x0000008a, 0x00000000, 0x000400fa, 0x00000088, 0x00000089, 0x00000092, 0x000200f8, 0x00000089, 0x0003003e, 0x0000008c, + 0x0000008b, 0x0003003e, 0x0000008d, 0x00000024, 0x0003003e, 0x0000008e, 0x00000084, 0x0003003e, 0x00000090, 0x00000025, + 0x00080039, 0x00000002, 0x00000091, 0x00000011, 0x0000008c, 0x0000008d, 0x0000008e, 0x00000090, 0x000200f9, 0x0000008a, + 0x000200f8, 0x00000092, 0x00060041, 0x00000078, 0x00000094, 0x00000077, 0x00000019, 0x00000035, 0x0004003d, 0x0000000a, + 0x00000095, 0x00000094, 0x000500ac, 0x00000006, 0x00000096, 0x00000084, 0x00000095, 0x000300f7, 0x00000098, 0x00000000, + 0x000400fa, 0x00000096, 0x00000097, 0x000000a0, 0x000200f8, 0x00000097, 0x0003003e, 0x0000009a, 0x0000008b, 0x0003003e, + 0x0000009b, 0x00000099, 0x0003003e, 0x0000009c, 0x00000084, 0x0003003e, 0x0000009e, 0x00000025, 0x00080039, 0x00000002, + 0x0000009f, 0x00000011, 0x0000009a, 0x0000009b, 0x0000009c, 0x0000009e, 0x000200f9, 0x00000098, 0x000200f8, 0x000000a0, + 0x0003003e, 0x00000073, 0x00000084, 0x000200f9, 0x00000098, 0x000200f8, 0x00000098, 0x000200f9, 0x0000008a, 0x000200f8, + 0x0000008a, 0x000200f9, 0x0000007e, 0x000200f8, 0x000000a2, 0x00060041, 0x00000078, 0x000000a4, 0x00000077, 0x00000019, + 0x000000a3, 0x0004003d, 0x0000000a, 0x000000a5, 0x000000a4, 0x0003003e, 0x00000073, 0x000000a5, 0x000200f9, 0x0000007e, + 0x000200f8, 0x0000007e, 0x0003003e, 0x000000a6, 0x00000025, 0x0003003e, 0x000000a7, 0x00000025, 0x000200f9, 0x000000a8, + 0x000200f8, 0x000000a8, 0x000400f6, 0x000000aa, 0x000000ab, 0x00000000, 0x000200f9, 0x000000ac, 0x000200f8, 0x000000ac, + 0x0004003d, 0x0000000a, 0x000000ad, 0x000000a7, 0x0004003d, 0x0000000a, 0x000000ae, 0x00000073, 0x000500b0, 0x00000006, + 0x000000af, 0x000000ad, 0x000000ae, 0x000400fa, 0x000000af, 0x000000a9, 0x000000aa, 0x000200f8, 0x000000a9, 0x0004003d, + 0x0000000a, 0x000000b5, 0x000000a6, 0x00060041, 0x0000001a, 0x000000b7, 0x000000b4, 0x00000019, 0x000000b5, 0x0004003d, + 0x0000000a, 0x000000b8, 0x000000b7, 0x00050080, 0x0000000a, 0x000000bb, 0x000000b5, 0x00000024, 0x00060041, 0x0000001a, + 0x000000bc, 0x000000b4, 0x00000019, 0x000000bb, 0x0004003d, 0x0000000a, 0x000000bd, 0x000000bc, 0x00050080, 0x0000000a, + 0x000000c0, 0x000000b5, 0x00000099, 0x00060041, 0x0000001a, 0x000000c1, 0x000000b4, 0x00000019, 0x000000c0, 0x0004003d, + 0x0000000a, 0x000000c2, 0x000000c1, 0x00060041, 0x00000078, 0x000000c5, 0x00000077, 0x00000019, 0x000000c4, 0x0004003d, + 0x0000000a, 0x000000c6, 0x000000c5, 0x000500ac, 0x00000006, 0x000000c7, 0x000000b8, 0x000000c6, 0x000300f7, 0x000000c9, + 0x00000000, 0x000400fa, 0x000000c7, 0x000000c8, 0x000000d1, 0x000200f8, 0x000000c8, 0x0003003e, 0x000000ca, 0x0000008b, + 0x0003003e, 0x000000cb, 0x0000008b, 0x0003003e, 0x000000cc, 0x000000b8, 0x0004003d, 0x0000000a, 0x000000cf, 0x000000a7, + 0x0003003e, 0x000000ce, 0x000000cf, 0x00080039, 0x00000002, 0x000000d0, 0x00000011, 0x000000ca, 0x000000cb, 0x000000cc, + 0x000000ce, 0x000200f9, 0x000000c9, 0x000200f8, 0x000000d1, 0x00060041, 0x00000078, 0x000000d4, 0x00000077, 0x00000019, + 0x000000d3, 0x0004003d, 0x0000000a, 0x000000d5, 0x000000d4, 0x000500ac, 0x00000006, 0x000000d6, 0x000000bd, 0x000000d5, + 0x000300f7, 0x000000d8, 0x00000000, 0x000400fa, 0x000000d6, 0x000000d7, 0x000000e1, 0x000200f8, 0x000000d7, 0x0003003e, + 0x000000da, 0x0000008b, 0x0003003e, 0x000000db, 0x000000d9, 0x0003003e, 0x000000dc, 0x000000bd, 0x0004003d, 0x0000000a, + 0x000000df, 0x000000a7, 0x0003003e, 0x000000de, 0x000000df, 0x00080039, 0x00000002, 0x000000e0, 0x00000011, 0x000000da, + 0x000000db, 0x000000dc, 0x000000de, 0x000200f9, 0x000000d8, 0x000200f8, 0x000000e1, 0x00060041, 0x00000078, 0x000000e4, + 0x00000077, 0x00000019, 0x000000e3, 0x0004003d, 0x0000000a, 0x000000e5, 0x000000e4, 0x000500ac, 0x00000006, 0x000000e6, + 0x000000c2, 0x000000e5, 0x000300f7, 0x000000e8, 0x00000000, 0x000400fa, 0x000000e6, 0x000000e7, 0x000000f0, 0x000200f8, + 0x000000e7, 0x0003003e, 0x000000e9, 0x0000008b, 0x0003003e, 0x000000ea, 0x00000028, 0x0003003e, 0x000000eb, 0x000000c2, + 0x0004003d, 0x0000000a, 0x000000ee, 0x000000a7, 0x0003003e, 0x000000ed, 0x000000ee, 0x00080039, 0x00000002, 0x000000ef, + 0x00000011, 0x000000e9, 0x000000ea, 0x000000eb, 0x000000ed, 0x000200f9, 0x000000e8, 0x000200f8, 0x000000f0, 0x00050084, + 0x0000000a, 0x000000f4, 0x000000b8, 0x000000bd, 0x00050084, 0x0000000a, 0x000000f6, 0x000000f4, 0x000000c2, 0x00060041, + 0x00000078, 0x000000f9, 0x00000077, 0x00000019, 0x000000f8, 0x0004003d, 0x0000000a, 0x000000fa, 0x000000f9, 0x000500ac, + 0x00000006, 0x000000fb, 0x000000f6, 0x000000fa, 0x000300f7, 0x000000fd, 0x00000000, 0x000400fa, 0x000000fb, 0x000000fc, + 0x000000fd, 0x000200f8, 0x000000fc, 0x0003003e, 0x000000fe, 0x0000008b, 0x0003003e, 0x000000ff, 0x0000004a, 0x0003003e, + 0x00000100, 0x000000f6, 0x0004003d, 0x0000000a, 0x00000103, 0x000000a7, 0x0003003e, 0x00000102, 0x00000103, 0x00080039, + 0x00000002, 0x00000104, 0x00000011, 0x000000fe, 0x000000ff, 0x00000100, 0x00000102, 0x000200f9, 0x000000fd, 0x000200f8, + 0x000000fd, 0x000200f9, 0x000000e8, 0x000200f8, 0x000000e8, 0x000200f9, 0x000000d8, 0x000200f8, 0x000000d8, 0x000200f9, + 0x000000c9, 0x000200f8, 0x000000c9, 0x00060041, 0x00000078, 0x00000106, 0x00000077, 0x00000019, 0x00000105, 0x0004003d, + 0x0000000a, 0x00000107, 0x00000106, 0x0004003d, 0x0000000a, 0x00000108, 0x000000a6, 0x00050080, 0x0000000a, 0x00000109, + 0x00000108, 0x00000107, 0x0003003e, 0x000000a6, 0x00000109, 0x000200f9, 0x000000ab, 0x000200f8, 0x000000ab, 0x0004003d, + 0x0000000a, 0x0000010a, 0x000000a7, 0x00050080, 0x0000000a, 0x0000010b, 0x0000010a, 0x00000035, 0x0003003e, 0x000000a7, + 0x0000010b, 0x000200f9, 0x000000a8, 0x000200f8, 0x000000aa, 0x000200f9, 0x00000072, 0x000200f8, 0x00000072, 0x000100fd, + 0x00010038, 0x00050036, 0x00000006, 0x00000008, 0x00000000, 0x00000007, 0x000200f8, 0x00000009, 0x00060041, 0x0000001a, + 0x0000001b, 0x00000017, 0x00000019, 0x00000019, 0x0004003d, 0x0000000a, 0x0000001c, 0x0000001b, 0x00060041, 0x0000001a, + 0x00000023, 0x00000021, 0x00000019, 0x0000001c, 0x000700ea, 0x0000000a, 0x00000026, 0x00000023, 0x00000024, 0x00000025, + 0x00000024, 0x000500ae, 0x00000006, 0x00000029, 0x00000026, 0x00000028, 0x000200fe, 0x00000029, 0x00010038, 0x00050036, + 0x00000002, 0x00000011, 0x00000000, 0x0000000c, 0x00030037, 0x0000000b, 0x0000000d, 0x00030037, 0x0000000b, 0x0000000e, + 0x00030037, 0x0000000b, 0x0000000f, 0x00030037, 0x0000000b, 0x00000010, 0x000200f8, 0x00000012, 0x00040039, 0x00000006, + 0x0000002c, 0x00000008, 0x000300f7, 0x0000002e, 0x00000000, 0x000400fa, 0x0000002c, 0x0000002d, 0x0000002e, 0x000200f8, + 0x0000002d, 0x000100fd, 0x000200f8, 0x0000002e, 0x00050041, 0x0000001a, 0x00000036, 0x00000034, 0x00000035, 0x000700ea, + 0x0000000a, 0x00000038, 0x00000036, 0x00000024, 0x00000025, 0x00000037, 0x00050080, 0x0000000a, 0x0000003c, 0x00000038, + 0x00000037, 0x00050044, 0x0000000a, 0x0000003d, 0x00000034, 0x00000002, 0x0004007c, 0x00000018, 0x0000003e, 0x0000003d, + 0x0004007c, 0x0000000a, 0x0000003f, 0x0000003e, 0x000500ac, 0x00000006, 0x00000040, 0x0000003c, 0x0000003f, 0x000300f7, + 0x00000043, 0x00000000, 0x000400fa, 0x00000040, 0x00000042, 0x00000043, 0x000200f8, 0x00000042, 0x000100fd, 0x000200f8, + 0x00000043, 0x00060041, 0x0000001a, 0x00000048, 0x00000034, 0x00000045, 0x00000038, 0x0003003e, 0x00000048, 0x00000037, + 0x00050080, 0x0000000a, 0x0000004b, 0x00000038, 0x0000004a, 0x00060041, 0x0000001a, 0x00000050, 0x0000004f, 0x00000019, + 0x00000019, 0x0004003d, 0x0000000a, 0x00000051, 0x00000050, 0x00060041, 0x0000001a, 0x00000052, 0x00000034, 0x00000045, + 0x0000004b, 0x0003003e, 0x00000052, 0x00000051, 0x00050080, 0x0000000a, 0x00000055, 0x00000038, 0x00000054, 0x00060041, + 0x0000001a, 0x00000056, 0x00000017, 0x00000019, 0x00000019, 0x0004003d, 0x0000000a, 0x00000057, 0x00000056, 0x00060041, + 0x0000001a, 0x00000058, 0x00000034, 0x00000045, 0x00000055, 0x0003003e, 0x00000058, 0x00000057, 0x00050080, 0x0000000a, + 0x0000005b, 0x00000038, 0x0000005a, 0x0004003d, 0x0000000a, 0x0000005c, 0x0000000d, 0x00060041, 0x0000001a, 0x0000005d, + 0x00000034, 0x00000045, 0x0000005b, 0x0003003e, 0x0000005d, 0x0000005c, 0x00050080, 0x0000000a, 0x00000060, 0x00000038, + 0x0000005f, 0x0004003d, 0x0000000a, 0x00000061, 0x0000000e, 0x00060041, 0x0000001a, 0x00000062, 0x00000034, 0x00000045, + 0x00000060, 0x0003003e, 0x00000062, 0x00000061, 0x00050080, 0x0000000a, 0x00000065, 0x00000038, 0x00000064, 0x0004003d, + 0x0000000a, 0x00000066, 0x0000000f, 0x00060041, 0x0000001a, 0x00000067, 0x00000034, 0x00000045, 0x00000065, 0x0003003e, + 0x00000067, 0x00000066, 0x00050080, 0x0000000a, 0x0000006a, 0x00000038, 0x00000069, 0x0004003d, 0x0000000a, 0x0000006b, + 0x00000010, 0x00060041, 0x0000001a, 0x0000006c, 0x00000034, 0x00000045, 0x0000006a, 0x0003003e, 0x0000006c, 0x0000006b, + 0x000100fd, 0x00010038, +}; diff --git a/layers/vulkan/generated/cmd_validation_draw_vert.h b/layers/vulkan/generated/cmd_validation_mesh_draw_vert.h similarity index 90% rename from layers/vulkan/generated/cmd_validation_draw_vert.h rename to layers/vulkan/generated/cmd_validation_mesh_draw_vert.h index 10935fa7f88..a2d79585882 100644 --- a/layers/vulkan/generated/cmd_validation_draw_vert.h +++ b/layers/vulkan/generated/cmd_validation_mesh_draw_vert.h @@ -26,5 +26,5 @@ #include // To view SPIR-V, copy contents of array and paste in https://www.khronos.org/spir/visualizer/ -extern const uint32_t cmd_validation_draw_vert_size; -extern const uint32_t cmd_validation_draw_vert[]; +extern const uint32_t cmd_validation_mesh_draw_vert_size; +extern const uint32_t cmd_validation_mesh_draw_vert[]; diff --git a/scripts/generate_source.py b/scripts/generate_source.py index e5246678cf0..82278b204af 100755 --- a/scripts/generate_source.py +++ b/scripts/generate_source.py @@ -369,8 +369,12 @@ def main(argv): '.clang-format', 'cmd_validation_dispatch_comp.h', 'cmd_validation_dispatch_comp.cpp', - 'cmd_validation_draw_vert.h', - 'cmd_validation_draw_vert.cpp', + 'cmd_validation_indirect_draw_vert.h', + 'cmd_validation_indirect_draw_vert.cpp', + 'cmd_validation_indexed_draw_vert.h', + 'cmd_validation_indexed_draw_vert.cpp', + 'cmd_validation_mesh_draw_vert.h', + 'cmd_validation_mesh_draw_vert.cpp', 'cmd_validation_trace_rays_rgen.h', 'cmd_validation_trace_rays_rgen.cpp', 'cmd_validation_copy_buffer_to_image_comp.h', diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e48a766fd62..b08bb1558c4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -38,6 +38,8 @@ target_sources(vk_layer_validation_tests PRIVATE framework/render.h framework/binding.h framework/binding.cpp + framework/buffer_helper.h + framework/buffer_helper.cpp framework/test_framework.cpp framework/ray_tracing_objects.h framework/ray_tracing_objects.cpp diff --git a/tests/framework/buffer_helper.cpp b/tests/framework/buffer_helper.cpp new file mode 100644 index 00000000000..a0612ae2b67 --- /dev/null +++ b/tests/framework/buffer_helper.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2015-2016, 2020-2024 The Khronos Group Inc. + * Copyright (c) 2015-2016, 2020-2024 Valve Corporation + * Copyright (c) 2015-2016, 2020-2024 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 "buffer_helper.h" + +namespace vkt { + +Buffer VertexBuffer(const Device &dev, const std::vector &vertices) { + vkt::Buffer vertex_buffer(dev, vertices.size() * sizeof(float), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + auto *vertex_buffer_ptr = static_cast(vertex_buffer.memory().map()); + std::copy(vertices.data(), vertices.data() + vertices.size(), vertex_buffer_ptr); + vertex_buffer.memory().unmap(); + return vertex_buffer; +} +} // namespace vkt diff --git a/tests/framework/buffer_helper.h b/tests/framework/buffer_helper.h new file mode 100644 index 00000000000..3d92a57a684 --- /dev/null +++ b/tests/framework/buffer_helper.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015-2016, 2020-2024 The Khronos Group Inc. + * Copyright (c) 2015-2016, 2020-2024 Valve Corporation + * Copyright (c) 2015-2016, 2020-2024 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 "binding.h" + +namespace vkt { + +Buffer VertexBuffer(const Device &dev, const std::vector &vertices); +template +Buffer IndexBuffer(const Device &dev, const std::vector &indices) { + vkt::Buffer index_buffer(dev, indices.size() * sizeof(IndexT), VK_BUFFER_USAGE_INDEX_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + auto *index_buffer_ptr = static_cast(index_buffer.memory().map()); + std::copy(indices.data(), indices.data() + indices.size(), index_buffer_ptr); + index_buffer.memory().unmap(); + return index_buffer; +} + +} // namespace vkt diff --git a/tests/unit/gpu_av_index_buffer_positive.cpp b/tests/unit/gpu_av_index_buffer_positive.cpp new file mode 100644 index 00000000000..c6359a5e91e --- /dev/null +++ b/tests/unit/gpu_av_index_buffer_positive.cpp @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2020-2024 The Khronos Group Inc. + * Copyright (c) 2020-2024 Valve Corporation + * Copyright (c) 2020-2024 LunarG, Inc. + * Copyright (c) 2020-2024 Google, 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 + */ + +#include "../framework/layer_validation_tests.h" +#include "../framework/pipeline_helper.h" +#include "../framework/buffer_helper.h" + +class PositiveGpuAVIndexBuffer : public GpuAVTest {}; + +TEST_F(PositiveGpuAVIndexBuffer, BadVertexIndex) { + TEST_DESCRIPTION("If no vertex buffer is used, all index values are legal"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + CreatePipelineHelper pipe(*this); + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.CreateGraphicsPipeline(); + + vkt::Buffer indexed_draw_buffer(*m_device, sizeof(VkDrawIndexedIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + { + auto indexed_draw_ptr = reinterpret_cast(indexed_draw_buffer.memory().map()); + indexed_draw_ptr->indexCount = 3; + indexed_draw_ptr->instanceCount = 1; + indexed_draw_ptr->firstIndex = 0; + indexed_draw_ptr->vertexOffset = 0; + indexed_draw_ptr->firstInstance = 0; + indexed_draw_buffer.memory().unmap(); + } + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + vkt::Buffer index_buffer = vkt::IndexBuffer(*m_device, {0, std::numeric_limits::max(), 42}); + + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT32); + vk::CmdDrawIndexedIndirect(m_commandBuffer->handle(), indexed_draw_buffer.handle(), 0, 1, sizeof(VkDrawIndexedIndirectCommand)); + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); +} diff --git a/tests/unit/gpu_av_indirect_buffer.cpp b/tests/unit/gpu_av_indirect_buffer.cpp index 6982055bcf8..5eabc43bd9f 100644 --- a/tests/unit/gpu_av_indirect_buffer.cpp +++ b/tests/unit/gpu_av_indirect_buffer.cpp @@ -13,6 +13,7 @@ #include "../framework/layer_validation_tests.h" #include "../framework/pipeline_helper.h" +#include "../framework/buffer_helper.h" class NegativeGpuAVIndirectBuffer : public GpuAVTest {}; @@ -547,6 +548,14 @@ TEST_F(NegativeGpuAVIndirectBuffer, FirstInstance) { RETURN_IF_SKIP(InitState(nullptr)); InitRenderTarget(); + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + CreatePipelineHelper pipe(*this); + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.CreateGraphicsPipeline(); + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); vkt::Buffer draw_buffer(*m_device, 4 * sizeof(VkDrawIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); VkDrawIndirectCommand *draw_ptr = static_cast(draw_buffer.memory().map()); @@ -559,15 +568,7 @@ TEST_F(NegativeGpuAVIndirectBuffer, FirstInstance) { } draw_buffer.memory().unmap(); - VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); - vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); - - CreatePipelineHelper pipe(*this); - pipe.gp_ci_.layout = pipeline_layout.handle(); - pipe.CreateGraphicsPipeline(); - - m_errorMonitor->SetDesiredError("VUID-VkDrawIndirectCommand-firstInstance-00501"); - VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_errorMonitor->SetDesiredErrorRegex("VUID-VkDrawIndirectCommand-firstInstance-00501", "at index 3"); m_commandBuffer->begin(&begin_info); m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); @@ -577,7 +578,25 @@ TEST_F(NegativeGpuAVIndirectBuffer, FirstInstance) { m_default_queue->Submit(*m_commandBuffer); m_default_queue->Wait(); m_errorMonitor->VerifyFound(); +} + +TEST_F(NegativeGpuAVIndirectBuffer, FirstInstanceIndexed) { + TEST_DESCRIPTION("Validate illegal firstInstance values"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + CreatePipelineHelper pipe(*this); + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.CreateGraphicsPipeline(); + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); // Now with an offset and indexed draw m_errorMonitor->SetDesiredError("VUID-VkDrawIndexedIndirectCommand-firstInstance-00554"); vkt::Buffer indexed_draw_buffer(*m_device, 4 * sizeof(VkDrawIndexedIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, @@ -596,7 +615,14 @@ TEST_F(NegativeGpuAVIndirectBuffer, FirstInstance) { m_commandBuffer->begin(&begin_info); m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); - vkt::Buffer index_buffer(*m_device, 3 * sizeof(uint32_t), VK_BUFFER_USAGE_INDEX_BUFFER_BIT); + vkt::Buffer index_buffer(*m_device, 3 * sizeof(uint32_t), VK_BUFFER_USAGE_INDEX_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + uint32_t *index_ptr = (uint32_t *)index_buffer.memory().map(); + index_ptr[0] = 0; + index_ptr[1] = 1; + index_ptr[2] = 2; + index_buffer.memory().unmap(); + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT32); vk::CmdDrawIndexedIndirect(m_commandBuffer->handle(), indexed_draw_buffer.handle(), sizeof(VkDrawIndexedIndirectCommand), 3, sizeof(VkDrawIndexedIndirectCommand)); @@ -607,6 +633,550 @@ TEST_F(NegativeGpuAVIndirectBuffer, FirstInstance) { m_errorMonitor->VerifyFound(); } +TEST_F(NegativeGpuAVIndirectBuffer, IndexBufferOOB) { + TEST_DESCRIPTION("Validate overruning the index buffer"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState()); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + CreatePipelineHelper pipe(*this); + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.CreateGraphicsPipeline(); + + // Now with an offset and indexed draw + vkt::Buffer indexed_draw_buffer(*m_device, sizeof(VkDrawIndexedIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + { + VkDrawIndexedIndirectCommand *indexed_draw_ptr = (VkDrawIndexedIndirectCommand *)indexed_draw_buffer.memory().map(); + indexed_draw_ptr->indexCount = 3; + indexed_draw_ptr->instanceCount = 1; + indexed_draw_ptr->firstIndex = 1; + indexed_draw_ptr->vertexOffset = 0; + indexed_draw_ptr->firstInstance = 0; + indexed_draw_buffer.memory().unmap(); + } + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + vkt::Buffer index_buffer(*m_device, 3 * sizeof(uint32_t), VK_BUFFER_USAGE_INDEX_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + auto *indicies = static_cast(index_buffer.memory().map()); + indicies[0] = 0u; + indicies[1] = 1u; + indicies[2] = 2u; + index_buffer.memory().unmap(); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-robustBufferAccess2-08798", + " firstIndex = 1 plus indexCount = 3"); + + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT32); + vk::CmdDrawIndexedIndirect(m_commandBuffer->handle(), indexed_draw_buffer.handle(), 0, 1, sizeof(VkDrawIndexedIndirectCommand)); + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} + +TEST_F(NegativeGpuAVIndirectBuffer, IndirectDrawBadVertexIndex32) { + TEST_DESCRIPTION("Validate illegal index buffer values - uint32_t index"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + char const *vsSource = R"glsl( + #version 450 + + layout(location=0) in vec3 pos; + + void main() { + gl_Position = vec4(pos, 1.0); + } + )glsl"; + VkShaderObj vs(this, vsSource, VK_SHADER_STAGE_VERTEX_BIT); + + CreatePipelineHelper pipe(*this); + VkVertexInputBindingDescription input_binding = {0, 0, VK_VERTEX_INPUT_RATE_VERTEX}; + VkVertexInputAttributeDescription input_attrib = {0, 0, VK_FORMAT_R32G32B32_SFLOAT, 0}; + pipe.vi_ci_.pVertexBindingDescriptions = &input_binding; + pipe.vi_ci_.vertexBindingDescriptionCount = 1; + pipe.vi_ci_.pVertexAttributeDescriptions = &input_attrib; + pipe.vi_ci_.vertexAttributeDescriptionCount = 1; + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.shader_stages_ = {vs.GetStageCreateInfo(), pipe.fs_->GetStageCreateInfo()}; + + pipe.CreateGraphicsPipeline(); + + // Now with an offset and indexed draw + vkt::Buffer indexed_draw_buffer(*m_device, sizeof(VkDrawIndexedIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + { + VkDrawIndexedIndirectCommand *indexed_draw_ptr = (VkDrawIndexedIndirectCommand *)indexed_draw_buffer.memory().map(); + indexed_draw_ptr->indexCount = 3; + indexed_draw_ptr->instanceCount = 1; + indexed_draw_ptr->firstIndex = 0; + indexed_draw_ptr->vertexOffset = 0; + indexed_draw_ptr->firstInstance = 0; + indexed_draw_buffer.memory().unmap(); + } + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + + vkt::Buffer index_buffer = vkt::IndexBuffer(*m_device, {0, 666, 42}); + vkt::Buffer vertex_buffer = vkt::VertexBuffer(*m_device, {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}); + VkDeviceSize vertex_buffer_offset = 0; + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT32); + vk::CmdBindVertexBuffers(m_commandBuffer->handle(), 0, 1, &vertex_buffer.handle(), &vertex_buffer_offset); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 666"); + // Validation shader breaks at first bad index + // m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 42"); + vk::CmdDrawIndexedIndirect(m_commandBuffer->handle(), indexed_draw_buffer.handle(), 0, 1, sizeof(VkDrawIndexedIndirectCommand)); + + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} + +TEST_F(NegativeGpuAVIndirectBuffer, IndirectDrawBadVertexIndex16) { + TEST_DESCRIPTION("Validate illegal index buffer values - uint16_t index"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + char const *vsSource = R"glsl( + #version 450 + + layout(location=0) in vec3 pos; + + void main() { + gl_Position = vec4(pos, 1.0); + } + )glsl"; + VkShaderObj vs(this, vsSource, VK_SHADER_STAGE_VERTEX_BIT); + + CreatePipelineHelper pipe(*this); + VkVertexInputBindingDescription input_binding = {0, 0, VK_VERTEX_INPUT_RATE_VERTEX}; + VkVertexInputAttributeDescription input_attrib = {0, 0, VK_FORMAT_R32G32B32_SFLOAT, 0}; + pipe.vi_ci_.pVertexBindingDescriptions = &input_binding; + pipe.vi_ci_.vertexBindingDescriptionCount = 1; + pipe.vi_ci_.pVertexAttributeDescriptions = &input_attrib; + pipe.vi_ci_.vertexAttributeDescriptionCount = 1; + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.shader_stages_ = {vs.GetStageCreateInfo(), pipe.fs_->GetStageCreateInfo()}; + + pipe.CreateGraphicsPipeline(); + + // Now with an offset and indexed draw + vkt::Buffer indexed_draw_buffer(*m_device, sizeof(VkDrawIndexedIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + { + VkDrawIndexedIndirectCommand *indexed_draw_ptr = (VkDrawIndexedIndirectCommand *)indexed_draw_buffer.memory().map(); + indexed_draw_ptr->indexCount = 3; + indexed_draw_ptr->instanceCount = 1; + indexed_draw_ptr->firstIndex = 0; + indexed_draw_ptr->vertexOffset = 0; + indexed_draw_ptr->firstInstance = 0; + indexed_draw_buffer.memory().unmap(); + } + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + + vkt::Buffer index_buffer = vkt::IndexBuffer(*m_device, {0, 128, 42}); + vkt::Buffer vertex_buffer = vkt::VertexBuffer(*m_device, {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}); + VkDeviceSize vertex_buffer_offset = 0; + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT16); + vk::CmdBindVertexBuffers(m_commandBuffer->handle(), 0, 1, &vertex_buffer.handle(), &vertex_buffer_offset); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 128"); + // Validation shader breaks at first bad index + // m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 42"); + vk::CmdDrawIndexedIndirect(m_commandBuffer->handle(), indexed_draw_buffer.handle(), 0, 1, sizeof(VkDrawIndexedIndirectCommand)); + + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} + +TEST_F(NegativeGpuAVIndirectBuffer, IndirectDrawBadVertexIndex8) { + TEST_DESCRIPTION("Validate illegal index buffer values - uint8_t index"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + AddRequiredExtensions(VK_KHR_INDEX_TYPE_UINT8_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddRequiredFeature(vkt::Feature::indexTypeUint8); + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + char const *vsSource = R"glsl( + #version 450 + + layout(location=0) in vec3 pos; + + void main() { + gl_Position = vec4(pos, 1.0); + } + )glsl"; + VkShaderObj vs(this, vsSource, VK_SHADER_STAGE_VERTEX_BIT); + + CreatePipelineHelper pipe(*this); + VkVertexInputBindingDescription input_binding = {0, 0, VK_VERTEX_INPUT_RATE_VERTEX}; + VkVertexInputAttributeDescription input_attrib = {0, 0, VK_FORMAT_R32G32B32_SFLOAT, 0}; + pipe.vi_ci_.pVertexBindingDescriptions = &input_binding; + pipe.vi_ci_.vertexBindingDescriptionCount = 1; + pipe.vi_ci_.pVertexAttributeDescriptions = &input_attrib; + pipe.vi_ci_.vertexAttributeDescriptionCount = 1; + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.shader_stages_ = {vs.GetStageCreateInfo(), pipe.fs_->GetStageCreateInfo()}; + + pipe.CreateGraphicsPipeline(); + + // Now with an offset and indexed draw + vkt::Buffer indexed_draw_buffer(*m_device, sizeof(VkDrawIndexedIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + { + VkDrawIndexedIndirectCommand *indexed_draw_ptr = (VkDrawIndexedIndirectCommand *)indexed_draw_buffer.memory().map(); + indexed_draw_ptr->indexCount = 3; + indexed_draw_ptr->instanceCount = 1; + indexed_draw_ptr->firstIndex = 0; + indexed_draw_ptr->vertexOffset = 0; + indexed_draw_ptr->firstInstance = 0; + indexed_draw_buffer.memory().unmap(); + } + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + + vkt::Buffer index_buffer = vkt::IndexBuffer(*m_device, {0, 128, 42}); + vkt::Buffer vertex_buffer = vkt::VertexBuffer(*m_device, {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}); + VkDeviceSize vertex_buffer_offset = 0; + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT8_KHR); + vk::CmdBindVertexBuffers(m_commandBuffer->handle(), 0, 1, &vertex_buffer.handle(), &vertex_buffer_offset); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 128"); + // Validation shader breaks at first bad index + // m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 42"); + vk::CmdDrawIndexedIndirect(m_commandBuffer->handle(), indexed_draw_buffer.handle(), 0, 1, sizeof(VkDrawIndexedIndirectCommand)); + + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} + +TEST_F(NegativeGpuAVIndirectBuffer, DrawBadVertexIndex32) { + TEST_DESCRIPTION("Validate illegal index buffer values - uint32_t index"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + char const *vsSource = R"glsl( + #version 450 + + layout(location=0) in vec3 pos; + + void main() { + gl_Position = vec4(pos, 1.0); + } + )glsl"; + VkShaderObj vs(this, vsSource, VK_SHADER_STAGE_VERTEX_BIT); + + CreatePipelineHelper pipe(*this); + VkVertexInputBindingDescription input_binding = {0, 0, VK_VERTEX_INPUT_RATE_VERTEX}; + VkVertexInputAttributeDescription input_attrib = {0, 0, VK_FORMAT_R32G32B32_SFLOAT, 0}; + pipe.vi_ci_.pVertexBindingDescriptions = &input_binding; + pipe.vi_ci_.vertexBindingDescriptionCount = 1; + pipe.vi_ci_.pVertexAttributeDescriptions = &input_attrib; + pipe.vi_ci_.vertexAttributeDescriptionCount = 1; + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.shader_stages_ = {vs.GetStageCreateInfo(), pipe.fs_->GetStageCreateInfo()}; + + pipe.CreateGraphicsPipeline(); + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + + vkt::Buffer index_buffer = vkt::IndexBuffer(*m_device, {0, 666, 42}); + vkt::Buffer vertex_buffer = vkt::VertexBuffer(*m_device, {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}); + VkDeviceSize vertex_buffer_offset = 0; + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT32); + vk::CmdBindVertexBuffers(m_commandBuffer->handle(), 0, 1, &vertex_buffer.handle(), &vertex_buffer_offset); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexed-None-02721", "index buffer at index 1 is 666"); + // Validation shader breaks at first bad index + // m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 42"); + vk::CmdDrawIndexed(m_commandBuffer->handle(), 3, 1, 0, 0, 0); + + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} + +TEST_F(NegativeGpuAVIndirectBuffer, DrawBadVertexIndex16) { + TEST_DESCRIPTION("Validate illegal index buffer values - uint16_t index"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + char const *vsSource = R"glsl( + #version 450 + + layout(location=0) in vec3 pos; + + void main() { + gl_Position = vec4(pos, 1.0); + } + )glsl"; + VkShaderObj vs(this, vsSource, VK_SHADER_STAGE_VERTEX_BIT); + + CreatePipelineHelper pipe(*this); + VkVertexInputBindingDescription input_binding = {0, 0, VK_VERTEX_INPUT_RATE_VERTEX}; + VkVertexInputAttributeDescription input_attrib = {0, 0, VK_FORMAT_R32G32B32_SFLOAT, 0}; + pipe.vi_ci_.pVertexBindingDescriptions = &input_binding; + pipe.vi_ci_.vertexBindingDescriptionCount = 1; + pipe.vi_ci_.pVertexAttributeDescriptions = &input_attrib; + pipe.vi_ci_.vertexAttributeDescriptionCount = 1; + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.shader_stages_ = {vs.GetStageCreateInfo(), pipe.fs_->GetStageCreateInfo()}; + + pipe.CreateGraphicsPipeline(); + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + + vkt::Buffer index_buffer = vkt::IndexBuffer(*m_device, {0, 666, 42}); + vkt::Buffer vertex_buffer = vkt::VertexBuffer(*m_device, {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}); + VkDeviceSize vertex_buffer_offset = 0; + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT16); + vk::CmdBindVertexBuffers(m_commandBuffer->handle(), 0, 1, &vertex_buffer.handle(), &vertex_buffer_offset); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexed-None-02721", "index buffer at index 1 is 666"); + // Validation shader breaks at first bad index + // m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 42"); + vk::CmdDrawIndexed(m_commandBuffer->handle(), 3, 1, 0, 0, 0); + + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} + +TEST_F(NegativeGpuAVIndirectBuffer, DrawBadVertexIndex8) { + TEST_DESCRIPTION("Validate illegal index buffer values - uint8_t index"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + AddRequiredExtensions(VK_KHR_INDEX_TYPE_UINT8_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddRequiredFeature(vkt::Feature::indexTypeUint8); + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + char const *vsSource = R"glsl( + #version 450 + + layout(location=0) in vec3 pos; + + void main() { + gl_Position = vec4(pos, 1.0); + } + )glsl"; + VkShaderObj vs(this, vsSource, VK_SHADER_STAGE_VERTEX_BIT); + + CreatePipelineHelper pipe(*this); + VkVertexInputBindingDescription input_binding = {0, 0, VK_VERTEX_INPUT_RATE_VERTEX}; + VkVertexInputAttributeDescription input_attrib = {0, 0, VK_FORMAT_R32G32B32_SFLOAT, 0}; + pipe.vi_ci_.pVertexBindingDescriptions = &input_binding; + pipe.vi_ci_.vertexBindingDescriptionCount = 1; + pipe.vi_ci_.pVertexAttributeDescriptions = &input_attrib; + pipe.vi_ci_.vertexAttributeDescriptionCount = 1; + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.shader_stages_ = {vs.GetStageCreateInfo(), pipe.fs_->GetStageCreateInfo()}; + + pipe.CreateGraphicsPipeline(); + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + + vkt::Buffer index_buffer = vkt::IndexBuffer(*m_device, {0, 66, 42}); + vkt::Buffer vertex_buffer = vkt::VertexBuffer(*m_device, {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}); + VkDeviceSize vertex_buffer_offset = 0; + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT8_KHR); + vk::CmdBindVertexBuffers(m_commandBuffer->handle(), 0, 1, &vertex_buffer.handle(), &vertex_buffer_offset); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexed-None-02721", "index buffer at index 1 is 66"); + // Validation shader breaks at first bad index + // m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexedIndirect-None-02721", "index buffer at index 1 is 42"); + vk::CmdDrawIndexed(m_commandBuffer->handle(), 3, 1, 0, 0, 0); + + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} + +#if 0 +TEST_F(NegativeGpuAVIndirectBuffer, BadVertexIndexDirect) { + TEST_DESCRIPTION("Validate illegal index buffer values for vkCmdDrawIndexed"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + CreatePipelineHelper pipe(*this); + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.CreateGraphicsPipeline(); + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + vkt::Buffer index_buffer(*m_device, 4 * sizeof(uint32_t), VK_BUFFER_USAGE_INDEX_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + auto *indicies = static_cast(index_buffer.memory().map()); + indicies[0] = 0u; + indicies[1] = 1u; + indicies[2] = 512u; + indicies[3] = 2u; + index_buffer.memory().unmap(); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexed-None-02721", "index buffer at index 2 is 512"); + + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT32); + + vk::CmdDrawIndexed(m_commandBuffer->handle(), 3, 1, 1, 0, 0); + + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} + +TEST_F(NegativeGpuAVIndirectBuffer, BadVertexIndexDirect16) { + TEST_DESCRIPTION("Validate illegal 16 bit index buffer values for vkCmdDrawIndexed"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState(nullptr)); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + CreatePipelineHelper pipe(*this); + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.CreateGraphicsPipeline(); + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + vkt::Buffer index_buffer(*m_device, 4 * sizeof(uint16_t), VK_BUFFER_USAGE_INDEX_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + auto *indicies = static_cast(index_buffer.memory().map()); + indicies[0] = 0u; + indicies[1] = 1u; + indicies[2] = 65535u; + indicies[3] = 2u; + index_buffer.memory().unmap(); + + m_errorMonitor->SetDesiredErrorRegex("VUID-vkCmdDrawIndexed-None-02721", "index buffer at index 2 is 65535"); + + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT16); + + vk::CmdDrawIndexed(m_commandBuffer->handle(), 3, 1, 1, 0, 0); + + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); + m_errorMonitor->VerifyFound(); +} +#endif + TEST_F(NegativeGpuAVIndirectBuffer, DispatchWorkgroupSize) { TEST_DESCRIPTION("GPU validation: Validate VkDispatchIndirectCommand"); RETURN_IF_SKIP(InitGpuAvFramework()); diff --git a/tests/unit/gpu_av_positive.cpp b/tests/unit/gpu_av_positive.cpp index 32b27ce8faf..b260bb27ac7 100644 --- a/tests/unit/gpu_av_positive.cpp +++ b/tests/unit/gpu_av_positive.cpp @@ -1732,3 +1732,53 @@ TEST_F(PositiveGpuAV, PipelineLayoutMixing) { m_default_queue->Submit(*m_commandBuffer); m_default_queue->Wait(); } + +TEST_F(PositiveGpuAV, VertexIndex) { + TEST_DESCRIPTION("Validate index buffer values"); + AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + RETURN_IF_SKIP(InitGpuAvFramework()); + + AddDisabledFeature(vkt::Feature::drawIndirectFirstInstance); + RETURN_IF_SKIP(InitState()); + InitRenderTarget(); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vku::InitStructHelper(); + vkt::PipelineLayout pipeline_layout(*m_device, pipelineLayoutCreateInfo); + + CreatePipelineHelper pipe(*this); + pipe.gp_ci_.layout = pipeline_layout.handle(); + pipe.CreateGraphicsPipeline(); + + // Now with an offset and indexed draw + vkt::Buffer indexed_draw_buffer(*m_device, sizeof(VkDrawIndexedIndirectCommand), VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + { + VkDrawIndexedIndirectCommand *indexed_draw_ptr = (VkDrawIndexedIndirectCommand *)indexed_draw_buffer.memory().map(); + indexed_draw_ptr->indexCount = 3; + indexed_draw_ptr->instanceCount = 1; + indexed_draw_ptr->firstIndex = 0; + indexed_draw_ptr->vertexOffset = 0; + indexed_draw_ptr->firstInstance = 0; + indexed_draw_buffer.memory().unmap(); + } + + VkCommandBufferBeginInfo begin_info = vku::InitStructHelper(); + m_commandBuffer->begin(&begin_info); + m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); + vk::CmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.Handle()); + const uint32_t kNumVertices = 12; + vkt::Buffer index_buffer(*m_device, kNumVertices * sizeof(uint32_t), VK_BUFFER_USAGE_INDEX_BUFFER_BIT, + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + auto *indicies = static_cast(index_buffer.memory().map()); + for (uint32_t i = 0; i < kNumVertices; i++) { + indicies[i] = kNumVertices - 1 - i; + } + index_buffer.memory().unmap(); + + vk::CmdBindIndexBuffer(m_commandBuffer->handle(), index_buffer.handle(), 0, VK_INDEX_TYPE_UINT32); + vk::CmdDrawIndexedIndirect(m_commandBuffer->handle(), indexed_draw_buffer.handle(), 0, 1, sizeof(VkDrawIndexedIndirectCommand)); + m_commandBuffer->EndRenderPass(); + m_commandBuffer->end(); + m_default_queue->Submit(*m_commandBuffer); + m_default_queue->Wait(); +}