From 30e252f94ecd2b0de1dd25d69831e87f6ed3a9de Mon Sep 17 00:00:00 2001 From: Jeremy Gebben Date: Thu, 9 Jan 2025 08:59:00 -0700 Subject: [PATCH] stateless: Refactor pNext, flag and enum checking utils Move most of the low level checking methods into a separate class. These checks are used with in the pNext checks and in many cases require knowledge about which extensions are enabled in the VkInstance, VkPhysicalDevice or VkDevice. The new separate object can be set up to use the correct DeviceExtensions object and then the extension checks within the rest of the code become much simpler. --- layers/chassis/chassis_manual.cpp | 16 +- layers/chassis/dispatch_object_manual.cpp | 5 +- layers/stateless/sl_buffer.cpp | 19 +- layers/stateless/sl_cmd_buffer.cpp | 129 +- layers/stateless/sl_cmd_buffer_dynamic.cpp | 55 +- layers/stateless/sl_descriptor.cpp | 68 +- .../sl_device_generated_commands.cpp | 134 +- layers/stateless/sl_device_memory.cpp | 23 +- layers/stateless/sl_external_object.cpp | 51 +- layers/stateless/sl_framebuffer.cpp | 16 +- layers/stateless/sl_image.cpp | 48 +- layers/stateless/sl_instance_device.cpp | 208 +- layers/stateless/sl_pipeline.cpp | 139 +- layers/stateless/sl_ray_tracing.cpp | 284 +- layers/stateless/sl_render_pass.cpp | 20 +- layers/stateless/sl_shader_object.cpp | 8 +- layers/stateless/sl_synchronization.cpp | 16 +- layers/stateless/sl_utils.cpp | 172 +- layers/stateless/sl_wsi.cpp | 110 +- layers/stateless/stateless_validation.h | 689 +- .../generated/feature_requirements_helper.cpp | 26 +- .../generated/stateless_validation_helper.cpp | 21729 +++++++++------- .../generated/stateless_validation_helper.h | 47 +- layers/vulkan/generated/valid_enum_values.cpp | 892 +- layers/vulkan/generated/valid_enum_values.h | 222 +- layers/vulkan/generated/valid_flag_values.cpp | 377 +- .../vulkan/generated/vk_extension_helper.cpp | 76 +- layers/vulkan/generated/vk_extension_helper.h | 16 +- .../generators/extension_helper_generator.py | 94 +- .../stateless_validation_helper_generator.py | 189 +- .../generators/valid_enum_values_generator.py | 26 +- .../generators/valid_flag_values_generator.py | 24 +- tests/framework/video_objects.h | 10 +- tests/unit/best_practices.cpp | 7 +- tests/unit/debug_printf.cpp | 1 + tests/unit/device_feature_property.cpp | 8 +- tests/unit/dynamic_rendering.cpp | 25 +- tests/unit/gpu_av.cpp | 7 +- tests/unit/instanceless.cpp | 13 +- tests/unit/nvidia_best_practices.cpp | 8 +- tests/unit/others.cpp | 14 +- tests/unit/pipeline_positive.cpp | 1 + tests/unit/shader_object.cpp | 1 + tests/unit/sync_val_positive.cpp | 1 + tests/unit/wsi.cpp | 1 + 45 files changed, 14520 insertions(+), 11505 deletions(-) diff --git a/layers/chassis/chassis_manual.cpp b/layers/chassis/chassis_manual.cpp index 2a82343985a..e0459f3c866 100644 --- a/layers/chassis/chassis_manual.cpp +++ b/layers/chassis/chassis_manual.cpp @@ -1,8 +1,8 @@ /*************************************************************************** * - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (c) 2015-2024 Google Inc. * Copyright (c) 2023-2024 RasterGrid Kft. * @@ -214,11 +214,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateInstance(const VkInstanceCreateInfo* pCreat layer_init_instance_dispatch_table(*pInstance, &instance_dispatch->instance_dispatch_table, fpGetInstanceProcAddr); - // We need to call this to properly check which device extensions have been promoted when validating query functions - // that take as input a physical device, which can be called before a logical device has been created. - instance_dispatch->device_extensions.InitFromDeviceCreateInfo(&instance_dispatch->instance_extensions, - instance_dispatch->api_version); - OutputLayerStatusInfo(instance_dispatch.get()); InstanceExtensionWhitelist(instance_dispatch.get(), pCreateInfo, *pInstance); // save a raw pointer since the unique_ptr will be invalidate by the move() below @@ -323,9 +318,8 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice gpu, const VkDevice record_obj.result = result; device_dispatch->device = *pDevice; // Save local info in device object - device_dispatch->api_version = device_dispatch->device_extensions.InitFromDeviceCreateInfo( - &instance_dispatch->instance_extensions, device_dispatch->api_version, - reinterpret_cast(&modified_create_info)); + device_dispatch->device_extensions = DeviceExtensions(instance_dispatch->instance_extensions, device_dispatch->api_version, + reinterpret_cast(&modified_create_info)); layer_init_device_dispatch_table(*pDevice, &device_dispatch->device_dispatch_table, fpGetDeviceProcAddr); instance_dispatch->debug_report->device_created++; diff --git a/layers/chassis/dispatch_object_manual.cpp b/layers/chassis/dispatch_object_manual.cpp index 19c41c70218..564ea01cd17 100644 --- a/layers/chassis/dispatch_object_manual.cpp +++ b/layers/chassis/dispatch_object_manual.cpp @@ -102,7 +102,8 @@ Instance::Instance(const VkInstanceCreateInfo *pCreateInfo) : HandleWrapper(new api_version = VK_MAKE_API_VERSION(VK_API_VERSION_VARIANT(specified_version), VK_API_VERSION_MAJOR(specified_version), VK_API_VERSION_MINOR(specified_version), 0); - instance_extensions.InitFromInstanceCreateInfo(specified_version, pCreateInfo); + instance_extensions = InstanceExtensions(specified_version, pCreateInfo); + device_extensions = DeviceExtensions(instance_extensions, api_version); debug_report->instance_pnext_chain = vku::SafePnextCopy(pCreateInfo->pNext); ActivateInstanceDebugCallbacks(debug_report); @@ -278,7 +279,7 @@ Device::Device(Instance *instance, VkPhysicalDevice gpu, const VkDeviceCreateInf // Setup the validation tables based on the application API version from the instance and the capabilities of the device driver auto effective_api_version = std::min(APIVersion(device_properties.apiVersion), dispatch_instance->api_version); - device_extensions.InitFromDeviceCreateInfo(&dispatch_instance->instance_extensions, effective_api_version, pCreateInfo); + device_extensions = DeviceExtensions(dispatch_instance->instance_extensions, effective_api_version, pCreateInfo); InitValidationObjects(); InitObjectDispatchVectors(); diff --git a/layers/stateless/sl_buffer.cpp b/layers/stateless/sl_buffer.cpp index e64f9441ff7..099d63a097d 100644 --- a/layers/stateless/sl_buffer.cpp +++ b/layers/stateless/sl_buffer.cpp @@ -21,11 +21,12 @@ bool StatelessValidation::manual_PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); - skip |= ValidateNotZero(pCreateInfo->size == 0, "VUID-VkBufferCreateInfo-size-00912", create_info_loc.dot(Field::size)); + skip |= state.ValidateNotZero(pCreateInfo->size == 0, "VUID-VkBufferCreateInfo-size-00912", create_info_loc.dot(Field::size)); // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) { @@ -68,9 +69,9 @@ bool StatelessValidation::manual_PreCallValidateCreateBuffer(VkDevice device, co } if (!vku::FindStructInPNextChain(pCreateInfo->pNext)) { - skip |= ValidateFlags(create_info_loc.dot(Field::usage), vvl::FlagBitmask::VkBufferUsageFlagBits, AllVkBufferUsageFlagBits, - pCreateInfo->usage, kRequiredFlags, VK_NULL_HANDLE, "VUID-VkBufferCreateInfo-None-09499", - "VUID-VkBufferCreateInfo-None-09500"); + skip |= state.ValidateFlags(create_info_loc.dot(Field::usage), vvl::FlagBitmask::VkBufferUsageFlagBits, + AllVkBufferUsageFlagBits, pCreateInfo->usage, kRequiredFlags, + "VUID-VkBufferCreateInfo-None-09499", "VUID-VkBufferCreateInfo-None-09500"); } if (pCreateInfo->flags & VK_BUFFER_CREATE_PROTECTED_BIT) { @@ -93,12 +94,12 @@ bool StatelessValidation::manual_PreCallValidateCreateBuffer(VkDevice device, co bool StatelessValidation::manual_PreCallValidateCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pBufferView, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; #ifdef VK_USE_PLATFORM_METAL_EXT - skip |= - ExportMetalObjectsPNextUtil(VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT, "VUID-VkBufferViewCreateInfo-pNext-06782", - error_obj.location, "VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT", pCreateInfo->pNext); + skip |= ExportMetalObjectsPNextUtil(VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT, + "VUID-VkBufferViewCreateInfo-pNext-06782", state.error_obj.location, + "VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT", pCreateInfo->pNext); #endif // VK_USE_PLATFORM_METAL_EXT return skip; } diff --git a/layers/stateless/sl_cmd_buffer.cpp b/layers/stateless/sl_cmd_buffer.cpp index 8a4d045aab4..19f03827053 100644 --- a/layers/stateless/sl_cmd_buffer.cpp +++ b/layers/stateless/sl_cmd_buffer.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,21 +54,23 @@ bool StatelessValidation::ValidateCmdBindIndexBuffer(VkCommandBuffer commandBuff bool StatelessValidation::manual_PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType, - const ErrorObject &error_obj) const { - return ValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, error_obj.location); + const vvl::stateless::State &state) const { + return ValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, state.error_obj.location); } bool StatelessValidation::manual_PreCallValidateCmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType, - const ErrorObject &error_obj) const { - return ValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, error_obj.location); + const vvl::stateless::State &state) const { + return ValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, state.error_obj.location); } bool StatelessValidation::manual_PreCallValidateCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + if (firstBinding > device_limits.maxVertexInputBindings) { skip |= LogError("VUID-vkCmdBindVertexBuffers-firstBinding-00624", commandBuffer, error_obj.location, "firstBinding (%" PRIu32 ") must be less than maxVertexInputBindings (%" PRIu32 ").", firstBinding, @@ -105,8 +107,9 @@ bool StatelessValidation::manual_PreCallValidateCmdBindVertexBuffers(VkCommandBu bool StatelessValidation::manual_PreCallValidateCmdBindTransformFeedbackBuffersEXT( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, - const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const ErrorObject &error_obj) const { + const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.transformFeedback) { skip |= LogError("VUID-vkCmdBindTransformFeedbackBuffersEXT-transformFeedback-02355", commandBuffer, error_obj.location, @@ -156,8 +159,9 @@ bool StatelessValidation::manual_PreCallValidateCmdBindTransformFeedbackBuffersE bool StatelessValidation::manual_PreCallValidateCmdBeginTransformFeedbackEXT( VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, - const VkDeviceSize *pCounterBufferOffsets, const ErrorObject &error_obj) const { + const VkDeviceSize *pCounterBufferOffsets, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.transformFeedback) { skip |= LogError("VUID-vkCmdBeginTransformFeedbackEXT-transformFeedback-02366", commandBuffer, error_obj.location, "transformFeedback feature was not enabled."); @@ -185,8 +189,9 @@ bool StatelessValidation::manual_PreCallValidateCmdEndTransformFeedbackEXT(VkCom uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.transformFeedback) { skip |= LogError("VUID-vkCmdEndTransformFeedbackEXT-transformFeedback-02374", commandBuffer, error_obj.location, "transformFeedback feature was not enabled."); @@ -221,8 +226,9 @@ bool StatelessValidation::manual_PreCallValidateCmdBindVertexBuffers2(VkCommandB uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; // Check VUID-vkCmdBindVertexBuffers2-bindingCount-arraylength // This is a special case and generator currently skips it @@ -325,14 +331,15 @@ bool StatelessValidation::ValidateCmdPushConstants(VkCommandBuffer commandBuffer bool StatelessValidation::manual_PreCallValidateCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, - const void *pValues, const ErrorObject &error_obj) const { - return ValidateCmdPushConstants(commandBuffer, offset, size, error_obj.location); + const void *pValues, const vvl::stateless::State &state) const { + return ValidateCmdPushConstants(commandBuffer, offset, size, state.error_obj.location); } bool StatelessValidation::manual_PreCallValidateCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo *pPushConstantsInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; skip |= ValidateCmdPushConstants(commandBuffer, pPushConstantsInfo->offset, pPushConstantsInfo->size, error_obj.location.dot(Field::pPushConstantsInfo)); if (pPushConstantsInfo->layout == VK_NULL_HANDLE) { @@ -351,8 +358,9 @@ bool StatelessValidation::manual_PreCallValidateCmdPushConstants2(VkCommandBuffe bool StatelessValidation::manual_PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, const VkImageSubresourceRange *pRanges, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!pColor) { skip |= LogError("VUID-vkCmdClearColorImage-pColor-04961", commandBuffer, error_obj.location, "pColor must not be null"); } @@ -362,8 +370,9 @@ bool StatelessValidation::manual_PreCallValidateCmdClearColorImage(VkCommandBuff bool StatelessValidation::manual_PreCallValidateGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if ((flags & VK_QUERY_RESULT_WITH_STATUS_BIT_KHR) && (flags & VK_QUERY_RESULT_WITH_AVAILABILITY_BIT)) { skip |= LogError("VUID-vkGetQueryPoolResults-flags-09443", device, error_obj.location.dot(Field::flags), @@ -375,8 +384,9 @@ bool StatelessValidation::manual_PreCallValidateGetQueryPoolResults(VkDevice dev bool StatelessValidation::manual_PreCallValidateCmdBeginConditionalRenderingEXT( VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if ((pConditionalRenderingBegin->offset & 3) != 0) { skip |= LogError("VUID-VkConditionalRenderingBeginInfoEXT-offset-01984", commandBuffer, @@ -389,8 +399,10 @@ bool StatelessValidation::manual_PreCallValidateCmdBeginConditionalRenderingEXT( bool StatelessValidation::manual_PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment *pAttachments, uint32_t rectCount, - const VkClearRect *pRects, const ErrorObject &error_obj) const { + const VkClearRect *pRects, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; for (uint32_t rect = 0; rect < rectCount; rect++) { const Location rect_loc = error_obj.location.dot(Field::pRects, rect); if (pRects[rect].layerCount == 0) { @@ -411,8 +423,9 @@ bool StatelessValidation::manual_PreCallValidateCmdClearAttachments(VkCommandBuf bool StatelessValidation::manual_PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy *pRegions, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pRegions != nullptr) { for (uint32_t i = 0; i < regionCount; i++) { @@ -427,8 +440,9 @@ bool StatelessValidation::manual_PreCallValidateCmdCopyBuffer(VkCommandBuffer co bool StatelessValidation::manual_PreCallValidateCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pCopyBufferInfo->pRegions != nullptr) { for (uint32_t i = 0; i < pCopyBufferInfo->regionCount; i++) { @@ -444,8 +458,9 @@ bool StatelessValidation::manual_PreCallValidateCmdCopyBuffer2(VkCommandBuffer c bool StatelessValidation::manual_PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (dstOffset & 3) { const LogObjectList objlist(commandBuffer, dstBuffer); @@ -467,8 +482,9 @@ bool StatelessValidation::manual_PreCallValidateCmdUpdateBuffer(VkCommandBuffer bool StatelessValidation::manual_PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (dstOffset & 3) { const LogObjectList objlist(commandBuffer, dstBuffer); @@ -492,8 +508,9 @@ bool StatelessValidation::manual_PreCallValidateCmdFillBuffer(VkCommandBuffer co bool StatelessValidation::manual_PreCallValidateCmdBindDescriptorBuffersEXT(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT *pBindingInfos, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.descriptorBuffer) { skip |= LogError("VUID-vkCmdBindDescriptorBuffersEXT-None-08047", commandBuffer, error_obj.location, "descriptorBuffer feature was not enabled."); @@ -501,10 +518,10 @@ bool StatelessValidation::manual_PreCallValidateCmdBindDescriptorBuffersEXT(VkCo for (uint32_t i = 0; i < bufferCount; i++) { if (!vku::FindStructInPNextChain(pBindingInfos[i].pNext)) { - skip |= ValidateFlags(error_obj.location.dot(Field::pBindingInfos, i).dot(Field::usage), - vvl::FlagBitmask::VkBufferUsageFlagBits, AllVkBufferUsageFlagBits, pBindingInfos[i].usage, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkDescriptorBufferBindingInfoEXT-None-09499", - "VUID-VkDescriptorBufferBindingInfoEXT-None-09500"); + skip |= state.ValidateFlags(error_obj.location.dot(Field::pBindingInfos, i).dot(Field::usage), + vvl::FlagBitmask::VkBufferUsageFlagBits, AllVkBufferUsageFlagBits, pBindingInfos[i].usage, + kRequiredFlags, "VUID-VkDescriptorBufferBindingInfoEXT-None-09499", + "VUID-VkDescriptorBufferBindingInfoEXT-None-09500"); } } @@ -513,14 +530,15 @@ bool StatelessValidation::manual_PreCallValidateCmdBindDescriptorBuffersEXT(VkCo bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceExternalBufferProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, - VkExternalBufferProperties *pExternalBufferProperties, const ErrorObject &error_obj) const { + VkExternalBufferProperties *pExternalBufferProperties, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!vku::FindStructInPNextChain(pExternalBufferInfo->pNext)) { - skip |= ValidateFlags(error_obj.location.dot(Field::pExternalBufferInfo).dot(Field::usage), - vvl::FlagBitmask::VkBufferUsageFlagBits, AllVkBufferUsageFlagBits, pExternalBufferInfo->usage, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkPhysicalDeviceExternalBufferInfo-None-09499", - "VUID-VkPhysicalDeviceExternalBufferInfo-None-09500"); + skip |= state.ValidateFlags(error_obj.location.dot(Field::pExternalBufferInfo).dot(Field::usage), + vvl::FlagBitmask::VkBufferUsageFlagBits, AllVkBufferUsageFlagBits, pExternalBufferInfo->usage, + kRequiredFlags, "VUID-VkPhysicalDeviceExternalBufferInfo-None-09499", + "VUID-VkPhysicalDeviceExternalBufferInfo-None-09500"); } return skip; @@ -530,15 +548,16 @@ bool StatelessValidation::manual_PreCallValidateCmdPushDescriptorSet(VkCommandBu VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, - const ErrorObject &error_obj) const { - return ValidateWriteDescriptorSet(error_obj.location, descriptorWriteCount, pDescriptorWrites); + const vvl::stateless::State &state) const { + return ValidateWriteDescriptorSet(state, state.error_obj.location, descriptorWriteCount, pDescriptorWrites); } bool StatelessValidation::manual_PreCallValidateCmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo *pPushDescriptorSetInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; - skip |= ValidateWriteDescriptorSet(error_obj.location, pPushDescriptorSetInfo->descriptorWriteCount, + const auto &error_obj = state.error_obj; + skip |= ValidateWriteDescriptorSet(state, error_obj.location, pPushDescriptorSetInfo->descriptorWriteCount, pPushDescriptorSetInfo->pDescriptorWrites); if (pPushDescriptorSetInfo->layout == VK_NULL_HANDLE) { if (!enabled_features.dynamicPipelineLayout) { @@ -684,22 +703,24 @@ bool StatelessValidation::ValidateViewport(const VkViewport &viewport, VkCommand bool StatelessValidation::manual_PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml // This is an array of handles, where the elements are allowed to be VK_NULL_HANDLE, and does not require any validation beyond // ValidateArray() - skip |= ValidateArray(error_obj.location.dot(Field::commandBufferCount), error_obj.location.dot(Field::pCommandBuffers), - commandBufferCount, &pCommandBuffers, true, true, kVUIDUndefined, - "VUID-vkFreeCommandBuffers-pCommandBuffers-00048"); + skip |= state.ValidateArray(error_obj.location.dot(Field::commandBufferCount), error_obj.location.dot(Field::pCommandBuffers), + commandBufferCount, &pCommandBuffers, true, true, kVUIDUndefined, + "VUID-vkFreeCommandBuffers-pCommandBuffers-00048"); return skip; } bool StatelessValidation::manual_PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; // pBeginInfo->pInheritanceInfo can be a non-null invalid pointer. If not secondary command buffer we need to ignore if (!error_obj.handle_data->command_buffer.is_secondary) { @@ -711,7 +732,7 @@ bool StatelessValidation::manual_PreCallValidateBeginCommandBuffer(VkCommandBuff const Location begin_info_loc = error_obj.location.dot(Field::pBeginInfo); const Location inheritance_loc = begin_info_loc.dot(Field::pInheritanceInfo); - skip |= ValidateCommandBufferInheritanceInfo(info, inheritance_loc); + skip |= ValidateCommandBufferInheritanceInfo(state, info, inheritance_loc); // Explicit VUs if (!enabled_features.inheritedQueries && info.occlusionQueryEnable == VK_TRUE) { @@ -721,22 +742,22 @@ bool StatelessValidation::manual_PreCallValidateBeginCommandBuffer(VkCommandBuff } if (enabled_features.inheritedQueries) { - skip |= ValidateFlags(inheritance_loc.dot(Field::queryFlags), vvl::FlagBitmask::VkQueryControlFlagBits, - AllVkQueryControlFlagBits, info.queryFlags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkCommandBufferInheritanceInfo-queryFlags-00057"); + skip |= state.ValidateFlags(inheritance_loc.dot(Field::queryFlags), vvl::FlagBitmask::VkQueryControlFlagBits, + AllVkQueryControlFlagBits, info.queryFlags, kOptionalFlags, + "VUID-VkCommandBufferInheritanceInfo-queryFlags-00057"); } else { // !inheritedQueries - skip |= ValidateReservedFlags(inheritance_loc.dot(Field::queryFlags), info.queryFlags, - "VUID-VkCommandBufferInheritanceInfo-queryFlags-02788"); + skip |= state.ValidateReservedFlags(inheritance_loc.dot(Field::queryFlags), info.queryFlags, + "VUID-VkCommandBufferInheritanceInfo-queryFlags-02788"); } if (enabled_features.pipelineStatisticsQuery) { - skip |= - ValidateFlags(inheritance_loc.dot(Field::pipelineStatistics), vvl::FlagBitmask::VkQueryPipelineStatisticFlagBits, - AllVkQueryPipelineStatisticFlagBits, info.pipelineStatistics, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-02789"); + skip |= state.ValidateFlags(inheritance_loc.dot(Field::pipelineStatistics), + vvl::FlagBitmask::VkQueryPipelineStatisticFlagBits, AllVkQueryPipelineStatisticFlagBits, + info.pipelineStatistics, kOptionalFlags, + "VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-02789"); } else { // !pipelineStatisticsQuery - skip |= ValidateReservedFlags(inheritance_loc.dot(Field::pipelineStatistics), info.pipelineStatistics, - "VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058"); + skip |= state.ValidateReservedFlags(inheritance_loc.dot(Field::pipelineStatistics), info.pipelineStatistics, + "VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058"); } const auto *conditional_rendering = diff --git a/layers/stateless/sl_cmd_buffer_dynamic.cpp b/layers/stateless/sl_cmd_buffer_dynamic.cpp index 5e0de493f6a..e9bf059bbfa 100644 --- a/layers/stateless/sl_cmd_buffer_dynamic.cpp +++ b/layers/stateless/sl_cmd_buffer_dynamic.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,8 +21,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport *pViewports, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.multiViewport) { if (viewportCount != 1) { @@ -53,8 +54,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetViewportWithCount(VkComman bool StatelessValidation::manual_PreCallValidateCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D *pScissors, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.multiViewport) { if (scissorCount != 1) { skip |= LogError("VUID-vkCmdSetScissorWithCount-scissorCount-03398", commandBuffer, @@ -119,8 +121,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetScissorWithCount(VkCommand bool StatelessValidation::manual_PreCallValidateCmdSetVertexInputEXT( VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount, const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, - const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions, const ErrorObject &error_obj) const { + const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (vertexBindingDescriptionCount > device_limits.maxVertexInputBindings) { skip |= LogError("VUID-vkCmdSetVertexInputEXT-vertexBindingDescriptionCount-04791", commandBuffer, @@ -271,8 +274,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetDiscardRectangleEXT(VkComm uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!pDiscardRectangles) { return skip; @@ -301,8 +305,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetDiscardRectangleEXT(VkComm bool StatelessValidation::manual_PreCallValidateCmdSetDiscardRectangleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (discard_rectangles_extension_version < 2) { skip |= LogError("VUID-vkCmdSetDiscardRectangleEnableEXT-specVersion-07851", commandBuffer, error_obj.location, "Requires support for version 2 of VK_EXT_discard_rectangles."); @@ -312,8 +317,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetDiscardRectangleEnableEXT( bool StatelessValidation::manual_PreCallValidateCmdSetDiscardRectangleModeEXT(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (discard_rectangles_extension_version < 2) { skip |= LogError("VUID-vkCmdSetDiscardRectangleModeEXT-specVersion-07852", commandBuffer, error_obj.location, "Requires support for version 2 of VK_EXT_discard_rectangles."); @@ -325,8 +331,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetExclusiveScissorEnableNV(V uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32 *pExclusiveScissorEnables, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (scissor_exclusive_extension_version < 2) { skip |= LogError("VUID-vkCmdSetExclusiveScissorEnableNV-exclusiveScissor-07853", commandBuffer, error_obj.location, "Requires support for version 2 of VK_NV_scissor_exclusive."); @@ -338,8 +345,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetExclusiveScissorNV(VkComma uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.multiViewport) { if (firstExclusiveScissor != 0) { @@ -399,8 +407,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetExclusiveScissorNV(VkComma bool StatelessValidation::manual_PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const uint64_t sum = static_cast(firstViewport) + static_cast(viewportCount); if ((sum < 1) || (sum > device_limits.maxViewports)) { skip |= LogError("VUID-vkCmdSetViewportWScalingNV-firstViewport-01324", commandBuffer, error_obj.location, @@ -414,8 +423,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetViewportWScalingNV(VkComma bool StatelessValidation::manual_PreCallValidateCmdSetViewportShadingRatePaletteNV( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, - const VkShadingRatePaletteNV *pShadingRatePalettes, const ErrorObject &error_obj) const { + const VkShadingRatePaletteNV *pShadingRatePalettes, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.multiViewport) { if (firstViewport != 0) { @@ -445,8 +455,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetCoarseSampleOrderNV(VkComm VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV *pCustomSampleOrders, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (sampleOrderType != VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV && customSampleOrderCount != 0) { skip |= LogError("VUID-vkCmdSetCoarseSampleOrderNV-sampleOrderType-02081", commandBuffer, error_obj.location, @@ -464,8 +475,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetCoarseSampleOrderNV(VkComm bool StatelessValidation::manual_PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.multiViewport) { if (firstViewport != 0) { @@ -501,8 +513,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetViewport(VkCommandBuffer c bool StatelessValidation::manual_PreCallValidateCmdSetDepthClampRangeEXT(VkCommandBuffer commandBuffer, VkDepthClampModeEXT depthClampMode, const VkDepthClampRangeEXT *pDepthClampRange, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (depthClampMode == VK_DEPTH_CLAMP_MODE_USER_DEFINED_RANGE_EXT) { if (!pDepthClampRange) { skip |= LogError("VUID-vkCmdSetDepthClampRangeEXT-pDepthClampRange-09647", device, @@ -516,8 +529,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetDepthClampRangeEXT(VkComma bool StatelessValidation::manual_PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.multiViewport) { if (firstScissor != 0) { @@ -573,8 +587,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetScissor(VkCommandBuffer co } bool StatelessValidation::manual_PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.wideLines && (lineWidth != 1.0f)) { skip |= LogError("VUID-vkCmdSetLineWidth-lineWidth-00788", commandBuffer, error_obj.location.dot(Field::lineWidth), @@ -585,8 +600,10 @@ bool StatelessValidation::manual_PreCallValidateCmdSetLineWidth(VkCommandBuffer } bool StatelessValidation::manual_PreCallValidateCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, - uint16_t lineStipplePattern, const ErrorObject &error_obj) const { + uint16_t lineStipplePattern, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (lineStippleFactor < 1 || lineStippleFactor > 256) { skip |= LogError("VUID-vkCmdSetLineStipple-lineStippleFactor-02776", commandBuffer, diff --git a/layers/stateless/sl_descriptor.cpp b/layers/stateless/sl_descriptor.cpp index 19127249285..fb43b084436 100644 --- a/layers/stateless/sl_descriptor.cpp +++ b/layers/stateless/sl_descriptor.cpp @@ -335,8 +335,9 @@ bool StatelessValidation::ValidateSamplerImageProcessingQCOM(const VkSamplerCrea bool StatelessValidation::manual_PreCallValidateCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSampler *pSampler, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); const auto &limits = device_limits; @@ -397,15 +398,15 @@ bool StatelessValidation::manual_PreCallValidateCreateSampler(VkDevice device, c } if (pCreateInfo->compareEnable == VK_TRUE) { - skip |= ValidateRangedEnum(create_info_loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, pCreateInfo->compareOp, - "VUID-VkSamplerCreateInfo-compareEnable-01080"); + skip |= state.ValidateRangedEnum(create_info_loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, pCreateInfo->compareOp, + "VUID-VkSamplerCreateInfo-compareEnable-01080"); } if ((pCreateInfo->addressModeU == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) || (pCreateInfo->addressModeV == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER) || (pCreateInfo->addressModeW == VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER)) { - skip |= ValidateRangedEnum(create_info_loc.dot(Field::borderColor), vvl::Enum::VkBorderColor, pCreateInfo->borderColor, - "VUID-VkSamplerCreateInfo-addressModeU-01078"); + skip |= state.ValidateRangedEnum(create_info_loc.dot(Field::borderColor), vvl::Enum::VkBorderColor, + pCreateInfo->borderColor, "VUID-VkSamplerCreateInfo-addressModeU-01078"); } if (enabled_features.samplerMirrorClampToEdge == VK_FALSE) { @@ -695,8 +696,9 @@ bool StatelessValidation::manual_PreCallValidateCreateDescriptorSetLayout(VkDevi const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; skip |= ValidateDescriptorSetLayoutCreateInfo(*pCreateInfo, error_obj.location.dot(Field::pCreateInfo)); return skip; } @@ -704,8 +706,9 @@ bool StatelessValidation::manual_PreCallValidateCreateDescriptorSetLayout(VkDevi bool StatelessValidation::manual_PreCallValidateGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; skip |= ValidateDescriptorSetLayoutCreateInfo(*pCreateInfo, error_obj.location.dot(Field::pCreateInfo)); return skip; } @@ -713,16 +716,18 @@ bool StatelessValidation::manual_PreCallValidateGetDescriptorSetLayoutSupport(Vk bool StatelessValidation::manual_PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet *pDescriptorSets, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { + const auto &error_obj = state.error_obj; // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml // This is an array of handles, where the elements are allowed to be VK_NULL_HANDLE, and does not require any validation beyond // ValidateArray() - return ValidateArray(error_obj.location.dot(Field::descriptorSetCount), error_obj.location.dot(Field::pDescriptorSets), - descriptorSetCount, &pDescriptorSets, true, true, kVUIDUndefined, - "VUID-vkFreeDescriptorSets-pDescriptorSets-00310"); + return state.ValidateArray(error_obj.location.dot(Field::descriptorSetCount), error_obj.location.dot(Field::pDescriptorSets), + descriptorSetCount, &pDescriptorSets, true, true, kVUIDUndefined, + "VUID-vkFreeDescriptorSets-pDescriptorSets-00310"); } -bool StatelessValidation::ValidateWriteDescriptorSet(const Location &loc, const uint32_t descriptorWriteCount, +bool StatelessValidation::ValidateWriteDescriptorSet(const vvl::stateless::State &state, const Location &loc, + const uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites) const { bool skip = false; if (!pDescriptorWrites) { @@ -738,7 +743,7 @@ bool StatelessValidation::ValidateWriteDescriptorSet(const Location &loc, const // If called from vkCmdPushDescriptorSetKHR, the dstSet member is ignored. if (!is_push_descriptor) { // dstSet must be a valid VkDescriptorSet handle - skip |= ValidateRequiredHandle(writes_loc.dot(Field::dstSet), descriptor_writes.dstSet); + skip |= state.ValidateRequiredHandle(writes_loc.dot(Field::dstSet), descriptor_writes.dstSet); } const VkDescriptorType descriptor_type = descriptor_writes.descriptorType; @@ -747,9 +752,9 @@ bool StatelessValidation::ValidateWriteDescriptorSet(const Location &loc, const (descriptor_type == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT)) { if (descriptor_writes.pImageInfo != nullptr && descriptor_type != VK_DESCRIPTOR_TYPE_SAMPLER) { for (uint32_t descriptor_index = 0; descriptor_index < descriptor_writes.descriptorCount; ++descriptor_index) { - skip |= ValidateRangedEnum(writes_loc.dot(Field::pImageInfo, descriptor_index).dot(Field::imageLayout), - vvl::Enum::VkImageLayout, descriptor_writes.pImageInfo[descriptor_index].imageLayout, - kVUIDUndefined); + skip |= state.ValidateRangedEnum(writes_loc.dot(Field::pImageInfo, descriptor_index).dot(Field::imageLayout), + vvl::Enum::VkImageLayout, + descriptor_writes.pImageInfo[descriptor_index].imageLayout, kVUIDUndefined); } } } @@ -761,8 +766,9 @@ bool StatelessValidation::manual_PreCallValidateUpdateDescriptorSets(VkDevice de const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies, - const ErrorObject &error_obj) const { - return ValidateWriteDescriptorSet(error_obj.location, descriptorWriteCount, pDescriptorWrites); + const vvl::stateless::State &state) const { + const auto &error_obj = state.error_obj; + return ValidateWriteDescriptorSet(state, error_obj.location, descriptorWriteCount, pDescriptorWrites); } static bool MutableDescriptorTypePartialOverlap(const VkDescriptorPoolCreateInfo *pCreateInfo, uint32_t i, uint32_t j) { @@ -833,8 +839,9 @@ static bool MutableDescriptorTypePartialOverlap(const VkDescriptorPoolCreateInfo bool StatelessValidation::manual_PreCallValidateCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); if (pCreateInfo->maxSets == 0 && ((pCreateInfo->flags & VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV) == 0)) { @@ -902,8 +909,9 @@ bool StatelessValidation::manual_PreCallValidateCreateDescriptorPool(VkDevice de bool StatelessValidation::manual_PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); switch (pCreateInfo->queryType) { @@ -968,8 +976,9 @@ bool StatelessValidation::manual_PreCallValidateCreateSamplerYcbcrConversion(VkD const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; // Check samplerYcbcrConversion feature is set if (!enabled_features.samplerYcbcrConversion) { @@ -1086,8 +1095,9 @@ bool StatelessValidation::manual_PreCallValidateCreateSamplerYcbcrConversion(VkD bool StatelessValidation::manual_PreCallValidateGetDescriptorEXT(VkDevice device, const VkDescriptorGetInfoEXT *pDescriptorInfo, size_t dataSize, void *pDescriptor, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.descriptorBuffer) { skip |= LogError("VUID-vkGetDescriptorEXT-None-08015", device, error_obj.location, "descriptorBuffer feature was not enabled."); @@ -1148,7 +1158,7 @@ bool StatelessValidation::manual_PreCallValidateGetDescriptorEXT(VkDevice device if (address_info) { const Location address_loc = data_loc.dot(data_field); - skip |= ValidateDescriptorAddressInfoEXT(*address_info, address_loc); + skip |= ValidateDescriptorAddressInfoEXT(state, *address_info, address_loc); if (address_info->address != 0) { if ((pDescriptorInfo->type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER || @@ -1164,8 +1174,9 @@ bool StatelessValidation::manual_PreCallValidateGetDescriptorEXT(VkDevice device bool StatelessValidation::manual_PreCallValidateCmdSetDescriptorBufferOffsets2EXT( VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT *pSetDescriptorBufferOffsetsInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pSetDescriptorBufferOffsetsInfo->layout == VK_NULL_HANDLE) { if (!enabled_features.dynamicPipelineLayout) { @@ -1184,8 +1195,9 @@ bool StatelessValidation::manual_PreCallValidateCmdSetDescriptorBufferOffsets2EX bool StatelessValidation::manual_PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers2EXT( VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT *pBindDescriptorBufferEmbeddedSamplersInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pBindDescriptorBufferEmbeddedSamplersInfo->layout == VK_NULL_HANDLE) { if (!enabled_features.dynamicPipelineLayout) { @@ -1204,8 +1216,9 @@ bool StatelessValidation::manual_PreCallValidateCmdBindDescriptorBufferEmbeddedS bool StatelessValidation::manual_PreCallValidateCmdPushDescriptorSetWithTemplate2( VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pPushDescriptorSetWithTemplateInfo->layout == VK_NULL_HANDLE) { if (!enabled_features.dynamicPipelineLayout) { @@ -1223,8 +1236,9 @@ bool StatelessValidation::manual_PreCallValidateCmdPushDescriptorSetWithTemplate bool StatelessValidation::manual_PreCallValidateCmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfoKHR *pBindDescriptorSetsInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pBindDescriptorSetsInfo->layout == VK_NULL_HANDLE) { if (!enabled_features.dynamicPipelineLayout) { skip |= LogError("VUID-VkBindDescriptorSetsInfo-None-09495", commandBuffer, diff --git a/layers/stateless/sl_device_generated_commands.cpp b/layers/stateless/sl_device_generated_commands.cpp index e7751f8ef55..bd8ec06841c 100644 --- a/layers/stateless/sl_device_generated_commands.cpp +++ b/layers/stateless/sl_device_generated_commands.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,7 +37,8 @@ static inline bool IsRayTracingCommand(VkIndirectCommandsTokenTypeEXT type) { VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_EXT, VK_INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXT}); } -bool StatelessValidation::ValidateIndirectExecutionSetPipelineInfo(const VkIndirectExecutionSetPipelineInfoEXT& pipeline_info, +bool StatelessValidation::ValidateIndirectExecutionSetPipelineInfo(const vvl::stateless::State& state, + const VkIndirectExecutionSetPipelineInfoEXT& pipeline_info, const Location& pipeline_info_loc) const { bool skip = false; @@ -52,12 +53,13 @@ bool StatelessValidation::ValidateIndirectExecutionSetPipelineInfo(const VkIndir props.maxIndirectPipelineCount); } - skip |= ValidateIndirectExecutionSetPipelineInfoEXT(pipeline_info, pipeline_info_loc); + skip |= ValidateIndirectExecutionSetPipelineInfoEXT(state, pipeline_info, pipeline_info_loc); return skip; } -bool StatelessValidation::ValidateIndirectExecutionSetShaderInfo(const VkIndirectExecutionSetShaderInfoEXT& shader_info, +bool StatelessValidation::ValidateIndirectExecutionSetShaderInfo(const vvl::stateless::State& state, + const VkIndirectExecutionSetShaderInfoEXT& shader_info, const Location& shader_info_loc) const { bool skip = false; @@ -77,30 +79,30 @@ bool StatelessValidation::ValidateIndirectExecutionSetShaderInfo(const VkIndirec } // implicit checks - done manually as code gen is hard to get correct - skip |= ValidateStructType(shader_info_loc, &shader_info, VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_INFO_EXT, false, - kVUIDUndefined, "VUID-VkIndirectExecutionSetShaderInfoEXT-sType-sType"); - skip |= ValidateStructTypeArray(shader_info_loc.dot(Field::shaderCount), shader_info_loc.dot(Field::pSetLayoutInfos), - shader_info.shaderCount, shader_info.pSetLayoutInfos, - VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_LAYOUT_INFO_EXT, true, false, - "VUID-VkIndirectExecutionSetShaderLayoutInfoEXT-sType-sType", - "VUID-VkIndirectExecutionSetShaderInfoEXT-pSetLayoutInfos-parameter", - "VUID-VkIndirectExecutionSetShaderInfoEXT-shaderCount-arraylength"); + skip |= state.ValidateStructType(shader_info_loc, &shader_info, VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_INFO_EXT, false, + kVUIDUndefined, "VUID-VkIndirectExecutionSetShaderInfoEXT-sType-sType"); + skip |= state.ValidateStructTypeArray(shader_info_loc.dot(Field::shaderCount), shader_info_loc.dot(Field::pSetLayoutInfos), + shader_info.shaderCount, shader_info.pSetLayoutInfos, + VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_LAYOUT_INFO_EXT, true, false, + "VUID-VkIndirectExecutionSetShaderLayoutInfoEXT-sType-sType", + "VUID-VkIndirectExecutionSetShaderInfoEXT-pSetLayoutInfos-parameter", + "VUID-VkIndirectExecutionSetShaderInfoEXT-shaderCount-arraylength"); // Validate shaderCount once above - skip |= ValidateArray(shader_info_loc.dot(Field::shaderCount), shader_info_loc.dot(Field::pInitialShaders), - shader_info.shaderCount, &shader_info.pInitialShaders, false, true, kVUIDUndefined, - "VUID-VkIndirectExecutionSetShaderInfoEXT-pInitialShaders-parameter"); - skip |= ValidateArray(shader_info_loc.dot(Field::pushConstantRangeCount), shader_info_loc.dot(Field::pPushConstantRanges), - shader_info.pushConstantRangeCount, &shader_info.pPushConstantRanges, false, true, kVUIDUndefined, - "VUID-VkIndirectExecutionSetShaderInfoEXT-pPushConstantRanges-parameter"); + skip |= state.ValidateArray(shader_info_loc.dot(Field::shaderCount), shader_info_loc.dot(Field::pInitialShaders), + shader_info.shaderCount, &shader_info.pInitialShaders, false, true, kVUIDUndefined, + "VUID-VkIndirectExecutionSetShaderInfoEXT-pInitialShaders-parameter"); + skip |= state.ValidateArray(shader_info_loc.dot(Field::pushConstantRangeCount), shader_info_loc.dot(Field::pPushConstantRanges), + shader_info.pushConstantRangeCount, &shader_info.pPushConstantRanges, false, true, kVUIDUndefined, + "VUID-VkIndirectExecutionSetShaderInfoEXT-pPushConstantRanges-parameter"); if (shader_info.pPushConstantRanges != nullptr) { for (uint32_t i = 0; i < shader_info.pushConstantRangeCount; ++i) { const Location pc_range_loc = shader_info_loc.dot(Field::pPushConstantRanges, i); - skip |= ValidateFlags(pc_range_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, shader_info.pPushConstantRanges[i].stageFlags, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkPushConstantRange-stageFlags-parameter", - "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); + skip |= state.ValidateFlags(pc_range_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, shader_info.pPushConstantRanges[i].stageFlags, kRequiredFlags, + "VUID-VkPushConstantRange-stageFlags-parameter", + "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); } } @@ -109,8 +111,10 @@ bool StatelessValidation::ValidateIndirectExecutionSetShaderInfo(const VkIndirec bool StatelessValidation::manual_PreCallValidateCreateIndirectExecutionSetEXT( VkDevice device, const VkIndirectExecutionSetCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, - VkIndirectExecutionSetEXT* pIndirectExecutionSet, const ErrorObject& error_obj) const { + VkIndirectExecutionSetEXT* pIndirectExecutionSet, const vvl::stateless::State& state) const { bool skip = false; + const auto& error_obj = state.error_obj; + if (!enabled_features.deviceGeneratedCommands) { skip |= LogError("VUID-vkCreateIndirectExecutionSetEXT-deviceGeneratedCommands-11013", device, error_obj.location, "deviceGeneratedCommands feature was not enabled."); @@ -125,7 +129,8 @@ bool StatelessValidation::manual_PreCallValidateCreateIndirectExecutionSetEXT( create_info_loc.dot(Field::type), "is VK_INDIRECT_EXECUTION_SET_INFO_TYPE_PIPELINES_EXT, but info.pPipelineInfo is null."); } else { - skip |= ValidateIndirectExecutionSetPipelineInfo(*pCreateInfo->info.pPipelineInfo, info_loc.dot(Field::pPipelineInfo)); + skip |= ValidateIndirectExecutionSetPipelineInfo(state, *pCreateInfo->info.pPipelineInfo, + info_loc.dot(Field::pPipelineInfo)); } } else if (pCreateInfo->type == VK_INDIRECT_EXECUTION_SET_INFO_TYPE_SHADER_OBJECTS_EXT) { if (!enabled_features.shaderObject) { @@ -145,21 +150,21 @@ bool StatelessValidation::manual_PreCallValidateCreateIndirectExecutionSetEXT( LogError("VUID-VkIndirectExecutionSetCreateInfoEXT-pShaderInfo-parameter", device, create_info_loc.dot(Field::type), "is VK_INDIRECT_EXECUTION_SET_INFO_TYPE_SHADER_OBJECTS_EXT, but info.pShaderInfo is null."); } else { - skip |= ValidateIndirectExecutionSetShaderInfo(*pCreateInfo->info.pShaderInfo, info_loc.dot(Field::pShaderInfo)); + skip |= ValidateIndirectExecutionSetShaderInfo(state, *pCreateInfo->info.pShaderInfo, info_loc.dot(Field::pShaderInfo)); } } return skip; -}; +} bool StatelessValidation::ValidateIndirectCommandsPushConstantToken( - const VkIndirectCommandsPushConstantTokenEXT& push_constant_token, VkIndirectCommandsTokenTypeEXT token_type, - const Location& push_constant_token_loc) const { + const vvl::stateless::State& state, const VkIndirectCommandsPushConstantTokenEXT& push_constant_token, + VkIndirectCommandsTokenTypeEXT token_type, const Location& push_constant_token_loc) const { bool skip = false; - skip |= ValidateFlags(push_constant_token_loc.dot(Field::updateRange).dot(Field::stageFlags), - vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, - push_constant_token.updateRange.stageFlags, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkPushConstantRange-stageFlags-parameter", "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); + skip |= state.ValidateFlags( + push_constant_token_loc.dot(Field::updateRange).dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, push_constant_token.updateRange.stageFlags, kRequiredFlags, + "VUID-VkPushConstantRange-stageFlags-parameter", "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); if (token_type == VK_INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXT && push_constant_token.updateRange.size != 4) { skip |= LogError("VUID-VkIndirectCommandsPushConstantTokenEXT-size-11133", device, @@ -169,15 +174,16 @@ bool StatelessValidation::ValidateIndirectCommandsPushConstantToken( } return skip; -}; +} -bool StatelessValidation::ValidateIndirectCommandsIndexBufferToken(const VkIndirectCommandsIndexBufferTokenEXT& index_buffer_token, +bool StatelessValidation::ValidateIndirectCommandsIndexBufferToken(const vvl::stateless::State& state, + const VkIndirectCommandsIndexBufferTokenEXT& index_buffer_token, const Location& index_buffer_token_loc) const { bool skip = false; - skip |= ValidateFlags(index_buffer_token_loc.dot(Field::mode), vvl::FlagBitmask::VkIndirectCommandsInputModeFlagBitsEXT, - AllVkIndirectCommandsInputModeFlagBitsEXT, index_buffer_token.mode, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkIndirectCommandsIndexBufferTokenEXT-mode-parameter", - "VUID-VkIndirectCommandsIndexBufferTokenEXT-mode-11135"); + skip |= state.ValidateFlags(index_buffer_token_loc.dot(Field::mode), vvl::FlagBitmask::VkIndirectCommandsInputModeFlagBitsEXT, + AllVkIndirectCommandsInputModeFlagBitsEXT, index_buffer_token.mode, kRequiredSingleBit, + "VUID-VkIndirectCommandsIndexBufferTokenEXT-mode-parameter", + "VUID-VkIndirectCommandsIndexBufferTokenEXT-mode-11135"); const auto& props = phys_dev_ext_props.device_generated_commands_props; if ((index_buffer_token.mode & props.supportedIndirectCommandsInputModes) == 0) { @@ -187,18 +193,19 @@ bool StatelessValidation::ValidateIndirectCommandsIndexBufferToken(const VkIndir string_VkIndirectCommandsInputModeFlagsEXT(props.supportedIndirectCommandsInputModes).c_str()); } return skip; -}; +} -bool StatelessValidation::ValidateIndirectCommandsExecutionSetToken(const VkIndirectCommandsExecutionSetTokenEXT& exe_set_token, +bool StatelessValidation::ValidateIndirectCommandsExecutionSetToken(const vvl::stateless::State& state, + const VkIndirectCommandsExecutionSetTokenEXT& exe_set_token, const Location& exe_set_token_loc) const { bool skip = false; - skip |= ValidateRangedEnum(exe_set_token_loc.dot(Field::type), vvl::Enum::VkIndirectExecutionSetInfoTypeEXT, exe_set_token.type, - "VUID-VkIndirectCommandsExecutionSetTokenEXT-type-parameter"); + skip |= state.ValidateRangedEnum(exe_set_token_loc.dot(Field::type), vvl::Enum::VkIndirectExecutionSetInfoTypeEXT, + exe_set_token.type, "VUID-VkIndirectCommandsExecutionSetTokenEXT-type-parameter"); - skip |= ValidateFlags(exe_set_token_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, exe_set_token.shaderStages, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkIndirectCommandsExecutionSetTokenEXT-shaderStages-parameter", - "VUID-VkIndirectCommandsExecutionSetTokenEXT-shaderStages-requiredbitmask"); + skip |= state.ValidateFlags(exe_set_token_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, exe_set_token.shaderStages, kRequiredFlags, + "VUID-VkIndirectCommandsExecutionSetTokenEXT-shaderStages-parameter", + "VUID-VkIndirectCommandsExecutionSetTokenEXT-shaderStages-requiredbitmask"); const auto& props = phys_dev_ext_props.device_generated_commands_props; if ((exe_set_token.shaderStages & (props.supportedIndirectCommandsShaderStagesPipelineBinding | @@ -213,9 +220,10 @@ bool StatelessValidation::ValidateIndirectCommandsExecutionSetToken(const VkIndi } return skip; -}; +} -bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const VkIndirectCommandsLayoutTokenEXT& token, +bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const vvl::stateless::State& state, + const VkIndirectCommandsLayoutTokenEXT& token, const Location& token_loc) const { bool skip = false; @@ -228,7 +236,7 @@ bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const VkIndirectCo LogError("VUID-VkIndirectCommandsLayoutTokenEXT-pPushConstant-parameter", device, token_loc.dot(Field::type), "is %s, but data.pPushConstant is null.", string_VkIndirectCommandsTokenTypeEXT(token.type)); } else { - skip |= ValidateIndirectCommandsPushConstantToken(*token.data.pPushConstant, token.type, + skip |= ValidateIndirectCommandsPushConstantToken(state, *token.data.pPushConstant, token.type, data_loc.dot(Field::pPushConstant)); } break; @@ -244,7 +252,8 @@ bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const VkIndirectCo skip |= LogError("VUID-VkIndirectCommandsLayoutTokenEXT-pIndexBuffer-parameter", device, token_loc.dot(Field::type), "is VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_EXT, but data.pIndexBuffer is null."); } else { - skip |= ValidateIndirectCommandsIndexBufferToken(*token.data.pIndexBuffer, data_loc.dot(Field::pIndexBuffer)); + skip |= + ValidateIndirectCommandsIndexBufferToken(state, *token.data.pIndexBuffer, data_loc.dot(Field::pIndexBuffer)); } break; case VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT: @@ -253,7 +262,8 @@ bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const VkIndirectCo LogError("VUID-VkIndirectCommandsLayoutTokenEXT-pExecutionSet-parameter", device, token_loc.dot(Field::type), "is VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT, but data.pExecutionSet is null."); } else { - skip |= ValidateIndirectCommandsExecutionSetToken(*token.data.pExecutionSet, data_loc.dot(Field::pExecutionSet)); + skip |= + ValidateIndirectCommandsExecutionSetToken(state, *token.data.pExecutionSet, data_loc.dot(Field::pExecutionSet)); } break; default: @@ -308,7 +318,8 @@ bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const VkIndirectCo return skip; } -bool StatelessValidation::ValidateIndirectCommandsLayoutStage(const VkIndirectCommandsLayoutTokenEXT& token, +bool StatelessValidation::ValidateIndirectCommandsLayoutStage(const vvl::stateless::State& state, + const VkIndirectCommandsLayoutTokenEXT& token, const Location& token_loc, VkShaderStageFlags shader_stages, bool has_stage_graphics, bool has_stage_compute, bool has_stage_ray_tracing, bool has_stage_mesh) const { @@ -372,8 +383,9 @@ bool StatelessValidation::ValidateIndirectCommandsLayoutStage(const VkIndirectCo bool StatelessValidation::manual_PreCallValidateCreateIndirectCommandsLayoutEXT( VkDevice device, const VkIndirectCommandsLayoutCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, - VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout, const ErrorObject& error_obj) const { + VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout, const vvl::stateless::State& state) const { bool skip = false; + const auto& error_obj = state.error_obj; if (!enabled_features.deviceGeneratedCommands) { skip |= LogError("VUID-vkCreateIndirectCommandsLayoutEXT-deviceGeneratedCommands-11089", device, error_obj.location, @@ -447,8 +459,8 @@ bool StatelessValidation::manual_PreCallValidateCreateIndirectCommandsLayoutEXT( for (uint32_t i = 0; i < pCreateInfo->tokenCount; ++i) { const Location token_loc = create_info_loc.dot(Field::pTokens, i); const auto& token = pCreateInfo->pTokens[i]; - skip |= ValidateIndirectCommandsLayoutToken(token, token_loc); - skip |= ValidateIndirectCommandsLayoutStage(token, token_loc, shader_stages, has_stage_graphics, has_stage_compute, + skip |= ValidateIndirectCommandsLayoutToken(state, token, token_loc); + skip |= ValidateIndirectCommandsLayoutStage(state, token, token_loc, shader_stages, has_stage_graphics, has_stage_compute, has_stage_ray_tracing, has_stage_mesh); if (token.type != VK_INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXT) { @@ -501,8 +513,9 @@ bool StatelessValidation::ValidateGeneratedCommandsInfo(VkCommandBuffer command_ bool StatelessValidation::manual_PreCallValidateCmdPreprocessGeneratedCommandsEXT( VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, VkCommandBuffer stateCommandBuffer, - const ErrorObject& error_obj) const { + const vvl::stateless::State& state) const { bool skip = false; + const auto& error_obj = state.error_obj; if (!enabled_features.deviceGeneratedCommands) { skip |= LogError("VUID-vkCmdPreprocessGeneratedCommandsEXT-deviceGeneratedCommands-11087", device, error_obj.location, "deviceGeneratedCommands feature was not enabled."); @@ -526,8 +539,9 @@ bool StatelessValidation::manual_PreCallValidateCmdPreprocessGeneratedCommandsEX bool StatelessValidation::manual_PreCallValidateCmdExecuteGeneratedCommandsEXT( VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, - const ErrorObject& error_obj) const { + const vvl::stateless::State& state) const { bool skip = false; + const auto& error_obj = state.error_obj; if (!enabled_features.deviceGeneratedCommands) { skip |= LogError("VUID-vkCmdExecuteGeneratedCommandsEXT-deviceGeneratedCommands-11059", device, error_obj.location, @@ -548,4 +562,4 @@ bool StatelessValidation::manual_PreCallValidateCmdExecuteGeneratedCommandsEXT( skip |= ValidateGeneratedCommandsInfo(commandBuffer, *pGeneratedCommandsInfo, info_loc); return skip; -} \ No newline at end of file +} diff --git a/layers/stateless/sl_device_memory.cpp b/layers/stateless/sl_device_memory.cpp index 7c9f5b65592..c0f439fed02 100644 --- a/layers/stateless/sl_device_memory.cpp +++ b/layers/stateless/sl_device_memory.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,8 +20,9 @@ bool StatelessValidation::manual_PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!pAllocateInfo) { return skip; @@ -92,8 +93,9 @@ bool StatelessValidation::ValidateDeviceImageMemoryRequirements(VkDevice device, bool StatelessValidation::manual_PreCallValidateGetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; skip |= ValidateDeviceImageMemoryRequirements(device, *pInfo, error_obj.location.dot(Field::pInfo)); @@ -102,8 +104,9 @@ bool StatelessValidation::manual_PreCallValidateGetDeviceImageMemoryRequirements bool StatelessValidation::manual_PreCallValidateGetDeviceImageSparseMemoryRequirements( VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements, const ErrorObject &error_obj) const { + VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; skip |= ValidateDeviceImageMemoryRequirements(device, *pInfo, error_obj.location.dot(Field::pInfo)); @@ -112,8 +115,9 @@ bool StatelessValidation::manual_PreCallValidateGetDeviceImageSparseMemoryRequir bool StatelessValidation::manual_PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; for (uint32_t bind_info_i = 0; bind_info_i < bindInfoCount; ++bind_info_i) { const VkBindSparseInfo &bind_info = pBindInfo[bind_info_i]; @@ -161,11 +165,12 @@ bool StatelessValidation::manual_PreCallValidateQueueBindSparse(VkQueue queue, u } bool StatelessValidation::manual_PreCallValidateSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!IsBetweenInclusive(priority, 0.0F, 1.0F)) { skip |= LogError("VUID-vkSetDeviceMemoryPriorityEXT-priority-06258", device, error_obj.location.dot(Field::priority), "is %f.", priority); } return skip; -} \ No newline at end of file +} diff --git a/layers/stateless/sl_external_object.cpp b/layers/stateless/sl_external_object.cpp index b7a9b3b9e63..c1b479523f0 100644 --- a/layers/stateless/sl_external_object.cpp +++ b/layers/stateless/sl_external_object.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,9 +21,10 @@ #include "generated/dispatch_functions.h" bool StatelessValidation::manual_PreCallValidateGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR *pGetFdInfo, int *pFd, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { constexpr auto allowed_types = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT | VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT; bool skip = false; + const auto &error_obj = state.error_obj; if (0 == (pGetFdInfo->handleType & allowed_types)) { skip |= LogError("VUID-VkMemoryGetFdInfoKHR-handleType-00672", pGetFdInfo->memory, error_obj.location.dot(Field::pGetFdInfo).dot(Field::handleType), @@ -37,8 +38,9 @@ bool StatelessValidation::manual_PreCallValidateGetMemoryFdKHR(VkDevice device, bool StatelessValidation::manual_PreCallValidateGetMemoryFdPropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR *pMemoryFdProperties, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (fd < 0) { skip |= LogError("VUID-vkGetMemoryFdPropertiesKHR-fd-00673", device, error_obj.location.dot(Field::fd), "handle (%d) is not a valid POSIX file descriptor.", fd); @@ -79,7 +81,8 @@ static constexpr VkExternalSemaphoreHandleTypeFlags kSemFdHandleTypes = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT | VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT; bool StatelessValidation::manual_PreCallValidateGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR *pGetFdInfo, - int *pFd, const ErrorObject &error_obj) const { + int *pFd, const vvl::stateless::State &state) const { + const auto &error_obj = state.error_obj; return ValidateExternalSemaphoreHandleType(pGetFdInfo->semaphore, "VUID-VkSemaphoreGetFdInfoKHR-handleType-01136", error_obj.location.dot(Field::pGetFdInfo).dot(Field::handleType), pGetFdInfo->handleType, kSemFdHandleTypes); @@ -87,8 +90,9 @@ bool StatelessValidation::manual_PreCallValidateGetSemaphoreFdKHR(VkDevice devic bool StatelessValidation::manual_PreCallValidateImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR *pImportSemaphoreFdInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location info_loc = error_obj.location.dot(Field::pImportSemaphoreFdInfo); skip |= ValidateExternalSemaphoreHandleType(pImportSemaphoreFdInfo->semaphore, "VUID-VkImportSemaphoreFdInfoKHR-handleType-01143", @@ -109,15 +113,16 @@ static constexpr VkExternalFenceHandleTypeFlags kFenceFdHandleTypes = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT | VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT; bool StatelessValidation::manual_PreCallValidateGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR *pGetFdInfo, int *pFd, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { return ValidateExternalFenceHandleType(pGetFdInfo->fence, "VUID-VkFenceGetFdInfoKHR-handleType-01456", - error_obj.location.dot(Field::pGetFdInfo).dot(Field::handleType), pGetFdInfo->handleType, - kFenceFdHandleTypes); + state.error_obj.location.dot(Field::pGetFdInfo).dot(Field::handleType), + pGetFdInfo->handleType, kFenceFdHandleTypes); } bool StatelessValidation::manual_PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR *pImportFenceFdInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location info_loc = error_obj.location.dot(Field::pImportFenceFdInfo); skip |= ValidateExternalFenceHandleType(pImportFenceFdInfo->fence, "VUID-VkImportFenceFdInfoKHR-handleType-01464", info_loc.dot(Field::handleType), pImportFenceFdInfo->handleType, kFenceFdHandleTypes); @@ -134,8 +139,9 @@ bool StatelessValidation::manual_PreCallValidateImportFenceFdKHR(VkDevice device bool StatelessValidation::manual_PreCallValidateGetMemoryHostPointerPropertiesEXT( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, - VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties, const ErrorObject &error_obj) const { + VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (handleType != VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT && handleType != VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT) { skip |= @@ -159,7 +165,7 @@ bool StatelessValidation::manual_PreCallValidateGetMemoryHostPointerPropertiesEX #ifdef VK_USE_PLATFORM_WIN32_KHR bool StatelessValidation::manual_PreCallValidateGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR *pGetWin32HandleInfo, - HANDLE *pHandle, const ErrorObject &error_obj) const { + HANDLE *pHandle, const vvl::stateless::State &state) const { constexpr VkExternalMemoryHandleTypeFlags nt_handles = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT; @@ -168,7 +174,7 @@ bool StatelessValidation::manual_PreCallValidateGetMemoryWin32HandleKHR(VkDevice bool skip = false; if ((pGetWin32HandleInfo->handleType & (nt_handles | global_share_handles)) == 0) { skip |= LogError("VUID-VkMemoryGetWin32HandleInfoKHR-handleType-00664", pGetWin32HandleInfo->memory, - error_obj.location.dot(Field::pGetWin32HandleInfo).dot(Field::handleType), + state.error_obj.location.dot(Field::pGetWin32HandleInfo).dot(Field::handleType), "(%s) is not one of the supported handle types (%s).", string_VkExternalMemoryHandleTypeFlagBits(pGetWin32HandleInfo->handleType), string_VkExternalMemoryHandleTypeFlags(nt_handles | global_share_handles).c_str()); @@ -178,8 +184,9 @@ bool StatelessValidation::manual_PreCallValidateGetMemoryWin32HandleKHR(VkDevice bool StatelessValidation::manual_PreCallValidateGetMemoryWin32HandlePropertiesKHR( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, - VkMemoryWin32HandlePropertiesKHR *pMemoryWin32HandleProperties, const ErrorObject &error_obj) const { + VkMemoryWin32HandlePropertiesKHR *pMemoryWin32HandleProperties, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (handle == NULL || handle == INVALID_HANDLE_VALUE) { static_assert(sizeof(HANDLE) == sizeof(uintptr_t)); // to use PRIxPTR for HANDLE formatting skip |= LogError("VUID-vkGetMemoryWin32HandlePropertiesKHR-handle-00665", device, error_obj.location.dot(Field::handle), @@ -200,8 +207,9 @@ static constexpr VkExternalSemaphoreHandleTypeFlags kSemWin32HandleTypes = VK_EX bool StatelessValidation::manual_PreCallValidateImportSemaphoreWin32HandleKHR(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR *info, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; skip |= ValidateExternalSemaphoreHandleType(info->semaphore, "VUID-VkImportSemaphoreWin32HandleInfoKHR-handleType-01140", @@ -226,9 +234,10 @@ bool StatelessValidation::manual_PreCallValidateImportSemaphoreWin32HandleKHR(Vk bool StatelessValidation::manual_PreCallValidateGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR *info, - HANDLE *pHandle, const ErrorObject &error_obj) const { + HANDLE *pHandle, + const vvl::stateless::State &state) const { return ValidateExternalSemaphoreHandleType(info->semaphore, "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01131", - error_obj.location.dot(Field::pGetWin32HandleInfo).dot(Field::handleType), + state.error_obj.location.dot(Field::pGetWin32HandleInfo).dot(Field::handleType), info->handleType, kSemWin32HandleTypes); } @@ -237,8 +246,9 @@ static constexpr VkExternalFenceHandleTypeFlags kFenceWin32HandleTypes = bool StatelessValidation::manual_PreCallValidateImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR *info, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; skip |= ValidateExternalFenceHandleType(info->fence, "VUID-VkImportFenceWin32HandleInfoKHR-handleType-01457", error_obj.location.dot(Field::pImportFenceWin32HandleInfo).dot(Field::handleType), info->handleType, kFenceWin32HandleTypes); @@ -259,7 +269,8 @@ bool StatelessValidation::manual_PreCallValidateImportFenceWin32HandleKHR(VkDevi } bool StatelessValidation::manual_PreCallValidateGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR *info, - HANDLE *pHandle, const ErrorObject &error_obj) const { + HANDLE *pHandle, const vvl::stateless::State &state) const { + const auto &error_obj = state.error_obj; return ValidateExternalFenceHandleType(info->fence, "VUID-VkFenceGetWin32HandleInfoKHR-handleType-01452", error_obj.location.dot(Field::pGetWin32HandleInfo).dot(Field::handleType), info->handleType, kFenceWin32HandleTypes); diff --git a/layers/stateless/sl_framebuffer.cpp b/layers/stateless/sl_framebuffer.cpp index d6b58f59cb3..3db313ffc27 100644 --- a/layers/stateless/sl_framebuffer.cpp +++ b/layers/stateless/sl_framebuffer.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,15 +20,17 @@ bool StatelessValidation::manual_PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkFramebuffer *pFramebuffer, const ErrorObject &error_obj) const { + VkFramebuffer *pFramebuffer, + const vvl::stateless::State &state) const { // Validation for pAttachments which is excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml bool skip = false; + const auto &error_obj = state.error_obj; const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); if ((pCreateInfo->flags & VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT) == 0) { - skip |= ValidateArray(create_info_loc.dot(Field::attachmentCount), error_obj.location.dot(Field::pAttachments), - pCreateInfo->attachmentCount, &pCreateInfo->pAttachments, false, true, kVUIDUndefined, - "VUID-VkFramebufferCreateInfo-flags-02778"); + skip |= state.ValidateArray(create_info_loc.dot(Field::attachmentCount), error_obj.location.dot(Field::pAttachments), + pCreateInfo->attachmentCount, &pCreateInfo->pAttachments, false, true, kVUIDUndefined, + "VUID-VkFramebufferCreateInfo-flags-02778"); } else { if (!enabled_features.imagelessFramebuffer) { skip |= LogError("VUID-VkFramebufferCreateInfo-flags-03189", device, create_info_loc.dot(Field::flags), diff --git a/layers/stateless/sl_image.cpp b/layers/stateless/sl_image.cpp index 7fb79b3b7e9..293838d6f1a 100644 --- a/layers/stateless/sl_image.cpp +++ b/layers/stateless/sl_image.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,8 +24,9 @@ bool StatelessValidation::manual_PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pCreateInfo == nullptr) { return skip; @@ -48,17 +49,17 @@ bool StatelessValidation::manual_PreCallValidateCreateImage(VkDevice device, con } } - skip |= ValidateNotZero(pCreateInfo->extent.width == 0, "VUID-VkImageCreateInfo-extent-00944", - create_info_loc.dot(Field::extent).dot(Field::width)); - skip |= ValidateNotZero(pCreateInfo->extent.height == 0, "VUID-VkImageCreateInfo-extent-00945", - create_info_loc.dot(Field::extent).dot(Field::height)); - skip |= ValidateNotZero(pCreateInfo->extent.depth == 0, "VUID-VkImageCreateInfo-extent-00946", - create_info_loc.dot(Field::extent).dot(Field::depth)); + skip |= state.ValidateNotZero(pCreateInfo->extent.width == 0, "VUID-VkImageCreateInfo-extent-00944", + create_info_loc.dot(Field::extent).dot(Field::width)); + skip |= state.ValidateNotZero(pCreateInfo->extent.height == 0, "VUID-VkImageCreateInfo-extent-00945", + create_info_loc.dot(Field::extent).dot(Field::height)); + skip |= state.ValidateNotZero(pCreateInfo->extent.depth == 0, "VUID-VkImageCreateInfo-extent-00946", + create_info_loc.dot(Field::extent).dot(Field::depth)); - skip |= ValidateNotZero(pCreateInfo->mipLevels == 0, "VUID-VkImageCreateInfo-mipLevels-00947", - create_info_loc.dot(Field::mipLevels)); - skip |= ValidateNotZero(pCreateInfo->arrayLayers == 0, "VUID-VkImageCreateInfo-arrayLayers-00948", - create_info_loc.dot(Field::arrayLayers)); + skip |= state.ValidateNotZero(pCreateInfo->mipLevels == 0, "VUID-VkImageCreateInfo-mipLevels-00947", + create_info_loc.dot(Field::mipLevels)); + skip |= state.ValidateNotZero(pCreateInfo->arrayLayers == 0, "VUID-VkImageCreateInfo-arrayLayers-00948", + create_info_loc.dot(Field::arrayLayers)); // InitialLayout must be PREINITIALIZED or UNDEFINED if ((pCreateInfo->initialLayout != VK_IMAGE_LAYOUT_UNDEFINED) && @@ -157,7 +158,7 @@ bool StatelessValidation::manual_PreCallValidateCreateImage(VkDevice device, con skip |= ValidateCreateImageFragmentShadingRate(*pCreateInfo, create_info_loc); skip |= ValidateCreateImageCornerSampled(*pCreateInfo, create_info_loc); skip |= ValidateCreateImageStencilUsage(*pCreateInfo, create_info_loc); - skip |= ValidateCreateImageCompressionControl(*pCreateInfo, create_info_loc); + skip |= ValidateCreateImageCompressionControl(state, *pCreateInfo, create_info_loc); skip |= ValidateCreateImageSwapchain(*pCreateInfo, create_info_loc); skip |= ValidateCreateImageFormatList(*pCreateInfo, create_info_loc); skip |= ValidateCreateImageMetalObject(*pCreateInfo, create_info_loc); @@ -520,16 +521,17 @@ bool StatelessValidation::ValidateCreateImageStencilUsage(const VkImageCreateInf return skip; } -bool StatelessValidation::ValidateCreateImageCompressionControl(const VkImageCreateInfo &create_info, +bool StatelessValidation::ValidateCreateImageCompressionControl(const vvl::stateless::State &state, + const VkImageCreateInfo &create_info, const Location &create_info_loc) const { bool skip = false; const auto image_compression_control = vku::FindStructInPNextChain(create_info.pNext); if (!image_compression_control) return skip; - skip |= ValidateFlags(create_info_loc.pNext(Struct::VkImageCompressionControlEXT, Field::flags), - vvl::FlagBitmask::VkImageCompressionFlagBitsEXT, AllVkImageCompressionFlagBitsEXT, - image_compression_control->flags, kOptionalSingleBit, VK_NULL_HANDLE, - "VUID-VkImageCompressionControlEXT-flags-06747"); + skip |= + state.ValidateFlags(create_info_loc.pNext(Struct::VkImageCompressionControlEXT, Field::flags), + vvl::FlagBitmask::VkImageCompressionFlagBitsEXT, AllVkImageCompressionFlagBitsEXT, + image_compression_control->flags, kOptionalSingleBit, "VUID-VkImageCompressionControlEXT-flags-06747"); if (image_compression_control->flags == VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT && !image_compression_control->pFixedRateFlags) { @@ -799,8 +801,9 @@ bool StatelessValidation::ValidateCreateImageDrmFormatModifiers(const VkImageCre bool StatelessValidation::manual_PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pCreateInfo == nullptr) { return skip; @@ -866,8 +869,9 @@ bool StatelessValidation::manual_PreCallValidateCreateImageView(VkDevice device, bool StatelessValidation::manual_PreCallValidateGetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo *pInfo, VkSubresourceLayout2 *pLayout, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location info_loc = error_obj.location.dot(Field::pInfo); const Location create_info_loc = info_loc.dot(Field::pCreateInfo); const Location subresource_loc = info_loc.dot(Field::pSubresource); diff --git a/layers/stateless/sl_instance_device.cpp b/layers/stateless/sl_instance_device.cpp index 0642df450cf..fa785a5071a 100644 --- a/layers/stateless/sl_instance_device.cpp +++ b/layers/stateless/sl_instance_device.cpp @@ -17,6 +17,7 @@ */ #include "stateless/stateless_validation.h" +#include "generated/enum_flag_bits.h" #include "generated/dispatch_functions.h" // Traits objects to allow string_join to operate on collections of const char * @@ -109,19 +110,31 @@ ExtEnabled ExtensionStateByName(const ExtensionState &extensions, vvl::Extension return state; } -bool StatelessValidation::manual_PreCallValidateCreateInstance(const VkInstanceCreateInfo *pCreateInfo, - const VkAllocationCallbacks *pAllocator, VkInstance *pInstance, - const ErrorObject &error_obj) const { +bool StatelessValidation::PreCallValidateCreateInstance(const VkInstanceCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkInstance *pInstance, + const ErrorObject &error_obj) const { bool skip = false; - const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); + Location loc = error_obj.location; // Note: From the spec-- // Providing a NULL VkInstanceCreateInfo::pApplicationInfo or providing an apiVersion of 0 is equivalent to providing // an apiVersion of VK_MAKE_VERSION(1, 0, 0). (a.k.a. VK_API_VERSION_1_0) - uint32_t local_api_version = (pCreateInfo->pApplicationInfo && pCreateInfo->pApplicationInfo->apiVersion) - ? pCreateInfo->pApplicationInfo->apiVersion - : VK_API_VERSION_1_0; + uint32_t local_api_version = (pCreateInfo->pApplicationInfo ? pCreateInfo->pApplicationInfo->apiVersion : VK_API_VERSION_1_0); + // Create and use a local instance extension object, as an actual instance has not been created yet + InstanceExtensions local_instance_extensions(local_api_version, pCreateInfo); + DeviceExtensions local_device_extensions(local_instance_extensions, local_api_version); + vvl::stateless::State state(*this, error_obj, local_device_extensions); + + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, true, + "VUID-vkCreateInstance-pCreateInfo-parameter", "VUID-VkInstanceCreateInfo-sType-sType"); + + if (pAllocator != nullptr) { + [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + } + skip |= state.ValidateRequiredPointer(loc.dot(Field::pInstance), pInstance, "VUID-vkCreateInstance-pInstance-parameter"); uint32_t api_version_nopatch = VK_MAKE_VERSION(VK_VERSION_MAJOR(local_api_version), VK_VERSION_MINOR(local_api_version), 0); + const Location create_info_loc = loc.dot(Field::pCreateInfo); if (api_version != api_version_nopatch) { if ((api_version_nopatch < VK_API_VERSION_1_0) && (local_api_version != 0)) { skip |= LogError("VUID-VkApplicationInfo-apiVersion-04010", instance, @@ -137,10 +150,32 @@ bool StatelessValidation::manual_PreCallValidateCreateInstance(const VkInstanceC } } - // Create and use a local instance extension object, as an actual instance has not been created yet - uint32_t specified_version = (pCreateInfo->pApplicationInfo ? pCreateInfo->pApplicationInfo->apiVersion : VK_API_VERSION_1_0); - InstanceExtensions local_instance_extensions; - local_instance_extensions.InitFromInstanceCreateInfo(specified_version, pCreateInfo); + if (pCreateInfo != nullptr) { + skip |= state.ValidateFlags(create_info_loc.dot(Field::flags), vvl::FlagBitmask::VkInstanceCreateFlagBits, + AllVkInstanceCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkInstanceCreateInfo-flags-parameter"); + + skip |= state.ValidateStructType( + create_info_loc.dot(Field::pApplicationInfo), pCreateInfo->pApplicationInfo, VK_STRUCTURE_TYPE_APPLICATION_INFO, false, + "VUID-VkInstanceCreateInfo-pApplicationInfo-parameter", "VUID-VkApplicationInfo-sType-sType"); + + if (pCreateInfo->pApplicationInfo != nullptr) { + [[maybe_unused]] const Location pApplicationInfo_loc = create_info_loc.dot(Field::pApplicationInfo); + skip |= + state.ValidateStructPnext(pApplicationInfo_loc, pCreateInfo->pApplicationInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkApplicationInfo-pNext-pNext", kVUIDUndefined, true); + } + + skip |= state.ValidateStringArray(create_info_loc.dot(Field::enabledLayerCount), + create_info_loc.dot(Field::ppEnabledLayerNames), pCreateInfo->enabledLayerCount, + pCreateInfo->ppEnabledLayerNames, false, true, kVUIDUndefined, + "VUID-VkInstanceCreateInfo-ppEnabledLayerNames-parameter"); + + skip |= state.ValidateStringArray(create_info_loc.dot(Field::enabledExtensionCount), + create_info_loc.dot(Field::ppEnabledExtensionNames), pCreateInfo->enabledExtensionCount, + pCreateInfo->ppEnabledExtensionNames, false, true, kVUIDUndefined, + "VUID-VkInstanceCreateInfo-ppEnabledExtensionNames-parameter"); + } for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { vvl::Extension extension = GetExtension(pCreateInfo->ppEnabledExtensionNames[i]); @@ -154,7 +189,49 @@ bool StatelessValidation::manual_PreCallValidateCreateInstance(const VkInstanceC "ppEnabledExtensionNames does not include VK_KHR_portability_enumeration"); } +#ifdef VK_USE_PLATFORM_METAL_EXT + auto export_metal_object_info = vku::FindStructInPNextChain(pCreateInfo->pNext); + while (export_metal_object_info) { + if ((export_metal_object_info->exportObjectType != VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT) && + (export_metal_object_info->exportObjectType != VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT)) { + skip |= LogError("VUID-VkInstanceCreateInfo-pNext-06779", instance, error_obj.location, + "The pNext chain contains a VkExportMetalObjectCreateInfoEXT whose " + "exportObjectType = %s, but only VkExportMetalObjectCreateInfoEXT structs with exportObjectType of " + "VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT or " + "VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT are allowed", + string_VkExportMetalObjectTypeFlagBitsEXT(export_metal_object_info->exportObjectType)); + } + export_metal_object_info = vku::FindStructInPNextChain(export_metal_object_info->pNext); + } +#endif // VK_USE_PLATFORM_METAL_EXT + + // avoid redundant pNext-pNext errors from the cases where we have specific VUs by returning early + const auto *debug_report_callback = vku::FindStructInPNextChain(pCreateInfo->pNext); + if (debug_report_callback && !local_instance_extensions.vk_ext_debug_report) { + skip |= LogError("VUID-VkInstanceCreateInfo-pNext-04925", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), + "does not include VK_EXT_debug_report, but the pNext chain includes VkDebugReportCallbackCreateInfoEXT."); + return skip; + } + const auto *debug_utils_messenger = vku::FindStructInPNextChain(pCreateInfo->pNext); + if (debug_utils_messenger && !local_instance_extensions.vk_ext_debug_utils) { + skip |= LogError("VUID-VkInstanceCreateInfo-pNext-04926", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), + "does not include VK_EXT_debug_utils, but the pNext chain includes VkDebugUtilsMessengerCreateInfoEXT."); + return skip; + } + const auto *direct_driver_loading_list = vku::FindStructInPNextChain(pCreateInfo->pNext); + if (direct_driver_loading_list && !local_instance_extensions.vk_lunarg_direct_driver_loading) { + skip |= LogError( + "VUID-VkInstanceCreateInfo-pNext-09400", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), + "does not include VK_LUNARG_direct_driver_loading, but the pNext chain includes VkDirectDriverLoadingListLUNARG."); + return skip; + } + const auto *validation_features = vku::FindStructInPNextChain(pCreateInfo->pNext); + if (validation_features && !local_instance_extensions.vk_ext_validation_features) { + skip |= LogError("VUID-VkInstanceCreateInfo-pNext-10243", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), + "does not include VK_EXT_validation_features, but the pNext chain includes VkValidationFeaturesEXT"); + return skip; + } if (validation_features) { bool debug_printf = false; bool gpu_assisted = false; @@ -185,64 +262,17 @@ bool StatelessValidation::manual_PreCallValidateCreateInstance(const VkInstanceC } } - if (!local_instance_extensions.vk_ext_debug_report && - vku::FindStructInPNextChain(pCreateInfo->pNext)) { - skip |= LogError("VUID-VkInstanceCreateInfo-pNext-04925", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), - "does not include VK_EXT_debug_report, but the pNext chain includes VkDebugReportCallbackCreateInfoEXT."); - } - if (!local_instance_extensions.vk_ext_debug_utils && - vku::FindStructInPNextChain(pCreateInfo->pNext)) { - skip |= LogError("VUID-VkInstanceCreateInfo-pNext-04926", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), - "does not include VK_EXT_debug_utils, but the pNext chain includes VkDebugUtilsMessengerCreateInfoEXT."); - } - if (!local_instance_extensions.vk_lunarg_direct_driver_loading && - vku::FindStructInPNextChain(pCreateInfo->pNext)) { - skip |= LogError( - "VUID-VkInstanceCreateInfo-pNext-09400", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), - "does not include VK_LUNARG_direct_driver_loading, but the pNext chain includes VkDirectDriverLoadingListLUNARG."); - } + constexpr std::array allowed_structs_VkInstanceCreateInfo = {VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, + VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT, + VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_LIST_LUNARG, + VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT, + VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, + VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT, + VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT}; -#ifdef VK_USE_PLATFORM_METAL_EXT - auto export_metal_object_info = vku::FindStructInPNextChain(pCreateInfo->pNext); - while (export_metal_object_info) { - if ((export_metal_object_info->exportObjectType != VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT) && - (export_metal_object_info->exportObjectType != VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT)) { - skip |= LogError("VUID-VkInstanceCreateInfo-pNext-06779", instance, error_obj.location, - "The pNext chain contains a VkExportMetalObjectCreateInfoEXT whose " - "exportObjectType = %s, but only VkExportMetalObjectCreateInfoEXT structs with exportObjectType of " - "VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT or " - "VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT are allowed", - string_VkExportMetalObjectTypeFlagBitsEXT(export_metal_object_info->exportObjectType)); - } - export_metal_object_info = vku::FindStructInPNextChain(export_metal_object_info->pNext); - } -#endif // VK_USE_PLATFORM_METAL_EXT - -// These were attempted to be turned on, but ran into a series of issues with CI machines. Basically adding these require our -// testing to also include the extension, which in turns will fail on machines with an older loader. -// TODO - Enable these once we have a way to add AddRequiredExtensions(VK_EXT_LAYER_SETTINGS_EXTENSION_NAME); to tests -#if 0 - // These are extensions/structs implemented in the Validation Layers itself, in theory, the extension string is not needed, but - // good to have for completeness. - if (!local_instance_extensions.vk_ext_layer_settings && - vku::FindStructInPNextChain(pCreateInfo->pNext)) { - skip |= LogWarning("VUID-VkInstanceCreateInfo-pNext-10242", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), - "does not include VK_EXT_layer_settings, but the pNext chain includes VkLayerSettingsCreateInfoEXT. " - "(Most layers, including Validation, will still work regardless of the extension included)"); - } - if (!local_instance_extensions.vk_ext_validation_features && - vku::FindStructInPNextChain(pCreateInfo->pNext)) { - skip |= LogWarning("VUID-VkInstanceCreateInfo-pNext-10243", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), - "does not include VK_EXT_validation_features, but the pNext chain includes VkValidationFeaturesEXT. " - "(Most layers, including Validation, will still work regardless of the extension included)"); - } - if (!local_instance_extensions.vk_ext_validation_flags && - vku::FindStructInPNextChain(pCreateInfo->pNext)) { - skip |= LogWarning("VUID-VkInstanceCreateInfo-pNext-10244", instance, create_info_loc.dot(Field::ppEnabledExtensionNames), - "does not include VK_EXT_validation_flags, but the pNext chain includes VkValidationFlagsEXT. (Most " - "layers, including Validation, will still work regardless of the extension included)"); - } -#endif + skip |= state.ValidateStructPnext(create_info_loc, pCreateInfo->pNext, allowed_structs_VkInstanceCreateInfo.size(), + allowed_structs_VkInstanceCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkInstanceCreateInfo-pNext-pNext", "VUID-VkInstanceCreateInfo-sType-unique", true); return skip; } @@ -259,15 +289,15 @@ void StatelessValidation::CommonPostCallRecordEnumeratePhysicalDevice(const VkPh // Enumerate the Device Ext Properties to save the PhysicalDevice supported extension state uint32_t ext_count = 0; - vvl::unordered_set dev_exts_enumerated{}; + std::vector ext_props{}; DispatchEnumerateDeviceExtensionProperties(phys_device, nullptr, &ext_count, nullptr); ext_props.resize(ext_count); DispatchEnumerateDeviceExtensionProperties(phys_device, nullptr, &ext_count, ext_props.data()); + + DeviceExtensions phys_dev_exts(instance_extensions, phys_dev_props->apiVersion, ext_props); for (uint32_t j = 0; j < ext_count; j++) { vvl::Extension extension = GetExtension(ext_props[j].extensionName); - dev_exts_enumerated.insert(extension); - if (extension == vvl::Extension::_VK_EXT_discard_rectangles) { discard_rectangles_extension_version = ext_props[j].specVersion; } else if (extension == vvl::Extension::_VK_NV_scissor_exclusive) { @@ -275,7 +305,7 @@ void StatelessValidation::CommonPostCallRecordEnumeratePhysicalDevice(const VkPh } } - device_extensions_enumerated[phys_device] = std::move(dev_exts_enumerated); + physical_device_extensions[phys_device] = std::move(phys_dev_exts); } } } @@ -441,18 +471,19 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe bool StatelessValidation::manual_PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); for (size_t i = 0; i < pCreateInfo->enabledLayerCount; i++) { - skip |= ValidateString(create_info_loc.dot(Field::ppEnabledLayerNames), - "VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter", pCreateInfo->ppEnabledLayerNames[i]); + skip |= state.ValidateString(create_info_loc.dot(Field::ppEnabledLayerNames), + "VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter", pCreateInfo->ppEnabledLayerNames[i]); } // If this device supports VK_KHR_portability_subset, it must be enabled - const auto &exposed_extensions = device_extensions_enumerated.at(physicalDevice); - const bool portability_supported = - exposed_extensions.find(vvl::Extension::_VK_KHR_portability_subset) != exposed_extensions.end(); + const auto &exposed_extensions = physical_device_extensions.at(physicalDevice); + const bool portability_supported = exposed_extensions.vk_khr_portability_subset; bool portability_requested = false; bool fragmentmask_requested = false; @@ -460,9 +491,9 @@ bool StatelessValidation::manual_PreCallValidateCreateDevice(VkPhysicalDevice ph for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { vvl::Extension extension = GetExtension(pCreateInfo->ppEnabledExtensionNames[i]); enabled_extensions.insert(extension); - skip |= - ValidateString(create_info_loc.dot(Field::ppEnabledExtensionNames), - "VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter", pCreateInfo->ppEnabledExtensionNames[i]); + skip |= state.ValidateString(create_info_loc.dot(Field::ppEnabledExtensionNames), + "VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter", + pCreateInfo->ppEnabledExtensionNames[i]); skip |= ValidateExtensionReqs(device_extensions, "VUID-vkCreateDevice-ppEnabledExtensionNames-01387", "device", extension, create_info_loc.dot(Field::ppEnabledExtensionNames, i)); if (extension == vvl::Extension::_VK_KHR_portability_subset) { @@ -936,8 +967,9 @@ bool StatelessValidation::manual_PreCallValidateCreateDevice(VkPhysicalDevice ph bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceImageFormatProperties2( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, - VkImageFormatProperties2 *pImageFormatProperties, const ErrorObject &error_obj) const { + VkImageFormatProperties2 *pImageFormatProperties, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pImageFormatInfo != nullptr) { const Location format_info_loc = error_obj.location.dot(Field::pImageFormatInfo); @@ -1026,8 +1058,9 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceImageFormatProp bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceImageFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, - VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties, const ErrorObject &error_obj) const { + VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { skip |= LogError("VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-02248", physicalDevice, @@ -1039,8 +1072,9 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceImageFormatProp bool StatelessValidation::manual_PreCallValidateSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location name_info_loc = error_obj.location.dot(Field::pNameInfo); if (pNameInfo->objectType == VK_OBJECT_TYPE_UNKNOWN) { skip |= LogError("VUID-vkSetDebugUtilsObjectNameEXT-pNameInfo-02587", device, name_info_loc.dot(Field::objectType), @@ -1061,8 +1095,9 @@ bool StatelessValidation::manual_PreCallValidateSetDebugUtilsObjectNameEXT(VkDev bool StatelessValidation::manual_PreCallValidateSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pTagInfo->objectType == VK_OBJECT_TYPE_UNKNOWN) { skip |= LogError("VUID-VkDebugUtilsObjectTagInfoEXT-objectType-01908", device, error_obj.location.dot(Field::pTagInfo).dot(Field::objectType), "cannot be VK_OBJECT_TYPE_UNKNOWN."); @@ -1072,8 +1107,9 @@ bool StatelessValidation::manual_PreCallValidateSetDebugUtilsObjectTagEXT(VkDevi bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const auto *api_props_lists = vku::FindStructInPNextChain(pProperties->pNext); if (api_props_lists && api_props_lists->pLayeredApis) { for (uint32_t i = 0; i < api_props_lists->layeredApiCount; i++) { diff --git a/layers/stateless/sl_pipeline.cpp b/layers/stateless/sl_pipeline.cpp index f215bf4bb78..089c6936009 100644 --- a/layers/stateless/sl_pipeline.cpp +++ b/layers/stateless/sl_pipeline.cpp @@ -25,22 +25,26 @@ bool StatelessValidation::manual_PreCallValidateCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + constexpr std::array allowed_structs = {VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(error_obj.location.dot(Field::pCreateInfo), pCreateInfo->pNext, allowed_structs.size(), - allowed_structs.data(), GeneratedVulkanHeaderVersion, "VUID-vkCreateShaderModule-pCreateInfo-06904", - "VUID-vkCreateShaderModule-pCreateInfo-06904", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(error_obj.location.dot(Field::pCreateInfo), pCreateInfo->pNext, allowed_structs.size(), + allowed_structs.data(), GeneratedVulkanHeaderVersion, + "VUID-vkCreateShaderModule-pCreateInfo-06904", "VUID-vkCreateShaderModule-pCreateInfo-06904", + true); return skip; } bool StatelessValidation::manual_PreCallValidateCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); // Validate layout count against device physical limit if (pCreateInfo->setLayoutCount > device_limits.maxBoundDescriptorSets) { @@ -123,12 +127,14 @@ bool StatelessValidation::ValidatePushConstantRange(uint32_t push_constant_range } // Called from graphics, compute, raytracing, etc -bool StatelessValidation::ValidatePipelineShaderStageCreateInfoCommon(const VkPipelineShaderStageCreateInfo &create_info, +bool StatelessValidation::ValidatePipelineShaderStageCreateInfoCommon(const vvl::stateless::State &state, + const VkPipelineShaderStageCreateInfo &create_info, const Location &loc) const { bool skip = false; if (create_info.pName) { - skip |= ValidateString(loc.dot(Field::pName), "VUID-VkPipelineShaderStageCreateInfo-pName-parameter", create_info.pName); + skip |= + state.ValidateString(loc.dot(Field::pName), "VUID-VkPipelineShaderStageCreateInfo-pName-parameter", create_info.pName); } if (vku::FindStructInPNextChain(create_info.pNext)) { @@ -203,14 +209,15 @@ bool StatelessValidation::ValidatePipelineBinaryInfo(const void *next, VkPipelin return skip; } -bool StatelessValidation::ValidatePipelineRenderingCreateInfo(const VkPipelineRenderingCreateInfo &rendering_struct, +bool StatelessValidation::ValidatePipelineRenderingCreateInfo(const vvl::stateless::State &state, + const VkPipelineRenderingCreateInfo &rendering_struct, const Location &loc) const { bool skip = false; if ((rendering_struct.depthAttachmentFormat != VK_FORMAT_UNDEFINED)) { - skip |= - ValidateRangedEnum(loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::depthAttachmentFormat), vvl::Enum::VkFormat, - rendering_struct.depthAttachmentFormat, "VUID-VkGraphicsPipelineCreateInfo-renderPass-06583"); + skip |= state.ValidateRangedEnum(loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::depthAttachmentFormat), + vvl::Enum::VkFormat, rendering_struct.depthAttachmentFormat, + "VUID-VkGraphicsPipelineCreateInfo-renderPass-06583"); if (!vkuFormatHasDepth(rendering_struct.depthAttachmentFormat)) { skip |= LogError("VUID-VkGraphicsPipelineCreateInfo-renderPass-06587", device, @@ -221,9 +228,9 @@ bool StatelessValidation::ValidatePipelineRenderingCreateInfo(const VkPipelineRe } if ((rendering_struct.stencilAttachmentFormat != VK_FORMAT_UNDEFINED)) { - skip |= ValidateRangedEnum(loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::stencilAttachmentFormat), - vvl::Enum::VkFormat, rendering_struct.stencilAttachmentFormat, - "VUID-VkGraphicsPipelineCreateInfo-renderPass-06584"); + skip |= state.ValidateRangedEnum(loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::stencilAttachmentFormat), + vvl::Enum::VkFormat, rendering_struct.stencilAttachmentFormat, + "VUID-VkGraphicsPipelineCreateInfo-renderPass-06584"); if (!vkuFormatHasStencil(rendering_struct.stencilAttachmentFormat)) { skip |= LogError("VUID-VkGraphicsPipelineCreateInfo-renderPass-06588", device, loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::stencilAttachmentFormat), @@ -233,7 +240,7 @@ bool StatelessValidation::ValidatePipelineRenderingCreateInfo(const VkPipelineRe } if (rendering_struct.colorAttachmentCount != 0) { - skip |= ValidateRangedEnumArray( + skip |= state.ValidateRangedEnumArray( loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::colorAttachmentCount), loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::pColorAttachmentFormats), vvl::Enum::VkFormat, rendering_struct.colorAttachmentCount, rendering_struct.pColorAttachmentFormats, true, true, @@ -248,9 +255,9 @@ bool StatelessValidation::ValidatePipelineRenderingCreateInfo(const VkPipelineRe if (rendering_struct.pColorAttachmentFormats) { for (uint32_t j = 0; j < rendering_struct.colorAttachmentCount; ++j) { - skip |= ValidateRangedEnum(loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::pColorAttachmentFormats, j), - vvl::Enum::VkFormat, rendering_struct.pColorAttachmentFormats[j], - "VUID-VkGraphicsPipelineCreateInfo-renderPass-06580"); + skip |= state.ValidateRangedEnum(loc.pNext(Struct::VkPipelineRenderingCreateInfo, Field::pColorAttachmentFormats, j), + vvl::Enum::VkFormat, rendering_struct.pColorAttachmentFormats[j], + "VUID-VkGraphicsPipelineCreateInfo-renderPass-06580"); } } @@ -353,8 +360,9 @@ bool StatelessValidation::ValidateCreateGraphicsPipelinesFlags(const VkPipelineC bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, - const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, const ErrorObject &error_obj) const { + const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!pCreateInfos) { return skip; @@ -372,9 +380,8 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( const Location flags_loc = create_flags_2 ? create_info_loc.pNext(Struct::VkPipelineCreateFlags2CreateInfo, Field::flags) : create_info_loc.dot(Field::flags); if (!create_flags_2) { - skip |= - ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, create_info.flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkGraphicsPipelineCreateInfo-None-09497"); + skip |= state.ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, + create_info.flags, kOptionalFlags, "VUID-VkGraphicsPipelineCreateInfo-None-09497"); } skip |= ValidateCreateGraphicsPipelinesFlags(flags, flags_loc); @@ -418,17 +425,17 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( (create_info.pColorBlendState && create_info.pMultisampleState)) { const auto rendering_struct = vku::FindStructInPNextChain(create_info.pNext); if (rendering_struct) { - skip |= ValidatePipelineRenderingCreateInfo(*rendering_struct, create_info_loc); + skip |= ValidatePipelineRenderingCreateInfo(state, *rendering_struct, create_info_loc); } // VkAttachmentSampleCountInfoAMD == VkAttachmentSampleCountInfoNV auto attachment_sample_count_info = vku::FindStructInPNextChain(create_info.pNext); if (attachment_sample_count_info && attachment_sample_count_info->pColorAttachmentSamples) { for (uint32_t j = 0; j < attachment_sample_count_info->colorAttachmentCount; ++j) { - skip |= ValidateFlags( + skip |= state.ValidateFlags( create_info_loc.pNext(Struct::VkAttachmentSampleCountInfoAMD, Field::pColorAttachmentSamples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, - attachment_sample_count_info->pColorAttachmentSamples[j], kRequiredFlags, VK_NULL_HANDLE, + attachment_sample_count_info->pColorAttachmentSamples[j], kRequiredFlags, "VUID-VkGraphicsPipelineCreateInfo-pColorAttachmentSamples-06592"); } } @@ -443,22 +450,23 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( "is 0, but %s is not enabled", VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME); } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( create_info_loc.dot(Field::stageCount), create_info_loc.dot(Field::pStages), create_info.stageCount, create_info.pStages, VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, true, true, "VUID-VkPipelineShaderStageCreateInfo-sType-sType", "VUID-VkGraphicsPipelineCreateInfo-pStages-06600", "VUID-VkGraphicsPipelineCreateInfo-pStages-06600"); // Can be null with enough dynamic states - skip |= ValidateStructType(create_info_loc.dot(Field::pRasterizationState), create_info.pRasterizationState, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, false, - "VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-09040", - "VUID-VkPipelineRasterizationStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(create_info_loc.dot(Field::pRasterizationState), create_info.pRasterizationState, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, false, + "VUID-VkGraphicsPipelineCreateInfo-pRasterizationState-09040", + "VUID-VkPipelineRasterizationStateCreateInfo-sType-sType"); } if (graphics_lib_info && (graphics_lib_info->flags & (VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT))) { - skip |= ValidateArray(create_info_loc.dot(Field::stageCount), create_info_loc.dot(Field::pStages), - create_info.stageCount, &create_info.pStages, true, true, - "VUID-VkGraphicsPipelineCreateInfo-flags-06644", "VUID-VkGraphicsPipelineCreateInfo-flags-06640"); + skip |= state.ValidateArray(create_info_loc.dot(Field::stageCount), create_info_loc.dot(Field::pStages), + create_info.stageCount, &create_info.pStages, true, true, + "VUID-VkGraphicsPipelineCreateInfo-flags-06644", + "VUID-VkGraphicsPipelineCreateInfo-flags-06640"); } // @@ -557,20 +565,20 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( active_shaders |= create_info.pStages[stage_index].stage; const Location stage_loc = create_info_loc.dot(Field::pStages, stage_index); - skip |= ValidateStructType(stage_loc, &create_info.pStages[stage_index], - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineShaderStageCreateInfo-sType-sType"); + skip |= state.ValidateStructType(stage_loc, &create_info.pStages[stage_index], + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineShaderStageCreateInfo-sType-sType"); // special graphics-only generated call - skip |= ValidatePipelineShaderStageCreateInfo(create_info.pStages[stage_index], stage_loc); - skip |= ValidatePipelineShaderStageCreateInfoCommon(create_info.pStages[stage_index], stage_loc); + skip |= ValidatePipelineShaderStageCreateInfo(state, create_info.pStages[stage_index], stage_loc); + skip |= ValidatePipelineShaderStageCreateInfoCommon(state, create_info.pStages[stage_index], stage_loc); } } if (has_pre_raster_state && (active_shaders & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT) && (active_shaders & VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT)) { if (create_info.pTessellationState) { - skip |= ValidatePipelineTessellationStateCreateInfo(*create_info.pTessellationState, + skip |= ValidatePipelineTessellationStateCreateInfo(state, *create_info.pTessellationState, create_info_loc.dot(Field::pTessellationState)); const bool has_dynamic_patch_control_points = @@ -587,7 +595,7 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( } if (!(active_shaders & VK_SHADER_STAGE_MESH_BIT_EXT) && (create_info.pInputAssemblyState != nullptr)) { - skip |= ValidatePipelineInputAssemblyStateCreateInfo(*create_info.pInputAssemblyState, + skip |= ValidatePipelineInputAssemblyStateCreateInfo(state, *create_info.pInputAssemblyState, create_info_loc.dot(Field::pInputAssemblyState)); } @@ -596,7 +604,7 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( (create_info.pVertexInputState != nullptr)) { auto const &vertex_input_state = create_info.pVertexInputState; const Location vertex_loc = create_info_loc.dot(Field::pVertexInputState); - skip |= ValidatePipelineVertexInputStateCreateInfo(*vertex_input_state, vertex_loc); + skip |= ValidatePipelineVertexInputStateCreateInfo(state, *vertex_input_state, vertex_loc); if (vertex_input_state->vertexBindingDescriptionCount > device_limits.maxVertexInputBindings) { skip |= LogError("VUID-VkPipelineVertexInputStateCreateInfo-vertexBindingDescriptionCount-00613", device, @@ -713,7 +721,7 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( if (create_info.pViewportState) { const auto &viewport_state = *create_info.pViewportState; const Location viewport_loc = create_info_loc.dot(Field::pViewportState); - skip |= ValidatePipelineViewportStateCreateInfo(*create_info.pViewportState, viewport_loc); + skip |= ValidatePipelineViewportStateCreateInfo(state, *create_info.pViewportState, viewport_loc); const auto *exclusive_scissor_struct = vku::FindStructInPNextChain(viewport_state.pNext); @@ -1006,7 +1014,7 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( // It is possible for pCreateInfos[i].pMultisampleState to be null when creating a graphics library if (create_info.pMultisampleState) { const Location ms_loc = create_info_loc.dot(Field::pMultisampleState); - skip |= ValidatePipelineMultisampleStateCreateInfo(*create_info.pMultisampleState, ms_loc); + skip |= ValidatePipelineMultisampleStateCreateInfo(state, *create_info.pMultisampleState, ms_loc); if (create_info.pMultisampleState->sampleShadingEnable == VK_TRUE) { if (!enabled_features.sampleRateShading) { @@ -1044,18 +1052,18 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( if (create_info.pDepthStencilState != nullptr && uses_depthstencil_attachment) { const Location ds_loc = create_info_loc.dot(Field::pDepthStencilState); auto const &ds_state = *create_info.pDepthStencilState; - skip |= ValidatePipelineDepthStencilStateCreateInfo(ds_state, ds_loc); + skip |= ValidatePipelineDepthStencilStateCreateInfo(state, ds_state, ds_loc); } if (create_info.pColorBlendState != nullptr && uses_color_attachment) { const Location color_loc = create_info_loc.dot(Field::pColorBlendState); auto const &color_blend_state = *create_info.pColorBlendState; - skip |= ValidatePipelineColorBlendStateCreateInfo(color_blend_state, color_loc); + skip |= ValidatePipelineColorBlendStateCreateInfo(state, color_blend_state, color_loc); // If logicOpEnable is VK_TRUE, logicOp must be a valid VkLogicOp value if (color_blend_state.logicOpEnable == VK_TRUE) { - skip |= ValidateRangedEnum(color_loc.dot(Field::logicOp), vvl::Enum::VkLogicOp, color_blend_state.logicOp, - "VUID-VkPipelineColorBlendStateCreateInfo-logicOpEnable-00607"); + skip |= state.ValidateRangedEnum(color_loc.dot(Field::logicOp), vvl::Enum::VkLogicOp, color_blend_state.logicOp, + "VUID-VkPipelineColorBlendStateCreateInfo-logicOpEnable-00607"); } const bool dynamic_not_set = (!vvl::Contains(dynamic_state_map, VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT) || @@ -1065,9 +1073,9 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( // If any of the dynamic states are not set still need a valid array if ((color_blend_state.attachmentCount > 0) && dynamic_not_set) { - skip |= ValidateArray(color_loc.dot(Field::attachmentCount), color_loc.dot(Field::pAttachments), - color_blend_state.attachmentCount, &color_blend_state.pAttachments, false, true, - kVUIDUndefined, "VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-07353"); + skip |= state.ValidateArray(color_loc.dot(Field::attachmentCount), color_loc.dot(Field::pAttachments), + color_blend_state.attachmentCount, &color_blend_state.pAttachments, false, true, + kVUIDUndefined, "VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-07353"); } auto color_write = vku::FindStructInPNextChain(color_blend_state.pNext); @@ -1082,7 +1090,7 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( if (create_info.pRasterizationState) { const Location rasterization_loc = create_info_loc.dot(Field::pRasterizationState); - skip |= ValidatePipelineRasterizationStateCreateInfo(*create_info.pRasterizationState, rasterization_loc); + skip |= ValidatePipelineRasterizationStateCreateInfo(state, *create_info.pRasterizationState, rasterization_loc); if (!IsExtEnabled(device_extensions.vk_nv_fill_rectangle)) { if (create_info.pRasterizationState->polygonMode == VK_POLYGON_MODE_FILL_RECTANGLE_NV) { @@ -1307,18 +1315,18 @@ bool StatelessValidation::ValidateCreateComputePipelinesFlags(const VkPipelineCr return skip; } -bool StatelessValidation::manual_PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkComputePipelineCreateInfo *pCreateInfos, - const VkAllocationCallbacks *pAllocator, - VkPipeline *pPipelines, const ErrorObject &error_obj) const { +bool StatelessValidation::manual_PreCallValidateCreateComputePipelines( + VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, + const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + for (uint32_t i = 0; i < createInfoCount; i++) { const Location create_info_loc = error_obj.location.dot(Field::pCreateInfos, i); const VkComputePipelineCreateInfo &create_info = pCreateInfos[i]; - skip |= ValidateString(create_info_loc.dot(Field::stage).dot(Field::pName), - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter", create_info.stage.pName); + skip |= state.ValidateString(create_info_loc.dot(Field::stage).dot(Field::pName), + "VUID-VkPipelineShaderStageCreateInfo-pName-parameter", create_info.stage.pName); auto feedback_struct = vku::FindStructInPNextChain(create_info.pNext); if (feedback_struct) { const uint32_t feedback_count = feedback_struct->pipelineStageCreationFeedbackCount; @@ -1336,8 +1344,8 @@ bool StatelessValidation::manual_PreCallValidateCreateComputePipelines(VkDevice const Location flags_loc = create_flags_2 ? create_info_loc.pNext(Struct::VkPipelineCreateFlags2CreateInfo, Field::flags) : create_info_loc.dot(Field::flags); if (!create_flags_2) { - skip |= ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, - create_info.flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkComputePipelineCreateInfo-None-09497"); + skip |= state.ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, + create_info.flags, kOptionalFlags, "VUID-VkComputePipelineCreateInfo-None-09497"); } skip |= ValidateCreateComputePipelinesFlags(flags, flags_loc); @@ -1365,7 +1373,7 @@ bool StatelessValidation::manual_PreCallValidateCreateComputePipelines(VkDevice } } - skip |= ValidatePipelineShaderStageCreateInfoCommon(create_info.stage, create_info_loc.dot(Field::stage)); + skip |= ValidatePipelineShaderStageCreateInfoCommon(state, create_info.stage, create_info_loc.dot(Field::stage)); skip |= ValidatePipelineBinaryInfo(create_info.pNext, create_info.flags, pipelineCache, create_info_loc); } @@ -1398,8 +1406,9 @@ bool StatelessValidation::ValidateDepthClampRange(const VkDepthClampRangeEXT &de bool StatelessValidation::manual_PreCallValidateCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const bool has_externally_sync = (pCreateInfo->flags & VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT) != 0; if (!enabled_features.pipelineCreationCacheControl && has_externally_sync) { @@ -1413,8 +1422,9 @@ bool StatelessValidation::manual_PreCallValidateCreatePipelineCache(VkDevice dev bool StatelessValidation::manual_PreCallValidateMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache *pSrcCaches, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pSrcCaches) { for (uint32_t index0 = 0; index0 < srcCacheCount; ++index0) { if (pSrcCaches[index0] == dstCache) { @@ -1429,8 +1439,9 @@ bool StatelessValidation::manual_PreCallValidateMergePipelineCaches(VkDevice dev bool StatelessValidation::manual_PreCallValidateGetPipelinePropertiesEXT(VkDevice device, const VkPipelineInfoEXT *pPipelineInfo, VkBaseOutStructure *pPipelineProperties, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.pipelinePropertiesIdentifier) { skip |= LogError("VUID-vkGetPipelinePropertiesEXT-None-06766", device, error_obj.location, diff --git a/layers/stateless/sl_ray_tracing.cpp b/layers/stateless/sl_ray_tracing.cpp index 99aefabcc3b..d69d130a3c1 100644 --- a/layers/stateless/sl_ray_tracing.cpp +++ b/layers/stateless/sl_ray_tracing.cpp @@ -93,9 +93,11 @@ bool StatelessValidation::ValidateGeometryNV(const VkGeometryNV &geometry, VkAcc return skip; } -bool StatelessValidation::ValidateAccelerationStructureInfoNV(const VkAccelerationStructureInfoNV &info, +bool StatelessValidation::ValidateAccelerationStructureInfoNV(const vvl::stateless::State &state, + const VkAccelerationStructureInfoNV &info, VkAccelerationStructureNV object_handle, const Location &loc) const { bool skip = false; + bool is_cmd = loc.function == Func::vkCmdBuildAccelerationStructureNV; if (info.type == VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_NV && info.geometryCount != 0) { skip |= LogError("VUID-VkAccelerationStructureInfoNV-type-02425", object_handle, loc, @@ -168,16 +170,17 @@ bool StatelessValidation::ValidateAccelerationStructureInfoNV(const VkAccelerati "or VK_GEOMETRY_TYPE_AABBS_NV."); } } - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, - AllVkBuildAccelerationStructureFlagBitsKHR, info.flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkAccelerationStructureInfoNV-flags-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, + AllVkBuildAccelerationStructureFlagBitsKHR, info.flags, kOptionalFlags, + "VUID-VkAccelerationStructureInfoNV-flags-parameter"); return skip; } bool StatelessValidation::manual_PreCallValidateCreateAccelerationStructureNV( VkDevice device, const VkAccelerationStructureCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkAccelerationStructureNV *pAccelerationStructure, const ErrorObject &error_obj) const { + VkAccelerationStructureNV *pAccelerationStructure, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if ((pCreateInfo->compactedSize != 0) && ((pCreateInfo->info.geometryCount != 0) || (pCreateInfo->info.instanceCount != 0))) { skip |= LogError("VUID-VkAccelerationStructureCreateInfoNV-compactedSize-02421", device, error_obj.location, @@ -186,18 +189,19 @@ bool StatelessValidation::manual_PreCallValidateCreateAccelerationStructureNV( pCreateInfo->compactedSize, pCreateInfo->info.geometryCount, pCreateInfo->info.instanceCount); } - skip |= ValidateAccelerationStructureInfoNV(pCreateInfo->info, VkAccelerationStructureNV(0), error_obj.location); + skip |= ValidateAccelerationStructureInfoNV(state, pCreateInfo->info, VkAccelerationStructureNV(0), error_obj.location); return skip; } bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructureNV( VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pInfo != nullptr) { - skip |= ValidateAccelerationStructureInfoNV(*pInfo, dst, error_obj.location); + skip |= ValidateAccelerationStructureInfoNV(state, *pInfo, dst, error_obj.location); } return skip; @@ -205,8 +209,9 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructureNV( bool StatelessValidation::manual_PreCallValidateCreateAccelerationStructureKHR( VkDevice device, const VkAccelerationStructureCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkAccelerationStructureKHR *pAccelerationStructure, const ErrorObject &error_obj) const { + VkAccelerationStructureKHR *pAccelerationStructure, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkCreateAccelerationStructureKHR-accelerationStructure-03611", device, error_obj.location, "accelerationStructure feature was not enabled."); @@ -260,8 +265,9 @@ bool StatelessValidation::manual_PreCallValidateCreateAccelerationStructureKHR( bool StatelessValidation::manual_PreCallValidateDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks *pAllocator, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkDestroyAccelerationStructureKHR-accelerationStructure-08934", device, error_obj.location, "accelerationStructure feature was not enabled."); @@ -272,8 +278,9 @@ bool StatelessValidation::manual_PreCallValidateDestroyAccelerationStructureKHR( bool StatelessValidation::manual_PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void *pData, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (dataSize < 8) { skip |= LogError("VUID-vkGetAccelerationStructureHandleNV-dataSize-02240", accelerationStructure, error_obj.location.dot(Field::dataSize), "must be greater than or equal to 8."); @@ -283,8 +290,9 @@ bool StatelessValidation::manual_PreCallValidateGetAccelerationStructureHandleNV bool StatelessValidation::manual_PreCallValidateCmdWriteAccelerationStructuresPropertiesNV( VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV *pAccelerationStructures, - VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery, const ErrorObject &error_obj) const { + VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (queryType != VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV) { skip |= LogError("VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryType-06216", device, error_obj.location, "queryType must be " @@ -353,15 +361,16 @@ bool StatelessValidation::ValidateCreateRayTracingPipelinesFlagsNV(const VkPipel bool StatelessValidation::manual_PreCallValidateCreateRayTracingPipelinesNV( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV *pCreateInfos, - const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, const ErrorObject &error_obj) const { + const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; for (uint32_t i = 0; i < createInfoCount; i++) { const Location create_info_loc = error_obj.location.dot(Field::pCreateInfos, i); const VkRayTracingPipelineCreateInfoNV &create_info = pCreateInfos[i]; for (uint32_t stage_index = 0; stage_index < create_info.stageCount; ++stage_index) { - skip |= ValidatePipelineShaderStageCreateInfoCommon(create_info.pStages[stage_index], + skip |= ValidatePipelineShaderStageCreateInfoCommon(state, create_info.pStages[stage_index], create_info_loc.dot(Field::pStages, stage_index)); } auto feedback_struct = vku::FindStructInPNextChain(create_info.pNext); @@ -380,9 +389,8 @@ bool StatelessValidation::manual_PreCallValidateCreateRayTracingPipelinesNV( const Location flags_loc = create_flags_2 ? create_info_loc.pNext(Struct::VkPipelineCreateFlags2CreateInfo, Field::flags) : create_info_loc.dot(Field::flags); if (!create_flags_2) { - skip |= - ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, create_info.flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkRayTracingPipelineCreateInfoNV-None-09497"); + skip |= state.ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, + create_info.flags, kOptionalFlags, "VUID-VkRayTracingPipelineCreateInfoNV-None-09497"); } skip |= ValidateCreateRayTracingPipelinesFlagsNV(flags, flags_loc); @@ -467,8 +475,10 @@ bool StatelessValidation::ValidateCreateRayTracingPipelinesFlagsKHR(const VkPipe bool StatelessValidation::manual_PreCallValidateCreateRayTracingPipelinesKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + if (!enabled_features.rayTracingPipeline) { skip |= LogError("VUID-vkCreateRayTracingPipelinesKHR-rayTracingPipeline-03586", device, error_obj.location, "the rayTracingPipeline feature was not enabled."); @@ -483,15 +493,14 @@ bool StatelessValidation::manual_PreCallValidateCreateRayTracingPipelinesKHR( const Location flags_loc = create_flags_2 ? create_info_loc.pNext(Struct::VkPipelineCreateFlags2CreateInfo, Field::flags) : create_info_loc.dot(Field::flags); if (!create_flags_2) { - skip |= - ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, create_info.flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkRayTracingPipelineCreateInfoKHR-None-09497"); + skip |= state.ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, + create_info.flags, kOptionalFlags, "VUID-VkRayTracingPipelineCreateInfoKHR-None-09497"); } skip |= ValidateCreateRayTracingPipelinesFlagsKHR(flags, flags_loc); for (uint32_t stage_index = 0; stage_index < create_info.stageCount; ++stage_index) { const Location stage_loc = create_info_loc.dot(Field::pStages, stage_index); - skip |= ValidatePipelineShaderStageCreateInfoCommon(create_info.pStages[stage_index], stage_loc); + skip |= ValidatePipelineShaderStageCreateInfoCommon(state, create_info.pStages[stage_index], stage_loc); const auto stage = create_info.pStages[stage_index].stage; if ((stage & kShaderStageAllRayTracing) == 0) { @@ -662,8 +671,10 @@ bool StatelessValidation::manual_PreCallValidateCreateRayTracingPipelinesKHR( bool StatelessValidation::manual_PreCallValidateCopyAccelerationStructureToMemoryKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + const Location info_loc = error_obj.location.dot(Field::pInfo); if (pInfo->mode != VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR) { skip |= LogError("VUID-VkCopyAccelerationStructureToMemoryInfoKHR-mode-03412", device, info_loc.dot(Field::mode), "is %s.", @@ -673,8 +684,8 @@ bool StatelessValidation::manual_PreCallValidateCopyAccelerationStructureToMemor skip |= LogError("VUID-vkCopyAccelerationStructureToMemoryKHR-accelerationStructureHostCommands-03584", device, error_obj.location, "accelerationStructureHostCommands feature was not enabled."); } - skip |= ValidateRequiredPointer(info_loc.dot(Field::dst).dot(Field::hostAddress), pInfo->dst.hostAddress, - "VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03732"); + skip |= state.ValidateRequiredPointer(info_loc.dot(Field::dst).dot(Field::hostAddress), pInfo->dst.hostAddress, + "VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03732"); if (SafeModulo((VkDeviceSize)pInfo->dst.hostAddress, 16) != 0) { skip |= LogError("VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-03751", device, info_loc.dot(Field::dst).dot(Field::hostAddress), "(0x%" PRIx64 ") must be aligned to 16 bytes.", @@ -684,8 +695,10 @@ bool StatelessValidation::manual_PreCallValidateCopyAccelerationStructureToMemor } bool StatelessValidation::manual_PreCallValidateCmdCopyAccelerationStructureToMemoryKHR( - VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo, const ErrorObject &error_obj) const { + VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkCmdCopyAccelerationStructureToMemoryKHR-accelerationStructure-08926", device, error_obj.location, @@ -722,8 +735,9 @@ bool StatelessValidation::ValidateCopyAccelerationStructureInfoKHR(const VkCopyA bool StatelessValidation::manual_PreCallValidateCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; skip |= ValidateCopyAccelerationStructureInfoKHR(*pInfo, error_obj.handle, error_obj.location.dot(Field::pInfo)); if (!enabled_features.accelerationStructureHostCommands) { skip |= LogError("VUID-vkCopyAccelerationStructureKHR-accelerationStructureHostCommands-03582", device, error_obj.location, @@ -734,8 +748,9 @@ bool StatelessValidation::manual_PreCallValidateCopyAccelerationStructureKHR(VkD bool StatelessValidation::manual_PreCallValidateCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkCmdCopyAccelerationStructureKHR-accelerationStructure-08925", device, error_obj.location, @@ -759,16 +774,18 @@ bool StatelessValidation::ValidateCopyMemoryToAccelerationStructureInfoKHR( bool StatelessValidation::manual_PreCallValidateCopyMemoryToAccelerationStructureKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + const Location info_loc = error_obj.location.dot(Field::pInfo); skip |= ValidateCopyMemoryToAccelerationStructureInfoKHR(*pInfo, error_obj.handle, info_loc); if (!enabled_features.accelerationStructureHostCommands) { skip |= LogError("VUID-vkCopyMemoryToAccelerationStructureKHR-accelerationStructureHostCommands-03583", device, error_obj.location, "accelerationStructureHostCommands feature was not enabled."); } - skip |= ValidateRequiredPointer(info_loc.dot(Field::src).dot(Field::hostAddress), pInfo->src.hostAddress, - "VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-03729"); + skip |= state.ValidateRequiredPointer(info_loc.dot(Field::src).dot(Field::hostAddress), pInfo->src.hostAddress, + "VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-03729"); if (SafeModulo((VkDeviceAddress)pInfo->src.hostAddress, 16) != 0) { skip |= LogError("VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-03750", device, @@ -780,8 +797,10 @@ bool StatelessValidation::manual_PreCallValidateCopyMemoryToAccelerationStructur } bool StatelessValidation::manual_PreCallValidateCmdCopyMemoryToAccelerationStructureKHR( - VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo, const ErrorObject &error_obj) const { + VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkCmdCopyMemoryToAccelerationStructureKHR-accelerationStructure-08927", device, error_obj.location, @@ -800,8 +819,9 @@ bool StatelessValidation::manual_PreCallValidateCmdCopyMemoryToAccelerationStruc bool StatelessValidation::manual_PreCallValidateCmdWriteAccelerationStructuresPropertiesKHR( VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, - VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery, const ErrorObject &error_obj) const { + VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-accelerationStructure-08924", commandBuffer, @@ -820,8 +840,9 @@ bool StatelessValidation::manual_PreCallValidateCmdWriteAccelerationStructuresPr bool StatelessValidation::manual_PreCallValidateWriteAccelerationStructuresPropertiesKHR( VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, - VkQueryType queryType, size_t dataSize, void *pData, size_t stride, const ErrorObject &error_obj) const { + VkQueryType queryType, size_t dataSize, void *pData, size_t stride, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructureHostCommands) { skip |= LogError("VUID-vkWriteAccelerationStructuresPropertiesKHR-accelerationStructureHostCommands-03585", device, error_obj.location, "accelerationStructureHostCommands feature was not enabled."); @@ -898,8 +919,9 @@ bool StatelessValidation::manual_PreCallValidateWriteAccelerationStructuresPrope bool StatelessValidation::manual_PreCallValidateGetRayTracingCaptureReplayShaderGroupHandlesKHR( VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.rayTracingPipelineShaderGroupHandleCaptureReplay) { skip |= LogError( "VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-rayTracingPipelineShaderGroupHandleCaptureReplay-03606", device, @@ -910,8 +932,9 @@ bool StatelessValidation::manual_PreCallValidateGetRayTracingCaptureReplayShader bool StatelessValidation::manual_PreCallValidateGetDeviceAccelerationStructureCompatibilityKHR( VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo, - VkAccelerationStructureCompatibilityKHR *pCompatibility, const ErrorObject &error_obj) const { + VkAccelerationStructureCompatibilityKHR *pCompatibility, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-accelerationStructure-08928", device, error_obj.location, "accelerationStructure feature was not enabled."); @@ -942,7 +965,8 @@ bool StatelessValidation::ValidateTotalPrimitivesCount(uint64_t total_triangles_ return skip; } -bool StatelessValidation::ValidateAccelerationStructureBuildGeometryInfoKHR(const VkAccelerationStructureBuildGeometryInfoKHR &info, +bool StatelessValidation::ValidateAccelerationStructureBuildGeometryInfoKHR(const vvl::stateless::State &state, + const VkAccelerationStructureBuildGeometryInfoKHR &info, const VulkanTypedHandle &handle, const Location &info_loc) const { bool skip = false; @@ -986,12 +1010,12 @@ bool StatelessValidation::ValidateAccelerationStructureBuildGeometryInfoKHR(cons const Location geometry_ptr_loc = info_loc.dot(info.pGeometries ? Field::pGeometries : Field::ppGeometries, geom_i); const Location geometry_loc = geometry_ptr_loc.dot(Field::geometry); - skip |= ValidateRangedEnum(geometry_ptr_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, geom.geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); + skip |= state.ValidateRangedEnum(geometry_ptr_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, geom.geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); if (geom.geometryType == VK_GEOMETRY_TYPE_TRIANGLES_KHR) { const Location triangles_loc = geometry_loc.dot(Field::triangles); - skip |= ValidateAccelerationStructureGeometryTrianglesDataKHR(geom.geometry.triangles, triangles_loc); + skip |= ValidateAccelerationStructureGeometryTrianglesDataKHR(state, geom.geometry.triangles, triangles_loc); if (geom.geometry.triangles.vertexStride > vvl::kU32Max) { skip |= LogError("VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexStride-03819", handle, @@ -1008,11 +1032,11 @@ bool StatelessValidation::ValidateAccelerationStructureBuildGeometryInfoKHR(cons } else if (geom.geometryType == VK_GEOMETRY_TYPE_INSTANCES_KHR) { const Location instances_loc = geometry_loc.dot(Field::instances); - skip |= ValidateAccelerationStructureGeometryInstancesDataKHR(geom.geometry.instances, instances_loc); + skip |= ValidateAccelerationStructureGeometryInstancesDataKHR(state, geom.geometry.instances, instances_loc); } else if (geom.geometryType == VK_GEOMETRY_TYPE_AABBS_KHR) { const Location aabbs_loc = geometry_loc.dot(Field::aabbs); - skip |= ValidateAccelerationStructureGeometryAabbsDataKHR(geom.geometry.aabbs, aabbs_loc); + skip |= ValidateAccelerationStructureGeometryAabbsDataKHR(state, geom.geometry.aabbs, aabbs_loc); if (geom.geometry.aabbs.stride % 8) { skip |= LogError("VUID-VkAccelerationStructureGeometryAabbsDataKHR-stride-03545", handle, @@ -1114,8 +1138,9 @@ static void ComputeTotalPrimitiveCountWithMaxPrimitivesCount( bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresKHR( VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, - const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos, const ErrorObject &error_obj) const { + const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkCmdBuildAccelerationStructuresKHR-accelerationStructure-08923", commandBuffer, error_obj.location, @@ -1130,7 +1155,7 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresKH for (const auto [info_i, info] : vvl::enumerate(pInfos, infoCount)) { const Location info_loc = error_obj.location.dot(Field::pInfos, info_i); - skip |= ValidateAccelerationStructureBuildGeometryInfoKHR(*info, error_obj.handle, info_loc); + skip |= ValidateAccelerationStructureBuildGeometryInfoKHR(state, *info, error_obj.handle, info_loc); if (SafeModulo(info->scratchData.deviceAddress, phys_dev_ext_props.acc_structure_props.minAccelerationStructureScratchOffsetAlignment) != 0) { @@ -1140,8 +1165,8 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresKH info->scratchData.deviceAddress, phys_dev_ext_props.acc_structure_props.minAccelerationStructureScratchOffsetAlignment); } - skip |= ValidateRangedEnum(info_loc.dot(Field::mode), vvl::Enum::VkBuildAccelerationStructureModeKHR, info->mode, - "VUID-vkCmdBuildAccelerationStructuresKHR-mode-04628"); + skip |= state.ValidateRangedEnum(info_loc.dot(Field::mode), vvl::Enum::VkBuildAccelerationStructureModeKHR, info->mode, + "VUID-vkCmdBuildAccelerationStructuresKHR-mode-04628"); if (info->mode == VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR && info->srcAccelerationStructure == VK_NULL_HANDLE) { skip |= LogError("VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-04630", commandBuffer, info_loc.dot(Field::mode), "is VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR, but srcAccelerationStructure is VK_NULL_HANDLE."); @@ -1245,9 +1270,9 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresKH break; } } - skip |= ValidateArray(info_loc.dot(Field::geometryCount), error_obj.location.dot(Field::ppBuildRangeInfos, info_i), - info->geometryCount, &ppBuildRangeInfos[info_i], false, true, kVUIDUndefined, - "VUID-vkCmdBuildAccelerationStructuresKHR-ppBuildRangeInfos-03676"); + skip |= state.ValidateArray(info_loc.dot(Field::geometryCount), error_obj.location.dot(Field::ppBuildRangeInfos, info_i), + info->geometryCount, &ppBuildRangeInfos[info_i], false, true, kVUIDUndefined, + "VUID-vkCmdBuildAccelerationStructuresKHR-ppBuildRangeInfos-03676"); } return skip; @@ -1256,8 +1281,10 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresKH bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresIndirectKHR( VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkDeviceAddress *pIndirectDeviceAddresses, const uint32_t *pIndirectStrides, const uint32_t *const *ppMaxPrimitiveCounts, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + if (!enabled_features.accelerationStructureIndirectBuild) { skip |= LogError("VUID-vkCmdBuildAccelerationStructuresIndirectKHR-accelerationStructureIndirectBuild-03650", commandBuffer, error_obj.location, "the accelerationStructureIndirectBuild feature was not enabled."); @@ -1272,7 +1299,7 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresIn for (const auto [info_i, info] : vvl::enumerate(pInfos, infoCount)) { const Location info_loc = error_obj.location.dot(Field::pInfos, info_i); - skip |= ValidateAccelerationStructureBuildGeometryInfoKHR(pInfos[info_i], error_obj.handle, info_loc); + skip |= ValidateAccelerationStructureBuildGeometryInfoKHR(state, pInfos[info_i], error_obj.handle, info_loc); if (SafeModulo(info->scratchData.deviceAddress, phys_dev_ext_props.acc_structure_props.minAccelerationStructureScratchOffsetAlignment) != 0) { @@ -1282,8 +1309,8 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresIn info->scratchData.deviceAddress, phys_dev_ext_props.acc_structure_props.minAccelerationStructureScratchOffsetAlignment); } - skip |= ValidateRangedEnum(info_loc.dot(Field::mode), vvl::Enum::VkBuildAccelerationStructureModeKHR, info->mode, - "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-mode-04628"); + skip |= state.ValidateRangedEnum(info_loc.dot(Field::mode), vvl::Enum::VkBuildAccelerationStructureModeKHR, info->mode, + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-mode-04628"); if (info->mode == VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR && info->srcAccelerationStructure == VK_NULL_HANDLE) { skip |= @@ -1437,8 +1464,10 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildAccelerationStructuresIn bool StatelessValidation::manual_PreCallValidateBuildAccelerationStructuresKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, - const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos, const ErrorObject &error_obj) const { + const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; + if (!enabled_features.accelerationStructureHostCommands) { skip |= LogError("VUID-vkBuildAccelerationStructuresKHR-accelerationStructureHostCommands-03581", device, error_obj.location, "accelerationStructureHostCommands feature was not enabled."); @@ -1452,14 +1481,14 @@ bool StatelessValidation::manual_PreCallValidateBuildAccelerationStructuresKHR( for (const auto [info_i, info] : vvl::enumerate(pInfos, infoCount)) { const Location info_loc = error_obj.location.dot(Field::pInfos, info_i); - skip |= ValidateAccelerationStructureBuildGeometryInfoKHR(*info, error_obj.handle, error_obj.location); + skip |= ValidateAccelerationStructureBuildGeometryInfoKHR(state, *info, error_obj.handle, error_obj.location); - skip |= ValidateRangedEnum(info_loc.dot(Field::mode), vvl::Enum::VkBuildAccelerationStructureModeKHR, info->mode, - "VUID-vkBuildAccelerationStructuresKHR-mode-04628"); + skip |= state.ValidateRangedEnum(info_loc.dot(Field::mode), vvl::Enum::VkBuildAccelerationStructureModeKHR, info->mode, + "VUID-vkBuildAccelerationStructuresKHR-mode-04628"); - skip |= ValidateArray(info_loc.dot(Field::geometryCount), error_obj.location.dot(Field::ppBuildRangeInfos, info_i), - info->geometryCount, &ppBuildRangeInfos[info_i], false, true, kVUIDUndefined, - "VUID-vkBuildAccelerationStructuresKHR-ppBuildRangeInfos-03676"); + skip |= state.ValidateArray(info_loc.dot(Field::geometryCount), error_obj.location.dot(Field::ppBuildRangeInfos, info_i), + info->geometryCount, &ppBuildRangeInfos[info_i], false, true, kVUIDUndefined, + "VUID-vkBuildAccelerationStructuresKHR-ppBuildRangeInfos-03676"); if (info->mode == VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR) { if (info->scratchData.hostAddress == nullptr) { @@ -1539,8 +1568,10 @@ bool StatelessValidation::manual_PreCallValidateBuildAccelerationStructuresKHR( bool StatelessValidation::manual_PreCallValidateGetAccelerationStructureBuildSizesKHR( VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo, - const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo, const ErrorObject &error_obj) const { + const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; uint64_t total_triangles_count = 0; uint64_t total_aabbs_count = 0; @@ -1548,7 +1579,7 @@ bool StatelessValidation::manual_PreCallValidateGetAccelerationStructureBuildSiz &total_aabbs_count); skip |= ValidateTotalPrimitivesCount(total_triangles_count, total_aabbs_count, error_obj.handle, error_obj.location); - skip |= ValidateAccelerationStructureBuildGeometryInfoKHR(*pBuildInfo, error_obj.handle, + skip |= ValidateAccelerationStructureBuildGeometryInfoKHR(state, *pBuildInfo, error_obj.handle, error_obj.location.dot(Field::pBuildInfo, 0)); if (!enabled_features.accelerationStructure) { skip |= LogError("VUID-vkGetAccelerationStructureBuildSizesKHR-accelerationStructure-08933", device, error_obj.location, @@ -1733,8 +1764,9 @@ bool StatelessValidation::manual_PreCallValidateCmdTraceRaysKHR(VkCommandBuffer const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pRaygenShaderBindingTable) { skip |= ValidateTraceRaysRaygenShaderBindingTable(commandBuffer, *pRaygenShaderBindingTable, error_obj.location.dot(Field::pRaygenShaderBindingTable)); @@ -1789,8 +1821,9 @@ bool StatelessValidation::manual_PreCallValidateCmdTraceRaysIndirectKHR( VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.rayTracingPipelineTraceRaysIndirect) { skip |= LogError("VUID-vkCmdTraceRaysIndirectKHR-rayTracingPipelineTraceRaysIndirect-03637", commandBuffer, error_obj.location, "rayTracingPipelineTraceRaysIndirect feature must be enabled."); @@ -1824,8 +1857,9 @@ bool StatelessValidation::manual_PreCallValidateCmdTraceRaysIndirectKHR( bool StatelessValidation::manual_PreCallValidateCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.rayTracingPipelineTraceRaysIndirect2) { skip |= LogError("VUID-vkCmdTraceRaysIndirect2KHR-rayTracingPipelineTraceRaysIndirect2-03637", commandBuffer, error_obj.location, "rayTracingPipelineTraceRaysIndirect2 feature was not enabled."); @@ -1839,12 +1873,11 @@ bool StatelessValidation::manual_PreCallValidateCmdTraceRaysIndirect2KHR(VkComma return skip; } -bool StatelessValidation::manual_PreCallValidateCreateMicromapEXT( - VkDevice device, - const VkMicromapCreateInfoEXT* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkMicromapEXT* pMicromap, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateCreateMicromapEXT(VkDevice device, const VkMicromapCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkMicromapEXT *pMicromap, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.micromap) { skip |= LogError("VUID-vkCreateMicromapEXT-micromap-07430", device, @@ -1859,11 +1892,11 @@ bool StatelessValidation::manual_PreCallValidateCreateMicromapEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateDestroyMicromapEXT( - VkDevice device, - VkMicromapEXT micromap, - const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateDestroyMicromapEXT(VkDevice device, VkMicromapEXT micromap, + const VkAllocationCallbacks *pAllocator, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.micromap) { skip |= @@ -1873,11 +1906,11 @@ bool StatelessValidation::manual_PreCallValidateDestroyMicromapEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateCmdBuildMicromapsEXT( - VkCommandBuffer commandBuffer, - uint32_t infoCount, - const VkMicromapBuildInfoEXT* pInfos, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateCmdBuildMicromapsEXT(VkCommandBuffer commandBuffer, uint32_t infoCount, + const VkMicromapBuildInfoEXT *pInfos, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; for (const auto [info_i, info] : vvl::enumerate(pInfos, infoCount)) { const Location info_loc = error_obj.location.dot(Field::pInfos, info_i); @@ -1909,12 +1942,11 @@ bool StatelessValidation::manual_PreCallValidateCmdBuildMicromapsEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateBuildMicromapsEXT( - VkDevice device, - VkDeferredOperationKHR deferredOperation, - uint32_t infoCount, - const VkMicromapBuildInfoEXT* pInfos, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateBuildMicromapsEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + uint32_t infoCount, const VkMicromapBuildInfoEXT *pInfos, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.micromapHostCommands) { skip |= LogError("VUID-vkBuildMicromapsEXT-micromapHostCommands-07555", device, @@ -1924,11 +1956,11 @@ bool StatelessValidation::manual_PreCallValidateBuildMicromapsEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateCopyMicromapEXT( - VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMicromapInfoEXT *pInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.micromapHostCommands) { skip |= LogError("VUID-vkCopyMicromapEXT-micromapHostCommands-07560", device, error_obj.location, @@ -1945,11 +1977,11 @@ bool StatelessValidation::manual_PreCallValidateCopyMicromapEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateCopyMicromapToMemoryEXT( - VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyMicromapToMemoryInfoEXT* pInfo, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateCopyMicromapToMemoryEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMicromapToMemoryInfoEXT *pInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.micromapHostCommands) { skip |= LogError("VUID-vkCopyMicromapToMemoryEXT-micromapHostCommands-07571", device, error_obj.location, @@ -1965,11 +1997,11 @@ bool StatelessValidation::manual_PreCallValidateCopyMicromapToMemoryEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateCopyMemoryToMicromapEXT( - VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyMemoryToMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateCopyMemoryToMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMemoryToMicromapInfoEXT *pInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.micromapHostCommands) { skip |= LogError("VUID-vkCopyMemoryToMicromapEXT-micromapHostCommands-07566", device, error_obj.location, @@ -1985,15 +2017,12 @@ bool StatelessValidation::manual_PreCallValidateCopyMemoryToMicromapEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateWriteMicromapsPropertiesEXT( - VkDevice device, - uint32_t micromapCount, - const VkMicromapEXT* pMicromaps, - VkQueryType queryType, - size_t dataSize, - void* pData, - size_t stride, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micromapCount, + const VkMicromapEXT *pMicromaps, VkQueryType queryType, + size_t dataSize, void *pData, size_t stride, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (queryType != VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT && queryType != VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT) { @@ -2004,10 +2033,11 @@ bool StatelessValidation::manual_PreCallValidateWriteMicromapsPropertiesEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateCmdCopyMicromapEXT( - VkCommandBuffer commandBuffer, - const VkCopyMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, + const VkCopyMicromapInfoEXT *pInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location info_loc = error_obj.location.dot(Field::pInfo); if (pInfo->mode != VK_COPY_MICROMAP_MODE_COMPACT_EXT && @@ -2019,10 +2049,11 @@ bool StatelessValidation::manual_PreCallValidateCmdCopyMicromapEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateCmdCopyMicromapToMemoryEXT( - VkCommandBuffer commandBuffer, - const VkCopyMicromapToMemoryInfoEXT* pInfo, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateCmdCopyMicromapToMemoryEXT(VkCommandBuffer commandBuffer, + const VkCopyMicromapToMemoryInfoEXT *pInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location info_loc = error_obj.location.dot(Field::pInfo); if (pInfo->mode != VK_COPY_MICROMAP_MODE_SERIALIZE_EXT) { @@ -2033,10 +2064,11 @@ bool StatelessValidation::manual_PreCallValidateCmdCopyMicromapToMemoryEXT( return skip; } -bool StatelessValidation::manual_PreCallValidateCmdCopyMemoryToMicromapEXT( - VkCommandBuffer commandBuffer, - const VkCopyMemoryToMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateCmdCopyMemoryToMicromapEXT(VkCommandBuffer commandBuffer, + const VkCopyMemoryToMicromapInfoEXT *pInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location info_loc = error_obj.location.dot(Field::pInfo); if (pInfo->mode != VK_COPY_MICROMAP_MODE_DESERIALIZE_EXT) { @@ -2048,13 +2080,10 @@ bool StatelessValidation::manual_PreCallValidateCmdCopyMemoryToMicromapEXT( } bool StatelessValidation::manual_PreCallValidateCmdWriteMicromapsPropertiesEXT( - VkCommandBuffer commandBuffer, - uint32_t micromapCount, - const VkMicromapEXT* pMicromaps, - VkQueryType queryType, - VkQueryPool queryPool, - uint32_t firstQuery, const ErrorObject& error_obj) const { + VkCommandBuffer commandBuffer, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, VkQueryType queryType, + VkQueryPool queryPool, uint32_t firstQuery, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (queryType != VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT && queryType != VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT) { @@ -2066,10 +2095,10 @@ bool StatelessValidation::manual_PreCallValidateCmdWriteMicromapsPropertiesEXT( } bool StatelessValidation::manual_PreCallValidateGetDeviceMicromapCompatibilityEXT( - VkDevice device, - const VkMicromapVersionInfoEXT* pVersionInfo, - VkAccelerationStructureCompatibilityKHR* pCompatibility, const ErrorObject& error_obj) const { + VkDevice device, const VkMicromapVersionInfoEXT *pVersionInfo, VkAccelerationStructureCompatibilityKHR *pCompatibility, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.micromap) { skip |= LogError("VUID-vkGetDeviceMicromapCompatibilityEXT-micromap-07551", device, @@ -2079,12 +2108,13 @@ bool StatelessValidation::manual_PreCallValidateGetDeviceMicromapCompatibilityEX return skip; } -bool StatelessValidation::manual_PreCallValidateGetMicromapBuildSizesEXT( - VkDevice device, - VkAccelerationStructureBuildTypeKHR buildType, - const VkMicromapBuildInfoEXT* pBuildInfo, - VkMicromapBuildSizesInfoEXT* pSizeInfo, const ErrorObject& error_obj) const { +bool StatelessValidation::manual_PreCallValidateGetMicromapBuildSizesEXT(VkDevice device, + VkAccelerationStructureBuildTypeKHR buildType, + const VkMicromapBuildInfoEXT *pBuildInfo, + VkMicromapBuildSizesInfoEXT *pSizeInfo, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!enabled_features.micromap) { skip |= LogError("VUID-vkGetMicromapBuildSizesEXT-micromap-07439", device, @@ -2097,4 +2127,4 @@ bool StatelessValidation::manual_PreCallValidateGetMicromapBuildSizesEXT( } return skip; -} \ No newline at end of file +} diff --git a/layers/stateless/sl_render_pass.cpp b/layers/stateless/sl_render_pass.cpp index 31428b5dd1f..ad97608d3fe 100644 --- a/layers/stateless/sl_render_pass.cpp +++ b/layers/stateless/sl_render_pass.cpp @@ -366,16 +366,17 @@ bool StatelessValidation::ValidateCreateRenderPass(VkDevice device, const VkRend bool StatelessValidation::manual_PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { vku::safe_VkRenderPassCreateInfo2 create_info_2 = ConvertVkRenderPassCreateInfoToV2KHR(*pCreateInfo); - return ValidateCreateRenderPass(device, create_info_2.ptr(), pAllocator, pRenderPass, error_obj); + return ValidateCreateRenderPass(device, create_info_2.ptr(), pAllocator, pRenderPass, state.error_obj); } bool StatelessValidation::manual_PreCallValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkRenderPass *pRenderPass, const ErrorObject &error_obj) const { + VkRenderPass *pRenderPass, + const vvl::stateless::State &state) const { vku::safe_VkRenderPassCreateInfo2 create_info_2(pCreateInfo); - return ValidateCreateRenderPass(device, create_info_2.ptr(), pAllocator, pRenderPass, error_obj); + return ValidateCreateRenderPass(device, create_info_2.ptr(), pAllocator, pRenderPass, state.error_obj); } void StatelessValidation::RecordRenderPass(VkRenderPass renderPass, const VkRenderPassCreateInfo2 *pCreateInfo) { @@ -530,15 +531,15 @@ bool StatelessValidation::ValidateCmdBeginRenderPass(VkCommandBuffer commandBuff bool StatelessValidation::manual_PreCallValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, VkSubpassContents, - const ErrorObject &error_obj) const { - return ValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, error_obj); + const vvl::stateless::State &state) const { + return ValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, state.error_obj); } bool StatelessValidation::manual_PreCallValidateCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, const VkSubpassBeginInfo *, - const ErrorObject &error_obj) const { - return ValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, error_obj); + const vvl::stateless::State &state) const { + return ValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, state.error_obj); } static bool UniqueRenderingInfoImageViews(const VkRenderingInfo &rendering_info, VkImageView image_view) { @@ -577,8 +578,9 @@ static bool UniqueRenderingInfoImageViews(const VkRenderingInfo &rendering_info, bool StatelessValidation::manual_PreCallValidateCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const Location rendering_info_loc = error_obj.location.dot(Field::pRenderingInfo); if (!enabled_features.dynamicRendering) { diff --git a/layers/stateless/sl_shader_object.cpp b/layers/stateless/sl_shader_object.cpp index 0e5a6edb658..494d08a349f 100644 --- a/layers/stateless/sl_shader_object.cpp +++ b/layers/stateless/sl_shader_object.cpp @@ -1,5 +1,5 @@ /* Copyright (c) 2023-2024 Nintendo - * Copyright (c) 2023-2024 LunarG, Inc. + * Copyright (c) 2023-2025 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,9 @@ bool StatelessValidation::manual_PreCallValidateCreateShadersEXT(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkShaderEXT *pShaders, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; for (uint32_t i = 0; i < createInfoCount; ++i) { const Location create_info_loc = error_obj.location.dot(Field::pCreateInfos, i); @@ -151,8 +152,9 @@ bool StatelessValidation::manual_PreCallValidateCreateShadersEXT(VkDevice device } bool StatelessValidation::manual_PreCallValidateGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, - void *pData, const ErrorObject &error_obj) const { + void *pData, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pData) { auto ptr = reinterpret_cast(pData); diff --git a/layers/stateless/sl_synchronization.cpp b/layers/stateless/sl_synchronization.cpp index 981814ee7ea..5fda718f2d5 100644 --- a/layers/stateless/sl_synchronization.cpp +++ b/layers/stateless/sl_synchronization.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2023 The Khronos Group Inc. - * Copyright (c) 2015-2023 Valve Corporation - * Copyright (c) 2015-2023 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2023 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,23 +20,23 @@ bool StatelessValidation::manual_PreCallValidateCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; #ifdef VK_USE_PLATFORM_METAL_EXT skip |= ExportMetalObjectsPNextUtil(VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT, - "VUID-VkSemaphoreCreateInfo-pNext-06789", error_obj.location, + "VUID-VkSemaphoreCreateInfo-pNext-06789", state.error_obj.location, "VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT", pCreateInfo->pNext); #endif // VK_USE_PLATFORM_METAL_EXT return skip; } bool StatelessValidation::manual_PreCallValidateCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; #ifdef VK_USE_PLATFORM_METAL_EXT skip |= ExportMetalObjectsPNextUtil(VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT, - "VUID-VkEventCreateInfo-pNext-06790", error_obj.location, + "VUID-VkEventCreateInfo-pNext-06790", state.error_obj.location, "VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT", pCreateInfo->pNext); #endif // VK_USE_PLATFORM_METAL_EXT return skip; -} \ No newline at end of file +} diff --git a/layers/stateless/sl_utils.cpp b/layers/stateless/sl_utils.cpp index 759773eaf8f..653f0999b82 100644 --- a/layers/stateless/sl_utils.cpp +++ b/layers/stateless/sl_utils.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,20 +54,6 @@ bool StatelessValidation::OutputExtensionError(const Location &loc, const vvl::E "function required extension %s which has not been enabled.\n", String(exentsions).c_str()); } -bool StatelessValidation::SupportedByPdev(const VkPhysicalDevice physical_device, vvl::Extension extension, bool skip_gpdp2) const { - // We don't know here if the caller cares or not about gpdp2 - if (instance_extensions.vk_khr_get_physical_device_properties2 || skip_gpdp2) { - // Struct is legal IF it's supported - const auto &dev_exts_enumerated = device_extensions_enumerated.find(physical_device); - if (dev_exts_enumerated == device_extensions_enumerated.end()) return true; - auto enum_iter = dev_exts_enumerated->second.find(extension); - if (enum_iter != dev_exts_enumerated->second.cend()) { - return true; - } - } - return false; -} - static const uint8_t kUtF8OneByteCode = 0xC0; static const uint8_t kUtF8OneByteMask = 0xE0; static const uint8_t kUtF8TwoByteCode = 0xE0; @@ -118,7 +104,7 @@ static VkStringErrorFlags ValidateVkString(const int max_length, const char *utf } static const int kMaxParamCheckerStringLength = 256; -bool StatelessValidation::ValidateString(const Location &loc, const char *vuid, const char *validate_string) const { +bool vvl::stateless::State::ValidateString(const Location &loc, const char *vuid, const char *validate_string) const { bool skip = false; VkStringErrorFlags result = ValidateVkString(kMaxParamCheckerStringLength, validate_string); @@ -126,30 +112,30 @@ bool StatelessValidation::ValidateString(const Location &loc, const char *vuid, if (result == VK_STRING_ERROR_NONE) { return skip; } else if (result & VK_STRING_ERROR_LENGTH) { - skip |= LogError(vuid, device, loc, "exceeds max length %" PRIu32 ".", kMaxParamCheckerStringLength); + skip |= log.LogError(vuid, error_obj.handle, loc, "exceeds max length %" PRIu32 ".", kMaxParamCheckerStringLength); } else if (result & VK_STRING_ERROR_BAD_DATA) { - skip |= LogError(vuid, device, loc, "contains invalid characters or is badly formed."); + skip |= log.LogError(vuid, error_obj.handle, loc, "contains invalid characters or is badly formed."); } return skip; } -bool StatelessValidation::ValidateNotZero(bool is_zero, const char *vuid, const Location &loc) const { +bool vvl::stateless::State::ValidateNotZero(bool is_zero, const char *vuid, const Location &loc) const { bool skip = false; if (is_zero) { - skip |= LogError(vuid, device, loc, "is zero."); + skip |= log.LogError(vuid, error_obj.handle, loc, "is zero."); } return skip; } -bool StatelessValidation::ValidateRequiredPointer(const Location &loc, const void *value, const char *vuid) const { +bool vvl::stateless::State::ValidateRequiredPointer(const Location &loc, const void *value, const char *vuid) const { bool skip = false; if (value == nullptr) { - skip |= LogError(vuid, device, loc, "is NULL."); + skip |= log.LogError(vuid, error_obj.handle, loc, "is NULL."); } return skip; } -bool StatelessValidation::ValidateAllocationCallbacks(const VkAllocationCallbacks &callback, const Location &loc) const { +bool vvl::stateless::State::ValidateAllocationCallbacks(const VkAllocationCallbacks &callback, const Location &loc) const { bool skip = false; skip |= ValidateRequiredPointer(loc.dot(Field::pfnAllocation), reinterpret_cast(callback.pfnAllocation), "VUID-VkAllocationCallbacks-pfnAllocation-00632"); @@ -174,9 +160,9 @@ bool StatelessValidation::ValidateAllocationCallbacks(const VkAllocationCallback return skip; } -bool StatelessValidation::ValidateStringArray(const Location &count_loc, const Location &array_loc, uint32_t count, - const char *const *array, bool count_required, bool array_required, - const char *count_required_vuid, const char *array_required_vuid) const { +bool vvl::stateless::State::ValidateStringArray(const Location &count_loc, const Location &array_loc, uint32_t count, + const char *const *array, bool count_required, bool array_required, + const char *count_required_vuid, const char *array_required_vuid) const { bool skip = false; if ((array == nullptr) || (count == 0)) { @@ -186,7 +172,7 @@ bool StatelessValidation::ValidateStringArray(const Location &count_loc, const L // Verify that strings in the array are not NULL for (uint32_t i = 0; i < count; ++i) { if (array[i] == nullptr) { - skip |= LogError(array_required_vuid, device, array_loc.dot(i), "is NULL."); + skip |= log.LogError(array_required_vuid, error_obj.handle, array_loc.dot(i), "is NULL."); } } } @@ -194,10 +180,9 @@ bool StatelessValidation::ValidateStringArray(const Location &count_loc, const L return skip; } -bool StatelessValidation::ValidateStructPnext(const Location &loc, const void *next, size_t allowed_type_count, - const VkStructureType *allowed_types, uint32_t header_version, const char *pnext_vuid, - const char *stype_vuid, const VkPhysicalDevice physical_device, - const bool is_const_param) const { +bool vvl::stateless::State::ValidateStructPnext(const Location &loc, const void *next, size_t allowed_type_count, + const VkStructureType *allowed_types, uint32_t header_version, + const char *pnext_vuid, const char *stype_vuid, const bool is_const_param) const { bool skip = false; if (next != nullptr) { @@ -213,7 +198,8 @@ bool StatelessValidation::ValidateStructPnext(const Location &loc, const void *n if ((allowed_type_count == 0) && (GetCustomStypeInfo().empty())) { std::string message = "must be NULL. "; message += disclaimer; - skip |= LogError(pnext_vuid, device, pNext_loc, message.c_str(), header_version, pNext_loc.Fields().c_str()); + skip |= + log.LogError(pnext_vuid, error_obj.handle, pNext_loc, message.c_str(), header_version, pNext_loc.Fields().c_str()); } else { const VkStructureType *start = allowed_types; const VkStructureType *end = allowed_types + allowed_type_count; @@ -223,9 +209,11 @@ bool StatelessValidation::ValidateStructPnext(const Location &loc, const void *n if ((loc.function != Func::vkCreateInstance || (current->sType != VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO)) && (loc.function != Func::vkCreateDevice || (current->sType != VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO))) { std::string type_name = string_VkStructureType(current->sType); - if (unique_stype_check.find(current->sType) != unique_stype_check.end() && !IsDuplicatePnext(current->sType)) { + if (unique_stype_check.find(current->sType) != unique_stype_check.end() + && !StatelessValidation::IsDuplicatePnext(current->sType)) { // stype_vuid will only be null if there are no listed pNext and will hit disclaimer check - skip |= LogError(stype_vuid, device, pNext_loc, + skip |= + log.LogError(stype_vuid, error_obj.handle, pNext_loc, "chain contains duplicate structure types: %s appears multiple times.", type_name.c_str()); } else { unique_stype_check.insert(current->sType); @@ -245,23 +233,23 @@ bool StatelessValidation::ValidateStructPnext(const Location &loc, const void *n if (type_name.compare("Unhandled VkStructureType") == 0) { std::string message = "chain includes a structure with unknown VkStructureType (%" PRIu32 "). "; message += disclaimer; - skip |= LogError(pnext_vuid, device, pNext_loc, message.c_str(), current->sType, header_version, - pNext_loc.Fields().c_str()); + skip |= log.LogError(pnext_vuid, error_obj.handle, pNext_loc, message.c_str(), current->sType, + header_version, pNext_loc.Fields().c_str()); } else { std::string message = "chain includes a structure with unexpected VkStructureType %s. "; message += disclaimer; - skip |= LogError(pnext_vuid, device, pNext_loc, message.c_str(), type_name.c_str(), header_version, - pNext_loc.Fields().c_str()); + skip |= log.LogError(pnext_vuid, error_obj.handle, pNext_loc, message.c_str(), type_name.c_str(), + header_version, pNext_loc.Fields().c_str()); } } // Send Location without pNext field so the pNext() connector can be used - skip |= ValidatePnextStructContents(loc, current, pnext_vuid, physical_device, is_const_param); + skip |= ValidatePnextStructContents(loc, current, pnext_vuid, is_const_param); if (loc.function == Func::vkGetPhysicalDeviceProperties2 || loc.function == Func::vkGetPhysicalDeviceProperties2KHR) { - skip |= ValidatePnextPropertyStructContents(loc, current, pnext_vuid, physical_device, is_const_param); + skip |= ValidatePnextPropertyStructContents(loc, current, pnext_vuid, is_const_param); } else if (loc.function == Func::vkGetPhysicalDeviceFeatures2 || loc.function == Func::vkGetPhysicalDeviceFeatures2KHR || loc.function == Func::vkCreateDevice) { - skip |= ValidatePnextFeatureStructContents(loc, current, pnext_vuid, physical_device, is_const_param); + skip |= ValidatePnextFeatureStructContents(loc, current, pnext_vuid, is_const_param); } } } @@ -273,21 +261,21 @@ bool StatelessValidation::ValidateStructPnext(const Location &loc, const void *n return skip; } -bool StatelessValidation::ValidateBool32(const Location &loc, VkBool32 value) const { +bool vvl::stateless::State::ValidateBool32(const Location &loc, VkBool32 value) const { bool skip = false; if ((value != VK_TRUE) && (value != VK_FALSE)) { - skip |= LogError("UNASSIGNED-GeneralParameterError-UnrecognizedBool32", device, loc, - "(%" PRIu32 - ") is neither VK_TRUE nor VK_FALSE. Applications MUST not pass any other " - "values than VK_TRUE or VK_FALSE into a Vulkan implementation where a VkBool32 is expected.", - value); + skip |= log.LogError("UNASSIGNED-GeneralParameterError-UnrecognizedBool32", error_obj.handle, loc, + "(%" PRIu32 + ") is neither VK_TRUE nor VK_FALSE. Applications MUST not pass any other " + "values than VK_TRUE or VK_FALSE into a Vulkan implementation where a VkBool32 is expected.", + value); } return skip; } -bool StatelessValidation::ValidateBool32Array(const Location &count_loc, const Location &array_loc, uint32_t count, - const VkBool32 *array, bool count_required, bool array_required, - const char *count_required_vuid, const char *array_required_vuid) const { +bool vvl::stateless::State::ValidateBool32Array(const Location &count_loc, const Location &array_loc, uint32_t count, + const VkBool32 *array, bool count_required, bool array_required, + const char *count_required_vuid, const char *array_required_vuid) const { bool skip = false; if ((array == nullptr) || (count == 0)) { @@ -296,11 +284,11 @@ bool StatelessValidation::ValidateBool32Array(const Location &count_loc, const L } else { for (uint32_t i = 0; i < count; ++i) { if ((array[i] != VK_TRUE) && (array[i] != VK_FALSE)) { - skip |= LogError(array_required_vuid, device, array_loc.dot(i), - "(%" PRIu32 - ") is neither VK_TRUE nor VK_FALSE. Applications MUST not pass any other " - "values than VK_TRUE or VK_FALSE into a Vulkan implementation where a VkBool32 is expected.", - array[i]); + skip |= log.LogError(array_required_vuid, error_obj.handle, array_loc.dot(i), + "(%" PRIu32 + ") is neither VK_TRUE nor VK_FALSE. Applications MUST not pass any other " + "values than VK_TRUE or VK_FALSE into a Vulkan implementation where a VkBool32 is expected.", + array[i]); } } } @@ -308,25 +296,25 @@ bool StatelessValidation::ValidateBool32Array(const Location &count_loc, const L return skip; } -bool StatelessValidation::ValidateReservedFlags(const Location &loc, VkFlags value, const char *vuid) const { +bool vvl::stateless::State::ValidateReservedFlags(const Location &loc, VkFlags value, const char *vuid) const { bool skip = false; if (value != 0) { - skip |= LogError(vuid, device, loc, "is %" PRIu32 ", but must be 0.", value); + skip |= log.LogError(vuid, error_obj.handle, loc, "is %" PRIu32 ", but must be 0.", value); } return skip; } // helper to implement validation of both 32 bit and 64 bit flags. template -bool StatelessValidation::ValidateFlagsImplementation(const Location &loc, vvl::FlagBitmask flag_bitmask, FlagTypedef all_flags, - FlagTypedef value, const FlagType flag_type, const char *vuid, - const char *flags_zero_vuid) const { +bool vvl::stateless::State::ValidateFlagsImplementation(const Location &loc, vvl::FlagBitmask flag_bitmask, FlagTypedef all_flags, + FlagTypedef value, const FlagType flag_type, const char *vuid, + const char *flags_zero_vuid) const { bool skip = false; const bool required = flag_type == kRequiredFlags || flag_type == kRequiredSingleBit; const char *zero_vuid = flag_type == kRequiredFlags ? flags_zero_vuid : vuid; if (required && value == 0) { - skip |= LogError(zero_vuid, device, loc, "is zero."); + skip |= log.LogError(zero_vuid, error_obj.handle, loc, "is zero."); } const auto HasMaxOneBitSet = [](const FlagTypedef f) { @@ -337,68 +325,68 @@ bool StatelessValidation::ValidateFlagsImplementation(const Location &loc, vvl:: const bool is_bits_type = flag_type == kRequiredSingleBit || flag_type == kOptionalSingleBit; if (is_bits_type && !HasMaxOneBitSet(value)) { - skip |= LogError(vuid, device, loc, "contains multiple members of %s when only a single value is allowed.", - String(flag_bitmask)); + skip |= log.LogError(vuid, error_obj.handle, loc, "contains multiple members of %s when only a single value is allowed.", + String(flag_bitmask)); } return skip; } -bool StatelessValidation::ValidateFlags(const Location &loc, vvl::FlagBitmask flag_bitmask, VkFlags all_flags, VkFlags value, - const FlagType flag_type, const VkPhysicalDevice physical_device, const char *vuid, - const char *flags_zero_vuid) const { +bool vvl::stateless::State::ValidateFlags(const Location &loc, vvl::FlagBitmask flag_bitmask, VkFlags all_flags, VkFlags value, + const FlagType flag_type, const char *vuid, const char *flags_zero_vuid) const { bool skip = false; skip |= ValidateFlagsImplementation(loc, flag_bitmask, all_flags, value, flag_type, vuid, flags_zero_vuid); - if (physical_device != VK_NULL_HANDLE && SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance5, true)) { + if (ignore_unknown_enums) { return skip; } if ((value & ~all_flags) != 0) { - skip |= LogError(vuid, device, loc, "contains flag bits (0x%" PRIx32 ") which are not recognized members of %s.", value, - String(flag_bitmask)); + skip |= + log.LogError(vuid, error_obj.handle, loc, "contains flag bits (0x%" PRIx32 ") which are not recognized members of %s.", + value, String(flag_bitmask)); } if (!skip && value != 0) { - vvl::Extensions required = IsValidFlagValue(flag_bitmask, value, device_extensions); - if (!required.empty() && device != VK_NULL_HANDLE) { - // If called from an instance function, there is no device to base extension support off of - skip |= LogError(vuid, device, loc, "has %s values (%s) that requires the extensions %s.", String(flag_bitmask), - DescribeFlagBitmaskValue(flag_bitmask, value).c_str(), String(required).c_str()); + vvl::Extensions required = IsValidFlagValue(flag_bitmask, value); + if (!required.empty()) { + skip |= + log.LogError(vuid, error_obj.handle, loc, "has %s values (%s) that requires the extensions %s.", + String(flag_bitmask), DescribeFlagBitmaskValue(flag_bitmask, value).c_str(), String(required).c_str()); } } return skip; } -bool StatelessValidation::ValidateFlags(const Location &loc, vvl::FlagBitmask flag_bitmask, VkFlags64 all_flags, VkFlags64 value, - const FlagType flag_type, const VkPhysicalDevice physical_device, const char *vuid, - const char *flags_zero_vuid) const { +bool vvl::stateless::State::ValidateFlags(const Location &loc, vvl::FlagBitmask flag_bitmask, VkFlags64 all_flags, VkFlags64 value, + const FlagType flag_type, const char *vuid, const char *flags_zero_vuid) const { bool skip = false; skip |= ValidateFlagsImplementation(loc, flag_bitmask, all_flags, value, flag_type, vuid, flags_zero_vuid); - if (physical_device != VK_NULL_HANDLE && SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance5, true)) { + if (ignore_unknown_enums) { return skip; } if ((value & ~all_flags) != 0) { - skip |= LogError(vuid, device, loc, "contains flag bits (0x%" PRIx64 ") which are not recognized members of %s.", value, - String(flag_bitmask)); + skip |= + log.LogError(vuid, error_obj.handle, loc, "contains flag bits (0x%" PRIx64 ") which are not recognized members of %s.", + value, String(flag_bitmask)); } if (!skip && value != 0) { - vvl::Extensions required = IsValidFlag64Value(flag_bitmask, value, device_extensions); - if (!required.empty() && device != VK_NULL_HANDLE) { - // If called from an instance function, there is no device to base extension support off of - skip |= LogError(vuid, device, loc, "has %s values (%s) that requires the extensions %s.", String(flag_bitmask), - DescribeFlagBitmaskValue64(flag_bitmask, value).c_str(), String(required).c_str()); + vvl::Extensions required = IsValidFlag64Value(flag_bitmask, value); + if (!required.empty()) { + skip |= log.LogError(vuid, error_obj.handle, loc, "has %s values (%s) that requires the extensions %s.", + String(flag_bitmask), DescribeFlagBitmaskValue64(flag_bitmask, value).c_str(), + String(required).c_str()); } } return skip; } -bool StatelessValidation::ValidateFlagsArray(const Location &count_loc, const Location &array_loc, vvl::FlagBitmask flag_bitmask, - VkFlags all_flags, uint32_t count, const VkFlags *array, bool count_required, - const char *count_required_vuid, const char *array_required_vuid) const { +bool vvl::stateless::State::ValidateFlagsArray(const Location &count_loc, const Location &array_loc, vvl::FlagBitmask flag_bitmask, + VkFlags all_flags, uint32_t count, const VkFlags *array, bool count_required, + const char *count_required_vuid, const char *array_required_vuid) const { bool skip = false; if ((array == nullptr) || (count == 0)) { @@ -408,8 +396,8 @@ bool StatelessValidation::ValidateFlagsArray(const Location &count_loc, const Lo // Verify that all VkFlags values in the array for (uint32_t i = 0; i < count; ++i) { if ((array[i] & (~all_flags)) != 0) { - skip |= LogError(array_required_vuid, device, array_loc.dot(i), - "contains flag bits that are not recognized members of %s.", String(flag_bitmask)); + skip |= log.LogError(array_required_vuid, error_obj.handle, array_loc.dot(i), + "contains flag bits that are not recognized members of %s.", String(flag_bitmask)); } } } diff --git a/layers/stateless/sl_wsi.cpp b/layers/stateless/sl_wsi.cpp index dbe1df162d7..8a0c1e0c9f1 100644 --- a/layers/stateless/sl_wsi.cpp +++ b/layers/stateless/sl_wsi.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. +/* Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (C) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,8 +22,9 @@ bool StatelessValidation::manual_PreCallValidateAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (semaphore == VK_NULL_HANDLE && fence == VK_NULL_HANDLE) { skip |= LogError("VUID-vkAcquireNextImageKHR-semaphore-01780", swapchain, error_obj.location, @@ -34,8 +35,10 @@ bool StatelessValidation::manual_PreCallValidateAcquireNextImageKHR(VkDevice dev } bool StatelessValidation::manual_PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, - uint32_t *pImageIndex, const ErrorObject &error_obj) const { + uint32_t *pImageIndex, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pAcquireInfo->semaphore == VK_NULL_HANDLE && pAcquireInfo->fence == VK_NULL_HANDLE) { skip |= LogError("VUID-VkAcquireNextImageInfoKHR-semaphore-01782", pAcquireInfo->swapchain, @@ -45,7 +48,8 @@ bool StatelessValidation::manual_PreCallValidateAcquireNextImage2KHR(VkDevice de return skip; } -bool StatelessValidation::ValidateSwapchainCreateInfo(const VkSwapchainCreateInfoKHR &create_info, const Location &loc) const { +bool StatelessValidation::ValidateSwapchainCreateInfo(const vvl::stateless::State &state, + const VkSwapchainCreateInfoKHR &create_info, const Location &loc) const { bool skip = false; // Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml @@ -65,8 +69,8 @@ bool StatelessValidation::ValidateSwapchainCreateInfo(const VkSwapchainCreateInf } } - skip |= ValidateNotZero(create_info.imageArrayLayers == 0, "VUID-VkSwapchainCreateInfoKHR-imageArrayLayers-01275", - loc.dot(Field::imageArrayLayers)); + skip |= state.ValidateNotZero(create_info.imageArrayLayers == 0, "VUID-VkSwapchainCreateInfoKHR-imageArrayLayers-01275", + loc.dot(Field::imageArrayLayers)); // Validate VK_KHR_image_format_list VkImageFormatListCreateInfo const auto format_list_info = vku::FindStructInPNextChain(create_info.pNext); @@ -127,8 +131,9 @@ bool StatelessValidation::ValidateSwapchainCreateInfo(const VkSwapchainCreateInf } if (create_info.flags & VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR) { - const bool is_required_ext_supported = - SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_surface_protected_capabilities); + auto stateless_instance = static_cast(dispatch_instance_->GetValidationObject(container_type)); + const auto &physdev_extensions = stateless_instance->physical_device_extensions.at(physical_device); + const bool is_required_ext_supported = IsExtEnabled(physdev_extensions.vk_khr_surface_protected_capabilities); const bool is_required_ext_enabled = IsExtEnabled(instance_extensions.vk_khr_surface_protected_capabilities); if (is_required_ext_supported && !is_required_ext_enabled) { @@ -156,9 +161,12 @@ bool StatelessValidation::ValidateSwapchainCreateInfo(const VkSwapchainCreateInf bool StatelessValidation::manual_PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkSwapchainKHR *pSwapchain, const ErrorObject &error_obj) const { + VkSwapchainKHR *pSwapchain, + const vvl::stateless::State &state) const { bool skip = false; - skip |= ValidateSwapchainCreateInfo(*pCreateInfo, error_obj.location.dot(Field::pCreateInfo)); + const auto &error_obj = state.error_obj; + + skip |= ValidateSwapchainCreateInfo(state, *pCreateInfo, error_obj.location.dot(Field::pCreateInfo)); return skip; } @@ -166,19 +174,21 @@ bool StatelessValidation::manual_PreCallValidateCreateSharedSwapchainsKHR(VkDevi const VkSwapchainCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pCreateInfos) { for (uint32_t i = 0; i < swapchainCount; i++) { - skip |= ValidateSwapchainCreateInfo(pCreateInfos[i], error_obj.location.dot(Field::pCreateInfos, i)); + skip |= ValidateSwapchainCreateInfo(state, pCreateInfos[i], error_obj.location.dot(Field::pCreateInfos, i)); } } return skip; } bool StatelessValidation::manual_PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (!pPresentInfo) return skip; if (const auto *present_regions = vku::FindStructInPNextChain(pPresentInfo->pNext)) { @@ -207,19 +217,21 @@ bool StatelessValidation::manual_PreCallValidateQueuePresentKHR(VkQueue queue, c bool StatelessValidation::manual_PreCallValidateCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkDisplayModeKHR *pMode, const ErrorObject &error_obj) const { + VkDisplayModeKHR *pMode, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const VkDisplayModeParametersKHR display_mode_parameters = pCreateInfo->parameters; const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); const Location param_loc = create_info_loc.dot(Field::parameters); - skip |= ValidateNotZero(display_mode_parameters.visibleRegion.width == 0, "VUID-VkDisplayModeParametersKHR-width-01990", - param_loc.dot(Field::visibleRegion).dot(Field::width)); - skip |= ValidateNotZero(display_mode_parameters.visibleRegion.height == 0, "VUID-VkDisplayModeParametersKHR-height-01991", - param_loc.dot(Field::visibleRegion).dot(Field::width)); - skip |= ValidateNotZero(display_mode_parameters.refreshRate == 0, "VUID-VkDisplayModeParametersKHR-refreshRate-01992", - param_loc.dot(Field::refreshRate)); + skip |= state.ValidateNotZero(display_mode_parameters.visibleRegion.width == 0, "VUID-VkDisplayModeParametersKHR-width-01990", + param_loc.dot(Field::visibleRegion).dot(Field::width)); + skip |= state.ValidateNotZero(display_mode_parameters.visibleRegion.height == 0, "VUID-VkDisplayModeParametersKHR-height-01991", + param_loc.dot(Field::visibleRegion).dot(Field::width)); + skip |= state.ValidateNotZero(display_mode_parameters.refreshRate == 0, "VUID-VkDisplayModeParametersKHR-refreshRate-01992", + param_loc.dot(Field::refreshRate)); return skip; } @@ -228,8 +240,9 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfaceFormatsK VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-06524", physicalDevice, @@ -242,8 +255,9 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfacePresentM VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-06524", physicalDevice, @@ -254,8 +268,9 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfacePresentM bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, - VkSurfaceCapabilities2KHR *pSurfaceCapabilities, const ErrorObject &error_obj) const { + VkSurfaceCapabilities2KHR *pSurfaceCapabilities, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-06521", physicalDevice, error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), @@ -313,8 +328,9 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfaceCapabili bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, - VkSurfaceFormat2KHR *pSurfaceFormats, const ErrorObject &error_obj) const { + VkSurfaceFormat2KHR *pSurfaceFormats, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-06521", physicalDevice, error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), @@ -335,8 +351,9 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfaceFormats2 #ifdef VK_USE_PLATFORM_WIN32_KHR bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfacePresentModes2EXT( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pPresentModeCount, - VkPresentModeKHR *pPresentModes, const ErrorObject &error_obj) const { + VkPresentModeKHR *pPresentModes, const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-06521", physicalDevice, error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), @@ -348,8 +365,10 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfacePresentM bool StatelessValidation::manual_PreCallValidateCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkSurfaceKHR *pSurface, const ErrorObject &error_obj) const { + VkSurfaceKHR *pSurface, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pCreateInfo->hwnd == nullptr) { skip |= LogError("VUID-VkWin32SurfaceCreateInfoKHR-hwnd-01308", instance, error_obj.location, "pCreateInfo->hwnd is NULL."); @@ -363,6 +382,7 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(V VkDeviceGroupPresentModeFlagsKHR *pModes, const ErrorObject &error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); if (!IsExtEnabled(device_extensions.vk_khr_swapchain)) skip |= OutputExtensionError(error_obj.location, {vvl::Extension::_VK_KHR_swapchain}); if (!IsExtEnabled(device_extensions.vk_khr_get_surface_capabilities2)) @@ -378,7 +398,7 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(V error_obj.location.dot(Field::pModes), "is NULL."); } - skip |= ValidateStructType( + skip |= state.ValidateStructType( error_obj.location.dot(Field::pSurfaceInfo), pSurfaceInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, true, "VUID-vkGetDeviceGroupSurfacePresentModes2EXT-pSurfaceInfo-parameter", "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType"); if (pSurfaceInfo != NULL) { @@ -386,10 +406,10 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(V VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT}; - skip |= ValidateStructPnext(error_obj.location.dot(Field::pSurfaceInfo), pSurfaceInfo->pNext, allowed_structs.size(), - allowed_structs.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-unique"); + skip |= state.ValidateStructPnext(error_obj.location.dot(Field::pSurfaceInfo), pSurfaceInfo->pNext, allowed_structs.size(), + allowed_structs.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", + "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-unique"); if (pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-06521", device, @@ -397,7 +417,8 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(V "is VK_NULL_HANDLE and VK_GOOGLE_surfaceless_query is not enabled."); } - skip |= ValidateRequiredHandle(error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), pSurfaceInfo->surface); + skip |= + state.ValidateRequiredHandle(error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), pSurfaceInfo->surface); } return skip; } @@ -408,8 +429,9 @@ bool StatelessValidation::manual_PreCallValidateCreateWaylandSurfaceKHR(VkInstan const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const auto display = pCreateInfo->display; const auto surface = pCreateInfo->surface; @@ -432,8 +454,9 @@ bool StatelessValidation::manual_PreCallValidateCreateWaylandSurfaceKHR(VkInstan bool StatelessValidation::manual_PreCallValidateCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const auto connection = pCreateInfo->connection; const auto window = pCreateInfo->window; @@ -443,8 +466,8 @@ bool StatelessValidation::manual_PreCallValidateCreateXcbSurfaceKHR(VkInstance i error_obj.location.dot(Field::pCreateInfo).dot(Field::connection), "is NULL!"); } - skip |= ValidateNotZero(window == 0, "VUID-VkXcbSurfaceCreateInfoKHR-window-01311", - error_obj.location.dot(Field::pCreateInfo).dot(Field::window)); + skip |= state.ValidateNotZero(window == 0, "VUID-VkXcbSurfaceCreateInfoKHR-window-01311", + error_obj.location.dot(Field::pCreateInfo).dot(Field::window)); return skip; } @@ -454,8 +477,10 @@ bool StatelessValidation::manual_PreCallValidateCreateXcbSurfaceKHR(VkInstance i bool StatelessValidation::manual_PreCallValidateCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkSurfaceKHR *pSurface, const ErrorObject &error_obj) const { + VkSurfaceKHR *pSurface, + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; const auto display = pCreateInfo->dpy; const auto window = pCreateInfo->window; @@ -465,8 +490,8 @@ bool StatelessValidation::manual_PreCallValidateCreateXlibSurfaceKHR(VkInstance error_obj.location.dot(Field::pCreateInfo).dot(Field::dpy), "is NULL!"); } - skip |= ValidateNotZero(window == 0, "VUID-VkXlibSurfaceCreateInfoKHR-window-01314", - error_obj.location.dot(Field::pCreateInfo).dot(Field::window)); + skip |= state.ValidateNotZero(window == 0, "VUID-VkXlibSurfaceCreateInfoKHR-window-01314", + error_obj.location.dot(Field::pCreateInfo).dot(Field::window)); return skip; } @@ -477,8 +502,9 @@ bool StatelessValidation::manual_PreCallValidateCreateAndroidSurfaceKHR(VkInstan const VkAndroidSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const { + const vvl::stateless::State &state) const { bool skip = false; + const auto &error_obj = state.error_obj; if (pCreateInfo->window == nullptr) { skip |= LogError("VUID-VkAndroidSurfaceCreateInfoKHR-window-01248", instance, error_obj.location.dot(Field::pCreateInfo).dot(Field::window), "is NULL."); diff --git a/layers/stateless/stateless_validation.h b/layers/stateless/stateless_validation.h index a2da4020cb9..15d34784c22 100644 --- a/layers/stateless/stateless_validation.h +++ b/layers/stateless/stateless_validation.h @@ -26,63 +26,23 @@ #include "chassis/validation_object.h" #include "generated/device_features.h" -class StatelessValidation : public ValidationObject { - using BaseClass = ValidationObject; +enum FlagType { kRequiredFlags, kOptionalFlags, kRequiredSingleBit, kOptionalSingleBit }; + +namespace vvl { +namespace stateless { +class State { using Func = vvl::Func; using Struct = vvl::Struct; using Field = vvl::Field; public: - StatelessValidation(vvl::dispatch::Device *dev, StatelessValidation *instance_vo) - : BaseClass(dev, LayerObjectTypeParameterValidation) {} - StatelessValidation(vvl::dispatch::Instance *inst) : BaseClass(inst, LayerObjectTypeParameterValidation) {} - ~StatelessValidation() {} - - VkPhysicalDeviceLimits device_limits = {}; - vvl::unordered_map physical_device_properties_map; - vvl::unordered_map> device_extensions_enumerated{}; - // We have a copy of this in Stateless and ValidationStateTracker, could move the ValidationObject, but we don't have a way to - // set it at the ValidationObject level - DeviceFeatures enabled_features = {}; - - // This was a special case where it was decided to use the extension version for validation - // https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/5671 - inline static uint32_t discard_rectangles_extension_version = 0; - inline static uint32_t scissor_exclusive_extension_version = 0; - - // Override chassis read/write locks for this validation object - // This override takes a deferred lock. i.e. it is not acquired. - ReadLockGuard ReadLock() const override; - WriteLockGuard WriteLock() override; - - // Device extension properties -- storing properties gathered from VkPhysicalDeviceProperties2::pNext chain - struct DeviceExtensionProperties { - VkPhysicalDeviceShadingRateImagePropertiesNV shading_rate_image_props; - VkPhysicalDeviceMeshShaderPropertiesNV mesh_shader_props_nv; - VkPhysicalDeviceMeshShaderPropertiesEXT mesh_shader_props_ext; - VkPhysicalDeviceRayTracingPropertiesNV ray_tracing_props_nv; - VkPhysicalDeviceRayTracingPipelinePropertiesKHR ray_tracing_props_khr; - VkPhysicalDeviceAccelerationStructurePropertiesKHR acc_structure_props; - VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback_props; - VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR vertex_attribute_divisor_props; - VkPhysicalDeviceFragmentShadingRatePropertiesKHR fragment_shading_rate_props; - VkPhysicalDeviceDepthStencilResolveProperties depth_stencil_resolve_props; - VkPhysicalDeviceExternalMemoryHostPropertiesEXT external_memory_host_props; - VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT device_generated_commands_props; - VkPhysicalDeviceRenderPassStripedPropertiesARM renderpass_striped_props; - }; - DeviceExtensionProperties phys_dev_ext_props = {}; - - struct SubpassesUsageStates { - vvl::unordered_set subpasses_using_color_attachment; - vvl::unordered_set subpasses_using_depthstencil_attachment; - }; + const Logger &log; + const ErrorObject &error_obj; + const DeviceExtensions &exts; + bool ignore_unknown_enums; - // Though this validation object is predominantly statless, the Framebuffer checks are greatly simplified by creating and - // updating a map of the renderpass usage states, and these accesses need thread protection. Use a mutex separate from the - // parent object's to maintain that functionality. - mutable std::mutex renderpass_map_mutex; - vvl::unordered_map renderpasses_states; + State(const Logger &log_, const ErrorObject &err_, const DeviceExtensions &exts_, bool ignore_unknown_enums_ = false) + : log(log_), error_obj(err_), exts(exts_), ignore_unknown_enums(ignore_unknown_enums_) {} bool ValidateNotZero(bool is_zero, const char *vuid, const Location &loc) const; @@ -97,12 +57,12 @@ class StatelessValidation : public ValidationObject { // Count parameters not tagged as optional cannot be 0 if (count_required && (count == 0)) { - skip |= LogError(count_required_vuid, device, count_loc, "must be greater than 0."); + skip |= log.LogError(count_required_vuid, error_obj.handle, count_loc, "must be greater than 0."); } // Array parameters not tagged as optional cannot be NULL, unless the count is 0 if (array_required && (count != 0) && (*array == nullptr)) { - skip |= LogError(array_required_vuid, device, array_loc, "is NULL."); + skip |= log.LogError(array_required_vuid, error_obj.handle, array_loc, "is NULL."); } return skip; @@ -117,7 +77,7 @@ class StatelessValidation : public ValidationObject { if (count == nullptr) { if (count_ptr_required) { - skip |= LogError(count_ptr_required_vuid, device, count_loc, "is NULL."); + skip |= log.LogError(count_ptr_required_vuid, error_obj.handle, count_loc, "is NULL."); } } else { skip |= ValidateArray(count_loc, array_loc, *array ? (*count) : 0, &array, count_value_required, array_required, @@ -134,10 +94,10 @@ class StatelessValidation : public ValidationObject { if (value == nullptr) { if (required) { - skip |= LogError(struct_vuid, device, loc, "is NULL."); + skip |= log.LogError(struct_vuid, error_obj.handle, loc, "is NULL."); } } else if (value->sType != sType) { - skip |= LogError(stype_vuid, device, loc.dot(Field::sType), "must be %s.", string_VkStructureType(sType)); + skip |= log.LogError(stype_vuid, error_obj.handle, loc.dot(Field::sType), "must be %s.", string_VkStructureType(sType)); } return skip; @@ -156,8 +116,8 @@ class StatelessValidation : public ValidationObject { // Verify that all structs in the array have the correct type for (uint32_t i = 0; i < count; ++i) { if (array[i].sType != sType) { - skip |= LogError(stype_vuid, device, array_loc.dot(i).dot(Field::sType), "must be %s", - string_VkStructureType(sType)); + skip |= log.LogError(stype_vuid, error_obj.handle, array_loc.dot(i).dot(Field::sType), "must be %s", + string_VkStructureType(sType)); } } } @@ -178,8 +138,8 @@ class StatelessValidation : public ValidationObject { // Verify that all structs in the array have the correct type for (uint32_t i = 0; i < count; ++i) { if (array[i]->sType != sType) { - skip |= LogError(stype_vuid, device, array_loc.dot(i).dot(Field::sType), "must be %s", - string_VkStructureType(sType)); + skip |= log.LogError(stype_vuid, error_obj.handle, array_loc.dot(i).dot(Field::sType), "must be %s", + string_VkStructureType(sType)); } } } @@ -196,7 +156,7 @@ class StatelessValidation : public ValidationObject { if (count == nullptr) { if (count_ptr_required) { - skip |= LogError(count_ptr_required_vuid, device, count_loc, "is NULL."); + skip |= log.LogError(count_ptr_required_vuid, error_obj.handle, count_loc, "is NULL."); } } else { skip |= @@ -211,7 +171,7 @@ class StatelessValidation : public ValidationObject { bool ValidateRequiredHandle(const Location &loc, T value) const { bool skip = false; if (value == VK_NULL_HANDLE) { - skip |= LogError("UNASSIGNED-GeneralParameterError-RequiredHandle", device, loc, "is VK_NULL_HANDLE."); + skip |= log.LogError("UNASSIGNED-GeneralParameterError-RequiredHandle", error_obj.handle, loc, "is VK_NULL_HANDLE."); } return skip; } @@ -228,8 +188,8 @@ class StatelessValidation : public ValidationObject { // Verify that no handles in the array are VK_NULL_HANDLE for (uint32_t i = 0; i < count; ++i) { if (array[i] == VK_NULL_HANDLE) { - skip |= LogError("UNASSIGNED-GeneralParameterError-RequiredHandleArray", device, array_loc.dot(i), - "is VK_NULL_HANDLE."); + skip |= log.LogError("UNASSIGNED-GeneralParameterError-RequiredHandleArray", error_obj.handle, array_loc.dot(i), + "is VK_NULL_HANDLE."); } } } @@ -237,24 +197,22 @@ class StatelessValidation : public ValidationObject { return skip; } + bool ValidateString(const Location &loc, const char *vuid, const char *validate_string) const; + bool ValidateStringArray(const Location &count_loc, const Location &array_loc, uint32_t count, const char *const *array, bool count_required, bool array_required, const char *count_required_vuid, const char *array_required_vuid) const; - bool CheckPromotedApiAgainstVulkanVersion(VkInstance instance, const Location &loc, const uint32_t promoted_version) const; - bool CheckPromotedApiAgainstVulkanVersion(VkPhysicalDevice pdev, const Location &loc, const uint32_t promoted_version) const; - bool SupportedByPdev(const VkPhysicalDevice physical_device, vvl::Extension extension, bool skip_gpdp2 = false) const; - bool ValidatePnextFeatureStructContents(const Location &loc, const VkBaseOutStructure *header, const char *pnext_vuid, - VkPhysicalDevice physicalDevice = VK_NULL_HANDLE, bool is_const_param = true) const; + bool is_const_param = true) const; bool ValidatePnextPropertyStructContents(const Location &loc, const VkBaseOutStructure *header, const char *pnext_vuid, - VkPhysicalDevice physicalDevice = VK_NULL_HANDLE, bool is_const_param = true) const; + bool is_const_param = true) const; bool ValidatePnextStructContents(const Location &loc, const VkBaseOutStructure *header, const char *pnext_vuid, - VkPhysicalDevice physicalDevice = VK_NULL_HANDLE, bool is_const_param = true) const; + bool is_const_param = true) const; bool ValidateStructPnext(const Location &loc, const void *next, size_t allowed_type_count, const VkStructureType *allowed_types, uint32_t header_version, const char *pnext_vuid, const char *stype_vuid, - VkPhysicalDevice physicalDevice = VK_NULL_HANDLE, const bool is_const_param = true) const; + const bool is_const_param = true) const; bool ValidateBool32(const Location &loc, VkBool32 value) const; @@ -263,25 +221,24 @@ class StatelessValidation : public ValidationObject { const char *array_required_vuid) const; template - bool ValidateRangedEnum(const Location &loc, vvl::Enum name, T value, const char *vuid, - const VkPhysicalDevice physical_device = VK_NULL_HANDLE) const { + bool ValidateRangedEnum(const Location &loc, vvl::Enum name, T value, const char *vuid) const { bool skip = false; - if (physical_device != VK_NULL_HANDLE && SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance5, true)) { + if (ignore_unknown_enums) { return skip; } ValidValue result = IsValidEnumValue(value); if (result == ValidValue::NotFound) { - skip |= LogError(vuid, device, loc, - "(%" PRIu32 - ") does not fall within the begin..end range of the %s enumeration tokens and is " - "not an extension added token.", - value, String(name)); - } else if (result == ValidValue::NoExtension && device != VK_NULL_HANDLE) { + skip |= log.LogError(vuid, error_obj.handle, loc, + "(%" PRIu32 + ") does not fall within the begin..end range of the %s enumeration tokens and is " + "not an extension added token.", + value, String(name)); + } else if (result == ValidValue::NoExtension) { // If called from an instance function, there is no device to base extension support off of auto extensions = GetEnumExtensions(value); - skip |= - LogError(vuid, device, loc, "(%s) requires the extensions %s.", DescribeEnum(value), String(extensions).c_str()); + skip |= log.LogError(vuid, error_obj.handle, loc, "(%s) requires the extensions %s.", DescribeEnum(value), + String(extensions).c_str()); } return skip; @@ -300,16 +257,16 @@ class StatelessValidation : public ValidationObject { for (uint32_t i = 0; i < count; ++i) { ValidValue result = IsValidEnumValue(array[i]); if (result == ValidValue::NotFound) { - skip |= LogError(array_required_vuid, device, array_loc.dot(i), - "(%" PRIu32 - ") does not fall within the begin..end range of the %s enumeration tokens and is " - "not an extension added token.", - array[i], String(name)); - } else if (result == ValidValue::NoExtension && device != VK_NULL_HANDLE) { + skip |= log.LogError(array_required_vuid, error_obj.handle, array_loc.dot(i), + "(%" PRIu32 + ") does not fall within the begin..end range of the %s enumeration tokens and is " + "not an extension added token.", + array[i], String(name)); + } else if (result == ValidValue::NoExtension) { // If called from an instance function, there is no device to base extension support off of auto extensions = GetEnumExtensions(array[i]); - skip |= LogError(array_required_vuid, device, array_loc.dot(i), "(%s) requires the extensions %s.", - DescribeEnum(array[i]), String(extensions).c_str()); + skip |= log.LogError(array_required_vuid, error_obj.handle, array_loc.dot(i), + "(%s) requires the extensions %s.", DescribeEnum(array[i]), String(extensions).c_str()); } } } @@ -319,20 +276,16 @@ class StatelessValidation : public ValidationObject { bool ValidateReservedFlags(const Location &loc, VkFlags value, const char *vuid) const; - enum FlagType { kRequiredFlags, kOptionalFlags, kRequiredSingleBit, kOptionalSingleBit }; - // helper to implement validation of both 32 bit and 64 bit flags. template bool ValidateFlagsImplementation(const Location &loc, vvl::FlagBitmask flag_bitmask, FlagTypedef all_flags, FlagTypedef value, const FlagType flag_type, const char *vuid, const char *flags_zero_vuid = nullptr) const; bool ValidateFlags(const Location &loc, vvl::FlagBitmask flag_bitmask, VkFlags all_flags, VkFlags value, - const FlagType flag_type, const VkPhysicalDevice physical_device, const char *vuid, - const char *flags_zero_vuid = nullptr) const; + const FlagType flag_type, const char *vuid, const char *flags_zero_vuid = nullptr) const; bool ValidateFlags(const Location &loc, vvl::FlagBitmask flag_bitmask, VkFlags64 all_flags, VkFlags64 value, - const FlagType flag_type, const VkPhysicalDevice physical_device, const char *vuid, - const char *flags_zero_vuid = nullptr) const; + const FlagType flag_type, const char *vuid, const char *flags_zero_vuid = nullptr) const; bool ValidateFlagsArray(const Location &count_loc, const Location &array_loc, vvl::FlagBitmask flag_bitmask, VkFlags all_flags, uint32_t count, const VkFlags *array, bool count_required, const char *count_required_vuid, @@ -346,11 +299,74 @@ class StatelessValidation : public ValidationObject { const char *DescribeEnum(T value) const; // VkFlags values don't have a way overload, so need to use vvl::FlagBitmask - vvl::Extensions IsValidFlagValue(vvl::FlagBitmask flag_bitmask, VkFlags value, const DeviceExtensions &device_extensions) const; - vvl::Extensions IsValidFlag64Value(vvl::FlagBitmask flag_bitmask, VkFlags64 value, - const DeviceExtensions &device_extensions) const; + vvl::Extensions IsValidFlagValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const; + vvl::Extensions IsValidFlag64Value(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const; std::string DescribeFlagBitmaskValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const; std::string DescribeFlagBitmaskValue64(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const; +}; +} // namespace stateless +} // namespace vvl + +class StatelessValidation : public ValidationObject { + using BaseClass = ValidationObject; + using Func = vvl::Func; + using Struct = vvl::Struct; + using Field = vvl::Field; + + public: + StatelessValidation(vvl::dispatch::Device *dev, StatelessValidation *instance_vo) + : BaseClass(dev, LayerObjectTypeParameterValidation) {} + StatelessValidation(vvl::dispatch::Instance *inst) : BaseClass(inst, LayerObjectTypeParameterValidation) {} + ~StatelessValidation() {} + + VkPhysicalDeviceLimits device_limits = {}; + vvl::unordered_map physical_device_properties_map; + vvl::unordered_map physical_device_extensions{}; + // We have a copy of this in Stateless and ValidationStateTracker, could move the ValidationObject, but we don't have a way to + // set it at the ValidationObject level + DeviceFeatures enabled_features = {}; + + // This was a special case where it was decided to use the extension version for validation + // https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/5671 + inline static uint32_t discard_rectangles_extension_version = 0; + inline static uint32_t scissor_exclusive_extension_version = 0; + + // Override chassis read/write locks for this validation object + // This override takes a deferred lock. i.e. it is not acquired. + ReadLockGuard ReadLock() const override; + WriteLockGuard WriteLock() override; + + // Device extension properties -- storing properties gathered from VkPhysicalDeviceProperties2::pNext chain + struct DeviceExtensionProperties { + VkPhysicalDeviceShadingRateImagePropertiesNV shading_rate_image_props; + VkPhysicalDeviceMeshShaderPropertiesNV mesh_shader_props_nv; + VkPhysicalDeviceMeshShaderPropertiesEXT mesh_shader_props_ext; + VkPhysicalDeviceRayTracingPropertiesNV ray_tracing_props_nv; + VkPhysicalDeviceRayTracingPipelinePropertiesKHR ray_tracing_props_khr; + VkPhysicalDeviceAccelerationStructurePropertiesKHR acc_structure_props; + VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback_props; + VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR vertex_attribute_divisor_props; + VkPhysicalDeviceFragmentShadingRatePropertiesKHR fragment_shading_rate_props; + VkPhysicalDeviceDepthStencilResolveProperties depth_stencil_resolve_props; + VkPhysicalDeviceExternalMemoryHostPropertiesEXT external_memory_host_props; + VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT device_generated_commands_props; + VkPhysicalDeviceRenderPassStripedPropertiesARM renderpass_striped_props; + }; + DeviceExtensionProperties phys_dev_ext_props = {}; + + struct SubpassesUsageStates { + vvl::unordered_set subpasses_using_color_attachment; + vvl::unordered_set subpasses_using_depthstencil_attachment; + }; + + // Though this validation object is predominantly statless, the Framebuffer checks are greatly simplified by creating and + // updating a map of the renderpass usage states, and these accesses need thread protection. Use a mutex separate from the + // parent object's to maintain that functionality. + mutable std::mutex renderpass_map_mutex; + vvl::unordered_map renderpasses_states; + + bool CheckPromotedApiAgainstVulkanVersion(VkInstance instance, const Location &loc, const uint32_t promoted_version) const; + bool CheckPromotedApiAgainstVulkanVersion(VkPhysicalDevice pdev, const Location &loc, const uint32_t promoted_version) const; template bool ValidateExtensionReqs(const ExtensionState &extensions, const char *vuid, const char *extension_type, @@ -386,8 +402,6 @@ class StatelessValidation : public ValidationObject { VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties, const RecordObject &record_obj) override; - bool ValidateString(const Location &loc, const char *vuid, const char *validate_string) const; - bool ValidateCoarseSampleOrderCustomNV(const VkCoarseSampleOrderCustomNV &order, const Location &order_loc) const; bool ValidateGeometryTrianglesNV(const VkGeometryTrianglesNV &triangles, VkAccelerationStructureNV object_handle, @@ -395,9 +409,10 @@ class StatelessValidation : public ValidationObject { bool ValidateGeometryAABBNV(const VkGeometryAABBNV &geometry, VkAccelerationStructureNV object_handle, const Location &loc) const; bool ValidateGeometryNV(const VkGeometryNV &geometry, VkAccelerationStructureNV object_handle, const Location &loc) const; - bool ValidateAccelerationStructureInfoNV(const VkAccelerationStructureInfoNV &info, VkAccelerationStructureNV object_handle, - const Location &loc) const; - bool ValidateSwapchainCreateInfo(const VkSwapchainCreateInfoKHR &create_info, const Location &loc) const; + bool ValidateAccelerationStructureInfoNV(const vvl::stateless::State &state, const VkAccelerationStructureInfoNV &info, + VkAccelerationStructureNV object_handle, const Location &loc) const; + bool ValidateSwapchainCreateInfo(const vvl::stateless::State &state, const VkSwapchainCreateInfoKHR &create_info, + const Location &loc) const; bool OutputExtensionError(const Location &loc, const vvl::Extensions &exentsions) const; @@ -406,30 +421,31 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; - bool manual_PreCallValidateCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkInstance *pInstance, const ErrorObject &error_obj) const; + bool PreCallValidateCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, + VkInstance *pInstance, const ErrorObject &error_obj) const override; bool manual_PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateCreateImageSparse(const VkImageCreateInfo &create_info, const Location &create_info_loc) const; bool ValidateCreateImageFragmentShadingRate(const VkImageCreateInfo &create_info, const Location &create_info_loc) const; bool ValidateCreateImageCornerSampled(const VkImageCreateInfo &create_info, const Location &create_info_loc) const; bool ValidateCreateImageStencilUsage(const VkImageCreateInfo &create_info, const Location &create_info_loc) const; - bool ValidateCreateImageCompressionControl(const VkImageCreateInfo &create_info, const Location &create_info_loc) const; + bool ValidateCreateImageCompressionControl(const vvl::stateless::State &state, const VkImageCreateInfo &create_info, + const Location &create_info_loc) const; bool ValidateCreateImageSwapchain(const VkImageCreateInfo &create_info, const Location &create_info_loc) const; bool ValidateCreateImageFormatList(const VkImageCreateInfo &create_info, const Location &create_info_loc) const; bool ValidateCreateImageMetalObject(const VkImageCreateInfo &create_info, const Location &create_info_loc) const; @@ -438,36 +454,39 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo *pInfo, - VkSubresourceLayout2 *pLayout, const ErrorObject &error_obj) const; + VkSubresourceLayout2 *pLayout, + const vvl::stateless::State &state) const; bool ValidateViewport(const VkViewport &viewport, VkCommandBuffer object, const Location &loc) const; bool manual_PreCallValidateCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkShaderModule *pShaderModule, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidatePushConstantRange(uint32_t push_constant_range_count, const VkPushConstantRange *push_constant_ranges, const Location &loc) const; - bool ValidatePipelineShaderStageCreateInfoCommon(const VkPipelineShaderStageCreateInfo &create_info, const Location &loc) const; + bool ValidatePipelineShaderStageCreateInfoCommon(const vvl::stateless::State &state, + const VkPipelineShaderStageCreateInfo &create_info, const Location &loc) const; bool ValidatePipelineBinaryInfo(const void *next, VkPipelineCreateFlags flags, VkPipelineCache pipelineCache, const Location &loc) const; - bool ValidatePipelineRenderingCreateInfo(const VkPipelineRenderingCreateInfo &rendering_struct, const Location &loc) const; + bool ValidatePipelineRenderingCreateInfo(const vvl::stateless::State &state, + const VkPipelineRenderingCreateInfo &rendering_struct, const Location &loc) const; bool ValidateCreateGraphicsPipelinesFlags(const VkPipelineCreateFlags2KHR flags, const Location &flags_loc) const; bool manual_PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateCreateComputePipelinesFlags(const VkPipelineCreateFlags2KHR flags, const Location &flags_loc) const; bool manual_PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateSamplerFilterMinMax(const VkSamplerCreateInfo &create_info, const Location &create_info_loc) const; bool ValidateSamplerCustomBoarderColor(const VkSamplerCreateInfo &create_info, const Location &create_info_loc) const; @@ -475,7 +494,7 @@ class StatelessValidation : public ValidationObject { bool ValidateSamplerImageProcessingQCOM(const VkSamplerCreateInfo &create_info, const Location &create_info_loc) const; bool manual_PreCallValidateCreateSampler(VkDevice device, const VkSamplerCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSampler *pSampler, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateMutableDescriptorTypeCreateInfo(const VkDescriptorSetLayoutCreateInfo &create_info, const VkMutableDescriptorTypeCreateInfoEXT &mutable_create_info, const Location &loc) const; @@ -483,298 +502,302 @@ class StatelessValidation : public ValidationObject { const Location &create_info_loc) const; bool manual_PreCallValidateCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pBufferView, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #ifdef VK_USE_PLATFORM_METAL_EXT bool ExportMetalObjectsPNextUtil(VkExportMetalObjectTypeFlagBitsEXT bit, const char *vuid, const Location &loc, const char *sType, const void *pNext) const; #endif // VK_USE_PLATFORM_METAL_EXT - bool ValidateWriteDescriptorSet(const Location &loc, const uint32_t descriptorWriteCount, + bool ValidateWriteDescriptorSet(const vvl::stateless::State &state, const Location &loc, const uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites) const; bool manual_PreCallValidateUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, - const VkDescriptorSet *pDescriptorSets, const ErrorObject &error_obj) const; + const VkDescriptorSet *pDescriptorSets, const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, - const VkCommandBuffer *pCommandBuffers, const ErrorObject &error_obj) const; + const VkCommandBuffer *pCommandBuffers, const vvl::stateless::State &state) const; bool manual_PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, - const VkViewport *pViewports, const ErrorObject &error_obj) const; + const VkViewport *pViewports, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, - const VkRect2D *pScissors, const ErrorObject &error_obj) const; - bool manual_PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth, const ErrorObject &error_obj) const; + const VkRect2D *pScissors, const vvl::stateless::State &state) const; + bool manual_PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth, + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment *pAttachments, uint32_t rectCount, - const VkClearRect *pRects, const ErrorObject &error_obj) const; + const VkClearRect *pRects, const vvl::stateless::State &state) const; bool manual_PreCallValidateGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy *pRegions, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, - VkDeviceSize dataSize, const void *pData, const ErrorObject &error_obj) const; + VkDeviceSize dataSize, const void *pData, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, - VkDeviceSize size, uint32_t data, const ErrorObject &error_obj) const; + VkDeviceSize size, uint32_t data, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBindDescriptorBuffersEXT(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT *pBindingInfos, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetPhysicalDeviceExternalBufferProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, - VkExternalBufferProperties *pExternalBufferProperties, const ErrorObject &error_obj) const; + VkExternalBufferProperties *pExternalBufferProperties, const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #ifdef VK_USE_PLATFORM_WIN32_KHR bool manual_PreCallValidateCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR bool manual_PreCallValidateCreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_XCB_KHR bool manual_PreCallValidateCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_XLIB_KHR bool manual_PreCallValidateCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR bool manual_PreCallValidateCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #endif // VK_USE_PLATFORM_ANDROID_KHR bool manual_PreCallValidateCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdPushDescriptorSet(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo *pPushDescriptorSetInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV *pShadingRatePalettes, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV *pCustomSampleOrders, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureNV *pAccelerationStructure, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureKHR *pAccelerationStructure, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks *pAllocator, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV *pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, - size_t dataSize, void *pData, const ErrorObject &error_obj) const; + size_t dataSize, void *pData, + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, - uint32_t firstQuery, const ErrorObject &error_obj) const; + uint32_t firstQuery, + const vvl::stateless::State &state) const; bool ValidateCreateRayTracingPipelinesFlagsNV(const VkPipelineCreateFlags2KHR flags, const Location &flags_loc) const; bool ValidateCreateRayTracingPipelinesFlagsKHR(const VkPipelineCreateFlags2KHR flags, const Location &flags_loc) const; bool manual_PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetDepthClampRangeEXT(VkCommandBuffer commandBuffer, VkDepthClampModeEXT depthClampMode, const VkDepthClampRangeEXT *pDepthClampRange, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateShadersEXT(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT *pCreateInfos, const VkAllocationCallbacks *pAllocator, - VkShaderEXT *pShaders, const ErrorObject &error_obj) const; + VkShaderEXT *pShaders, const vvl::stateless::State &state) const; bool manual_PreCallValidateGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, void *pData, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #ifdef VK_USE_PLATFORM_WIN32_KHR bool PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR *pModes, - const ErrorObject &error_obj) const override; + const ErrorObject &error_obj) const; #endif // VK_USE_PLATFORM_WIN32_KHR bool manual_PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFramebuffer *pFramebuffer, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, - uint16_t lineStipplePattern, const ErrorObject &error_obj) const; + uint16_t lineStipplePattern, const vvl::stateless::State &state) const; bool ValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType, const Location &loc) const; bool manual_PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkIndexType indexType, const ErrorObject &error_obj) const; + VkIndexType indexType, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkDeviceSize size, VkIndexType indexType, const ErrorObject &error_obj) const; + VkDeviceSize size, VkIndexType indexType, + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, - uint32_t *pImageIndex, const ErrorObject &error_obj) const; + uint32_t *pImageIndex, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, - uint32_t vertexStride, const ErrorObject &error_obj) const; + uint32_t vertexStride, const vvl::stateless::State &state) const; bool manual_PreCallValidateCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetDescriptorEXT(VkDevice device, const VkDescriptorGetInfoEXT *pDescriptorInfo, size_t dataSize, - void *pDescriptor, const ErrorObject &error_obj) const; + void *pDescriptor, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetDescriptorBufferOffsets2EXT( VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT *pSetDescriptorBufferOffsetsInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers2EXT( VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT *pBindDescriptorBufferEmbeddedSamplersInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdPushDescriptorSetWithTemplate2( VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfoKHR *pBindDescriptorSetsInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR *pGetFdInfo, int *pFd, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetMemoryFdPropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR *pMemoryFdProperties, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateExternalSemaphoreHandleType(VkSemaphore semaphore, const char *vuid, const Location &handle_type_loc, VkExternalSemaphoreHandleTypeFlagBits handle_type, VkExternalSemaphoreHandleTypeFlags allowed_types) const; @@ -782,56 +805,56 @@ class StatelessValidation : public ValidationObject { VkExternalFenceHandleTypeFlagBits handle_type, VkExternalFenceHandleTypeFlags allowed_types) const; bool manual_PreCallValidateImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR *pImportSemaphoreFdInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR *pGetFdInfo, int *pFd, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR *pImportFenceFdInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR *pGetFdInfo, int *pFd, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #ifdef VK_USE_PLATFORM_WIN32_KHR bool manual_PreCallValidateGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR *pGetWin32HandleInfo, - HANDLE *pHandle, const ErrorObject &error_obj) const; + HANDLE *pHandle, const vvl::stateless::State &state) const; bool manual_PreCallValidateGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR *pMemoryWin32HandleProperties, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateImportSemaphoreWin32HandleKHR( VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR *pImportSemaphoreWin32HandleInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR *pGetWin32HandleInfo, - HANDLE *pHandle, const ErrorObject &error_obj) const; + HANDLE *pHandle, const vvl::stateless::State &state) const; bool manual_PreCallValidateImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR *pImportFenceWin32HandleInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR *pGetWin32HandleInfo, - HANDLE *pHandle, const ErrorObject &error_obj) const; + HANDLE *pHandle, const vvl::stateless::State &state) const; #endif bool manual_PreCallValidateCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateCopyAccelerationStructureInfoKHR(const VkCopyAccelerationStructureInfoKHR &as_info, const VulkanTypedHandle &handle, const Location &info_loc) const; bool ValidateCopyMemoryToAccelerationStructureInfoKHR(const VkCopyMemoryToAccelerationStructureInfoKHR &as_info, @@ -839,63 +862,64 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdWriteAccelerationStructuresPropertiesKHR( VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, - uint32_t firstQuery, const ErrorObject &error_obj) const; + uint32_t firstQuery, const vvl::stateless::State &state) const; bool manual_PreCallValidateWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType, size_t dataSize, void *pData, - size_t stride, const ErrorObject &error_obj) const; + size_t stride, const vvl::stateless::State &state) const; bool manual_PreCallValidateGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void *pData, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, const VkDeviceAddress *pIndirectDeviceAddresses, const uint32_t *pIndirectStrides, const uint32_t *const *ppMaxPrimitiveCounts, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetDeviceAccelerationStructureCompatibilityKHR( VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo, - VkAccelerationStructureCompatibilityKHR *pCompatibility, const ErrorObject &error_obj) const; + VkAccelerationStructureCompatibilityKHR *pCompatibility, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, - const VkViewport *pViewports, const ErrorObject &error_obj) const; + const VkViewport *pViewports, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, - const VkRect2D *pScissors, const ErrorObject &error_obj) const; + const VkRect2D *pScissors, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBindVertexBuffers2(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, const VkDeviceSize *pSizes, const VkDeviceSize *pStrides, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; [[nodiscard]] bool ValidateTotalPrimitivesCount(uint64_t total_triangles_count, uint64_t total_aabbs_count, const VulkanTypedHandle &handle, const Location &loc) const; - [[nodiscard]] bool ValidateAccelerationStructureBuildGeometryInfoKHR(const VkAccelerationStructureBuildGeometryInfoKHR &info, + [[nodiscard]] bool ValidateAccelerationStructureBuildGeometryInfoKHR(const vvl::stateless::State &state, + const VkAccelerationStructureBuildGeometryInfoKHR &info, const VulkanTypedHandle &handle, const Location &info_loc) const; bool manual_PreCallValidateCmdBuildAccelerationStructuresKHR( VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, - const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos, const ErrorObject &error_obj) const; + const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos, const vvl::stateless::State &state) const; bool manual_PreCallValidateBuildAccelerationStructuresKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR *pInfos, - const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos, const ErrorObject &error_obj) const; + const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos, const vvl::stateless::State &state) const; bool manual_PreCallValidateGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo, const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateTraceRaysRaygenShaderBindingTable(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR &raygen_shader_binding_table, @@ -915,54 +939,55 @@ class StatelessValidation : public ValidationObject { const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, uint32_t width, - uint32_t height, uint32_t depth, const ErrorObject &error_obj) const; + uint32_t height, uint32_t depth, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR *pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR *pCallableShaderBindingTable, - VkDeviceAddress indirectDeviceAddress, const ErrorObject &error_obj) const; + VkDeviceAddress indirectDeviceAddress, + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetVertexInputEXT(VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount, const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateCmdPushConstants(VkCommandBuffer commandBuffer, uint32_t offset, uint32_t size, const Location &loc) const; bool manual_PreCallValidateCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo *pPushConstantsInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *pValues, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, - const VkPipelineCache *pSrcCaches, const ErrorObject &error_obj) const; + const VkPipelineCache *pSrcCaches, const vvl::stateless::State &state) const; bool manual_PreCallValidateGetPipelinePropertiesEXT(VkDevice device, const VkPipelineInfoEXT *pPipelineInfo, VkBaseOutStructure *pPipelineProperties, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateDepthClampRange(const VkDepthClampRangeEXT &depth_clamp_range, const Location &loc) const; bool manual_PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue *pColor, uint32_t rangeCount, - const VkImageSubresourceRange *pRanges, const ErrorObject &error_obj) const; + const VkImageSubresourceRange *pRanges, const vvl::stateless::State &state) const; bool ValidateRenderPassStripeBeginInfo(VkCommandBuffer commandBuffer, const void *pNext, const VkRect2D render_area, const Location &loc) const; bool ValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *const rp_begin, const ErrorObject &error_obj) const; bool manual_PreCallValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, - VkSubpassContents, const ErrorObject &error_obj) const; + VkSubpassContents, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, - const VkSubpassBeginInfo *, const ErrorObject &error_obj) const; + const VkSubpassBeginInfo *, const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateBeginRenderingColorAttachment(VkCommandBuffer commandBuffer, const VkRenderingInfo &rendering_info, const Location &rendering_info_loc) const; @@ -977,13 +1002,13 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void *pData, VkDeviceSize stride, VkQueryResultFlags flags, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements &memory_requirements, const Location &loc) const; @@ -991,167 +1016,147 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetDiscardRectangleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetDiscardRectangleModeEXT(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdSetExclusiveScissorEnableNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32 *pExclusiveScissorEnables, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #ifdef VK_USE_PLATFORM_WIN32_KHR bool manual_PreCallValidateGetPhysicalDeviceSurfacePresentModes2EXT(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; #endif // VK_USE_PLATFORM_WIN32_KHR bool manual_PreCallValidateGetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateGetDeviceImageSparseMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, - VkFence fence, const ErrorObject &error_obj) const; + VkFence fence, const vvl::stateless::State &state) const; - bool ValidateIndirectExecutionSetPipelineInfo(const VkIndirectExecutionSetPipelineInfoEXT &pipeline_info, + bool ValidateIndirectExecutionSetPipelineInfo(const vvl::stateless::State &state, + const VkIndirectExecutionSetPipelineInfoEXT &pipeline_info, const Location &pipeline_info_loc) const; - bool ValidateIndirectExecutionSetShaderInfo(const VkIndirectExecutionSetShaderInfoEXT &shader_info, + bool ValidateIndirectExecutionSetShaderInfo(const vvl::stateless::State &state, + const VkIndirectExecutionSetShaderInfoEXT &shader_info, const Location &shader_info_loc) const; bool manual_PreCallValidateCreateIndirectExecutionSetEXT(VkDevice device, const VkIndirectExecutionSetCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectExecutionSetEXT *pIndirectExecutionSet, - const ErrorObject &error_obj) const; - bool ValidateIndirectCommandsPushConstantToken(const VkIndirectCommandsPushConstantTokenEXT &push_constant_token, + const vvl::stateless::State &state) const; + bool ValidateIndirectCommandsPushConstantToken(const vvl::stateless::State &state, + const VkIndirectCommandsPushConstantTokenEXT &push_constant_token, VkIndirectCommandsTokenTypeEXT token_type, const Location &push_constant_token_loc) const; - bool ValidateIndirectCommandsIndexBufferToken(const VkIndirectCommandsIndexBufferTokenEXT &index_buffer_token, + bool ValidateIndirectCommandsIndexBufferToken(const vvl::stateless::State &state, + const VkIndirectCommandsIndexBufferTokenEXT &index_buffer_token, const Location &index_buffer_token_loc) const; - bool ValidateIndirectCommandsExecutionSetToken(const VkIndirectCommandsExecutionSetTokenEXT &exe_set_token, + bool ValidateIndirectCommandsExecutionSetToken(const vvl::stateless::State &state, + const VkIndirectCommandsExecutionSetTokenEXT &exe_set_token, const Location &exe_set_token_loc) const; - bool ValidateIndirectCommandsLayoutToken(const VkIndirectCommandsLayoutTokenEXT &token, const Location &token_loc) const; - bool ValidateIndirectCommandsLayoutStage(const VkIndirectCommandsLayoutTokenEXT &token, const Location &token_loc, - VkShaderStageFlags shader_stages, bool has_stage_graphics, bool has_stage_compute, - bool has_stage_ray_tracing, bool has_stage_mesh) const; + bool ValidateIndirectCommandsLayoutToken(const vvl::stateless::State &state, const VkIndirectCommandsLayoutTokenEXT &token, + const Location &token_loc) const; + bool ValidateIndirectCommandsLayoutStage(const vvl::stateless::State &state, const VkIndirectCommandsLayoutTokenEXT &token, + const Location &token_loc, VkShaderStageFlags shader_stages, bool has_stage_graphics, + bool has_stage_compute, bool has_stage_ray_tracing, bool has_stage_mesh) const; bool manual_PreCallValidateCreateIndirectCommandsLayoutEXT(VkDevice device, const VkIndirectCommandsLayoutCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkIndirectCommandsLayoutEXT *pIndirectCommandsLayout, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool ValidateGeneratedCommandsInfo(VkCommandBuffer command_buffer, const VkGeneratedCommandsInfoEXT &generated_commands_info, const Location &info_loc) const; bool manual_PreCallValidateCmdPreprocessGeneratedCommandsEXT(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo, VkCommandBuffer stateCommandBuffer, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; bool manual_PreCallValidateCmdExecuteGeneratedCommandsEXT(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo, - const ErrorObject &error_obj) const; + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCreateMicromapEXT(VkDevice device, const VkMicromapCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkMicromapEXT *pMicromap, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateDestroyMicromapEXT(VkDevice device, VkMicromapEXT micromap, const VkAllocationCallbacks *pAllocator, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCmdBuildMicromapsEXT(VkCommandBuffer commandBuffer, uint32_t infoCount, + const VkMicromapBuildInfoEXT *pInfos, const vvl::stateless::State &state) const; + + bool manual_PreCallValidateBuildMicromapsEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, + const VkMicromapBuildInfoEXT *pInfos, const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMicromapInfoEXT *pInfo, const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCopyMicromapToMemoryEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMicromapToMemoryInfoEXT *pInfo, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCopyMemoryToMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMemoryToMicromapInfoEXT *pInfo, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, + VkQueryType queryType, size_t dataSize, void *pData, size_t stride, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT *pInfo, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCmdCopyMicromapToMemoryEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT *pInfo, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCmdCopyMemoryToMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT *pInfo, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateCmdWriteMicromapsPropertiesEXT(VkCommandBuffer commandBuffer, uint32_t micromapCount, + const VkMicromapEXT *pMicromaps, VkQueryType queryType, + VkQueryPool queryPool, uint32_t firstQuery, + const vvl::stateless::State &state) const; + + bool manual_PreCallValidateGetDeviceMicromapCompatibilityEXT(VkDevice device, const VkMicromapVersionInfoEXT *pVersionInfo, + VkAccelerationStructureCompatibilityKHR *pCompatibility, + const vvl::stateless::State &state) const; - bool manual_PreCallValidateCreateMicromapEXT( - VkDevice device, - const VkMicromapCreateInfoEXT* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkMicromapEXT* pMicromap, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateDestroyMicromapEXT( - VkDevice device, - VkMicromapEXT micromap, - const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateCmdBuildMicromapsEXT( - VkCommandBuffer commandBuffer, - uint32_t infoCount, - const VkMicromapBuildInfoEXT* pInfos, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateBuildMicromapsEXT( - VkDevice device, - VkDeferredOperationKHR deferredOperation, - uint32_t infoCount, - const VkMicromapBuildInfoEXT* pInfos, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateCopyMicromapEXT( - VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateCopyMicromapToMemoryEXT( - VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyMicromapToMemoryInfoEXT* pInfo, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateCopyMemoryToMicromapEXT( - VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyMemoryToMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateWriteMicromapsPropertiesEXT( - VkDevice device, - uint32_t micromapCount, - const VkMicromapEXT* pMicromaps, - VkQueryType queryType, - size_t dataSize, - void* pData, - size_t stride, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateCmdCopyMicromapEXT( - VkCommandBuffer commandBuffer, - const VkCopyMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateCmdCopyMicromapToMemoryEXT( - VkCommandBuffer commandBuffer, - const VkCopyMicromapToMemoryInfoEXT* pInfo, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateCmdCopyMemoryToMicromapEXT( - VkCommandBuffer commandBuffer, - const VkCopyMemoryToMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateCmdWriteMicromapsPropertiesEXT( - VkCommandBuffer commandBuffer, - uint32_t micromapCount, - const VkMicromapEXT* pMicromaps, - VkQueryType queryType, - VkQueryPool queryPool, - uint32_t firstQuery, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateGetDeviceMicromapCompatibilityEXT( - VkDevice device, - const VkMicromapVersionInfoEXT* pVersionInfo, - VkAccelerationStructureCompatibilityKHR* pCompatibility, const ErrorObject& error_obj) const; - - bool manual_PreCallValidateGetMicromapBuildSizesEXT( - VkDevice device, - VkAccelerationStructureBuildTypeKHR buildType, - const VkMicromapBuildInfoEXT* pBuildInfo, - VkMicromapBuildSizesInfoEXT* pSizeInfo, const ErrorObject& error_obj) const; + bool manual_PreCallValidateGetMicromapBuildSizesEXT(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, + const VkMicromapBuildInfoEXT *pBuildInfo, + VkMicromapBuildSizesInfoEXT *pSizeInfo, + const vvl::stateless::State &state) const; bool ValidateAllocateMemoryExternal(VkDevice device, const VkMemoryAllocateInfo &allocate_info, VkMemoryAllocateFlags flags, const Location &allocate_info_loc) const; diff --git a/layers/vulkan/generated/feature_requirements_helper.cpp b/layers/vulkan/generated/feature_requirements_helper.cpp index 07874f24bdc..aa657696493 100644 --- a/layers/vulkan/generated/feature_requirements_helper.cpp +++ b/layers/vulkan/generated/feature_requirements_helper.cpp @@ -4357,21 +4357,21 @@ FeatureAndName AddFeature(APIVersion api_version, vkt::Feature feature, void **i } #ifdef VK_ENABLE_BETA_EXTENSIONS - case Feature::constantAlphaColorBlendFactors : { - auto vk_struct = const_cast( - vku::FindStructInPNextChain(*inout_pnext_chain)); - if (!vk_struct) { - vk_struct = new VkPhysicalDevicePortabilitySubsetFeaturesKHR; - *vk_struct = vku::InitStructHelper(); - if (*inout_pnext_chain) { - vvl::PnextChainAdd(*inout_pnext_chain, vk_struct); - } else { - *inout_pnext_chain = vk_struct; - } + case Feature::constantAlphaColorBlendFactors: { + auto vk_struct = const_cast( + vku::FindStructInPNextChain(*inout_pnext_chain)); + if (!vk_struct) { + vk_struct = new VkPhysicalDevicePortabilitySubsetFeaturesKHR; + *vk_struct = vku::InitStructHelper(); + if (*inout_pnext_chain) { + vvl::PnextChainAdd(*inout_pnext_chain, vk_struct); + } else { + *inout_pnext_chain = vk_struct; } - return {&vk_struct->constantAlphaColorBlendFactors, - "VkPhysicalDevicePortabilitySubsetFeaturesKHR::constantAlphaColorBlendFactors"}; } + return {&vk_struct->constantAlphaColorBlendFactors, + "VkPhysicalDevicePortabilitySubsetFeaturesKHR::constantAlphaColorBlendFactors"}; + } #endif // VK_ENABLE_BETA_EXTENSIONS #ifdef VK_ENABLE_BETA_EXTENSIONS diff --git a/layers/vulkan/generated/stateless_validation_helper.cpp b/layers/vulkan/generated/stateless_validation_helper.cpp index 114dbfb39ef..ed2fe2e5459 100644 --- a/layers/vulkan/generated/stateless_validation_helper.cpp +++ b/layers/vulkan/generated/stateless_validation_helper.cpp @@ -26,31 +26,22 @@ #include "generated/enum_flag_bits.h" #include "generated/dispatch_functions.h" -bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc, const VkBaseOutStructure* header, - const char* pnext_vuid, const VkPhysicalDevice physicalDevice, - bool is_const_param) const { +bool vvl::stateless::State::ValidatePnextFeatureStructContents(const Location& loc, const VkBaseOutStructure* header, + const char* pnext_vuid, bool is_const_param) const { bool skip = false; - const bool is_physdev_api = physicalDevice != VK_NULL_HANDLE; switch (header->sType) { // Validation code for VkPhysicalDevice16BitStorageFeatures structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: { // Covers // VUID-VkPhysicalDevice16BitStorageFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_16bit_storage)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_16bit_storage))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES), but its parent extension " - "VK_KHR_16bit_storage has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_16bit_storage)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES), but its parent extension " + "VK_KHR_16bit_storage has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevice16BitStorageFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_16bit_storage)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevice16BitStorageFeatures, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_16bit_storage) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevice16BitStorageFeatures* structure = (VkPhysicalDevice16BitStorageFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::storageBuffer16BitAccess), structure->storageBuffer16BitAccess); @@ -66,21 +57,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMultiviewFeatures structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: { // Covers VUID-VkPhysicalDeviceMultiviewFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_multiview)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_multiview))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES), " - "but its parent extension " - "VK_KHR_multiview has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_multiview)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES), but its parent extension " + "VK_KHR_multiview has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMultiviewFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_multiview)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMultiviewFeatures, but when creating VkDevice, the " - "parent extension " - "(VK_KHR_multiview) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMultiviewFeatures* structure = (VkPhysicalDeviceMultiviewFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::multiview), structure->multiview); @@ -94,21 +78,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: { // Covers // VUID-VkPhysicalDeviceVariablePointersFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_variable_pointers)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_variable_pointers))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES), but its parent extension " - "VK_KHR_variable_pointers has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_variable_pointers)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES), but its parent extension " + "VK_KHR_variable_pointers has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVariablePointersFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_variable_pointers)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceVariablePointersFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_variable_pointers) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceVariablePointersFeatures* structure = (VkPhysicalDeviceVariablePointersFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::variablePointersStorageBuffer), structure->variablePointersStorageBuffer); @@ -121,18 +98,13 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES: { // Covers // VUID-VkPhysicalDeviceProtectedMemoryFeatures-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_1) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES) " - "which was added in VK_API_VERSION_1_1 but the " - "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + if (exts.api_version < VK_API_VERSION_1_1) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES) which " + "was added in VK_API_VERSION_1_1 but the " + "current effective API version is %s.", + StringAPIVersion(exts.api_version).c_str()); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceProtectedMemoryFeatures); @@ -145,21 +117,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: { // Covers // VUID-VkPhysicalDeviceSamplerYcbcrConversionFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_sampler_ycbcr_conversion)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES), but its parent extension " "VK_KHR_sampler_ycbcr_conversion has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSamplerYcbcrConversionFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceSamplerYcbcrConversionFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_sampler_ycbcr_conversion) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceSamplerYcbcrConversionFeatures* structure = (VkPhysicalDeviceSamplerYcbcrConversionFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::samplerYcbcrConversion), structure->samplerYcbcrConversion); } @@ -169,18 +135,13 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderDrawParametersFeatures-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_1) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES) which was added in " - "VK_API_VERSION_1_1 but the " - "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + if (exts.api_version < VK_API_VERSION_1_1) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES) " + "which was added in VK_API_VERSION_1_1 but the " + "current effective API version is %s.", + StringAPIVersion(exts.api_version).c_str()); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderDrawParametersFeatures); @@ -192,18 +153,13 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVulkan11Features structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES: { // Covers VUID-VkPhysicalDeviceVulkan11Features-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_2) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (exts.api_version < VK_API_VERSION_1_2) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES) " "which was added in VK_API_VERSION_1_2 but the " "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + StringAPIVersion(exts.api_version).c_str()); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVulkan11Features); @@ -239,18 +195,13 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVulkan12Features structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES: { // Covers VUID-VkPhysicalDeviceVulkan12Features-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_2) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (exts.api_version < VK_API_VERSION_1_2) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES) " "which was added in VK_API_VERSION_1_2 but the " "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + StringAPIVersion(exts.api_version).c_str()); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVulkan12Features); @@ -378,21 +329,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: { // Covers // VUID-VkPhysicalDevice8BitStorageFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_8bit_storage)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_8bit_storage))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES), but its parent extension " - "VK_KHR_8bit_storage has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_8bit_storage)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES), but its parent extension " + "VK_KHR_8bit_storage has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevice8BitStorageFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_8bit_storage)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevice8BitStorageFeatures, but when creating VkDevice, the " - "parent extension " - "(VK_KHR_8bit_storage) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevice8BitStorageFeatures* structure = (VkPhysicalDevice8BitStorageFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::storageBuffer8BitAccess), structure->storageBuffer8BitAccess); @@ -407,21 +351,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderAtomicInt64Features-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_atomic_int64)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_atomic_int64))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES), but its parent extension " - "VK_KHR_shader_atomic_int64 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_shader_atomic_int64)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES), but its parent extension " + "VK_KHR_shader_atomic_int64 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderAtomicInt64Features); - if (!IsExtEnabled(device_extensions.vk_khr_shader_atomic_int64)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderAtomicInt64Features, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_shader_atomic_int64) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderAtomicInt64Features* structure = (VkPhysicalDeviceShaderAtomicInt64Features*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderBufferInt64Atomics), structure->shaderBufferInt64Atomics); @@ -433,21 +370,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderFloat16Int8Features-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_float16_int8)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_float16_int8))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES), but its parent extension " - "VK_KHR_shader_float16_int8 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_shader_float16_int8)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES), but its parent extension " + "VK_KHR_shader_float16_int8 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderFloat16Int8Features); - if (!IsExtEnabled(device_extensions.vk_khr_shader_float16_int8)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderFloat16Int8Features, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_shader_float16_int8) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderFloat16Int8Features* structure = (VkPhysicalDeviceShaderFloat16Int8Features*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderFloat16), structure->shaderFloat16); @@ -459,21 +389,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES: { // Covers // VUID-VkPhysicalDeviceDescriptorIndexingFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_descriptor_indexing)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_descriptor_indexing))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES), but its parent extension " - "VK_EXT_descriptor_indexing has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_descriptor_indexing)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES), but its parent extension " + "VK_EXT_descriptor_indexing has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDescriptorIndexingFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_indexing)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDescriptorIndexingFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_descriptor_indexing) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDescriptorIndexingFeatures* structure = (VkPhysicalDeviceDescriptorIndexingFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderInputAttachmentArrayDynamicIndexing), structure->shaderInputAttachmentArrayDynamicIndexing); @@ -540,21 +463,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: { // Covers // VUID-VkPhysicalDeviceScalarBlockLayoutFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_scalar_block_layout)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_scalar_block_layout))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES), but its parent extension " - "VK_EXT_scalar_block_layout has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_scalar_block_layout)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES), but its parent extension " + "VK_EXT_scalar_block_layout has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceScalarBlockLayoutFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_scalar_block_layout)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceScalarBlockLayoutFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_scalar_block_layout) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceScalarBlockLayoutFeatures* structure = (VkPhysicalDeviceScalarBlockLayoutFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::scalarBlockLayout), structure->scalarBlockLayout); } @@ -564,21 +480,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES: { // Covers // VUID-VkPhysicalDeviceVulkanMemoryModelFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_vulkan_memory_model)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_vulkan_memory_model))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES), but its parent extension " - "VK_KHR_vulkan_memory_model has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_vulkan_memory_model)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES), but its parent extension " + "VK_KHR_vulkan_memory_model has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVulkanMemoryModelFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_vulkan_memory_model)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceVulkanMemoryModelFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_vulkan_memory_model) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceVulkanMemoryModelFeatures* structure = (VkPhysicalDeviceVulkanMemoryModelFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::vulkanMemoryModel), structure->vulkanMemoryModel); @@ -593,21 +502,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES: { // Covers // VUID-VkPhysicalDeviceImagelessFramebufferFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_imageless_framebuffer)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_imageless_framebuffer))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES), but its parent extension " - "VK_KHR_imageless_framebuffer has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_imageless_framebuffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES), but its parent extension " + "VK_KHR_imageless_framebuffer has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImagelessFramebufferFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_imageless_framebuffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImagelessFramebufferFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_imageless_framebuffer) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImagelessFramebufferFeatures* structure = (VkPhysicalDeviceImagelessFramebufferFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::imagelessFramebuffer), structure->imagelessFramebuffer); } @@ -617,22 +519,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES: { // Covers // VUID-VkPhysicalDeviceUniformBufferStandardLayoutFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_uniform_buffer_standard_layout)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_uniform_buffer_standard_layout))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_uniform_buffer_standard_layout)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES), but its parent extension " "VK_KHR_uniform_buffer_standard_layout has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceUniformBufferStandardLayoutFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_uniform_buffer_standard_layout)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceUniformBufferStandardLayoutFeatures, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_uniform_buffer_standard_layout) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceUniformBufferStandardLayoutFeatures* structure = (VkPhysicalDeviceUniformBufferStandardLayoutFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::uniformBufferStandardLayout), structure->uniformBufferStandardLayout); @@ -643,10 +538,9 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_subgroup_extended_types)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_subgroup_extended_types))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_shader_subgroup_extended_types)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES), but its parent extension " "VK_KHR_shader_subgroup_extended_types has not been enabled."); @@ -657,22 +551,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES: { // Covers // VUID-VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_separate_depth_stencil_layouts)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_separate_depth_stencil_layouts))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_separate_depth_stencil_layouts)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES), but its parent extension " "VK_KHR_separate_depth_stencil_layouts has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_separate_depth_stencil_layouts)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_separate_depth_stencil_layouts) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures* structure = (VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::separateDepthStencilLayouts), structure->separateDepthStencilLayouts); @@ -683,21 +570,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: { // Covers // VUID-VkPhysicalDeviceHostQueryResetFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_host_query_reset)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_host_query_reset))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES), but its parent extension " - "VK_EXT_host_query_reset has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_host_query_reset)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES), but its parent extension " + "VK_EXT_host_query_reset has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceHostQueryResetFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_host_query_reset)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceHostQueryResetFeatures, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_host_query_reset) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceHostQueryResetFeatures* structure = (VkPhysicalDeviceHostQueryResetFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::hostQueryReset), structure->hostQueryReset); } @@ -707,21 +587,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES: { // Covers // VUID-VkPhysicalDeviceTimelineSemaphoreFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_timeline_semaphore)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_timeline_semaphore))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES), but its parent extension " - "VK_KHR_timeline_semaphore has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_timeline_semaphore)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES), but its parent extension " + "VK_KHR_timeline_semaphore has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceTimelineSemaphoreFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_timeline_semaphore)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceTimelineSemaphoreFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_timeline_semaphore) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceTimelineSemaphoreFeatures* structure = (VkPhysicalDeviceTimelineSemaphoreFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::timelineSemaphore), structure->timelineSemaphore); } @@ -731,21 +604,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: { // Covers // VUID-VkPhysicalDeviceBufferDeviceAddressFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_buffer_device_address)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_buffer_device_address))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES), but its parent extension " - "VK_KHR_buffer_device_address has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_buffer_device_address)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES), but its parent extension " + "VK_KHR_buffer_device_address has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceBufferDeviceAddressFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceBufferDeviceAddressFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_buffer_device_address) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceBufferDeviceAddressFeatures* structure = (VkPhysicalDeviceBufferDeviceAddressFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::bufferDeviceAddress), structure->bufferDeviceAddress); @@ -760,18 +626,13 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVulkan13Features structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES: { // Covers VUID-VkPhysicalDeviceVulkan13Features-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_3) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (exts.api_version < VK_API_VERSION_1_3) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES) " "which was added in VK_API_VERSION_1_3 but the " "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + StringAPIVersion(exts.api_version).c_str()); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVulkan13Features); @@ -815,22 +676,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderTerminateInvocationFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_terminate_invocation)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_terminate_invocation))) { - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES), but its parent extension " - "VK_KHR_shader_terminate_invocation has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_shader_terminate_invocation)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES), but its parent extension " + "VK_KHR_shader_terminate_invocation has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderTerminateInvocationFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_shader_terminate_invocation)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderTerminateInvocationFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_shader_terminate_invocation) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderTerminateInvocationFeatures* structure = (VkPhysicalDeviceShaderTerminateInvocationFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderTerminateInvocation), structure->shaderTerminateInvocation); @@ -841,10 +695,9 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_shader_demote_to_helper_invocation)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_shader_demote_to_helper_invocation))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_shader_demote_to_helper_invocation)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES), but its parent extension " "VK_EXT_shader_demote_to_helper_invocation has not been enabled."); @@ -852,12 +705,6 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_shader_demote_to_helper_invocation)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_shader_demote_to_helper_invocation) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures* structure = (VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures*)header; skip |= @@ -869,21 +716,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES: { // Covers // VUID-VkPhysicalDevicePrivateDataFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_private_data)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_private_data))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES), but its parent extension " - "VK_EXT_private_data has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_private_data)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES), but its parent extension " + "VK_EXT_private_data has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePrivateDataFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_private_data)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePrivateDataFeatures, but when creating VkDevice, the " - "parent extension " - "(VK_EXT_private_data) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePrivateDataFeatures* structure = (VkPhysicalDevicePrivateDataFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::privateData), structure->privateData); } @@ -893,22 +733,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES: { // Covers // VUID-VkPhysicalDevicePipelineCreationCacheControlFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_pipeline_creation_cache_control)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_pipeline_creation_cache_control))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_pipeline_creation_cache_control)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES), but its parent extension " "VK_EXT_pipeline_creation_cache_control has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelineCreationCacheControlFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_creation_cache_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePipelineCreationCacheControlFeatures, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_pipeline_creation_cache_control) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePipelineCreationCacheControlFeatures* structure = (VkPhysicalDevicePipelineCreationCacheControlFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineCreationCacheControl), structure->pipelineCreationCacheControl); @@ -919,21 +752,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES: { // Covers // VUID-VkPhysicalDeviceSynchronization2Features-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_synchronization2)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_synchronization2))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES), but its parent extension " - "VK_KHR_synchronization2 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_synchronization2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES), but its parent extension " + "VK_KHR_synchronization2 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSynchronization2Features); - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceSynchronization2Features, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_synchronization2) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceSynchronization2Features* structure = (VkPhysicalDeviceSynchronization2Features*)header; skip |= ValidateBool32(pNext_loc.dot(Field::synchronization2), structure->synchronization2); } @@ -943,10 +769,9 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES: { // Covers // VUID-VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_zero_initialize_workgroup_memory)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_zero_initialize_workgroup_memory))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_zero_initialize_workgroup_memory)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES), but its parent extension " "VK_KHR_zero_initialize_workgroup_memory has not been enabled."); @@ -954,12 +779,6 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_zero_initialize_workgroup_memory)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_zero_initialize_workgroup_memory) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures* structure = (VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderZeroInitializeWorkgroupMemory), @@ -971,21 +790,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES: { // Covers // VUID-VkPhysicalDeviceImageRobustnessFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_image_robustness)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_image_robustness))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES), but its parent extension " - "VK_EXT_image_robustness has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_image_robustness)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES), but its parent extension " + "VK_EXT_image_robustness has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageRobustnessFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_image_robustness)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImageRobustnessFeatures, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_image_robustness) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImageRobustnessFeatures* structure = (VkPhysicalDeviceImageRobustnessFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::robustImageAccess), structure->robustImageAccess); } @@ -995,21 +807,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES: { // Covers // VUID-VkPhysicalDeviceSubgroupSizeControlFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_subgroup_size_control)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_subgroup_size_control))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES), but its parent extension " - "VK_EXT_subgroup_size_control has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_subgroup_size_control)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES), but its parent extension " + "VK_EXT_subgroup_size_control has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSubgroupSizeControlFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_subgroup_size_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceSubgroupSizeControlFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_subgroup_size_control) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceSubgroupSizeControlFeatures* structure = (VkPhysicalDeviceSubgroupSizeControlFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::subgroupSizeControl), structure->subgroupSizeControl); @@ -1021,21 +826,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES: { // Covers // VUID-VkPhysicalDeviceInlineUniformBlockFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_inline_uniform_block)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_inline_uniform_block))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES), but its parent extension " - "VK_EXT_inline_uniform_block has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_inline_uniform_block)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES), but its parent extension " + "VK_EXT_inline_uniform_block has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceInlineUniformBlockFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_inline_uniform_block)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceInlineUniformBlockFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_inline_uniform_block) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceInlineUniformBlockFeatures* structure = (VkPhysicalDeviceInlineUniformBlockFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::inlineUniformBlock), structure->inlineUniformBlock); @@ -1048,22 +846,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES: { // Covers // VUID-VkPhysicalDeviceTextureCompressionASTCHDRFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_texture_compression_astc_hdr)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_texture_compression_astc_hdr))) { - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES), but its parent extension " - "VK_EXT_texture_compression_astc_hdr has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_texture_compression_astc_hdr)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES), but its parent extension " + "VK_EXT_texture_compression_astc_hdr has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceTextureCompressionASTCHDRFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_texture_compression_astc_hdr)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceTextureCompressionASTCHDRFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_texture_compression_astc_hdr) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceTextureCompressionASTCHDRFeatures* structure = (VkPhysicalDeviceTextureCompressionASTCHDRFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::textureCompressionASTC_HDR), structure->textureCompressionASTC_HDR); @@ -1074,21 +865,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES: { // Covers // VUID-VkPhysicalDeviceDynamicRenderingFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_dynamic_rendering)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_dynamic_rendering))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES), but its parent extension " - "VK_KHR_dynamic_rendering has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_dynamic_rendering)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES), but its parent extension " + "VK_KHR_dynamic_rendering has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDynamicRenderingFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDynamicRenderingFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_dynamic_rendering) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDynamicRenderingFeatures* structure = (VkPhysicalDeviceDynamicRenderingFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::dynamicRendering), structure->dynamicRendering); } @@ -1098,22 +882,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderIntegerDotProductFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_integer_dot_product)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_integer_dot_product))) { - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES), but its parent extension " - "VK_KHR_shader_integer_dot_product has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_shader_integer_dot_product)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES), but its parent extension " + "VK_KHR_shader_integer_dot_product has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderIntegerDotProductFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_shader_integer_dot_product)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderIntegerDotProductFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_shader_integer_dot_product) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderIntegerDotProductFeatures* structure = (VkPhysicalDeviceShaderIntegerDotProductFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderIntegerDotProduct), structure->shaderIntegerDotProduct); @@ -1124,21 +901,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES: { // Covers // VUID-VkPhysicalDeviceMaintenance4Features-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance4)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance4))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES), but its parent extension " - "VK_KHR_maintenance4 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance4)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES), but its parent extension " + "VK_KHR_maintenance4 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMaintenance4Features); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMaintenance4Features, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_maintenance4) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMaintenance4Features* structure = (VkPhysicalDeviceMaintenance4Features*)header; skip |= ValidateBool32(pNext_loc.dot(Field::maintenance4), structure->maintenance4); } @@ -1147,18 +917,13 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVulkan14Features structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES: { // Covers VUID-VkPhysicalDeviceVulkan14Features-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_4) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (exts.api_version < VK_API_VERSION_1_4) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES) " "which was added in VK_API_VERSION_1_4 but the " "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + StringAPIVersion(exts.api_version).c_str()); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVulkan14Features); @@ -1214,25 +979,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES: { // Covers // VUID-VkPhysicalDeviceGlobalPriorityQueryFeatures-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_global_priority_query)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_global_priority_query))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_global_priority)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_global_priority)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES), but its parent extension " - "VK_EXT_global_priority_query, or VK_KHR_global_priority has not been enabled."); + if ((!IsExtEnabled(exts.vk_ext_global_priority_query)) && (!IsExtEnabled(exts.vk_khr_global_priority))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES), but its parent extension " + "VK_EXT_global_priority_query, or VK_KHR_global_priority has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceGlobalPriorityQueryFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_global_priority) && - !IsExtEnabled(device_extensions.vk_ext_global_priority_query)) { - skip |= LogError( - pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceGlobalPriorityQueryFeatures, but when creating VkDevice, the " - "parent extension " - "(VK_KHR_global_priority or VK_EXT_global_priority_query) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceGlobalPriorityQueryFeatures* structure = (VkPhysicalDeviceGlobalPriorityQueryFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::globalPriorityQuery), structure->globalPriorityQuery); } @@ -1242,21 +996,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderSubgroupRotateFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_subgroup_rotate)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_subgroup_rotate))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_shader_subgroup_rotate)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES), but its parent extension " "VK_KHR_shader_subgroup_rotate has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderSubgroupRotateFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_shader_subgroup_rotate)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderSubgroupRotateFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_shader_subgroup_rotate) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderSubgroupRotateFeatures* structure = (VkPhysicalDeviceShaderSubgroupRotateFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderSubgroupRotate), structure->shaderSubgroupRotate); @@ -1269,21 +1017,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderFloatControls2Features-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_float_controls2)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_float_controls2))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_shader_float_controls2)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT_CONTROLS_2_FEATURES), but its parent extension " "VK_KHR_shader_float_controls2 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderFloatControls2Features); - if (!IsExtEnabled(device_extensions.vk_khr_shader_float_controls2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderFloatControls2Features, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_shader_float_controls2) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderFloatControls2Features* structure = (VkPhysicalDeviceShaderFloatControls2Features*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderFloatControls2), structure->shaderFloatControls2); } @@ -1293,21 +1035,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES: { // Covers // VUID-VkPhysicalDeviceShaderExpectAssumeFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_expect_assume)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_expect_assume))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES), but its parent extension " - "VK_KHR_shader_expect_assume has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_shader_expect_assume)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EXPECT_ASSUME_FEATURES), but its parent extension " + "VK_KHR_shader_expect_assume has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderExpectAssumeFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_shader_expect_assume)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderExpectAssumeFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_shader_expect_assume) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderExpectAssumeFeatures* structure = (VkPhysicalDeviceShaderExpectAssumeFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderExpectAssume), structure->shaderExpectAssume); } @@ -1317,25 +1052,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES: { // Covers // VUID-VkPhysicalDeviceLineRasterizationFeatures-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_line_rasterization)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_line_rasterization))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_line_rasterization)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_line_rasterization)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES), but its parent extension " - "VK_EXT_line_rasterization, or VK_KHR_line_rasterization has not been enabled."); + if ((!IsExtEnabled(exts.vk_ext_line_rasterization)) && (!IsExtEnabled(exts.vk_khr_line_rasterization))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES), but its parent extension " + "VK_EXT_line_rasterization, or VK_KHR_line_rasterization has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceLineRasterizationFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_line_rasterization) && - !IsExtEnabled(device_extensions.vk_ext_line_rasterization)) { - skip |= LogError( - pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceLineRasterizationFeatures, but when creating VkDevice, the parent " - "extension " - "(VK_KHR_line_rasterization or VK_EXT_line_rasterization) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceLineRasterizationFeatures* structure = (VkPhysicalDeviceLineRasterizationFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rectangularLines), structure->rectangularLines); @@ -1355,25 +1079,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES: { // Covers // VUID-VkPhysicalDeviceVertexAttributeDivisorFeatures-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_vertex_attribute_divisor)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_vertex_attribute_divisor))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_vertex_attribute_divisor)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_vertex_attribute_divisor)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if ((!IsExtEnabled(exts.vk_ext_vertex_attribute_divisor)) && (!IsExtEnabled(exts.vk_khr_vertex_attribute_divisor))) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES), but its parent extension " "VK_EXT_vertex_attribute_divisor, or VK_KHR_vertex_attribute_divisor has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVertexAttributeDivisorFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_vertex_attribute_divisor) && - !IsExtEnabled(device_extensions.vk_ext_vertex_attribute_divisor)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceVertexAttributeDivisorFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_vertex_attribute_divisor or VK_EXT_vertex_attribute_divisor) was not included in " - "ppEnabledExtensionNames."); - } VkPhysicalDeviceVertexAttributeDivisorFeatures* structure = (VkPhysicalDeviceVertexAttributeDivisorFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::vertexAttributeInstanceRateDivisor), structure->vertexAttributeInstanceRateDivisor); @@ -1387,25 +1101,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES: { // Covers // VUID-VkPhysicalDeviceIndexTypeUint8Features-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_index_type_uint8)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_index_type_uint8))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_index_type_uint8)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_index_type_uint8)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES), but its parent extension " - "VK_EXT_index_type_uint8, or VK_KHR_index_type_uint8 has not been enabled."); + if ((!IsExtEnabled(exts.vk_ext_index_type_uint8)) && (!IsExtEnabled(exts.vk_khr_index_type_uint8))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES), but its parent extension " + "VK_EXT_index_type_uint8, or VK_KHR_index_type_uint8 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceIndexTypeUint8Features); - if (!IsExtEnabled(device_extensions.vk_khr_index_type_uint8) && - !IsExtEnabled(device_extensions.vk_ext_index_type_uint8)) { - skip |= LogError( - pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceIndexTypeUint8Features, but when creating VkDevice, the parent " - "extension " - "(VK_KHR_index_type_uint8 or VK_EXT_index_type_uint8) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceIndexTypeUint8Features* structure = (VkPhysicalDeviceIndexTypeUint8Features*)header; skip |= ValidateBool32(pNext_loc.dot(Field::indexTypeUint8), structure->indexTypeUint8); } @@ -1415,21 +1118,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES: { // Covers // VUID-VkPhysicalDeviceMaintenance5Features-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance5)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance5))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES), but its parent extension " - "VK_KHR_maintenance5 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance5)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES), but its parent extension " + "VK_KHR_maintenance5 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMaintenance5Features); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMaintenance5Features, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_maintenance5) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMaintenance5Features* structure = (VkPhysicalDeviceMaintenance5Features*)header; skip |= ValidateBool32(pNext_loc.dot(Field::maintenance5), structure->maintenance5); } @@ -1439,22 +1135,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES: { // Covers // VUID-VkPhysicalDeviceDynamicRenderingLocalReadFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_dynamic_rendering_local_read)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read))) { - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES), but its parent extension " - "VK_KHR_dynamic_rendering_local_read has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_dynamic_rendering_local_read)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES), but its parent extension " + "VK_KHR_dynamic_rendering_local_read has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDynamicRenderingLocalReadFeatures); - if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDynamicRenderingLocalReadFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_dynamic_rendering_local_read) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDynamicRenderingLocalReadFeatures* structure = (VkPhysicalDeviceDynamicRenderingLocalReadFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::dynamicRenderingLocalRead), structure->dynamicRenderingLocalRead); @@ -1465,21 +1154,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES: { // Covers // VUID-VkPhysicalDeviceMaintenance6Features-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance6)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance6))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES), but its parent extension " - "VK_KHR_maintenance6 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance6)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES), but its parent extension " + "VK_KHR_maintenance6 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMaintenance6Features); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMaintenance6Features, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_maintenance6) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMaintenance6Features* structure = (VkPhysicalDeviceMaintenance6Features*)header; skip |= ValidateBool32(pNext_loc.dot(Field::maintenance6), structure->maintenance6); } @@ -1489,21 +1171,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES: { // Covers // VUID-VkPhysicalDevicePipelineProtectedAccessFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_pipeline_protected_access)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_pipeline_protected_access))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_pipeline_protected_access)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES), but its parent extension " "VK_EXT_pipeline_protected_access has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelineProtectedAccessFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_protected_access)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePipelineProtectedAccessFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_pipeline_protected_access) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePipelineProtectedAccessFeatures* structure = (VkPhysicalDevicePipelineProtectedAccessFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineProtectedAccess), structure->pipelineProtectedAccess); @@ -1514,21 +1190,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES: { // Covers // VUID-VkPhysicalDevicePipelineRobustnessFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_pipeline_robustness)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_pipeline_robustness))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES), but its parent extension " - "VK_EXT_pipeline_robustness has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_pipeline_robustness)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES), but its parent extension " + "VK_EXT_pipeline_robustness has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelineRobustnessFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_robustness)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePipelineRobustnessFeatures, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_pipeline_robustness) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePipelineRobustnessFeatures* structure = (VkPhysicalDevicePipelineRobustnessFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineRobustness), structure->pipelineRobustness); } @@ -1538,21 +1207,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES: { // Covers // VUID-VkPhysicalDeviceHostImageCopyFeatures-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_host_image_copy)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_host_image_copy))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES), but its parent extension " - "VK_EXT_host_image_copy has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_host_image_copy)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES), but its parent extension " + "VK_EXT_host_image_copy has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceHostImageCopyFeatures); - if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceHostImageCopyFeatures, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_host_image_copy) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceHostImageCopyFeatures* structure = (VkPhysicalDeviceHostImageCopyFeatures*)header; skip |= ValidateBool32(pNext_loc.dot(Field::hostImageCopy), structure->hostImageCopy); } @@ -1561,14 +1223,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePerformanceQueryFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR: { // Covers // VUID-VkPhysicalDevicePerformanceQueryFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_performance_query)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR), but its parent extension " + "VK_KHR_performance_query has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePerformanceQueryFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_performance_query)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePerformanceQueryFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_performance_query) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePerformanceQueryFeaturesKHR* structure = (VkPhysicalDevicePerformanceQueryFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::performanceCounterQueryPools), structure->performanceCounterQueryPools); @@ -1581,14 +1244,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePortabilitySubsetFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR: { // Covers // VUID-VkPhysicalDevicePortabilitySubsetFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_portability_subset)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR), but its parent extension " + "VK_KHR_portability_subset has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePortabilitySubsetFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_portability_subset)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePortabilitySubsetFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_portability_subset) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePortabilitySubsetFeaturesKHR* structure = (VkPhysicalDevicePortabilitySubsetFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::constantAlphaColorBlendFactors), structure->constantAlphaColorBlendFactors); @@ -1630,14 +1295,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderClockFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceShaderClockFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_shader_clock)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR), but its parent extension " + "VK_KHR_shader_clock has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderClockFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_shader_clock)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderClockFeaturesKHR, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_shader_clock) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderClockFeaturesKHR* structure = (VkPhysicalDeviceShaderClockFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderSubgroupClock), structure->shaderSubgroupClock); @@ -1648,14 +1314,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFragmentShadingRateFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceFragmentShadingRateFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR), but its parent extension " + "VK_KHR_fragment_shading_rate has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFragmentShadingRateFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFragmentShadingRateFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_fragment_shading_rate) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceFragmentShadingRateFeaturesKHR* structure = (VkPhysicalDeviceFragmentShadingRateFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineFragmentShadingRate), structure->pipelineFragmentShadingRate); @@ -1669,14 +1337,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderQuadControlFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceShaderQuadControlFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_shader_quad_control)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_QUAD_CONTROL_FEATURES_KHR), but its parent extension " + "VK_KHR_shader_quad_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderQuadControlFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_shader_quad_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderQuadControlFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_shader_quad_control) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderQuadControlFeaturesKHR* structure = (VkPhysicalDeviceShaderQuadControlFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderQuadControl), structure->shaderQuadControl); } @@ -1685,14 +1355,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePresentWaitFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR: { // Covers // VUID-VkPhysicalDevicePresentWaitFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_present_wait)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR), but its parent extension " + "VK_KHR_present_wait has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePresentWaitFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_present_wait)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePresentWaitFeaturesKHR, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_present_wait) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePresentWaitFeaturesKHR* structure = (VkPhysicalDevicePresentWaitFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::presentWait), structure->presentWait); } @@ -1701,15 +1372,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: { // Covers // VUID-VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_pipeline_executable_properties)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR), but its parent extension " + "VK_KHR_pipeline_executable_properties has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_executable_properties)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_pipeline_executable_properties) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR* structure = (VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineExecutableInfo), structure->pipelineExecutableInfo); @@ -1719,14 +1392,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePresentIdFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR: { // Covers // VUID-VkPhysicalDevicePresentIdFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_present_id)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR), but its parent extension " + "VK_KHR_present_id has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePresentIdFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_present_id)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePresentIdFeaturesKHR, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_present_id) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePresentIdFeaturesKHR* structure = (VkPhysicalDevicePresentIdFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::presentId), structure->presentId); } @@ -1735,16 +1409,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR-sType-sType + + if ((!IsExtEnabled(exts.vk_khr_fragment_shader_barycentric)) && + (!IsExtEnabled(exts.vk_nv_fragment_shader_barycentric))) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR), but its parent extension " + "VK_KHR_fragment_shader_barycentric, or VK_NV_fragment_shader_barycentric has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shader_barycentric) && - !IsExtEnabled(device_extensions.vk_nv_fragment_shader_barycentric)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_fragment_shader_barycentric or VK_NV_fragment_shader_barycentric) was not included " - "in ppEnabledExtensionNames."); - } VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR* structure = (VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::fragmentShaderBarycentric), structure->fragmentShaderBarycentric); @@ -1754,15 +1429,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_shader_subgroup_uniform_control_flow)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR), but " + "its parent extension " + "VK_KHR_shader_subgroup_uniform_control_flow has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_shader_subgroup_uniform_control_flow)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR, but " - "when creating VkDevice, the parent extension " - "(VK_KHR_shader_subgroup_uniform_control_flow) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR* structure = (VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderSubgroupUniformControlFlow), @@ -1773,15 +1450,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_workgroup_memory_explicit_layout)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR), but its parent extension " + "VK_KHR_workgroup_memory_explicit_layout has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_workgroup_memory_explicit_layout)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_workgroup_memory_explicit_layout) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR* structure = (VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR*)header; skip |= @@ -1801,14 +1480,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_ray_tracing_maintenance1)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR), but its parent extension " + "VK_KHR_ray_tracing_maintenance1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_maintenance1)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_ray_tracing_maintenance1) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR* structure = (VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rayTracingMaintenance1), structure->rayTracingMaintenance1); @@ -1821,15 +1502,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_shader_maximal_reconvergence)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR), but its parent extension " + "VK_KHR_shader_maximal_reconvergence has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_shader_maximal_reconvergence)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_shader_maximal_reconvergence) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR* structure = (VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderMaximalReconvergence), structure->shaderMaximalReconvergence); @@ -1839,14 +1522,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_ray_tracing_position_fetch)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR), but its parent extension " + "VK_KHR_ray_tracing_position_fetch has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_position_fetch)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_ray_tracing_position_fetch) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR* structure = (VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rayTracingPositionFetch), structure->rayTracingPositionFetch); @@ -1856,14 +1541,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePipelineBinaryFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR: { // Covers // VUID-VkPhysicalDevicePipelineBinaryFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_pipeline_binary)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_FEATURES_KHR), but its parent extension " + "VK_KHR_pipeline_binary has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelineBinaryFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePipelineBinaryFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_pipeline_binary) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePipelineBinaryFeaturesKHR* structure = (VkPhysicalDevicePipelineBinaryFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineBinaries), structure->pipelineBinaries); } @@ -1872,14 +1558,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCooperativeMatrixFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceCooperativeMatrixFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_cooperative_matrix)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR), but its parent extension " + "VK_KHR_cooperative_matrix has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCooperativeMatrixFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_cooperative_matrix)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCooperativeMatrixFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_cooperative_matrix) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCooperativeMatrixFeaturesKHR* structure = (VkPhysicalDeviceCooperativeMatrixFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::cooperativeMatrix), structure->cooperativeMatrix); @@ -1891,16 +1579,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR-sType-sType + + if ((!IsExtEnabled(exts.vk_khr_compute_shader_derivatives)) && (!IsExtEnabled(exts.vk_nv_compute_shader_derivatives))) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_KHR), but its parent extension " + "VK_KHR_compute_shader_derivatives, or VK_NV_compute_shader_derivatives has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_compute_shader_derivatives) && - !IsExtEnabled(device_extensions.vk_nv_compute_shader_derivatives)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR, but when " - "creating VkDevice, the parent extension " - "(VK_KHR_compute_shader_derivatives or VK_NV_compute_shader_derivatives) was not included in " - "ppEnabledExtensionNames."); - } VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR* structure = (VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::computeDerivativeGroupQuads), structure->computeDerivativeGroupQuads); @@ -1912,6 +1600,13 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVideoEncodeAV1FeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceVideoEncodeAV1FeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_AV1_FEATURES_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVideoEncodeAV1FeaturesKHR); VkPhysicalDeviceVideoEncodeAV1FeaturesKHR* structure = (VkPhysicalDeviceVideoEncodeAV1FeaturesKHR*)header; @@ -1922,6 +1617,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVideoMaintenance1FeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceVideoMaintenance1FeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_maintenance1)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR), but its parent extension " + "VK_KHR_video_maintenance1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVideoMaintenance1FeaturesKHR); VkPhysicalDeviceVideoMaintenance1FeaturesKHR* structure = (VkPhysicalDeviceVideoMaintenance1FeaturesKHR*)header; @@ -1932,6 +1635,14 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUANTIZATION_MAP_FEATURES_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVideoEncodeQuantizationMapFeaturesKHR); @@ -1944,15 +1655,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_shader_relaxed_extended_instruction)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR), but " + "its parent extension " + "VK_KHR_shader_relaxed_extended_instruction has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_shader_relaxed_extended_instruction)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR, but " - "when creating VkDevice, the parent extension " - "(VK_KHR_shader_relaxed_extended_instruction) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR* structure = (VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderRelaxedExtendedInstruction), @@ -1963,14 +1676,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMaintenance7FeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceMaintenance7FeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_maintenance7)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR), but its parent extension " + "VK_KHR_maintenance7 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMaintenance7FeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance7)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMaintenance7FeaturesKHR, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_maintenance7) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMaintenance7FeaturesKHR* structure = (VkPhysicalDeviceMaintenance7FeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::maintenance7), structure->maintenance7); } @@ -1979,14 +1693,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceTransformFeedbackFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceTransformFeedbackFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_transform_feedback)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT), but its parent extension " + "VK_EXT_transform_feedback has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceTransformFeedbackFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceTransformFeedbackFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_transform_feedback) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceTransformFeedbackFeaturesEXT* structure = (VkPhysicalDeviceTransformFeedbackFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::transformFeedback), structure->transformFeedback); @@ -1997,14 +1713,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCornerSampledImageFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceCornerSampledImageFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_corner_sampled_image)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV), but its parent extension " + "VK_NV_corner_sampled_image has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCornerSampledImageFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_corner_sampled_image)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCornerSampledImageFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_corner_sampled_image) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCornerSampledImageFeaturesNV* structure = (VkPhysicalDeviceCornerSampledImageFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::cornerSampledImage), structure->cornerSampledImage); } @@ -2013,14 +1731,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceASTCDecodeFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceASTCDecodeFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_astc_decode_mode)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT), but its parent extension " + "VK_EXT_astc_decode_mode has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceASTCDecodeFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_astc_decode_mode)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceASTCDecodeFeaturesEXT, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_astc_decode_mode) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceASTCDecodeFeaturesEXT* structure = (VkPhysicalDeviceASTCDecodeFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::decodeModeSharedExponent), structure->decodeModeSharedExponent); } @@ -2029,14 +1748,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceConditionalRenderingFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceConditionalRenderingFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_conditional_rendering)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT), but its parent extension " + "VK_EXT_conditional_rendering has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceConditionalRenderingFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceConditionalRenderingFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_conditional_rendering) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceConditionalRenderingFeaturesEXT* structure = (VkPhysicalDeviceConditionalRenderingFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::conditionalRendering), structure->conditionalRendering); @@ -2049,14 +1770,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDepthClipEnableFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDepthClipEnableFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_clip_enable)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT), but its parent extension " + "VK_EXT_depth_clip_enable has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDepthClipEnableFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_clip_enable)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDepthClipEnableFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_depth_clip_enable) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDepthClipEnableFeaturesEXT* structure = (VkPhysicalDeviceDepthClipEnableFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::depthClipEnable), structure->depthClipEnable); } @@ -2065,14 +1787,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG: { // Covers // VUID-VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG-sType-sType + + if (!IsExtEnabled(exts.vk_img_relaxed_line_rasterization)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG), but its parent extension " + "VK_IMG_relaxed_line_rasterization has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG); - if (!IsExtEnabled(device_extensions.vk_img_relaxed_line_rasterization)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG, but when " - "creating VkDevice, the parent extension " - "(VK_IMG_relaxed_line_rasterization) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG* structure = (VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG*)header; skip |= ValidateBool32(pNext_loc.dot(Field::relaxedLineRasterization), structure->relaxedLineRasterization); @@ -2083,14 +1807,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderEnqueueFeaturesAMDX structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_FEATURES_AMDX: { // Covers // VUID-VkPhysicalDeviceShaderEnqueueFeaturesAMDX-sType-sType + + if (!IsExtEnabled(exts.vk_amdx_shader_enqueue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_FEATURES_AMDX), but its parent extension " + "VK_AMDX_shader_enqueue has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderEnqueueFeaturesAMDX); - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderEnqueueFeaturesAMDX, but when creating " - "VkDevice, the parent extension " - "(VK_AMDX_shader_enqueue) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderEnqueueFeaturesAMDX* structure = (VkPhysicalDeviceShaderEnqueueFeaturesAMDX*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderEnqueue), structure->shaderEnqueue); @@ -2102,14 +1827,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_blend_operation_advanced)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT), but its parent extension " + "VK_EXT_blend_operation_advanced has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_blend_operation_advanced)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_blend_operation_advanced) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* structure = (VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::advancedBlendCoherentOperations), @@ -2120,14 +1847,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderSMBuiltinsFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceShaderSMBuiltinsFeaturesNV-sType-sType - if (is_const_param) { - [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderSMBuiltinsFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_shader_sm_builtins)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderSMBuiltinsFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_shader_sm_builtins) was not included in ppEnabledExtensionNames."); - } + + if (!IsExtEnabled(exts.vk_nv_shader_sm_builtins)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV), but its parent extension " + "VK_NV_shader_sm_builtins has not been enabled."); + } + if (is_const_param) { + [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderSMBuiltinsFeaturesNV); VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* structure = (VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderSMBuiltins), structure->shaderSMBuiltins); } @@ -2136,14 +1864,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShadingRateImageFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceShadingRateImageFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_shading_rate_image)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV), but its parent extension " + "VK_NV_shading_rate_image has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShadingRateImageFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShadingRateImageFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_shading_rate_image) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShadingRateImageFeaturesNV* structure = (VkPhysicalDeviceShadingRateImageFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shadingRateImage), structure->shadingRateImage); @@ -2154,14 +1883,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_representative_fragment_test)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV), but its parent extension " + "VK_NV_representative_fragment_test has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_representative_fragment_test)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_representative_fragment_test) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV* structure = (VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::representativeFragmentTest), structure->representativeFragmentTest); @@ -2171,14 +1902,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMeshShaderFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceMeshShaderFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_mesh_shader)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV), but its parent extension " + "VK_NV_mesh_shader has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMeshShaderFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_mesh_shader)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMeshShaderFeaturesNV, but when creating VkDevice, " - "the parent extension " - "(VK_NV_mesh_shader) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMeshShaderFeaturesNV* structure = (VkPhysicalDeviceMeshShaderFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::taskShader), structure->taskShader); @@ -2189,14 +1921,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderImageFootprintFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceShaderImageFootprintFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_shader_image_footprint)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV), but its parent extension " + "VK_NV_shader_image_footprint has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderImageFootprintFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_shader_image_footprint)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderImageFootprintFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_shader_image_footprint) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderImageFootprintFeaturesNV* structure = (VkPhysicalDeviceShaderImageFootprintFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::imageFootprint), structure->imageFootprint); } @@ -2205,14 +1939,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceExclusiveScissorFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceExclusiveScissorFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_scissor_exclusive)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV), but its parent extension " + "VK_NV_scissor_exclusive has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExclusiveScissorFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_scissor_exclusive)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceExclusiveScissorFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_scissor_exclusive) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceExclusiveScissorFeaturesNV* structure = (VkPhysicalDeviceExclusiveScissorFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::exclusiveScissor), structure->exclusiveScissor); } @@ -2221,14 +1956,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL: { // Covers // VUID-VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL-sType-sType + + if (!IsExtEnabled(exts.vk_intel_shader_integer_functions2)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL), but its parent extension " + "VK_INTEL_shader_integer_functions2 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL); - if (!IsExtEnabled(device_extensions.vk_intel_shader_integer_functions2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL, but when " - "creating VkDevice, the parent extension " - "(VK_INTEL_shader_integer_functions2) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL* structure = (VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderIntegerFunctions2), structure->shaderIntegerFunctions2); @@ -2238,14 +1975,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFragmentDensityMapFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceFragmentDensityMapFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT), but its parent extension " + "VK_EXT_fragment_density_map has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFragmentDensityMapFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFragmentDensityMapFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_fragment_density_map) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceFragmentDensityMapFeaturesEXT* structure = (VkPhysicalDeviceFragmentDensityMapFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::fragmentDensityMap), structure->fragmentDensityMap); @@ -2259,14 +1998,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCoherentMemoryFeaturesAMD structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD: { // Covers // VUID-VkPhysicalDeviceCoherentMemoryFeaturesAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_device_coherent_memory)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD), but its parent extension " + "VK_AMD_device_coherent_memory has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCoherentMemoryFeaturesAMD); - if (!IsExtEnabled(device_extensions.vk_amd_device_coherent_memory)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCoherentMemoryFeaturesAMD, but when creating " - "VkDevice, the parent extension " - "(VK_AMD_device_coherent_memory) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCoherentMemoryFeaturesAMD* structure = (VkPhysicalDeviceCoherentMemoryFeaturesAMD*)header; skip |= ValidateBool32(pNext_loc.dot(Field::deviceCoherentMemory), structure->deviceCoherentMemory); } @@ -2275,14 +2015,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_image_atomic_int64)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT), but its parent extension " + "VK_EXT_shader_image_atomic_int64 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_shader_image_atomic_int64)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_shader_image_atomic_int64) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT* structure = (VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderImageInt64Atomics), structure->shaderImageInt64Atomics); @@ -2294,14 +2036,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMemoryPriorityFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceMemoryPriorityFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_memory_priority)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT), but its parent extension " + "VK_EXT_memory_priority has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMemoryPriorityFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_memory_priority)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMemoryPriorityFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_memory_priority) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMemoryPriorityFeaturesEXT* structure = (VkPhysicalDeviceMemoryPriorityFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::memoryPriority), structure->memoryPriority); } @@ -2310,15 +2053,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_dedicated_allocation_image_aliasing)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV), but its parent extension " + "VK_NV_dedicated_allocation_image_aliasing has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_dedicated_allocation_image_aliasing)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_dedicated_allocation_image_aliasing) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV* structure = (VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::dedicatedAllocationImageAliasing), @@ -2329,14 +2074,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceBufferDeviceAddressFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceBufferDeviceAddressFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_buffer_device_address)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT), but its parent extension " + "VK_EXT_buffer_device_address has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceBufferDeviceAddressFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_buffer_device_address)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceBufferDeviceAddressFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_buffer_device_address) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceBufferDeviceAddressFeaturesEXT* structure = (VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::bufferDeviceAddress), structure->bufferDeviceAddress); @@ -2351,14 +2098,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCooperativeMatrixFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceCooperativeMatrixFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_cooperative_matrix)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV), but its parent extension " + "VK_NV_cooperative_matrix has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCooperativeMatrixFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_cooperative_matrix)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCooperativeMatrixFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_cooperative_matrix) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCooperativeMatrixFeaturesNV* structure = (VkPhysicalDeviceCooperativeMatrixFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::cooperativeMatrix), structure->cooperativeMatrix); @@ -2370,14 +2118,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCoverageReductionModeFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceCoverageReductionModeFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_coverage_reduction_mode)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV), but its parent extension " + "VK_NV_coverage_reduction_mode has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCoverageReductionModeFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_coverage_reduction_mode)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCoverageReductionModeFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_coverage_reduction_mode) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCoverageReductionModeFeaturesNV* structure = (VkPhysicalDeviceCoverageReductionModeFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::coverageReductionMode), structure->coverageReductionMode); @@ -2387,14 +2137,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_fragment_shader_interlock)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT), but its parent extension " + "VK_EXT_fragment_shader_interlock has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_fragment_shader_interlock)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_fragment_shader_interlock) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT* structure = (VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT*)header; skip |= @@ -2410,14 +2162,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceYcbcrImageArraysFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceYcbcrImageArraysFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_ycbcr_image_arrays)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT), but its parent extension " + "VK_EXT_ycbcr_image_arrays has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceYcbcrImageArraysFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_ycbcr_image_arrays)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceYcbcrImageArraysFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_ycbcr_image_arrays) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceYcbcrImageArraysFeaturesEXT* structure = (VkPhysicalDeviceYcbcrImageArraysFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::ycbcrImageArrays), structure->ycbcrImageArrays); } @@ -2426,14 +2180,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceProvokingVertexFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceProvokingVertexFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_provoking_vertex)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT), but its parent extension " + "VK_EXT_provoking_vertex has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceProvokingVertexFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_provoking_vertex)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceProvokingVertexFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_provoking_vertex) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceProvokingVertexFeaturesEXT* structure = (VkPhysicalDeviceProvokingVertexFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::provokingVertexLast), structure->provokingVertexLast); @@ -2445,14 +2200,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderAtomicFloatFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceShaderAtomicFloatFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_atomic_float)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT), but its parent extension " + "VK_EXT_shader_atomic_float has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderAtomicFloatFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_shader_atomic_float)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_shader_atomic_float) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderAtomicFloatFeaturesEXT* structure = (VkPhysicalDeviceShaderAtomicFloatFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderBufferFloat32Atomics), structure->shaderBufferFloat32Atomics); @@ -2483,14 +2240,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceExtendedDynamicStateFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceExtendedDynamicStateFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_extended_dynamic_state)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT), but its parent extension " + "VK_EXT_extended_dynamic_state has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExtendedDynamicStateFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceExtendedDynamicStateFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_extended_dynamic_state) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceExtendedDynamicStateFeaturesEXT* structure = (VkPhysicalDeviceExtendedDynamicStateFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::extendedDynamicState), structure->extendedDynamicState); @@ -2500,14 +2259,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMapMemoryPlacedFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceMapMemoryPlacedFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_map_memory_placed)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_FEATURES_EXT), but its parent extension " + "VK_EXT_map_memory_placed has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMapMemoryPlacedFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_map_memory_placed)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMapMemoryPlacedFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_map_memory_placed) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMapMemoryPlacedFeaturesEXT* structure = (VkPhysicalDeviceMapMemoryPlacedFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::memoryMapPlaced), structure->memoryMapPlaced); @@ -2520,14 +2280,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_atomic_float2)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT), but its parent extension " + "VK_EXT_shader_atomic_float2 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_shader_atomic_float2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_shader_atomic_float2) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT* structure = (VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderBufferFloat16Atomics), structure->shaderBufferFloat16Atomics); @@ -2566,14 +2328,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_swapchain_maintenance1)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT), but its parent extension " + "VK_EXT_swapchain_maintenance1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_swapchain_maintenance1) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT* structure = (VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::swapchainMaintenance1), structure->swapchainMaintenance1); @@ -2583,14 +2347,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_device_generated_commands)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV), but its parent extension " + "VK_NV_device_generated_commands has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_device_generated_commands) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV* structure = (VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::deviceGeneratedCommands), structure->deviceGeneratedCommands); @@ -2600,14 +2366,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceInheritedViewportScissorFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceInheritedViewportScissorFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_inherited_viewport_scissor)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV), but its parent extension " + "VK_NV_inherited_viewport_scissor has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceInheritedViewportScissorFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_inherited_viewport_scissor)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceInheritedViewportScissorFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_inherited_viewport_scissor) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceInheritedViewportScissorFeaturesNV* structure = (VkPhysicalDeviceInheritedViewportScissorFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::inheritedViewportScissor2D), structure->inheritedViewportScissor2D); @@ -2617,14 +2385,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_texel_buffer_alignment)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT), but its parent extension " + "VK_EXT_texel_buffer_alignment has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_texel_buffer_alignment)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_texel_buffer_alignment) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT* structure = (VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::texelBufferAlignment), structure->texelBufferAlignment); @@ -2634,14 +2404,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDepthBiasControlFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDepthBiasControlFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_bias_control)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT), but its parent extension " + "VK_EXT_depth_bias_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDepthBiasControlFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_bias_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDepthBiasControlFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_depth_bias_control) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDepthBiasControlFeaturesEXT* structure = (VkPhysicalDeviceDepthBiasControlFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::depthBiasControl), structure->depthBiasControl); @@ -2657,14 +2429,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDeviceMemoryReportFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDeviceMemoryReportFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_device_memory_report)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT), but its parent extension " + "VK_EXT_device_memory_report has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDeviceMemoryReportFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_device_memory_report)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDeviceMemoryReportFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_device_memory_report) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDeviceMemoryReportFeaturesEXT* structure = (VkPhysicalDeviceDeviceMemoryReportFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::deviceMemoryReport), structure->deviceMemoryReport); } @@ -2673,14 +2447,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRobustness2FeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceRobustness2FeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_robustness2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT), but its parent extension " + "VK_EXT_robustness2 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRobustness2FeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_robustness2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRobustness2FeaturesEXT, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_robustness2) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRobustness2FeaturesEXT* structure = (VkPhysicalDeviceRobustness2FeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::robustBufferAccess2), structure->robustBufferAccess2); @@ -2693,14 +2468,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCustomBorderColorFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceCustomBorderColorFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_custom_border_color)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT), but its parent extension " + "VK_EXT_custom_border_color has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCustomBorderColorFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_custom_border_color)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCustomBorderColorFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_custom_border_color) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCustomBorderColorFeaturesEXT* structure = (VkPhysicalDeviceCustomBorderColorFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::customBorderColors), structure->customBorderColors); @@ -2712,14 +2489,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePresentBarrierFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV: { // Covers // VUID-VkPhysicalDevicePresentBarrierFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_present_barrier)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV), but its parent extension " + "VK_NV_present_barrier has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePresentBarrierFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_present_barrier)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePresentBarrierFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_present_barrier) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePresentBarrierFeaturesNV* structure = (VkPhysicalDevicePresentBarrierFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::presentBarrier), structure->presentBarrier); } @@ -2728,14 +2506,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDiagnosticsConfigFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceDiagnosticsConfigFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_device_diagnostics_config)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV), but its parent extension " + "VK_NV_device_diagnostics_config has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDiagnosticsConfigFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_device_diagnostics_config)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDiagnosticsConfigFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_device_diagnostics_config) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDiagnosticsConfigFeaturesNV* structure = (VkPhysicalDeviceDiagnosticsConfigFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::diagnosticsConfig), structure->diagnosticsConfig); } @@ -2744,14 +2523,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCudaKernelLaunchFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceCudaKernelLaunchFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_cuda_kernel_launch)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV), but its parent extension " + "VK_NV_cuda_kernel_launch has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCudaKernelLaunchFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCudaKernelLaunchFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_cuda_kernel_launch) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCudaKernelLaunchFeaturesNV* structure = (VkPhysicalDeviceCudaKernelLaunchFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::cudaKernelLaunchFeatures), structure->cudaKernelLaunchFeatures); } @@ -2760,14 +2540,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDescriptorBufferFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDescriptorBufferFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT), but its parent extension " + "VK_EXT_descriptor_buffer has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDescriptorBufferFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDescriptorBufferFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_descriptor_buffer) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDescriptorBufferFeaturesEXT* structure = (VkPhysicalDeviceDescriptorBufferFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::descriptorBuffer), structure->descriptorBuffer); @@ -2785,14 +2566,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_graphics_pipeline_library)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT), but its parent extension " + "VK_EXT_graphics_pipeline_library has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_graphics_pipeline_library) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT* structure = (VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::graphicsPipelineLibrary), structure->graphicsPipelineLibrary); @@ -2802,15 +2585,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD: { // Covers // VUID-VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_shader_early_and_late_fragment_tests)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD), but " + "its parent extension " + "VK_AMD_shader_early_and_late_fragment_tests has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD); - if (!IsExtEnabled(device_extensions.vk_amd_shader_early_and_late_fragment_tests)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD, but when " - "creating VkDevice, the parent extension " - "(VK_AMD_shader_early_and_late_fragment_tests) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD* structure = (VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderEarlyAndLateFragmentTests), @@ -2821,14 +2606,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_fragment_shading_rate_enums)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV), but its parent extension " + "VK_NV_fragment_shading_rate_enums has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_fragment_shading_rate_enums)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_fragment_shading_rate_enums) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV* structure = (VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::fragmentShadingRateEnums), structure->fragmentShadingRateEnums); @@ -2844,14 +2631,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRayTracingMotionBlurFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceRayTracingMotionBlurFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_ray_tracing_motion_blur)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV), but its parent extension " + "VK_NV_ray_tracing_motion_blur has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRayTracingMotionBlurFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing_motion_blur)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRayTracingMotionBlurFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_ray_tracing_motion_blur) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRayTracingMotionBlurFeaturesNV* structure = (VkPhysicalDeviceRayTracingMotionBlurFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rayTracingMotionBlur), structure->rayTracingMotionBlur); @@ -2863,14 +2652,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_ycbcr_2plane_444_formats)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT), but its parent extension " + "VK_EXT_ycbcr_2plane_444_formats has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_ycbcr_2plane_444_formats)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_ycbcr_2plane_444_formats) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT* structure = (VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::ycbcr2plane444Formats), structure->ycbcr2plane444Formats); @@ -2880,14 +2671,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFragmentDensityMap2FeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceFragmentDensityMap2FeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_fragment_density_map2)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT), but its parent extension " + "VK_EXT_fragment_density_map2 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFragmentDensityMap2FeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFragmentDensityMap2FeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_fragment_density_map2) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceFragmentDensityMap2FeaturesEXT* structure = (VkPhysicalDeviceFragmentDensityMap2FeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::fragmentDensityMapDeferred), structure->fragmentDensityMapDeferred); } @@ -2896,14 +2689,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceImageCompressionControlFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceImageCompressionControlFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_compression_control)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT), but its parent extension " + "VK_EXT_image_compression_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageCompressionControlFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_image_compression_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImageCompressionControlFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_image_compression_control) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImageCompressionControlFeaturesEXT* structure = (VkPhysicalDeviceImageCompressionControlFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::imageCompressionControl), structure->imageCompressionControl); @@ -2913,15 +2708,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_attachment_feedback_loop_layout)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT), but its parent extension " + "VK_EXT_attachment_feedback_loop_layout has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_layout)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_attachment_feedback_loop_layout) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT* structure = (VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::attachmentFeedbackLoopLayout), structure->attachmentFeedbackLoopLayout); @@ -2931,14 +2728,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevice4444FormatsFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDevice4444FormatsFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_4444_formats)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT), but its parent extension " + "VK_EXT_4444_formats has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevice4444FormatsFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_4444_formats)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevice4444FormatsFeaturesEXT, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_4444_formats) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevice4444FormatsFeaturesEXT* structure = (VkPhysicalDevice4444FormatsFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::formatA4R4G4B4), structure->formatA4R4G4B4); @@ -2948,14 +2746,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFaultFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT: { // Covers VUID-VkPhysicalDeviceFaultFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_device_fault)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT), but its parent extension " + "VK_EXT_device_fault has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFaultFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_device_fault)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFaultFeaturesEXT, but when creating VkDevice, the " - "parent extension " - "(VK_EXT_device_fault) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceFaultFeaturesEXT* structure = (VkPhysicalDeviceFaultFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::deviceFault), structure->deviceFault); @@ -2966,17 +2765,19 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT-sType-sType + + if ((!IsExtEnabled(exts.vk_arm_rasterization_order_attachment_access)) && + (!IsExtEnabled(exts.vk_ext_rasterization_order_attachment_access))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT), but " + "its parent extension " + "VK_ARM_rasterization_order_attachment_access, or " + "VK_EXT_rasterization_order_attachment_access has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_arm_rasterization_order_attachment_access) && - !IsExtEnabled(device_extensions.vk_ext_rasterization_order_attachment_access)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT, but " - "when creating VkDevice, the parent extension " - "(VK_ARM_rasterization_order_attachment_access or " - "VK_EXT_rasterization_order_attachment_access) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT* structure = (VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rasterizationOrderColorAttachmentAccess), @@ -2993,14 +2794,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_rgba10x6_formats)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT), but its parent extension " + "VK_EXT_rgba10x6_formats has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_rgba10x6_formats)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_rgba10x6_formats) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT* structure = (VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::formatRgba10x6WithoutYCbCrSampler), structure->formatRgba10x6WithoutYCbCrSampler); @@ -3010,16 +2812,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT-sType-sType + + if ((!IsExtEnabled(exts.vk_ext_mutable_descriptor_type)) && (!IsExtEnabled(exts.vk_valve_mutable_descriptor_type))) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT), but its parent extension " + "VK_EXT_mutable_descriptor_type, or VK_VALVE_mutable_descriptor_type has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_valve_mutable_descriptor_type) && - !IsExtEnabled(device_extensions.vk_ext_mutable_descriptor_type)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_VALVE_mutable_descriptor_type or VK_EXT_mutable_descriptor_type) was not included in " - "ppEnabledExtensionNames."); - } VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT* structure = (VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::mutableDescriptorType), structure->mutableDescriptorType); @@ -3029,14 +2831,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_vertex_input_dynamic_state)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT), but its parent extension " + "VK_EXT_vertex_input_dynamic_state has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_vertex_input_dynamic_state)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_vertex_input_dynamic_state) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT* structure = (VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::vertexInputDynamicState), structure->vertexInputDynamicState); @@ -3046,14 +2850,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceAddressBindingReportFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceAddressBindingReportFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_device_address_binding_report)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT), but its parent extension " + "VK_EXT_device_address_binding_report has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceAddressBindingReportFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_device_address_binding_report)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceAddressBindingReportFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_device_address_binding_report) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceAddressBindingReportFeaturesEXT* structure = (VkPhysicalDeviceAddressBindingReportFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::reportAddressBinding), structure->reportAddressBinding); @@ -3063,14 +2869,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDepthClipControlFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDepthClipControlFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_clip_control)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT), but its parent extension " + "VK_EXT_depth_clip_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDepthClipControlFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_clip_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDepthClipControlFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_depth_clip_control) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDepthClipControlFeaturesEXT* structure = (VkPhysicalDeviceDepthClipControlFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::depthClipControl), structure->depthClipControl); } @@ -3079,15 +2887,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT: { // Covers // VUID-VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_primitive_topology_list_restart)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT), but its parent extension " + "VK_EXT_primitive_topology_list_restart has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_primitive_topology_list_restart)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_primitive_topology_list_restart) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT* structure = (VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::primitiveTopologyListRestart), structure->primitiveTopologyListRestart); @@ -3100,15 +2910,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT: { // Covers // VUID-VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_present_mode_fifo_latest_ready)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT), but its parent extension " + "VK_EXT_present_mode_fifo_latest_ready has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_present_mode_fifo_latest_ready)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_present_mode_fifo_latest_ready) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT* structure = (VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::presentModeFifoLatestReady), structure->presentModeFifoLatestReady); @@ -3118,14 +2930,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceSubpassShadingFeaturesHUAWEI structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI: { // Covers // VUID-VkPhysicalDeviceSubpassShadingFeaturesHUAWEI-sType-sType + + if (!IsExtEnabled(exts.vk_huawei_subpass_shading)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI), but its parent extension " + "VK_HUAWEI_subpass_shading has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSubpassShadingFeaturesHUAWEI); - if (!IsExtEnabled(device_extensions.vk_huawei_subpass_shading)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceSubpassShadingFeaturesHUAWEI, but when creating " - "VkDevice, the parent extension " - "(VK_HUAWEI_subpass_shading) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceSubpassShadingFeaturesHUAWEI* structure = (VkPhysicalDeviceSubpassShadingFeaturesHUAWEI*)header; skip |= ValidateBool32(pNext_loc.dot(Field::subpassShading), structure->subpassShading); } @@ -3134,14 +2948,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceInvocationMaskFeaturesHUAWEI structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI: { // Covers // VUID-VkPhysicalDeviceInvocationMaskFeaturesHUAWEI-sType-sType + + if (!IsExtEnabled(exts.vk_huawei_invocation_mask)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI), but its parent extension " + "VK_HUAWEI_invocation_mask has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceInvocationMaskFeaturesHUAWEI); - if (!IsExtEnabled(device_extensions.vk_huawei_invocation_mask)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceInvocationMaskFeaturesHUAWEI, but when creating " - "VkDevice, the parent extension " - "(VK_HUAWEI_invocation_mask) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceInvocationMaskFeaturesHUAWEI* structure = (VkPhysicalDeviceInvocationMaskFeaturesHUAWEI*)header; skip |= ValidateBool32(pNext_loc.dot(Field::invocationMask), structure->invocationMask); } @@ -3150,14 +2966,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceExternalMemoryRDMAFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceExternalMemoryRDMAFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_external_memory_rdma)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV), but its parent extension " + "VK_NV_external_memory_rdma has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExternalMemoryRDMAFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_external_memory_rdma)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceExternalMemoryRDMAFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_external_memory_rdma) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceExternalMemoryRDMAFeaturesNV* structure = (VkPhysicalDeviceExternalMemoryRDMAFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::externalMemoryRDMA), structure->externalMemoryRDMA); } @@ -3166,14 +2984,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePipelinePropertiesFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT: { // Covers // VUID-VkPhysicalDevicePipelinePropertiesFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_pipeline_properties)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT), but its parent extension " + "VK_EXT_pipeline_properties has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelinePropertiesFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_properties)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePipelinePropertiesFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_pipeline_properties) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePipelinePropertiesFeaturesEXT* structure = (VkPhysicalDevicePipelinePropertiesFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelinePropertiesIdentifier), structure->pipelinePropertiesIdentifier); } @@ -3182,14 +3002,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFrameBoundaryFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceFrameBoundaryFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_frame_boundary)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT), but its parent extension " + "VK_EXT_frame_boundary has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFrameBoundaryFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_frame_boundary)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFrameBoundaryFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_frame_boundary) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceFrameBoundaryFeaturesEXT* structure = (VkPhysicalDeviceFrameBoundaryFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::frameBoundary), structure->frameBoundary); } @@ -3198,15 +3019,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_multisampled_render_to_single_sampled)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT), but " + "its parent extension " + "VK_EXT_multisampled_render_to_single_sampled has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_multisampled_render_to_single_sampled)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT, but " - "when creating VkDevice, the parent extension " - "(VK_EXT_multisampled_render_to_single_sampled) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT* structure = (VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::multisampledRenderToSingleSampled), @@ -3217,14 +3040,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceExtendedDynamicState2FeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceExtendedDynamicState2FeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_extended_dynamic_state2)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT), but its parent extension " + "VK_EXT_extended_dynamic_state2 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExtendedDynamicState2FeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceExtendedDynamicState2FeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_extended_dynamic_state2) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceExtendedDynamicState2FeaturesEXT* structure = (VkPhysicalDeviceExtendedDynamicState2FeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::extendedDynamicState2), structure->extendedDynamicState2); @@ -3239,14 +3064,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceColorWriteEnableFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceColorWriteEnableFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_color_write_enable)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT), but its parent extension " + "VK_EXT_color_write_enable has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceColorWriteEnableFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_color_write_enable)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceColorWriteEnableFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_color_write_enable) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceColorWriteEnableFeaturesEXT* structure = (VkPhysicalDeviceColorWriteEnableFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::colorWriteEnable), structure->colorWriteEnable); } @@ -3255,14 +3082,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT: { // Covers // VUID-VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_primitives_generated_query)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT), but its parent extension " + "VK_EXT_primitives_generated_query has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_primitives_generated_query)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_primitives_generated_query) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT* structure = (VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::primitivesGeneratedQuery), structure->primitivesGeneratedQuery); @@ -3278,14 +3107,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceImageViewMinLodFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceImageViewMinLodFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_view_min_lod)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT), but its parent extension " + "VK_EXT_image_view_min_lod has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageViewMinLodFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_image_view_min_lod)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImageViewMinLodFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_image_view_min_lod) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImageViewMinLodFeaturesEXT* structure = (VkPhysicalDeviceImageViewMinLodFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::minLod), structure->minLod); } @@ -3294,14 +3125,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMultiDrawFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceMultiDrawFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_multi_draw)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT), but its parent extension " + "VK_EXT_multi_draw has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMultiDrawFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_multi_draw)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMultiDrawFeaturesEXT, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_multi_draw) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMultiDrawFeaturesEXT* structure = (VkPhysicalDeviceMultiDrawFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::multiDraw), structure->multiDraw); } @@ -3310,14 +3142,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceImage2DViewOf3DFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceImage2DViewOf3DFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_2d_view_of_3d)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT), but its parent extension " + "VK_EXT_image_2d_view_of_3d has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImage2DViewOf3DFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_image_2d_view_of_3d)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImage2DViewOf3DFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_image_2d_view_of_3d) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImage2DViewOf3DFeaturesEXT* structure = (VkPhysicalDeviceImage2DViewOf3DFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::image2DViewOf3D), structure->image2DViewOf3D); @@ -3328,14 +3162,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderTileImageFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceShaderTileImageFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_tile_image)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT), but its parent extension " + "VK_EXT_shader_tile_image has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderTileImageFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_shader_tile_image)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderTileImageFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_shader_tile_image) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderTileImageFeaturesEXT* structure = (VkPhysicalDeviceShaderTileImageFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderTileImageColorReadAccess), structure->shaderTileImageColorReadAccess); @@ -3351,14 +3186,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceOpacityMicromapFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceOpacityMicromapFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT), but its parent extension " + "VK_EXT_opacity_micromap has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceOpacityMicromapFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceOpacityMicromapFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_opacity_micromap) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceOpacityMicromapFeaturesEXT* structure = (VkPhysicalDeviceOpacityMicromapFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::micromap), structure->micromap); @@ -3372,14 +3208,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDisplacementMicromapFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceDisplacementMicromapFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_displacement_micromap)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_FEATURES_NV), but its parent extension " + "VK_NV_displacement_micromap has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDisplacementMicromapFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_displacement_micromap)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDisplacementMicromapFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_displacement_micromap) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDisplacementMicromapFeaturesNV* structure = (VkPhysicalDeviceDisplacementMicromapFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::displacementMicromap), structure->displacementMicromap); } @@ -3389,14 +3227,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI: { // Covers // VUID-VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI-sType-sType + + if (!IsExtEnabled(exts.vk_huawei_cluster_culling_shader)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI), but its parent extension " + "VK_HUAWEI_cluster_culling_shader has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI); - if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI, but when " - "creating VkDevice, the parent extension " - "(VK_HUAWEI_cluster_culling_shader) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI* structure = (VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI*)header; skip |= ValidateBool32(pNext_loc.dot(Field::clustercullingShader), structure->clustercullingShader); @@ -3409,14 +3249,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceBorderColorSwizzleFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceBorderColorSwizzleFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_border_color_swizzle)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT), but its parent extension " + "VK_EXT_border_color_swizzle has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceBorderColorSwizzleFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_border_color_swizzle)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceBorderColorSwizzleFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_border_color_swizzle) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceBorderColorSwizzleFeaturesEXT* structure = (VkPhysicalDeviceBorderColorSwizzleFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::borderColorSwizzle), structure->borderColorSwizzle); @@ -3427,14 +3269,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT: { // Covers // VUID-VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_pageable_device_local_memory)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT), but its parent extension " + "VK_EXT_pageable_device_local_memory has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_pageable_device_local_memory)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_pageable_device_local_memory) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT* structure = (VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pageableDeviceLocalMemory), structure->pageableDeviceLocalMemory); @@ -3444,14 +3288,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceSchedulingControlsFeaturesARM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM: { // Covers // VUID-VkPhysicalDeviceSchedulingControlsFeaturesARM-sType-sType + + if (!IsExtEnabled(exts.vk_arm_scheduling_controls)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM), but its parent extension " + "VK_ARM_scheduling_controls has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSchedulingControlsFeaturesARM); - if (!IsExtEnabled(device_extensions.vk_arm_scheduling_controls)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceSchedulingControlsFeaturesARM, but when creating " - "VkDevice, the parent extension " - "(VK_ARM_scheduling_controls) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceSchedulingControlsFeaturesARM* structure = (VkPhysicalDeviceSchedulingControlsFeaturesARM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::schedulingControls), structure->schedulingControls); } @@ -3460,14 +3306,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_sliced_view_of_3d)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT), but its parent extension " + "VK_EXT_image_sliced_view_of_3d has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_image_sliced_view_of_3d)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_image_sliced_view_of_3d) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT* structure = (VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::imageSlicedViewOf3D), structure->imageSlicedViewOf3D); } @@ -3476,15 +3324,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: { // Covers // VUID-VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE-sType-sType + + if (!IsExtEnabled(exts.vk_valve_descriptor_set_host_mapping)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE), but its parent extension " + "VK_VALVE_descriptor_set_host_mapping has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE); - if (!IsExtEnabled(device_extensions.vk_valve_descriptor_set_host_mapping)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE, but when " - "creating VkDevice, the parent extension " - "(VK_VALVE_descriptor_set_host_mapping) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE* structure = (VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE*)header; skip |= ValidateBool32(pNext_loc.dot(Field::descriptorSetHostMapping), structure->descriptorSetHostMapping); @@ -3494,14 +3344,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDepthClampZeroOneFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDepthClampZeroOneFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_clamp_zero_one)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT), but its parent extension " + "VK_EXT_depth_clamp_zero_one has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDepthClampZeroOneFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_clamp_zero_one)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDepthClampZeroOneFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_depth_clamp_zero_one) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDepthClampZeroOneFeaturesEXT* structure = (VkPhysicalDeviceDepthClampZeroOneFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::depthClampZeroOne), structure->depthClampZeroOne); } @@ -3510,14 +3362,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_non_seamless_cube_map)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT), but its parent extension " + "VK_EXT_non_seamless_cube_map has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_non_seamless_cube_map)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_non_seamless_cube_map) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT* structure = (VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::nonSeamlessCubeMap), structure->nonSeamlessCubeMap); } @@ -3526,14 +3380,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRenderPassStripedFeaturesARM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM: { // Covers // VUID-VkPhysicalDeviceRenderPassStripedFeaturesARM-sType-sType + + if (!IsExtEnabled(exts.vk_arm_render_pass_striped)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM), but its parent extension " + "VK_ARM_render_pass_striped has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRenderPassStripedFeaturesARM); - if (!IsExtEnabled(device_extensions.vk_arm_render_pass_striped)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRenderPassStripedFeaturesARM, but when creating " - "VkDevice, the parent extension " - "(VK_ARM_render_pass_striped) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRenderPassStripedFeaturesARM* structure = (VkPhysicalDeviceRenderPassStripedFeaturesARM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::renderPassStriped), structure->renderPassStriped); } @@ -3542,14 +3398,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_fragment_density_map_offset)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM), but its parent extension " + "VK_QCOM_fragment_density_map_offset has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_fragment_density_map_offset)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM, but when " - "creating VkDevice, the parent extension " - "(VK_QCOM_fragment_density_map_offset) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM* structure = (VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::fragmentDensityMapOffset), structure->fragmentDensityMapOffset); @@ -3559,14 +3417,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCopyMemoryIndirectFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceCopyMemoryIndirectFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_copy_memory_indirect)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV), but its parent extension " + "VK_NV_copy_memory_indirect has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCopyMemoryIndirectFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_copy_memory_indirect)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCopyMemoryIndirectFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_copy_memory_indirect) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCopyMemoryIndirectFeaturesNV* structure = (VkPhysicalDeviceCopyMemoryIndirectFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::indirectCopy), structure->indirectCopy); } @@ -3575,14 +3435,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMemoryDecompressionFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceMemoryDecompressionFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_memory_decompression)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV), but its parent extension " + "VK_NV_memory_decompression has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMemoryDecompressionFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_memory_decompression)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMemoryDecompressionFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_memory_decompression) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMemoryDecompressionFeaturesNV* structure = (VkPhysicalDeviceMemoryDecompressionFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::memoryDecompression), structure->memoryDecompression); } @@ -3591,15 +3453,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_device_generated_commands_compute)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV), but its parent extension " + "VK_NV_device_generated_commands_compute has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_device_generated_commands_compute) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV* structure = (VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::deviceGeneratedCompute), structure->deviceGeneratedCompute); @@ -3615,14 +3479,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceLinearColorAttachmentFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceLinearColorAttachmentFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_linear_color_attachment)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV), but its parent extension " + "VK_NV_linear_color_attachment has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceLinearColorAttachmentFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_linear_color_attachment)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceLinearColorAttachmentFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_linear_color_attachment) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceLinearColorAttachmentFeaturesNV* structure = (VkPhysicalDeviceLinearColorAttachmentFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::linearColorAttachment), structure->linearColorAttachment); @@ -3632,15 +3498,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_compression_control_swapchain)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT), but " + "its parent extension " + "VK_EXT_image_compression_control_swapchain has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_image_compression_control_swapchain)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT, but " - "when creating VkDevice, the parent extension " - "(VK_EXT_image_compression_control_swapchain) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT* structure = (VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::imageCompressionControlSwapchain), @@ -3651,14 +3519,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceImageProcessingFeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceImageProcessingFeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_image_processing)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM), but its parent extension " + "VK_QCOM_image_processing has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageProcessingFeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_image_processing)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImageProcessingFeaturesQCOM, but when creating " - "VkDevice, the parent extension " - "(VK_QCOM_image_processing) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImageProcessingFeaturesQCOM* structure = (VkPhysicalDeviceImageProcessingFeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::textureSampleWeighted), structure->textureSampleWeighted); @@ -3671,14 +3540,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceNestedCommandBufferFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceNestedCommandBufferFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_nested_command_buffer)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT), but its parent extension " + "VK_EXT_nested_command_buffer has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceNestedCommandBufferFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_nested_command_buffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceNestedCommandBufferFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_nested_command_buffer) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceNestedCommandBufferFeaturesEXT* structure = (VkPhysicalDeviceNestedCommandBufferFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::nestedCommandBuffer), structure->nestedCommandBuffer); @@ -3692,14 +3563,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceExtendedDynamicState3FeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceExtendedDynamicState3FeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_extended_dynamic_state3)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT), but its parent extension " + "VK_EXT_extended_dynamic_state3 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExtendedDynamicState3FeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_extended_dynamic_state3) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceExtendedDynamicState3FeaturesEXT* structure = (VkPhysicalDeviceExtendedDynamicState3FeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::extendedDynamicState3TessellationDomainOrigin), @@ -3800,14 +3673,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_subpass_merge_feedback)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT), but its parent extension " + "VK_EXT_subpass_merge_feedback has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_subpass_merge_feedback)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_subpass_merge_feedback) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT* structure = (VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::subpassMergeFeedback), structure->subpassMergeFeedback); @@ -3817,14 +3692,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_module_identifier)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT), but its parent extension " + "VK_EXT_shader_module_identifier has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_shader_module_identifier)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_shader_module_identifier) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT* structure = (VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderModuleIdentifier), structure->shaderModuleIdentifier); @@ -3834,14 +3711,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceOpticalFlowFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceOpticalFlowFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_optical_flow)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV), but its parent extension " + "VK_NV_optical_flow has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceOpticalFlowFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_optical_flow)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceOpticalFlowFeaturesNV, but when creating VkDevice, " - "the parent extension " - "(VK_NV_optical_flow) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceOpticalFlowFeaturesNV* structure = (VkPhysicalDeviceOpticalFlowFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::opticalFlow), structure->opticalFlow); } @@ -3850,14 +3728,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceLegacyDitheringFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceLegacyDitheringFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_legacy_dithering)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT), but its parent extension " + "VK_EXT_legacy_dithering has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceLegacyDitheringFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_legacy_dithering)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceLegacyDitheringFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_legacy_dithering) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceLegacyDitheringFeaturesEXT* structure = (VkPhysicalDeviceLegacyDitheringFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::legacyDithering), structure->legacyDithering); } @@ -3867,14 +3746,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceExternalFormatResolveFeaturesANDROID structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID: { // Covers // VUID-VkPhysicalDeviceExternalFormatResolveFeaturesANDROID-sType-sType + + if (!IsExtEnabled(exts.vk_android_external_format_resolve)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID), but its parent extension " + "VK_ANDROID_external_format_resolve has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExternalFormatResolveFeaturesANDROID); - if (!IsExtEnabled(device_extensions.vk_android_external_format_resolve)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceExternalFormatResolveFeaturesANDROID, but when " - "creating VkDevice, the parent extension " - "(VK_ANDROID_external_format_resolve) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceExternalFormatResolveFeaturesANDROID* structure = (VkPhysicalDeviceExternalFormatResolveFeaturesANDROID*)header; skip |= ValidateBool32(pNext_loc.dot(Field::externalFormatResolve), structure->externalFormatResolve); @@ -3885,14 +3766,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceAntiLagFeaturesAMD structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD: { // Covers // VUID-VkPhysicalDeviceAntiLagFeaturesAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_anti_lag)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ANTI_LAG_FEATURES_AMD), but its parent extension " + "VK_AMD_anti_lag has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceAntiLagFeaturesAMD); - if (!IsExtEnabled(device_extensions.vk_amd_anti_lag)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceAntiLagFeaturesAMD, but when creating VkDevice, the " - "parent extension " - "(VK_AMD_anti_lag) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceAntiLagFeaturesAMD* structure = (VkPhysicalDeviceAntiLagFeaturesAMD*)header; skip |= ValidateBool32(pNext_loc.dot(Field::antiLag), structure->antiLag); } @@ -3901,14 +3783,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderObjectFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceShaderObjectFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_object)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT), but its parent extension " + "VK_EXT_shader_object has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderObjectFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_shader_object)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderObjectFeaturesEXT, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_shader_object) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderObjectFeaturesEXT* structure = (VkPhysicalDeviceShaderObjectFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderObject), structure->shaderObject); } @@ -3917,14 +3800,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceTilePropertiesFeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceTilePropertiesFeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_tile_properties)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM), but its parent extension " + "VK_QCOM_tile_properties has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceTilePropertiesFeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_tile_properties)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceTilePropertiesFeaturesQCOM, but when creating " - "VkDevice, the parent extension " - "(VK_QCOM_tile_properties) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceTilePropertiesFeaturesQCOM* structure = (VkPhysicalDeviceTilePropertiesFeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::tileProperties), structure->tileProperties); } @@ -3933,14 +3817,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceAmigoProfilingFeaturesSEC structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_AMIGO_PROFILING_FEATURES_SEC: { // Covers // VUID-VkPhysicalDeviceAmigoProfilingFeaturesSEC-sType-sType + + if (!IsExtEnabled(exts.vk_sec_amigo_profiling)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_AMIGO_PROFILING_FEATURES_SEC), but its parent extension " + "VK_SEC_amigo_profiling has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceAmigoProfilingFeaturesSEC); - if (!IsExtEnabled(device_extensions.vk_sec_amigo_profiling)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceAmigoProfilingFeaturesSEC, but when creating " - "VkDevice, the parent extension " - "(VK_SEC_amigo_profiling) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceAmigoProfilingFeaturesSEC* structure = (VkPhysicalDeviceAmigoProfilingFeaturesSEC*)header; skip |= ValidateBool32(pNext_loc.dot(Field::amigoProfiling), structure->amigoProfiling); } @@ -3949,15 +3834,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_multiview_per_view_viewports)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM), but its parent extension " + "VK_QCOM_multiview_per_view_viewports has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_multiview_per_view_viewports)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM, but when " - "creating VkDevice, the parent extension " - "(VK_QCOM_multiview_per_view_viewports) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM* structure = (VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::multiviewPerViewViewports), structure->multiviewPerViewViewports); @@ -3967,15 +3854,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_ray_tracing_invocation_reorder)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV), but its parent extension " + "VK_NV_ray_tracing_invocation_reorder has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing_invocation_reorder)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_ray_tracing_invocation_reorder) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV* structure = (VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rayTracingInvocationReorder), structure->rayTracingInvocationReorder); @@ -3985,14 +3874,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_extended_sparse_address_space)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV), but its parent extension " + "VK_NV_extended_sparse_address_space has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_extended_sparse_address_space)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_extended_sparse_address_space) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV* structure = (VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::extendedSparseAddressSpace), structure->extendedSparseAddressSpace); @@ -4002,14 +3893,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_legacy_vertex_attributes)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT), but its parent extension " + "VK_EXT_legacy_vertex_attributes has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_legacy_vertex_attributes)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_legacy_vertex_attributes) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT* structure = (VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::legacyVertexAttributes), structure->legacyVertexAttributes); @@ -4019,14 +3912,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM: { // Covers // VUID-VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM-sType-sType + + if (!IsExtEnabled(exts.vk_arm_shader_core_builtins)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM), but its parent extension " + "VK_ARM_shader_core_builtins has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM); - if (!IsExtEnabled(device_extensions.vk_arm_shader_core_builtins)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM, but when creating " - "VkDevice, the parent extension " - "(VK_ARM_shader_core_builtins) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM* structure = (VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderCoreBuiltins), structure->shaderCoreBuiltins); } @@ -4035,15 +3930,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT: { // Covers // VUID-VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_pipeline_library_group_handles)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT), but its parent extension " + "VK_EXT_pipeline_library_group_handles has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_library_group_handles)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_pipeline_library_group_handles) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT* structure = (VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineLibraryGroupHandles), structure->pipelineLibraryGroupHandles); @@ -4053,15 +3950,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_dynamic_rendering_unused_attachments)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT), but " + "its parent extension " + "VK_EXT_dynamic_rendering_unused_attachments has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_dynamic_rendering_unused_attachments)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT, but " - "when creating VkDevice, the parent extension " - "(VK_EXT_dynamic_rendering_unused_attachments) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT* structure = (VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::dynamicRenderingUnusedAttachments), @@ -4072,15 +3971,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_multiview_per_view_render_areas)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM), but its parent extension " + "VK_QCOM_multiview_per_view_render_areas has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_multiview_per_view_render_areas)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM, but when " - "creating VkDevice, the parent extension " - "(VK_QCOM_multiview_per_view_render_areas) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM* structure = (VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::multiviewPerViewRenderAreas), structure->multiviewPerViewRenderAreas); @@ -4090,14 +3991,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePerStageDescriptorSetFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV: { // Covers // VUID-VkPhysicalDevicePerStageDescriptorSetFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_per_stage_descriptor_set)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV), but its parent extension " + "VK_NV_per_stage_descriptor_set has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePerStageDescriptorSetFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_per_stage_descriptor_set)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePerStageDescriptorSetFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_per_stage_descriptor_set) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePerStageDescriptorSetFeaturesNV* structure = (VkPhysicalDevicePerStageDescriptorSetFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::perStageDescriptorSet), structure->perStageDescriptorSet); @@ -4109,14 +4012,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceImageProcessing2FeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceImageProcessing2FeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_image_processing2)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM), but its parent extension " + "VK_QCOM_image_processing2 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageProcessing2FeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_image_processing2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImageProcessing2FeaturesQCOM, but when creating " - "VkDevice, the parent extension " - "(VK_QCOM_image_processing2) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImageProcessing2FeaturesQCOM* structure = (VkPhysicalDeviceImageProcessing2FeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::textureBlockMatch2), structure->textureBlockMatch2); } @@ -4125,14 +4030,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCubicWeightsFeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceCubicWeightsFeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_filter_cubic_weights)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM), but its parent extension " + "VK_QCOM_filter_cubic_weights has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCubicWeightsFeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_filter_cubic_weights)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCubicWeightsFeaturesQCOM, but when creating " - "VkDevice, the parent extension " - "(VK_QCOM_filter_cubic_weights) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCubicWeightsFeaturesQCOM* structure = (VkPhysicalDeviceCubicWeightsFeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::selectableCubicWeights), structure->selectableCubicWeights); } @@ -4141,14 +4047,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceYcbcrDegammaFeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceYcbcrDegammaFeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_ycbcr_degamma)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM), but its parent extension " + "VK_QCOM_ycbcr_degamma has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceYcbcrDegammaFeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_ycbcr_degamma)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceYcbcrDegammaFeaturesQCOM, but when creating " - "VkDevice, the parent extension " - "(VK_QCOM_ycbcr_degamma) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceYcbcrDegammaFeaturesQCOM* structure = (VkPhysicalDeviceYcbcrDegammaFeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::ycbcrDegamma), structure->ycbcrDegamma); } @@ -4157,14 +4064,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCubicClampFeaturesQCOM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM: { // Covers // VUID-VkPhysicalDeviceCubicClampFeaturesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_filter_cubic_clamp)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM), but its parent extension " + "VK_QCOM_filter_cubic_clamp has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCubicClampFeaturesQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_filter_cubic_clamp)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCubicClampFeaturesQCOM, but when creating VkDevice, " - "the parent extension " - "(VK_QCOM_filter_cubic_clamp) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCubicClampFeaturesQCOM* structure = (VkPhysicalDeviceCubicClampFeaturesQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::cubicRangeClamp), structure->cubicRangeClamp); } @@ -4173,16 +4081,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_attachment_feedback_loop_dynamic_state)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT), but " + "its parent extension " + "VK_EXT_attachment_feedback_loop_dynamic_state has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_dynamic_state)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_attachment_feedback_loop_dynamic_state) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT* structure = (VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::attachmentFeedbackLoopDynamicState), @@ -4194,15 +4103,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX: { // Covers // VUID-VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX-sType-sType + + if (!IsExtEnabled(exts.vk_qnx_external_memory_screen_buffer)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX), but its parent extension " + "VK_QNX_external_memory_screen_buffer has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX); - if (!IsExtEnabled(device_extensions.vk_qnx_external_memory_screen_buffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX, but when " - "creating VkDevice, the parent extension " - "(VK_QNX_external_memory_screen_buffer) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX* structure = (VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX*)header; skip |= ValidateBool32(pNext_loc.dot(Field::screenBufferImport), structure->screenBufferImport); @@ -4213,15 +4124,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_descriptor_pool_overallocation)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV), but its parent extension " + "VK_NV_descriptor_pool_overallocation has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_descriptor_pool_overallocation)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_descriptor_pool_overallocation) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV* structure = (VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::descriptorPoolOverallocation), structure->descriptorPoolOverallocation); @@ -4231,14 +4144,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRawAccessChainsFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceRawAccessChainsFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_raw_access_chains)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV), but its parent extension " + "VK_NV_raw_access_chains has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRawAccessChainsFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_raw_access_chains)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRawAccessChainsFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_raw_access_chains) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRawAccessChainsFeaturesNV* structure = (VkPhysicalDeviceRawAccessChainsFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderRawAccessChains), structure->shaderRawAccessChains); } @@ -4247,14 +4161,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCommandBufferInheritanceFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceCommandBufferInheritanceFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_command_buffer_inheritance)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMMAND_BUFFER_INHERITANCE_FEATURES_NV), but its parent extension " + "VK_NV_command_buffer_inheritance has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCommandBufferInheritanceFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_command_buffer_inheritance)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCommandBufferInheritanceFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_command_buffer_inheritance) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceCommandBufferInheritanceFeaturesNV* structure = (VkPhysicalDeviceCommandBufferInheritanceFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::commandBufferInheritance), structure->commandBufferInheritance); @@ -4264,14 +4180,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_shader_atomic_float16_vector)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV), but its parent extension " + "VK_NV_shader_atomic_float16_vector has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_shader_atomic_float16_vector)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV, but when " - "creating VkDevice, the parent extension " - "(VK_NV_shader_atomic_float16_vector) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV* structure = (VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderFloat16VectorAtomics), structure->shaderFloat16VectorAtomics); @@ -4281,15 +4199,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_replicated_composites)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_REPLICATED_COMPOSITES_FEATURES_EXT), but its parent extension " + "VK_EXT_shader_replicated_composites has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_shader_replicated_composites)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_shader_replicated_composites) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT* structure = (VkPhysicalDeviceShaderReplicatedCompositesFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderReplicatedComposites), structure->shaderReplicatedComposites); @@ -4299,14 +4219,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRayTracingValidationFeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceRayTracingValidationFeaturesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_ray_tracing_validation)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV), but its parent extension " + "VK_NV_ray_tracing_validation has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRayTracingValidationFeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing_validation)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRayTracingValidationFeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_ray_tracing_validation) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRayTracingValidationFeaturesNV* structure = (VkPhysicalDeviceRayTracingValidationFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rayTracingValidation), structure->rayTracingValidation); } @@ -4315,14 +4237,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_device_generated_commands)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_EXT), but its parent extension " + "VK_EXT_device_generated_commands has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_device_generated_commands) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT* structure = (VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::deviceGeneratedCommands), structure->deviceGeneratedCommands); @@ -4335,14 +4259,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceImageAlignmentControlFeaturesMESA structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA: { // Covers // VUID-VkPhysicalDeviceImageAlignmentControlFeaturesMESA-sType-sType + + if (!IsExtEnabled(exts.vk_mesa_image_alignment_control)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA), but its parent extension " + "VK_MESA_image_alignment_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageAlignmentControlFeaturesMESA); - if (!IsExtEnabled(device_extensions.vk_mesa_image_alignment_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceImageAlignmentControlFeaturesMESA, but when creating " - "VkDevice, the parent extension " - "(VK_MESA_image_alignment_control) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceImageAlignmentControlFeaturesMESA* structure = (VkPhysicalDeviceImageAlignmentControlFeaturesMESA*)header; skip |= ValidateBool32(pNext_loc.dot(Field::imageAlignmentControl), structure->imageAlignmentControl); @@ -4352,14 +4278,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDepthClampControlFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceDepthClampControlFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_clamp_control)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_CONTROL_FEATURES_EXT), but its parent extension " + "VK_EXT_depth_clamp_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDepthClampControlFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_clamp_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDepthClampControlFeaturesEXT, but when creating " - "VkDevice, the parent extension " - "(VK_EXT_depth_clamp_control) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceDepthClampControlFeaturesEXT* structure = (VkPhysicalDeviceDepthClampControlFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::depthClampControl), structure->depthClampControl); } @@ -4368,14 +4296,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceHdrVividFeaturesHUAWEI structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI: { // Covers // VUID-VkPhysicalDeviceHdrVividFeaturesHUAWEI-sType-sType + + if (!IsExtEnabled(exts.vk_huawei_hdr_vivid)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HDR_VIVID_FEATURES_HUAWEI), but its parent extension " + "VK_HUAWEI_hdr_vivid has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceHdrVividFeaturesHUAWEI); - if (!IsExtEnabled(device_extensions.vk_huawei_hdr_vivid)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceHdrVividFeaturesHUAWEI, but when creating VkDevice, " - "the parent extension " - "(VK_HUAWEI_hdr_vivid) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceHdrVividFeaturesHUAWEI* structure = (VkPhysicalDeviceHdrVividFeaturesHUAWEI*)header; skip |= ValidateBool32(pNext_loc.dot(Field::hdrVivid), structure->hdrVivid); } @@ -4384,14 +4313,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceCooperativeMatrix2FeaturesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV: { // Covers // VUID-VkPhysicalDeviceCooperativeMatrix2FeaturesNV-sType-sType - if (is_const_param) { - [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCooperativeMatrix2FeaturesNV); - if (!IsExtEnabled(device_extensions.vk_nv_cooperative_matrix2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceCooperativeMatrix2FeaturesNV, but when creating " - "VkDevice, the parent extension " - "(VK_NV_cooperative_matrix2) was not included in ppEnabledExtensionNames."); - } + + if (!IsExtEnabled(exts.vk_nv_cooperative_matrix2)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV), but its parent extension " + "VK_NV_cooperative_matrix2 has not been enabled."); + } + if (is_const_param) { + [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceCooperativeMatrix2FeaturesNV); VkPhysicalDeviceCooperativeMatrix2FeaturesNV* structure = (VkPhysicalDeviceCooperativeMatrix2FeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::cooperativeMatrixWorkgroupScope), structure->cooperativeMatrixWorkgroupScope); @@ -4416,14 +4347,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_vertex_attribute_robustness)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_ROBUSTNESS_FEATURES_EXT), but its parent extension " + "VK_EXT_vertex_attribute_robustness has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_vertex_attribute_robustness)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT, but when " - "creating VkDevice, the parent extension " - "(VK_EXT_vertex_attribute_robustness) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT* structure = (VkPhysicalDeviceVertexAttributeRobustnessFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::vertexAttributeRobustness), structure->vertexAttributeRobustness); @@ -4433,14 +4366,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceAccelerationStructureFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceAccelerationStructureFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_acceleration_structure)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR), but its parent extension " + "VK_KHR_acceleration_structure has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceAccelerationStructureFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceAccelerationStructureFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_acceleration_structure) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceAccelerationStructureFeaturesKHR* structure = (VkPhysicalDeviceAccelerationStructureFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::accelerationStructure), structure->accelerationStructure); @@ -4462,14 +4397,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRayTracingPipelineFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceRayTracingPipelineFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_ray_tracing_pipeline)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR), but its parent extension " + "VK_KHR_ray_tracing_pipeline has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRayTracingPipelineFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRayTracingPipelineFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_ray_tracing_pipeline) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRayTracingPipelineFeaturesKHR* structure = (VkPhysicalDeviceRayTracingPipelineFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rayTracingPipeline), structure->rayTracingPipeline); @@ -4489,14 +4426,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceRayQueryFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceRayQueryFeaturesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_ray_query)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR), but its parent extension " + "VK_KHR_ray_query has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceRayQueryFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_ray_query)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceRayQueryFeaturesKHR, but when creating VkDevice, the " - "parent extension " - "(VK_KHR_ray_query) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceRayQueryFeaturesKHR* structure = (VkPhysicalDeviceRayQueryFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::rayQuery), structure->rayQuery); } @@ -4505,14 +4443,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMeshShaderFeaturesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT: { // Covers // VUID-VkPhysicalDeviceMeshShaderFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_mesh_shader)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT), but its parent extension " + "VK_EXT_mesh_shader has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMeshShaderFeaturesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_mesh_shader)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMeshShaderFeaturesEXT, but when creating VkDevice, " - "the parent extension " - "(VK_EXT_mesh_shader) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMeshShaderFeaturesEXT* structure = (VkPhysicalDeviceMeshShaderFeaturesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::taskShader), structure->taskShader); @@ -4533,27 +4472,20 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc return skip; } -bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& loc, const VkBaseOutStructure* header, - const char* pnext_vuid, const VkPhysicalDevice physicalDevice, - bool is_const_param) const { +bool vvl::stateless::State::ValidatePnextPropertyStructContents(const Location& loc, const VkBaseOutStructure* header, + const char* pnext_vuid, bool is_const_param) const { bool skip = false; - const bool is_physdev_api = physicalDevice != VK_NULL_HANDLE; switch (header->sType) { // Validation code for VkPhysicalDeviceSubgroupProperties structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: { // Covers VUID-VkPhysicalDeviceSubgroupProperties-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_1) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (exts.api_version < VK_API_VERSION_1_1) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES) " "which was added in VK_API_VERSION_1_1 but the " "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + StringAPIVersion(exts.api_version).c_str()); } } break; @@ -4561,12 +4493,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: { // Covers // VUID-VkPhysicalDevicePointClippingProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance2)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance2))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES), but its parent extension " - "VK_KHR_maintenance2 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES), but its parent extension " + "VK_KHR_maintenance2 has not been enabled."); } } break; @@ -4574,12 +4505,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceMultiviewProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_multiview)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_multiview))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES), but its parent extension " - "VK_KHR_multiview has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_multiview)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES), but its parent extension " + "VK_KHR_multiview has not been enabled."); } } break; @@ -4587,32 +4517,27 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceProtectedMemoryProperties-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_1) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES) " - "which was added in VK_API_VERSION_1_1 but the " - "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + if (exts.api_version < VK_API_VERSION_1_1) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES) which " + "was added in VK_API_VERSION_1_1 but the " + "current effective API version is %s.", + StringAPIVersion(exts.api_version).c_str()); } } break; // Validation code for VkPhysicalDeviceIDProperties structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: { // Covers VUID-VkPhysicalDeviceIDProperties-sType-sType - if (!IsExtEnabled(instance_extensions.vk_khr_external_fence_capabilities) && - !IsExtEnabled(instance_extensions.vk_khr_external_memory_capabilities) && - !IsExtEnabled(instance_extensions.vk_khr_external_semaphore_capabilities)) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES), but " - "its parent extension " - "VK_KHR_external_fence_capabilities, VK_KHR_external_memory_capabilities, or " - "VK_KHR_external_semaphore_capabilities has not been enabled."); + if ((!IsExtEnabled(exts.vk_khr_external_fence_capabilities)) && + (!IsExtEnabled(exts.vk_khr_external_memory_capabilities)) && + (!IsExtEnabled(exts.vk_khr_external_semaphore_capabilities))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES), " + "but its parent extension " + "VK_KHR_external_fence_capabilities, VK_KHR_external_memory_capabilities, or " + "VK_KHR_external_semaphore_capabilities has not been enabled."); } } break; @@ -4620,12 +4545,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceMaintenance3Properties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance3)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance3))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES), but its parent extension " - "VK_KHR_maintenance3 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance3)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES), but its parent extension " + "VK_KHR_maintenance3 has not been enabled."); } } break; @@ -4633,18 +4557,13 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceVulkan11Properties-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_2) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES) which " - "was added in VK_API_VERSION_1_2 but the " - "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + if (exts.api_version < VK_API_VERSION_1_2) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES) which was " + "added in VK_API_VERSION_1_2 but the " + "current effective API version is %s.", + StringAPIVersion(exts.api_version).c_str()); } } break; @@ -4652,30 +4571,24 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceVulkan12Properties-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_2) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES) which " - "was added in VK_API_VERSION_1_2 but the " - "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + if (exts.api_version < VK_API_VERSION_1_2) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES) which was " + "added in VK_API_VERSION_1_2 but the " + "current effective API version is %s.", + StringAPIVersion(exts.api_version).c_str()); } } break; // Validation code for VkPhysicalDeviceDriverProperties structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES: { // Covers VUID-VkPhysicalDeviceDriverProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_driver_properties)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_driver_properties))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES), " - "but its parent extension " - "VK_KHR_driver_properties has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_driver_properties)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES), but its parent extension " + "VK_KHR_driver_properties has not been enabled."); } } break; @@ -4683,12 +4596,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceFloatControlsProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_float_controls)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_float_controls))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES), but its parent extension " - "VK_KHR_shader_float_controls has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_shader_float_controls)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES), but its parent extension " + "VK_KHR_shader_float_controls has not been enabled."); } } break; @@ -4696,12 +4608,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceDescriptorIndexingProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_descriptor_indexing)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_descriptor_indexing))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES), but its parent extension " - "VK_EXT_descriptor_indexing has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_descriptor_indexing)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES), but its parent extension " + "VK_EXT_descriptor_indexing has not been enabled."); } } break; @@ -4709,9 +4620,9 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceDepthStencilResolveProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_depth_stencil_resolve)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_depth_stencil_resolve))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_depth_stencil_resolve)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES), but its parent extension " "VK_KHR_depth_stencil_resolve has not been enabled."); @@ -4722,9 +4633,9 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceSamplerFilterMinmaxProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_sampler_filter_minmax)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_sampler_filter_minmax))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_sampler_filter_minmax)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES), but its parent extension " "VK_EXT_sampler_filter_minmax has not been enabled."); @@ -4735,12 +4646,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceTimelineSemaphoreProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_timeline_semaphore)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_timeline_semaphore))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES), but its parent extension " - "VK_KHR_timeline_semaphore has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_timeline_semaphore)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES), but its parent extension " + "VK_KHR_timeline_semaphore has not been enabled."); } } break; @@ -4748,18 +4658,13 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceVulkan13Properties-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_3) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES) which " - "was added in VK_API_VERSION_1_3 but the " - "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + if (exts.api_version < VK_API_VERSION_1_3) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES) which was " + "added in VK_API_VERSION_1_3 but the " + "current effective API version is %s.", + StringAPIVersion(exts.api_version).c_str()); } } break; @@ -4767,9 +4672,9 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceSubgroupSizeControlProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_subgroup_size_control)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_subgroup_size_control))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_subgroup_size_control)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES), but its parent extension " "VK_EXT_subgroup_size_control has not been enabled."); @@ -4780,9 +4685,9 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceInlineUniformBlockProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_inline_uniform_block)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_inline_uniform_block))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_inline_uniform_block)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES), but its parent extension " "VK_EXT_inline_uniform_block has not been enabled."); @@ -4793,13 +4698,12 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceShaderIntegerDotProductProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_shader_integer_dot_product)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_shader_integer_dot_product))) { - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES), but its parent extension " - "VK_KHR_shader_integer_dot_product has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_shader_integer_dot_product)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES), but its parent extension " + "VK_KHR_shader_integer_dot_product has not been enabled."); } } break; @@ -4807,9 +4711,9 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceTexelBufferAlignmentProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_texel_buffer_alignment)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_texel_buffer_alignment))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_texel_buffer_alignment)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES), but its parent extension " "VK_EXT_texel_buffer_alignment has not been enabled."); @@ -4820,12 +4724,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceMaintenance4Properties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance4)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance4))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES), but its parent extension " - "VK_KHR_maintenance4 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance4)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES), but its parent extension " + "VK_KHR_maintenance4 has not been enabled."); } } break; @@ -4833,18 +4736,13 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceVulkan14Properties-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_4) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES) which " - "was added in VK_API_VERSION_1_4 but the " - "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + if (exts.api_version < VK_API_VERSION_1_4) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES) which was " + "added in VK_API_VERSION_1_4 but the " + "current effective API version is %s.", + StringAPIVersion(exts.api_version).c_str()); } } break; @@ -4852,14 +4750,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceLineRasterizationProperties-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_line_rasterization)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_line_rasterization))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_line_rasterization)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_line_rasterization)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES), but its parent extension " - "VK_EXT_line_rasterization, or VK_KHR_line_rasterization has not been enabled."); + if ((!IsExtEnabled(exts.vk_ext_line_rasterization)) && (!IsExtEnabled(exts.vk_khr_line_rasterization))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES), but its parent extension " + "VK_EXT_line_rasterization, or VK_KHR_line_rasterization has not been enabled."); } } break; @@ -4867,13 +4762,12 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceVertexAttributeDivisorProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_vertex_attribute_divisor)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_vertex_attribute_divisor))) { - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES), but its parent extension " - "VK_KHR_vertex_attribute_divisor has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_vertex_attribute_divisor)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES), but its parent extension " + "VK_KHR_vertex_attribute_divisor has not been enabled."); } } break; @@ -4881,12 +4775,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceMaintenance5Properties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance5)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance5))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES), but its parent extension " - "VK_KHR_maintenance5 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance5)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES), but its parent extension " + "VK_KHR_maintenance5 has not been enabled."); } } break; @@ -4894,12 +4787,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES: { // Covers // VUID-VkPhysicalDevicePushDescriptorProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_push_descriptor)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_push_descriptor))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES), but its parent extension " - "VK_KHR_push_descriptor has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_push_descriptor)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES), but its parent extension " + "VK_KHR_push_descriptor has not been enabled."); } } break; @@ -4907,12 +4799,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceMaintenance6Properties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance6)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance6))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES), but its parent extension " - "VK_KHR_maintenance6 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance6)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES), but its parent extension " + "VK_KHR_maintenance6 has not been enabled."); } } break; @@ -4920,12 +4811,11 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES: { // Covers // VUID-VkPhysicalDevicePipelineRobustnessProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_pipeline_robustness)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_pipeline_robustness))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES), but its parent extension " - "VK_EXT_pipeline_robustness has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_pipeline_robustness)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES), but its parent extension " + "VK_EXT_pipeline_robustness has not been enabled."); } } break; @@ -4933,48 +4823,86 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES: { // Covers // VUID-VkPhysicalDeviceHostImageCopyProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_host_image_copy)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_host_image_copy))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES), but its parent extension " - "VK_EXT_host_image_copy has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_host_image_copy)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES), but its parent extension " + "VK_EXT_host_image_copy has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceHostImageCopyProperties); - if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_host_image_copy"); - } VkPhysicalDeviceHostImageCopyProperties* structure = (VkPhysicalDeviceHostImageCopyProperties*)header; skip |= ValidateBool32(pNext_loc.dot(Field::identicalMemoryTypeRequirements), structure->identicalMemoryTypeRequirements); } } break; - // No Validation code for VkPhysicalDevicePerformanceQueryPropertiesKHR structure members -- Covers - // VUID-VkPhysicalDevicePerformanceQueryPropertiesKHR-sType-sType + // Validation code for VkPhysicalDevicePerformanceQueryPropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDevicePerformanceQueryPropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_performance_query)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR), but its parent extension " + "VK_KHR_performance_query has not been enabled."); + } + } break; #ifdef VK_ENABLE_BETA_EXTENSIONS - // No Validation code for VkPhysicalDevicePortabilitySubsetPropertiesKHR structure members -- Covers - // VUID-VkPhysicalDevicePortabilitySubsetPropertiesKHR-sType-sType + // Validation code for VkPhysicalDevicePortabilitySubsetPropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDevicePortabilitySubsetPropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_portability_subset)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR), but its parent extension " + "VK_KHR_portability_subset has not been enabled."); + } + } break; #endif // VK_ENABLE_BETA_EXTENSIONS - // No Validation code for VkPhysicalDeviceFragmentShadingRatePropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceFragmentShadingRatePropertiesKHR-sType-sType + // Validation code for VkPhysicalDeviceFragmentShadingRatePropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceFragmentShadingRatePropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR), but its parent extension " + "VK_KHR_fragment_shading_rate has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR-sType-sType - // No Validation code for VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_fragment_shader_barycentric)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR), but its parent extension " + "VK_KHR_fragment_shader_barycentric has not been enabled."); + } + } break; // Validation code for VkPhysicalDevicePipelineBinaryPropertiesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR: { // Covers // VUID-VkPhysicalDevicePipelineBinaryPropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_pipeline_binary)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_BINARY_PROPERTIES_KHR), but its parent extension " + "VK_KHR_pipeline_binary has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelineBinaryPropertiesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_pipeline_binary"); - } VkPhysicalDevicePipelineBinaryPropertiesKHR* structure = (VkPhysicalDevicePipelineBinaryPropertiesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineBinaryInternalCache), structure->pipelineBinaryInternalCache); @@ -4991,104 +4919,390 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo } } break; - // No Validation code for VkPhysicalDeviceCooperativeMatrixPropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceCooperativeMatrixPropertiesKHR-sType-sType + // Validation code for VkPhysicalDeviceCooperativeMatrixPropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceCooperativeMatrixPropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_cooperative_matrix)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR), but its parent extension " + "VK_KHR_cooperative_matrix has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_compute_shader_derivatives)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_PROPERTIES_KHR), but its parent extension " + "VK_KHR_compute_shader_derivatives has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR-sType-sType + // Validation code for VkPhysicalDeviceMaintenance7PropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceMaintenance7PropertiesKHR-sType-sType - // No Validation code for VkPhysicalDeviceMaintenance7PropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceMaintenance7PropertiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_maintenance7)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR), but its parent extension " + "VK_KHR_maintenance7 has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceTransformFeedbackPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceTransformFeedbackPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceTransformFeedbackPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceTransformFeedbackPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX structure members -- Covers - // VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType + if (!IsExtEnabled(exts.vk_ext_transform_feedback)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT), but its parent extension " + "VK_EXT_transform_feedback has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: { // Covers + // VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType + + if (!IsExtEnabled(exts.vk_nvx_multiview_per_view_attributes)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX), but its parent extension " + "VK_NVX_multiview_per_view_attributes has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceDiscardRectanglePropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_discard_rectangles)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT), but its parent extension " + "VK_EXT_discard_rectangles has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceDiscardRectanglePropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceConservativeRasterizationPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceConservativeRasterizationPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceConservativeRasterizationPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceConservativeRasterizationPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_conservative_rasterization)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT), but its parent extension " + "VK_EXT_conservative_rasterization has not been enabled."); + } + } break; #ifdef VK_ENABLE_BETA_EXTENSIONS - // No Validation code for VkPhysicalDeviceShaderEnqueuePropertiesAMDX structure members -- Covers - // VUID-VkPhysicalDeviceShaderEnqueuePropertiesAMDX-sType-sType + // Validation code for VkPhysicalDeviceShaderEnqueuePropertiesAMDX structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_PROPERTIES_AMDX: { // Covers + // VUID-VkPhysicalDeviceShaderEnqueuePropertiesAMDX-sType-sType + + if (!IsExtEnabled(exts.vk_amdx_shader_enqueue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_PROPERTIES_AMDX), but its parent extension " + "VK_AMDX_shader_enqueue has not been enabled."); + } + } break; #endif // VK_ENABLE_BETA_EXTENSIONS - // No Validation code for VkPhysicalDeviceSampleLocationsPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceSampleLocationsPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceSampleLocationsPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_sample_locations)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT), but its parent extension " + "VK_EXT_sample_locations has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceShaderSMBuiltinsPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceShaderSMBuiltinsPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceShadingRateImagePropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceShadingRateImagePropertiesNV-sType-sType + if (!IsExtEnabled(exts.vk_ext_blend_operation_advanced)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT), but its parent extension " + "VK_EXT_blend_operation_advanced has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceRayTracingPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceRayTracingPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceShaderSMBuiltinsPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceShaderSMBuiltinsPropertiesNV-sType-sType - // No Validation code for VkPhysicalDeviceExternalMemoryHostPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_nv_shader_sm_builtins)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV), but its parent extension " + "VK_NV_shader_sm_builtins has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceShaderCorePropertiesAMD structure members -- Covers - // VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType + // Validation code for VkPhysicalDeviceShadingRateImagePropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceShadingRateImagePropertiesNV-sType-sType - // No Validation code for VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_nv_shading_rate_image)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV), but its parent extension " + "VK_NV_shading_rate_image has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceMeshShaderPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceMeshShaderPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceRayTracingPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceRayTracingPropertiesNV-sType-sType - // No Validation code for VkPhysicalDevicePCIBusInfoPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDevicePCIBusInfoPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_nv_ray_tracing)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV), but its parent extension " + "VK_NV_ray_tracing has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceFragmentDensityMapPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceFragmentDensityMapPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceExternalMemoryHostPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceShaderCoreProperties2AMD structure members -- Covers - // VUID-VkPhysicalDeviceShaderCoreProperties2AMD-sType-sType + if (!IsExtEnabled(exts.vk_ext_external_memory_host)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT), but its parent extension " + "VK_EXT_external_memory_host has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceCooperativeMatrixPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceCooperativeMatrixPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceShaderCorePropertiesAMD structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: { // Covers + // VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType - // No Validation code for VkPhysicalDeviceProvokingVertexPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceProvokingVertexPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_amd_shader_core_properties)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD), but its parent extension " + "VK_AMD_shader_core_properties has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceMapMemoryPlacedPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceMapMemoryPlacedPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV-sType-sType + if (!IsExtEnabled(exts.vk_ext_vertex_attribute_divisor)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT), but its parent extension " + "VK_EXT_vertex_attribute_divisor has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceMeshShaderPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceMeshShaderPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_mesh_shader)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV), but its parent extension " + "VK_NV_mesh_shader has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceRobustness2PropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceRobustness2PropertiesEXT-sType-sType + // Validation code for VkPhysicalDevicePCIBusInfoPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDevicePCIBusInfoPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceCustomBorderColorPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceCustomBorderColorPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_pci_bus_info)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT), but its parent extension " + "VK_EXT_pci_bus_info has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceCudaKernelLaunchPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceCudaKernelLaunchPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceFragmentDensityMapPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceFragmentDensityMapPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceDescriptorBufferPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDescriptorBufferPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT), but its parent extension " + "VK_EXT_fragment_density_map has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceShaderCoreProperties2AMD structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: { // Covers + // VUID-VkPhysicalDeviceShaderCoreProperties2AMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_shader_core_properties2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD), but its parent extension " + "VK_AMD_shader_core_properties2 has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceCooperativeMatrixPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceCooperativeMatrixPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_cooperative_matrix)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV), but its parent extension " + "VK_NV_cooperative_matrix has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceProvokingVertexPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceProvokingVertexPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_provoking_vertex)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT), but its parent extension " + "VK_EXT_provoking_vertex has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceMapMemoryPlacedPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceMapMemoryPlacedPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_map_memory_placed)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT), but its parent extension " + "VK_EXT_map_memory_placed has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_device_generated_commands)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV), but its parent extension " + "VK_NV_device_generated_commands has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceRobustness2PropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceRobustness2PropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_robustness2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT), but its parent extension " + "VK_EXT_robustness2 has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceCustomBorderColorPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceCustomBorderColorPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_custom_border_color)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT), but its parent extension " + "VK_EXT_custom_border_color has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceCudaKernelLaunchPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceCudaKernelLaunchPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_cuda_kernel_launch)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV), but its parent extension " + "VK_NV_cuda_kernel_launch has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceDescriptorBufferPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceDescriptorBufferPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT), but its parent extension " + "VK_EXT_descriptor_buffer has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT), but its parent extension " + "VK_EXT_descriptor_buffer has not been enabled."); + } + } break; // Validation code for VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT: { // Covers // VUID-VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_graphics_pipeline_library)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT), but its parent extension " + "VK_EXT_graphics_pipeline_library has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_graphics_pipeline_library"); - } VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT* structure = (VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::graphicsPipelineLibraryFastLinking), @@ -5102,97 +5316,255 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo // Validation code for VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV: { // Covers // VUID-VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_fragment_shading_rate_enums)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV), but its parent extension " + "VK_NV_fragment_shading_rate_enums has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV); - if (!IsExtEnabled(device_extensions.vk_nv_fragment_shading_rate_enums)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_fragment_shading_rate_enums"); - } VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV* structure = (VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV*)header; skip |= ValidateFlags( pNext_loc.dot(Field::maxFragmentShadingRateInvocationCount), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, structure->maxFragmentShadingRateInvocationCount, kRequiredSingleBit, physicalDevice, + AllVkSampleCountFlagBits, structure->maxFragmentShadingRateInvocationCount, kRequiredSingleBit, "VUID-VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV-maxFragmentShadingRateInvocationCount-parameter", "VUID-VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV-maxFragmentShadingRateInvocationCount-parameter"); } } break; - // No Validation code for VkPhysicalDeviceFragmentDensityMap2PropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceFragmentDensityMap2PropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceFragmentDensityMap2PropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceFragmentDensityMap2PropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceDrmPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDrmPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_fragment_density_map2)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT), but its parent extension " + "VK_EXT_fragment_density_map2 has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceDrmPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT: { // Covers VUID-VkPhysicalDeviceDrmPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_physical_device_drm)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT), but its parent extension " + "VK_EXT_physical_device_drm has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceSubpassShadingPropertiesHUAWEI structure members -- Covers - // VUID-VkPhysicalDeviceSubpassShadingPropertiesHUAWEI-sType-sType + // Validation code for VkPhysicalDeviceSubpassShadingPropertiesHUAWEI structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: { // Covers + // VUID-VkPhysicalDeviceSubpassShadingPropertiesHUAWEI-sType-sType - // No Validation code for VkPhysicalDeviceMultiDrawPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceMultiDrawPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_huawei_subpass_shading)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI), but its parent extension " + "VK_HUAWEI_subpass_shading has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceMultiDrawPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceMultiDrawPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_multi_draw)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT), but its parent extension " + "VK_EXT_multi_draw has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceShaderTileImagePropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceShaderTileImagePropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceShaderTileImagePropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceShaderTileImagePropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceOpacityMicromapPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceOpacityMicromapPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_shader_tile_image)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT), but its parent extension " + "VK_EXT_shader_tile_image has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceOpacityMicromapPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceOpacityMicromapPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT), but its parent extension " + "VK_EXT_opacity_micromap has not been enabled."); + } + } break; #ifdef VK_ENABLE_BETA_EXTENSIONS - // No Validation code for VkPhysicalDeviceDisplacementMicromapPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceDisplacementMicromapPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceDisplacementMicromapPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceDisplacementMicromapPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_displacement_micromap)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_PROPERTIES_NV), but its parent extension " + "VK_NV_displacement_micromap has not been enabled."); + } + } break; #endif // VK_ENABLE_BETA_EXTENSIONS - // No Validation code for VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI structure members -- Covers - // VUID-VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI-sType-sType + // Validation code for VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI: { // Covers + // VUID-VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI-sType-sType + + if (!IsExtEnabled(exts.vk_huawei_cluster_culling_shader)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI), but its parent extension " + "VK_HUAWEI_cluster_culling_shader has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceShaderCorePropertiesARM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM: { // Covers + // VUID-VkPhysicalDeviceShaderCorePropertiesARM-sType-sType - // No Validation code for VkPhysicalDeviceShaderCorePropertiesARM structure members -- Covers - // VUID-VkPhysicalDeviceShaderCorePropertiesARM-sType-sType + if (!IsExtEnabled(exts.vk_arm_shader_core_properties)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM), but its parent extension " + "VK_ARM_shader_core_properties has not been enabled."); + } + } break; // Validation code for VkPhysicalDeviceSchedulingControlsPropertiesARM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM: { // Covers // VUID-VkPhysicalDeviceSchedulingControlsPropertiesARM-sType-sType + + if (!IsExtEnabled(exts.vk_arm_scheduling_controls)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM), but its parent extension " + "VK_ARM_scheduling_controls has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceSchedulingControlsPropertiesARM); - if (!IsExtEnabled(device_extensions.vk_arm_scheduling_controls)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_ARM_scheduling_controls"); - } VkPhysicalDeviceSchedulingControlsPropertiesARM* structure = (VkPhysicalDeviceSchedulingControlsPropertiesARM*)header; skip |= ValidateFlags( pNext_loc.dot(Field::schedulingControlsFlags), vvl::FlagBitmask::VkPhysicalDeviceSchedulingControlsFlagBitsARM, AllVkPhysicalDeviceSchedulingControlsFlagBitsARM, structure->schedulingControlsFlags, kRequiredFlags, - physicalDevice, "VUID-VkPhysicalDeviceSchedulingControlsPropertiesARM-schedulingControlsFlags-parameter", + "VUID-VkPhysicalDeviceSchedulingControlsPropertiesARM-schedulingControlsFlags-parameter", "VUID-VkPhysicalDeviceSchedulingControlsPropertiesARM-schedulingControlsFlags-requiredbitmask"); } } break; - // No Validation code for VkPhysicalDeviceRenderPassStripedPropertiesARM structure members -- Covers - // VUID-VkPhysicalDeviceRenderPassStripedPropertiesARM-sType-sType + // Validation code for VkPhysicalDeviceRenderPassStripedPropertiesARM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM: { // Covers + // VUID-VkPhysicalDeviceRenderPassStripedPropertiesARM-sType-sType - // No Validation code for VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM structure members -- Covers - // VUID-VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM-sType-sType + if (!IsExtEnabled(exts.vk_arm_render_pass_striped)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM), but its parent extension " + "VK_ARM_render_pass_striped has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceCopyMemoryIndirectPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceCopyMemoryIndirectPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM: { // Covers + // VUID-VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM-sType-sType - // No Validation code for VkPhysicalDeviceMemoryDecompressionPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceMemoryDecompressionPropertiesNV-sType-sType + if (!IsExtEnabled(exts.vk_qcom_fragment_density_map_offset)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM), but its parent extension " + "VK_QCOM_fragment_density_map_offset has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceCopyMemoryIndirectPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceCopyMemoryIndirectPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_copy_memory_indirect)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV), but its parent extension " + "VK_NV_copy_memory_indirect has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceImageProcessingPropertiesQCOM structure members -- Covers - // VUID-VkPhysicalDeviceImageProcessingPropertiesQCOM-sType-sType + // Validation code for VkPhysicalDeviceMemoryDecompressionPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceMemoryDecompressionPropertiesNV-sType-sType - // No Validation code for VkPhysicalDeviceNestedCommandBufferPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceNestedCommandBufferPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_nv_memory_decompression)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV), but its parent extension " + "VK_NV_memory_decompression has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceImageProcessingPropertiesQCOM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM: { // Covers + // VUID-VkPhysicalDeviceImageProcessingPropertiesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_image_processing)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM), but its parent extension " + "VK_QCOM_image_processing has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceNestedCommandBufferPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceNestedCommandBufferPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_nested_command_buffer)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT), but its parent extension " + "VK_EXT_nested_command_buffer has not been enabled."); + } + } break; // Validation code for VkPhysicalDeviceExtendedDynamicState3PropertiesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT: { // Covers // VUID-VkPhysicalDeviceExtendedDynamicState3PropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_extended_dynamic_state3)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT), but its parent extension " + "VK_EXT_extended_dynamic_state3 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExtendedDynamicState3PropertiesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_extended_dynamic_state3"); - } VkPhysicalDeviceExtendedDynamicState3PropertiesEXT* structure = (VkPhysicalDeviceExtendedDynamicState3PropertiesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::dynamicPrimitiveTopologyUnrestricted), @@ -5200,67 +5572,217 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo } } break; - // No Validation code for VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_module_identifier)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT), but its parent extension " + "VK_EXT_shader_module_identifier has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceOpticalFlowPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceOpticalFlowPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceOpticalFlowPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceOpticalFlowPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_optical_flow)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV), but its parent extension " + "VK_NV_optical_flow has not been enabled."); + } + } break; #ifdef VK_USE_PLATFORM_ANDROID_KHR - // No Validation code for VkPhysicalDeviceExternalFormatResolvePropertiesANDROID structure members -- Covers - // VUID-VkPhysicalDeviceExternalFormatResolvePropertiesANDROID-sType-sType + // Validation code for VkPhysicalDeviceExternalFormatResolvePropertiesANDROID structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID: { // Covers + // VUID-VkPhysicalDeviceExternalFormatResolvePropertiesANDROID-sType-sType + + if (!IsExtEnabled(exts.vk_android_external_format_resolve)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID), but its parent extension " + "VK_ANDROID_external_format_resolve has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_ANDROID_KHR - // No Validation code for VkPhysicalDeviceShaderObjectPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceShaderObjectPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceShaderObjectPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceShaderObjectPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV-sType-sType + if (!IsExtEnabled(exts.vk_ext_shader_object)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT), but its parent extension " + "VK_EXT_shader_object has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_ray_tracing_invocation_reorder)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV), but its parent extension " + "VK_NV_ray_tracing_invocation_reorder has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_extended_sparse_address_space)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV), but its parent extension " + "VK_NV_extended_sparse_address_space has not been enabled."); + } + } break; // Validation code for VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT: { // Covers // VUID-VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_legacy_vertex_attributes)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT), but its parent extension " + "VK_EXT_legacy_vertex_attributes has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT); - if (!IsExtEnabled(device_extensions.vk_ext_legacy_vertex_attributes)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_legacy_vertex_attributes"); - } VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT* structure = (VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::nativeUnalignedPerformance), structure->nativeUnalignedPerformance); } } break; - // No Validation code for VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM structure members -- Covers - // VUID-VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM-sType-sType + // Validation code for VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM: { // Covers + // VUID-VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM-sType-sType + + if (!IsExtEnabled(exts.vk_arm_shader_core_builtins)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM), but its parent extension " + "VK_ARM_shader_core_builtins has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceImageProcessing2PropertiesQCOM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM: { // Covers + // VUID-VkPhysicalDeviceImageProcessing2PropertiesQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_image_processing2)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM), but its parent extension " + "VK_QCOM_image_processing2 has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceLayeredDriverPropertiesMSFT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT: { // Covers + // VUID-VkPhysicalDeviceLayeredDriverPropertiesMSFT-sType-sType - // No Validation code for VkPhysicalDeviceImageProcessing2PropertiesQCOM structure members -- Covers - // VUID-VkPhysicalDeviceImageProcessing2PropertiesQCOM-sType-sType + if (!IsExtEnabled(exts.vk_msft_layered_driver)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT), but its parent extension " + "VK_MSFT_layered_driver has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceLayeredDriverPropertiesMSFT structure members -- Covers - // VUID-VkPhysicalDeviceLayeredDriverPropertiesMSFT-sType-sType + // Validation code for VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_device_generated_commands)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_EXT), but its parent extension " + "VK_EXT_device_generated_commands has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceImageAlignmentControlPropertiesMESA structure members -- Covers - // VUID-VkPhysicalDeviceImageAlignmentControlPropertiesMESA-sType-sType + // Validation code for VkPhysicalDeviceImageAlignmentControlPropertiesMESA structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA: { // Covers + // VUID-VkPhysicalDeviceImageAlignmentControlPropertiesMESA-sType-sType - // No Validation code for VkPhysicalDeviceCooperativeMatrix2PropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceCooperativeMatrix2PropertiesNV-sType-sType + if (!IsExtEnabled(exts.vk_mesa_image_alignment_control)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA), but its parent extension " + "VK_MESA_image_alignment_control has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceAccelerationStructurePropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceAccelerationStructurePropertiesKHR-sType-sType + // Validation code for VkPhysicalDeviceCooperativeMatrix2PropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceCooperativeMatrix2PropertiesNV-sType-sType - // No Validation code for VkPhysicalDeviceRayTracingPipelinePropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceRayTracingPipelinePropertiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_nv_cooperative_matrix2)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_PROPERTIES_NV), but its parent extension " + "VK_NV_cooperative_matrix2 has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceAccelerationStructurePropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceAccelerationStructurePropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_acceleration_structure)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR), but its parent extension " + "VK_KHR_acceleration_structure has not been enabled."); + } + } break; - // No Validation code for VkPhysicalDeviceMeshShaderPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceMeshShaderPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceRayTracingPipelinePropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceRayTracingPipelinePropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_ray_tracing_pipeline)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR), but its parent extension " + "VK_KHR_ray_tracing_pipeline has not been enabled."); + } + } break; + + // Validation code for VkPhysicalDeviceMeshShaderPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceMeshShaderPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_mesh_shader)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT), but its parent extension " + "VK_EXT_mesh_shader has not been enabled."); + } + } break; default: skip = false; @@ -5269,10 +5791,9 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo } // All structs that are not a Feature or Property struct -bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const VkBaseOutStructure* header, const char* pnext_vuid, - const VkPhysicalDevice physicalDevice, bool is_const_param) const { +bool vvl::stateless::State::ValidatePnextStructContents(const Location& loc, const VkBaseOutStructure* header, + const char* pnext_vuid, bool is_const_param) const { bool skip = false; - const bool is_physdev_api = physicalDevice != VK_NULL_HANDLE; switch (header->sType) { // Validation code for VkShaderModuleCreateInfo structure members case VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO: { // Covers VUID-VkShaderModuleCreateInfo-sType-sType @@ -5294,7 +5815,7 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineLayoutCreateInfo); VkPipelineLayoutCreateInfo* structure = (VkPipelineLayoutCreateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineLayoutCreateFlagBits, - AllVkPipelineLayoutCreateFlagBits, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkPipelineLayoutCreateFlagBits, structure->flags, kOptionalFlags, "VUID-VkPipelineLayoutCreateInfo-flags-parameter"); skip |= ValidateArray(pNext_loc.dot(Field::pushConstantRangeCount), pNext_loc.dot(Field::pPushConstantRanges), @@ -5309,7 +5830,7 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const skip |= ValidateFlags(pPushConstantRanges_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, structure->pPushConstantRanges[pushConstantRangeIndex].stageFlags, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkPushConstantRange-stageFlags-parameter", + "VUID-VkPushConstantRange-stageFlags-parameter", "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); } } @@ -5319,46 +5840,39 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkMemoryDedicatedRequirements structure members case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: { // Covers VUID-VkMemoryDedicatedRequirements-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_dedicated_allocation)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_dedicated_allocation))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS), but " - "its parent extension " - "VK_KHR_dedicated_allocation has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_dedicated_allocation)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS), " + "but its parent extension " + "VK_KHR_dedicated_allocation has not been enabled."); } } break; // Validation code for VkMemoryDedicatedAllocateInfo structure members case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO: { // Covers VUID-VkMemoryDedicatedAllocateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_dedicated_allocation)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_dedicated_allocation))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO), but " - "its parent extension " - "VK_KHR_dedicated_allocation has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_dedicated_allocation)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO), " + "but its parent extension " + "VK_KHR_dedicated_allocation has not been enabled."); } } break; // Validation code for VkMemoryAllocateFlagsInfo structure members case VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO: { // Covers VUID-VkMemoryAllocateFlagsInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_device_group)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_device_group))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO), but its " - "parent extension " - "VK_KHR_device_group has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_device_group)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO), but " + "its parent extension " + "VK_KHR_device_group has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkMemoryAllocateFlagsInfo); - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_device_group"); - } VkMemoryAllocateFlagsInfo* structure = (VkMemoryAllocateFlagsInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkMemoryAllocateFlagBits, - AllVkMemoryAllocateFlagBits, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkMemoryAllocateFlagBits, structure->flags, kOptionalFlags, "VUID-VkMemoryAllocateFlagsInfo-flags-parameter"); } } break; @@ -5366,19 +5880,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceGroupRenderPassBeginInfo structure members case VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO: { // Covers VUID-VkDeviceGroupRenderPassBeginInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_device_group)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_device_group))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO), " - "but its parent extension " - "VK_KHR_device_group has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_device_group)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO), but its parent extension " + "VK_KHR_device_group has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceGroupRenderPassBeginInfo); - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_device_group"); - } VkDeviceGroupRenderPassBeginInfo* structure = (VkDeviceGroupRenderPassBeginInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::deviceRenderAreaCount), pNext_loc.dot(Field::pDeviceRenderAreas), structure->deviceRenderAreaCount, &structure->pDeviceRenderAreas, false, true, kVUIDUndefined, @@ -5390,31 +5899,25 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO: { // Covers // VUID-VkDeviceGroupCommandBufferBeginInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_device_group)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_device_group))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO), but its parent extension " - "VK_KHR_device_group has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_device_group)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO), but its parent extension " + "VK_KHR_device_group has not been enabled."); } } break; // Validation code for VkDeviceGroupSubmitInfo structure members case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: { // Covers VUID-VkDeviceGroupSubmitInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_device_group)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_device_group))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO), but its " - "parent extension " - "VK_KHR_device_group has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_device_group)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO), but " + "its parent extension " + "VK_KHR_device_group has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceGroupSubmitInfo); - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_device_group"); - } VkDeviceGroupSubmitInfo* structure = (VkDeviceGroupSubmitInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::waitSemaphoreCount), pNext_loc.dot(Field::pWaitSemaphoreDeviceIndices), structure->waitSemaphoreCount, &structure->pWaitSemaphoreDeviceIndices, false, true, @@ -5434,31 +5937,25 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceGroupBindSparseInfo structure members case VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO: { // Covers VUID-VkDeviceGroupBindSparseInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_device_group)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_device_group))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO), but " - "its parent extension " - "VK_KHR_device_group has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_device_group)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO), " + "but its parent extension " + "VK_KHR_device_group has not been enabled."); } } break; // Validation code for VkBindBufferMemoryDeviceGroupInfo structure members case VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO: { // Covers VUID-VkBindBufferMemoryDeviceGroupInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_device_group)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_device_group))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO), but its parent extension " - "VK_KHR_device_group has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_device_group)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO), but its parent extension " + "VK_KHR_device_group has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBindBufferMemoryDeviceGroupInfo); - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_device_group"); - } VkBindBufferMemoryDeviceGroupInfo* structure = (VkBindBufferMemoryDeviceGroupInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::deviceIndexCount), pNext_loc.dot(Field::pDeviceIndices), structure->deviceIndexCount, &structure->pDeviceIndices, false, true, kVUIDUndefined, @@ -5469,19 +5966,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkBindImageMemoryDeviceGroupInfo structure members case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO: { // Covers VUID-VkBindImageMemoryDeviceGroupInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_device_group)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_device_group))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO), " - "but its parent extension " - "VK_KHR_device_group has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_device_group)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO), but its parent extension " + "VK_KHR_device_group has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBindImageMemoryDeviceGroupInfo); - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_device_group"); - } VkBindImageMemoryDeviceGroupInfo* structure = (VkBindImageMemoryDeviceGroupInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::deviceIndexCount), pNext_loc.dot(Field::pDeviceIndices), structure->deviceIndexCount, &structure->pDeviceIndices, false, true, kVUIDUndefined, @@ -5497,11 +5989,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceGroupDeviceCreateInfo structure members case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: { // Covers VUID-VkDeviceGroupDeviceCreateInfo-sType-sType - if (!IsExtEnabled(instance_extensions.vk_khr_device_group_creation)) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO), but " - "its parent extension " - "VK_KHR_device_group_creation has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_device_group_creation)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO), " + "but its parent extension " + "VK_KHR_device_group_creation has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceGroupDeviceCreateInfo); @@ -5515,11 +6007,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPhysicalDeviceFeatures2 structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2: { // Covers VUID-VkPhysicalDeviceFeatures2-sType-sType - if (!IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2), but its " - "parent extension " - "VK_KHR_get_physical_device_properties2 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_get_physical_device_properties2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2), but " + "its parent extension " + "VK_KHR_get_physical_device_properties2 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceFeatures2); @@ -5655,19 +6147,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO: { // Covers // VUID-VkRenderPassInputAttachmentAspectCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance2)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance2))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_maintenance2)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO), but its parent extension " "VK_KHR_maintenance2 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassInputAttachmentAspectCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance2)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_maintenance2"); - } VkRenderPassInputAttachmentAspectCreateInfo* structure = (VkRenderPassInputAttachmentAspectCreateInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::aspectReferenceCount), pNext_loc.dot(Field::pAspectReferences), structure->aspectReferenceCount, &structure->pAspectReferences, true, true, @@ -5679,11 +6167,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const ++aspectReferenceIndex) { [[maybe_unused]] const Location pAspectReferences_loc = pNext_loc.dot(Field::pAspectReferences, aspectReferenceIndex); - skip |= ValidateFlags(pAspectReferences_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, - structure->pAspectReferences[aspectReferenceIndex].aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkInputAttachmentAspectReference-aspectMask-parameter", - "VUID-VkInputAttachmentAspectReference-aspectMask-requiredbitmask"); + skip |= + ValidateFlags(pAspectReferences_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, structure->pAspectReferences[aspectReferenceIndex].aspectMask, + kRequiredFlags, "VUID-VkInputAttachmentAspectReference-aspectMask-parameter", + "VUID-VkInputAttachmentAspectReference-aspectMask-requiredbitmask"); } } } @@ -5692,23 +6180,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkImageViewUsageCreateInfo structure members case VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO: { // Covers VUID-VkImageViewUsageCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance2)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance2))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO), but " - "its parent extension " - "VK_KHR_maintenance2 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO), " + "but its parent extension " + "VK_KHR_maintenance2 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImageViewUsageCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance2)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_maintenance2"); - } VkImageViewUsageCreateInfo* structure = (VkImageViewUsageCreateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, - structure->usage, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageViewUsageCreateInfo-usage-parameter", + structure->usage, kRequiredFlags, "VUID-VkImageViewUsageCreateInfo-usage-parameter", "VUID-VkImageViewUsageCreateInfo-usage-requiredbitmask"); } } break; @@ -5717,43 +6199,34 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO: { // Covers // VUID-VkPipelineTessellationDomainOriginStateCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance2)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance2))) { - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO), but its parent extension " - "VK_KHR_maintenance2 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance2)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO), but its parent extension " + "VK_KHR_maintenance2 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineTessellationDomainOriginStateCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance2)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_maintenance2"); - } VkPipelineTessellationDomainOriginStateCreateInfo* structure = (VkPipelineTessellationDomainOriginStateCreateInfo*)header; - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::domainOrigin), vvl::Enum::VkTessellationDomainOrigin, structure->domainOrigin, - "VUID-VkPipelineTessellationDomainOriginStateCreateInfo-domainOrigin-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::domainOrigin), vvl::Enum::VkTessellationDomainOrigin, + structure->domainOrigin, + "VUID-VkPipelineTessellationDomainOriginStateCreateInfo-domainOrigin-parameter"); } } break; // Validation code for VkRenderPassMultiviewCreateInfo structure members case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO: { // Covers VUID-VkRenderPassMultiviewCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_multiview)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_multiview))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO), " - "but its parent extension " - "VK_KHR_multiview has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_multiview)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO), but its parent extension " + "VK_KHR_multiview has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassMultiviewCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_multiview)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_multiview"); - } VkRenderPassMultiviewCreateInfo* structure = (VkRenderPassMultiviewCreateInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::subpassCount), pNext_loc.dot(Field::pViewMasks), structure->subpassCount, &structure->pViewMasks, false, true, kVUIDUndefined, @@ -5772,17 +6245,12 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkProtectedSubmitInfo structure members case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: { // Covers VUID-VkProtectedSubmitInfo-sType-sType - if (is_physdev_api) { - VkPhysicalDeviceProperties device_properties = {}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < VK_API_VERSION_1_1) { - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (exts.api_version < VK_API_VERSION_1_1) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO) which was " "added in VK_API_VERSION_1_1 but the " "current effective API version is %s.", - StringAPIVersion(device_api_version).c_str()); - } + StringAPIVersion(exts.api_version).c_str()); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkProtectedSubmitInfo); @@ -5794,19 +6262,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSamplerYcbcrConversionInfo structure members case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: { // Covers VUID-VkSamplerYcbcrConversionInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_sampler_ycbcr_conversion)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO), but " - "its parent extension " - "VK_KHR_sampler_ycbcr_conversion has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO), " + "but its parent extension " + "VK_KHR_sampler_ycbcr_conversion has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSamplerYcbcrConversionInfo); - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_sampler_ycbcr_conversion"); - } VkSamplerYcbcrConversionInfo* structure = (VkSamplerYcbcrConversionInfo*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::conversion), structure->conversion); } @@ -5815,22 +6278,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkBindImagePlaneMemoryInfo structure members case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: { // Covers VUID-VkBindImagePlaneMemoryInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_sampler_ycbcr_conversion)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO), but " - "its parent extension " - "VK_KHR_sampler_ycbcr_conversion has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO), " + "but its parent extension " + "VK_KHR_sampler_ycbcr_conversion has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBindImagePlaneMemoryInfo); - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_sampler_ycbcr_conversion"); - } VkBindImagePlaneMemoryInfo* structure = (VkBindImagePlaneMemoryInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::planeAspect), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, structure->planeAspect, kRequiredSingleBit, VK_NULL_HANDLE, + AllVkImageAspectFlagBits, structure->planeAspect, kRequiredSingleBit, "VUID-VkBindImagePlaneMemoryInfo-planeAspect-parameter", "VUID-VkBindImagePlaneMemoryInfo-planeAspect-parameter"); } @@ -5840,22 +6298,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: { // Covers // VUID-VkImagePlaneMemoryRequirementsInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_sampler_ycbcr_conversion)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO), but its parent extension " - "VK_KHR_sampler_ycbcr_conversion has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO), but its parent extension " + "VK_KHR_sampler_ycbcr_conversion has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImagePlaneMemoryRequirementsInfo); - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_sampler_ycbcr_conversion"); - } VkImagePlaneMemoryRequirementsInfo* structure = (VkImagePlaneMemoryRequirementsInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::planeAspect), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, structure->planeAspect, kRequiredSingleBit, VK_NULL_HANDLE, + AllVkImageAspectFlagBits, structure->planeAspect, kRequiredSingleBit, "VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-parameter", "VUID-VkImagePlaneMemoryRequirementsInfo-planeAspect-parameter"); } @@ -5865,9 +6318,9 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: { // Covers // VUID-VkSamplerYcbcrConversionImageFormatProperties-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_sampler_ycbcr_conversion)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES), but its parent extension " "VK_KHR_sampler_ycbcr_conversion has not been enabled."); @@ -5878,51 +6331,46 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO: { // Covers // VUID-VkPhysicalDeviceExternalImageFormatInfo-sType-sType - if (!IsExtEnabled(instance_extensions.vk_khr_external_memory_capabilities)) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO), but its parent extension " - "VK_KHR_external_memory_capabilities has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_external_memory_capabilities)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO), but its parent extension " + "VK_KHR_external_memory_capabilities has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceExternalImageFormatInfo); VkPhysicalDeviceExternalImageFormatInfo* structure = (VkPhysicalDeviceExternalImageFormatInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, AllVkExternalMemoryHandleTypeFlagBits, structure->handleType, kOptionalSingleBit, - physicalDevice, "VUID-VkPhysicalDeviceExternalImageFormatInfo-handleType-parameter"); + "VUID-VkPhysicalDeviceExternalImageFormatInfo-handleType-parameter"); } } break; // Validation code for VkExternalImageFormatProperties structure members case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: { // Covers VUID-VkExternalImageFormatProperties-sType-sType - if (!IsExtEnabled(instance_extensions.vk_khr_external_memory_capabilities)) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES), " - "but its parent extension " - "VK_KHR_external_memory_capabilities has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_external_memory_capabilities)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES), but its parent extension " + "VK_KHR_external_memory_capabilities has not been enabled."); } } break; // Validation code for VkExternalMemoryImageCreateInfo structure members case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO: { // Covers VUID-VkExternalMemoryImageCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_external_memory)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_external_memory))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO), " - "but its parent extension " - "VK_KHR_external_memory has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_external_memory)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO), but its parent extension " + "VK_KHR_external_memory has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExternalMemoryImageCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_external_memory)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_external_memory"); - } VkExternalMemoryImageCreateInfo* structure = (VkExternalMemoryImageCreateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleTypes), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, VK_NULL_HANDLE, + AllVkExternalMemoryHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, "VUID-VkExternalMemoryImageCreateInfo-handleTypes-parameter"); } } break; @@ -5930,22 +6378,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkExternalMemoryBufferCreateInfo structure members case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO: { // Covers VUID-VkExternalMemoryBufferCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_external_memory)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_external_memory))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO), " - "but its parent extension " - "VK_KHR_external_memory has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_external_memory)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO), but its parent extension " + "VK_KHR_external_memory has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExternalMemoryBufferCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_external_memory)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_external_memory"); - } VkExternalMemoryBufferCreateInfo* structure = (VkExternalMemoryBufferCreateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleTypes), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, VK_NULL_HANDLE, + AllVkExternalMemoryHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, "VUID-VkExternalMemoryBufferCreateInfo-handleTypes-parameter"); } } break; @@ -5953,22 +6396,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkExportMemoryAllocateInfo structure members case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO: { // Covers VUID-VkExportMemoryAllocateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_external_memory)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_external_memory))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO), but its " - "parent extension " - "VK_KHR_external_memory has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_external_memory)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO), but " + "its parent extension " + "VK_KHR_external_memory has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportMemoryAllocateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_external_memory)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_external_memory"); - } VkExportMemoryAllocateInfo* structure = (VkExportMemoryAllocateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleTypes), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, VK_NULL_HANDLE, + AllVkExternalMemoryHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, "VUID-VkExportMemoryAllocateInfo-handleTypes-parameter"); } } break; @@ -5976,22 +6414,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkExportFenceCreateInfo structure members case VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO: { // Covers VUID-VkExportFenceCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_external_fence)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_external_fence))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO), but its " - "parent extension " - "VK_KHR_external_fence has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_external_fence)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO), but " + "its parent extension " + "VK_KHR_external_fence has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportFenceCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_external_fence)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_external_fence"); - } VkExportFenceCreateInfo* structure = (VkExportFenceCreateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleTypes), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, - AllVkExternalFenceHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, VK_NULL_HANDLE, + AllVkExternalFenceHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, "VUID-VkExportFenceCreateInfo-handleTypes-parameter"); } } break; @@ -5999,42 +6432,32 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkExportSemaphoreCreateInfo structure members case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO: { // Covers VUID-VkExportSemaphoreCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_external_semaphore)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_external_semaphore))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO), but " - "its parent extension " - "VK_KHR_external_semaphore has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_external_semaphore)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO), " + "but its parent extension " + "VK_KHR_external_semaphore has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportSemaphoreCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_external_semaphore"); - } VkExportSemaphoreCreateInfo* structure = (VkExportSemaphoreCreateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleTypes), vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, AllVkExternalSemaphoreHandleTypeFlagBits, structure->handleTypes, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkExportSemaphoreCreateInfo-handleTypes-parameter"); + "VUID-VkExportSemaphoreCreateInfo-handleTypes-parameter"); } } break; // Validation code for VkImageFormatListCreateInfo structure members case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO: { // Covers VUID-VkImageFormatListCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_image_format_list)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_image_format_list))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO), but " - "its parent extension " - "VK_KHR_image_format_list has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_image_format_list)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO), " + "but its parent extension " + "VK_KHR_image_format_list has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImageFormatListCreateInfo); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_image_format_list))) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_image_format_list"); - } VkImageFormatListCreateInfo* structure = (VkImageFormatListCreateInfo*)header; skip |= ValidateRangedEnumArray(pNext_loc.dot(Field::viewFormatCount), pNext_loc.dot(Field::pViewFormats), vvl::Enum::VkFormat, structure->viewFormatCount, structure->pViewFormats, false, @@ -6046,19 +6469,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO: { // Covers // VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_descriptor_indexing)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_descriptor_indexing))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_descriptor_indexing)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO), but its parent extension " "VK_EXT_descriptor_indexing has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDescriptorSetLayoutBindingFlagsCreateInfo); - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_indexing)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_descriptor_indexing"); - } VkDescriptorSetLayoutBindingFlagsCreateInfo* structure = (VkDescriptorSetLayoutBindingFlagsCreateInfo*)header; skip |= ValidateFlagsArray(pNext_loc.dot(Field::bindingCount), pNext_loc.dot(Field::pBindingFlags), vvl::FlagBitmask::VkDescriptorBindingFlagBits, AllVkDescriptorBindingFlagBits, @@ -6071,20 +6490,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO: { // Covers // VUID-VkDescriptorSetVariableDescriptorCountAllocateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_descriptor_indexing)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_descriptor_indexing))) { - skip |= - LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO), but its parent extension " - "VK_EXT_descriptor_indexing has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_descriptor_indexing)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO), but its parent extension " + "VK_EXT_descriptor_indexing has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDescriptorSetVariableDescriptorCountAllocateInfo); - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_indexing)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_descriptor_indexing"); - } VkDescriptorSetVariableDescriptorCountAllocateInfo* structure = (VkDescriptorSetVariableDescriptorCountAllocateInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::descriptorSetCount), pNext_loc.dot(Field::pDescriptorCounts), @@ -6097,10 +6511,9 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT: { // Covers // VUID-VkDescriptorSetVariableDescriptorCountLayoutSupport-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_descriptor_indexing)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_descriptor_indexing))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_descriptor_indexing)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT), but its parent extension " "VK_EXT_descriptor_indexing has not been enabled."); @@ -6111,19 +6524,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE: { // Covers // VUID-VkSubpassDescriptionDepthStencilResolve-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_depth_stencil_resolve)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_depth_stencil_resolve))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE), but its parent extension " - "VK_KHR_depth_stencil_resolve has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_depth_stencil_resolve)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE), but its parent extension " + "VK_KHR_depth_stencil_resolve has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSubpassDescriptionDepthStencilResolve); - if (!IsExtEnabled(device_extensions.vk_khr_depth_stencil_resolve)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_depth_stencil_resolve"); - } VkSubpassDescriptionDepthStencilResolve* structure = (VkSubpassDescriptionDepthStencilResolve*)header; skip |= ValidateStructType(pNext_loc.dot(Field::pDepthStencilResolveAttachment), @@ -6141,11 +6549,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const pDepthStencilResolveAttachment_loc, structure->pDepthStencilResolveAttachment->pNext, allowed_structs_VkAttachmentReference2.size(), allowed_structs_VkAttachmentReference2.data(), GeneratedVulkanHeaderVersion, "VUID-VkAttachmentReference2-pNext-pNext", - "VUID-VkAttachmentReference2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkAttachmentReference2-sType-unique", true); skip |= ValidateRangedEnum(pDepthStencilResolveAttachment_loc.dot(Field::layout), vvl::Enum::VkImageLayout, structure->pDepthStencilResolveAttachment->layout, - "VUID-VkAttachmentReference2-layout-parameter", VK_NULL_HANDLE); + "VUID-VkAttachmentReference2-layout-parameter"); } } } break; @@ -6153,22 +6561,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkImageStencilUsageCreateInfo structure members case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO: { // Covers VUID-VkImageStencilUsageCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_separate_stencil_usage)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_separate_stencil_usage))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO), but " - "its parent extension " - "VK_EXT_separate_stencil_usage has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_separate_stencil_usage)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO), " + "but its parent extension " + "VK_EXT_separate_stencil_usage has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImageStencilUsageCreateInfo); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_separate_stencil_usage))) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_separate_stencil_usage"); - } VkImageStencilUsageCreateInfo* structure = (VkImageStencilUsageCreateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::stencilUsage), vvl::FlagBitmask::VkImageUsageFlagBits, - AllVkImageUsageFlagBits, structure->stencilUsage, kRequiredFlags, VK_NULL_HANDLE, + AllVkImageUsageFlagBits, structure->stencilUsage, kRequiredFlags, "VUID-VkImageStencilUsageCreateInfo-stencilUsage-parameter", "VUID-VkImageStencilUsageCreateInfo-stencilUsage-requiredbitmask"); } @@ -6177,42 +6580,32 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSamplerReductionModeCreateInfo structure members case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO: { // Covers VUID-VkSamplerReductionModeCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_sampler_filter_minmax)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_sampler_filter_minmax))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO), " - "but its parent extension " - "VK_EXT_sampler_filter_minmax has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_sampler_filter_minmax)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO), but its parent extension " + "VK_EXT_sampler_filter_minmax has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSamplerReductionModeCreateInfo); - if (!IsExtEnabled(device_extensions.vk_ext_sampler_filter_minmax)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_sampler_filter_minmax"); - } VkSamplerReductionModeCreateInfo* structure = (VkSamplerReductionModeCreateInfo*)header; - skip |= ValidateRangedEnum(pNext_loc.dot(Field::reductionMode), vvl::Enum::VkSamplerReductionMode, - structure->reductionMode, - "VUID-VkSamplerReductionModeCreateInfo-reductionMode-parameter", VK_NULL_HANDLE); + skip |= + ValidateRangedEnum(pNext_loc.dot(Field::reductionMode), vvl::Enum::VkSamplerReductionMode, + structure->reductionMode, "VUID-VkSamplerReductionModeCreateInfo-reductionMode-parameter"); } } break; // Validation code for VkFramebufferAttachmentsCreateInfo structure members case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO: { // Covers VUID-VkFramebufferAttachmentsCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_imageless_framebuffer)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_imageless_framebuffer))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO), " - "but its parent extension " - "VK_KHR_imageless_framebuffer has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_imageless_framebuffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO), but its parent extension " + "VK_KHR_imageless_framebuffer has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkFramebufferAttachmentsCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_imageless_framebuffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_imageless_framebuffer"); - } VkFramebufferAttachmentsCreateInfo* structure = (VkFramebufferAttachmentsCreateInfo*)header; skip |= ValidateStructTypeArray( pNext_loc.dot(Field::attachmentImageInfoCount), pNext_loc.dot(Field::pAttachmentImageInfos), @@ -6226,20 +6619,20 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const ++attachmentImageInfoIndex) { [[maybe_unused]] const Location pAttachmentImageInfos_loc = pNext_loc.dot(Field::pAttachmentImageInfos, attachmentImageInfoIndex); - skip |= ValidateStructPnext( - pAttachmentImageInfos_loc, structure->pAttachmentImageInfos[attachmentImageInfoIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkFramebufferAttachmentImageInfo-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= ValidateStructPnext(pAttachmentImageInfos_loc, + structure->pAttachmentImageInfos[attachmentImageInfoIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, + "VUID-VkFramebufferAttachmentImageInfo-pNext-pNext", kVUIDUndefined, true); skip |= ValidateFlags(pAttachmentImageInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, structure->pAttachmentImageInfos[attachmentImageInfoIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkFramebufferAttachmentImageInfo-flags-parameter"); + "VUID-VkFramebufferAttachmentImageInfo-flags-parameter"); skip |= ValidateFlags(pAttachmentImageInfos_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, structure->pAttachmentImageInfos[attachmentImageInfoIndex].usage, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkFramebufferAttachmentImageInfo-usage-parameter", + kRequiredFlags, "VUID-VkFramebufferAttachmentImageInfo-usage-parameter", "VUID-VkFramebufferAttachmentImageInfo-usage-requiredbitmask"); skip |= ValidateRangedEnumArray(pAttachmentImageInfos_loc.dot(Field::viewFormatCount), @@ -6256,19 +6649,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkRenderPassAttachmentBeginInfo structure members case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO: { // Covers VUID-VkRenderPassAttachmentBeginInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_imageless_framebuffer)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_imageless_framebuffer))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO), " - "but its parent extension " - "VK_KHR_imageless_framebuffer has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_imageless_framebuffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO), but its parent extension " + "VK_KHR_imageless_framebuffer has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassAttachmentBeginInfo); - if (!IsExtEnabled(device_extensions.vk_khr_imageless_framebuffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_imageless_framebuffer"); - } VkRenderPassAttachmentBeginInfo* structure = (VkRenderPassAttachmentBeginInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::attachmentCount), pNext_loc.dot(Field::pAttachments), structure->attachmentCount, &structure->pAttachments, false, true, kVUIDUndefined, @@ -6279,22 +6667,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkAttachmentReferenceStencilLayout structure members case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT: { // Covers VUID-VkAttachmentReferenceStencilLayout-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_separate_depth_stencil_layouts)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_separate_depth_stencil_layouts))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT), " - "but its parent extension " - "VK_KHR_separate_depth_stencil_layouts has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_separate_depth_stencil_layouts)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT), but its parent extension " + "VK_KHR_separate_depth_stencil_layouts has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkAttachmentReferenceStencilLayout); - if (!IsExtEnabled(device_extensions.vk_khr_separate_depth_stencil_layouts)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_separate_depth_stencil_layouts"); - } VkAttachmentReferenceStencilLayout* structure = (VkAttachmentReferenceStencilLayout*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::stencilLayout), vvl::Enum::VkImageLayout, structure->stencilLayout, - "VUID-VkAttachmentReferenceStencilLayout-stencilLayout-parameter", VK_NULL_HANDLE); + "VUID-VkAttachmentReferenceStencilLayout-stencilLayout-parameter"); } } break; @@ -6302,62 +6685,50 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT: { // Covers // VUID-VkAttachmentDescriptionStencilLayout-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_separate_depth_stencil_layouts)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_separate_depth_stencil_layouts))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT), but its parent extension " - "VK_KHR_separate_depth_stencil_layouts has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_separate_depth_stencil_layouts)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT), but its parent extension " + "VK_KHR_separate_depth_stencil_layouts has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkAttachmentDescriptionStencilLayout); - if (!IsExtEnabled(device_extensions.vk_khr_separate_depth_stencil_layouts)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_separate_depth_stencil_layouts"); - } VkAttachmentDescriptionStencilLayout* structure = (VkAttachmentDescriptionStencilLayout*)header; - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::stencilInitialLayout), vvl::Enum::VkImageLayout, structure->stencilInitialLayout, - "VUID-VkAttachmentDescriptionStencilLayout-stencilInitialLayout-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::stencilInitialLayout), vvl::Enum::VkImageLayout, + structure->stencilInitialLayout, + "VUID-VkAttachmentDescriptionStencilLayout-stencilInitialLayout-parameter"); - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::stencilFinalLayout), vvl::Enum::VkImageLayout, structure->stencilFinalLayout, - "VUID-VkAttachmentDescriptionStencilLayout-stencilFinalLayout-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::stencilFinalLayout), vvl::Enum::VkImageLayout, + structure->stencilFinalLayout, + "VUID-VkAttachmentDescriptionStencilLayout-stencilFinalLayout-parameter"); } } break; // Validation code for VkSemaphoreTypeCreateInfo structure members case VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO: { // Covers VUID-VkSemaphoreTypeCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_timeline_semaphore)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_timeline_semaphore))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO), but its " - "parent extension " - "VK_KHR_timeline_semaphore has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_timeline_semaphore)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO), but " + "its parent extension " + "VK_KHR_timeline_semaphore has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSemaphoreTypeCreateInfo); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_timeline_semaphore))) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_timeline_semaphore"); - } VkSemaphoreTypeCreateInfo* structure = (VkSemaphoreTypeCreateInfo*)header; - skip |= - ValidateRangedEnum(pNext_loc.dot(Field::semaphoreType), vvl::Enum::VkSemaphoreType, structure->semaphoreType, - "VUID-VkSemaphoreTypeCreateInfo-semaphoreType-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::semaphoreType), vvl::Enum::VkSemaphoreType, + structure->semaphoreType, "VUID-VkSemaphoreTypeCreateInfo-semaphoreType-parameter"); } } break; // Validation code for VkTimelineSemaphoreSubmitInfo structure members case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: { // Covers VUID-VkTimelineSemaphoreSubmitInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_timeline_semaphore)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_timeline_semaphore))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO), but " - "its parent extension " - "VK_KHR_timeline_semaphore has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_timeline_semaphore)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO), " + "but its parent extension " + "VK_KHR_timeline_semaphore has not been enabled."); } } break; @@ -6365,12 +6736,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO: { // Covers // VUID-VkBufferOpaqueCaptureAddressCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_buffer_device_address)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_buffer_device_address))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO), but its parent extension " - "VK_KHR_buffer_device_address has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_buffer_device_address)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO), but its parent extension " + "VK_KHR_buffer_device_address has not been enabled."); } } break; @@ -6378,12 +6748,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO: { // Covers // VUID-VkMemoryOpaqueCaptureAddressAllocateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_buffer_device_address)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_buffer_device_address))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO), but its parent extension " - "VK_KHR_buffer_device_address has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_buffer_device_address)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO), but its parent extension " + "VK_KHR_buffer_device_address has not been enabled."); } } break; @@ -6391,19 +6760,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO: { // Covers // VUID-VkPipelineCreationFeedbackCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_pipeline_creation_feedback)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_pipeline_creation_feedback))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO), but its parent extension " - "VK_EXT_pipeline_creation_feedback has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_pipeline_creation_feedback)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO), but its parent extension " + "VK_EXT_pipeline_creation_feedback has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineCreationFeedbackCreateInfo); - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_creation_feedback)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_pipeline_creation_feedback"); - } VkPipelineCreationFeedbackCreateInfo* structure = (VkPipelineCreationFeedbackCreateInfo*)header; skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pPipelineCreationFeedback), structure->pPipelineCreationFeedback, @@ -6428,47 +6792,41 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDevicePrivateDataCreateInfo structure members case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO: { // Covers VUID-VkDevicePrivateDataCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_private_data)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_private_data))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO), but " - "its parent extension " - "VK_EXT_private_data has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_private_data)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO), " + "but its parent extension " + "VK_EXT_private_data has not been enabled."); } } break; // Validation code for VkMemoryBarrier2 structure members case VK_STRUCTURE_TYPE_MEMORY_BARRIER_2: { // Covers VUID-VkMemoryBarrier2-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_synchronization2)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_synchronization2))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_synchronization2)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_MEMORY_BARRIER_2), but its parent extension " "VK_KHR_synchronization2 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkMemoryBarrier2); - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_synchronization2"); - } VkMemoryBarrier2* structure = (VkMemoryBarrier2*)header; skip |= ValidateFlags(pNext_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, structure->srcStageMask, kOptionalFlags, VK_NULL_HANDLE, + AllVkPipelineStageFlagBits2, structure->srcStageMask, kOptionalFlags, "VUID-VkMemoryBarrier2-srcStageMask-parameter"); - skip |= ValidateFlags(pNext_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, structure->srcAccessMask, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); + skip |= + ValidateFlags(pNext_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + structure->srcAccessMask, kOptionalFlags, "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); skip |= ValidateFlags(pNext_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, structure->dstStageMask, kOptionalFlags, VK_NULL_HANDLE, + AllVkPipelineStageFlagBits2, structure->dstStageMask, kOptionalFlags, "VUID-VkMemoryBarrier2-dstStageMask-parameter"); - skip |= ValidateFlags(pNext_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, structure->dstAccessMask, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); + skip |= + ValidateFlags(pNext_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + structure->dstAccessMask, kOptionalFlags, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); } } break; @@ -6476,13 +6834,12 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO: { // Covers // VUID-VkPipelineShaderStageRequiredSubgroupSizeCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_subgroup_size_control)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_subgroup_size_control))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if ((!IsExtEnabled(exts.vk_ext_shader_object)) && (!IsExtEnabled(exts.vk_ext_subgroup_size_control))) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO), but its parent extension " - "VK_EXT_subgroup_size_control has not been enabled."); + "VK_EXT_shader_object, or VK_EXT_subgroup_size_control has not been enabled."); } } break; @@ -6490,19 +6847,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK: { // Covers // VUID-VkWriteDescriptorSetInlineUniformBlock-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_inline_uniform_block)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_inline_uniform_block))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK), but its parent extension " - "VK_EXT_inline_uniform_block has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_inline_uniform_block)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK), but its parent extension " + "VK_EXT_inline_uniform_block has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkWriteDescriptorSetInlineUniformBlock); - if (!IsExtEnabled(device_extensions.vk_ext_inline_uniform_block)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_inline_uniform_block"); - } VkWriteDescriptorSetInlineUniformBlock* structure = (VkWriteDescriptorSetInlineUniformBlock*)header; skip |= ValidateArray(pNext_loc.dot(Field::dataSize), pNext_loc.dot(Field::pData), structure->dataSize, @@ -6515,9 +6867,9 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO: { // Covers // VUID-VkDescriptorPoolInlineUniformBlockCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_inline_uniform_block)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_inline_uniform_block))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_ext_inline_uniform_block)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO), but its parent extension " "VK_EXT_inline_uniform_block has not been enabled."); @@ -6527,12 +6879,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineRenderingCreateInfo structure members case VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO: { // Covers VUID-VkPipelineRenderingCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_dynamic_rendering)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_dynamic_rendering))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO), but " - "its parent extension " - "VK_KHR_dynamic_rendering has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_dynamic_rendering)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO), " + "but its parent extension " + "VK_KHR_dynamic_rendering has not been enabled."); } } break; @@ -6540,39 +6891,34 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO: { // Covers // VUID-VkCommandBufferInheritanceRenderingInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_dynamic_rendering)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_dynamic_rendering))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO), but its parent extension " - "VK_KHR_dynamic_rendering has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_dynamic_rendering)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO), but its parent extension " + "VK_KHR_dynamic_rendering has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkCommandBufferInheritanceRenderingInfo); - if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_dynamic_rendering"); - } VkCommandBufferInheritanceRenderingInfo* structure = (VkCommandBufferInheritanceRenderingInfo*)header; - skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderingFlagBits, AllVkRenderingFlagBits, - structure->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkCommandBufferInheritanceRenderingInfo-flags-parameter"); + skip |= + ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderingFlagBits, AllVkRenderingFlagBits, + structure->flags, kOptionalFlags, "VUID-VkCommandBufferInheritanceRenderingInfo-flags-parameter"); skip |= ValidateRangedEnumArray( pNext_loc.dot(Field::colorAttachmentCount), pNext_loc.dot(Field::pColorAttachmentFormats), vvl::Enum::VkFormat, structure->colorAttachmentCount, structure->pColorAttachmentFormats, false, true, kVUIDUndefined, "VUID-VkCommandBufferInheritanceRenderingInfo-pColorAttachmentFormats-parameter"); - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::depthAttachmentFormat), vvl::Enum::VkFormat, structure->depthAttachmentFormat, - "VUID-VkCommandBufferInheritanceRenderingInfo-depthAttachmentFormat-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::depthAttachmentFormat), vvl::Enum::VkFormat, + structure->depthAttachmentFormat, + "VUID-VkCommandBufferInheritanceRenderingInfo-depthAttachmentFormat-parameter"); - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::stencilAttachmentFormat), vvl::Enum::VkFormat, structure->stencilAttachmentFormat, - "VUID-VkCommandBufferInheritanceRenderingInfo-stencilAttachmentFormat-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::stencilAttachmentFormat), vvl::Enum::VkFormat, + structure->stencilAttachmentFormat, + "VUID-VkCommandBufferInheritanceRenderingInfo-stencilAttachmentFormat-parameter"); skip |= ValidateFlags(pNext_loc.dot(Field::rasterizationSamples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, structure->rasterizationSamples, kOptionalSingleBit, VK_NULL_HANDLE, + AllVkSampleCountFlagBits, structure->rasterizationSamples, kOptionalSingleBit, "VUID-VkCommandBufferInheritanceRenderingInfo-rasterizationSamples-parameter"); } } break; @@ -6580,10 +6926,9 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkFormatProperties3 structure members case VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3: { // Covers VUID-VkFormatProperties3-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_format_feature_flags2)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_format_feature_flags2))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_format_feature_flags2)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3), but its parent extension " "VK_KHR_format_feature_flags2 has not been enabled."); } @@ -6593,26 +6938,18 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO: { // Covers // VUID-VkDeviceQueueGlobalPriorityCreateInfo-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_global_priority)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_global_priority))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_global_priority)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_global_priority)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO), but its parent extension " - "VK_EXT_global_priority, or VK_KHR_global_priority has not been enabled."); + if ((!IsExtEnabled(exts.vk_ext_global_priority)) && (!IsExtEnabled(exts.vk_khr_global_priority))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO), but its parent extension " + "VK_EXT_global_priority, or VK_KHR_global_priority has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceQueueGlobalPriorityCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_global_priority) && - !IsExtEnabled(device_extensions.vk_ext_global_priority)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_global_priority or VK_EXT_global_priority"); - } VkDeviceQueueGlobalPriorityCreateInfo* structure = (VkDeviceQueueGlobalPriorityCreateInfo*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::globalPriority), vvl::Enum::VkQueueGlobalPriority, structure->globalPriority, - "VUID-VkDeviceQueueGlobalPriorityCreateInfo-globalPriority-parameter", VK_NULL_HANDLE); + "VUID-VkDeviceQueueGlobalPriorityCreateInfo-globalPriority-parameter"); } } break; @@ -6620,14 +6957,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES: { // Covers // VUID-VkQueueFamilyGlobalPriorityProperties-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_global_priority_query)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_global_priority_query))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_global_priority)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_global_priority)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES), but its parent extension " - "VK_EXT_global_priority_query, or VK_KHR_global_priority has not been enabled."); + if ((!IsExtEnabled(exts.vk_ext_global_priority_query)) && (!IsExtEnabled(exts.vk_khr_global_priority))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES), but its parent extension " + "VK_EXT_global_priority_query, or VK_KHR_global_priority has not been enabled."); } } break; @@ -6635,28 +6969,18 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO: { // Covers // VUID-VkPipelineRasterizationLineStateCreateInfo-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_line_rasterization)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_line_rasterization))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_line_rasterization)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_line_rasterization)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO), but its parent extension " - "VK_EXT_line_rasterization, or VK_KHR_line_rasterization has not been enabled."); + if ((!IsExtEnabled(exts.vk_ext_line_rasterization)) && (!IsExtEnabled(exts.vk_khr_line_rasterization))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO), but its parent extension " + "VK_EXT_line_rasterization, or VK_KHR_line_rasterization has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineRasterizationLineStateCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_line_rasterization) && - !IsExtEnabled(device_extensions.vk_ext_line_rasterization)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_line_rasterization or VK_EXT_line_rasterization"); - } VkPipelineRasterizationLineStateCreateInfo* structure = (VkPipelineRasterizationLineStateCreateInfo*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::lineRasterizationMode), vvl::Enum::VkLineRasterizationMode, structure->lineRasterizationMode, - "VUID-VkPipelineRasterizationLineStateCreateInfo-lineRasterizationMode-parameter", - VK_NULL_HANDLE); + "VUID-VkPipelineRasterizationLineStateCreateInfo-lineRasterizationMode-parameter"); skip |= ValidateBool32(pNext_loc.dot(Field::stippledLineEnable), structure->stippledLineEnable); } @@ -6666,23 +6990,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO: { // Covers // VUID-VkPipelineVertexInputDivisorStateCreateInfo-sType-sType - if (((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_vertex_attribute_divisor)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_vertex_attribute_divisor))) && - ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_vertex_attribute_divisor)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_vertex_attribute_divisor)))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), + if ((!IsExtEnabled(exts.vk_ext_vertex_attribute_divisor)) && (!IsExtEnabled(exts.vk_khr_vertex_attribute_divisor))) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType " "(VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO), but its parent extension " "VK_EXT_vertex_attribute_divisor, or VK_KHR_vertex_attribute_divisor has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineVertexInputDivisorStateCreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_vertex_attribute_divisor) && - !IsExtEnabled(device_extensions.vk_ext_vertex_attribute_divisor)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_vertex_attribute_divisor or " - "VK_EXT_vertex_attribute_divisor"); - } VkPipelineVertexInputDivisorStateCreateInfo* structure = (VkPipelineVertexInputDivisorStateCreateInfo*)header; skip |= ValidateArray(pNext_loc.dot(Field::vertexBindingDivisorCount), pNext_loc.dot(Field::pVertexBindingDivisors), structure->vertexBindingDivisorCount, &structure->pVertexBindingDivisors, true, true, @@ -6702,22 +7018,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineCreateFlags2CreateInfo structure members case VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO: { // Covers VUID-VkPipelineCreateFlags2CreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance5)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance5))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO), " - "but its parent extension " - "VK_KHR_maintenance5 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance5)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO), but its parent extension " + "VK_KHR_maintenance5 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineCreateFlags2CreateInfo); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_maintenance5"); - } VkPipelineCreateFlags2CreateInfo* structure = (VkPipelineCreateFlags2CreateInfo*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineCreateFlagBits2, - AllVkPipelineCreateFlagBits2, structure->flags, kRequiredFlags, VK_NULL_HANDLE, + AllVkPipelineCreateFlagBits2, structure->flags, kRequiredFlags, "VUID-VkPipelineCreateFlags2CreateInfo-flags-parameter", "VUID-VkPipelineCreateFlags2CreateInfo-flags-requiredbitmask"); } @@ -6726,36 +7037,30 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkBufferUsageFlags2CreateInfo structure members case VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO: { // Covers VUID-VkBufferUsageFlags2CreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance5)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance5))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO), " - "but its parent extension " - "VK_KHR_maintenance5 has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_maintenance5)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO), but its parent extension " + "VK_KHR_maintenance5 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBufferUsageFlags2CreateInfo); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance5))) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_maintenance5"); - } VkBufferUsageFlags2CreateInfo* structure = (VkBufferUsageFlags2CreateInfo*)header; - skip |= ValidateFlags(pNext_loc.dot(Field::usage), vvl::FlagBitmask::VkBufferUsageFlagBits2, - AllVkBufferUsageFlagBits2, structure->usage, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkBufferUsageFlags2CreateInfo-usage-parameter", - "VUID-VkBufferUsageFlags2CreateInfo-usage-requiredbitmask"); + skip |= + ValidateFlags(pNext_loc.dot(Field::usage), vvl::FlagBitmask::VkBufferUsageFlagBits2, AllVkBufferUsageFlagBits2, + structure->usage, kRequiredFlags, "VUID-VkBufferUsageFlags2CreateInfo-usage-parameter", + "VUID-VkBufferUsageFlags2CreateInfo-usage-requiredbitmask"); } } break; // Validation code for VkRenderingAttachmentLocationInfo structure members case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO: { // Covers VUID-VkRenderingAttachmentLocationInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_dynamic_rendering_local_read)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO), " - "but its parent extension " - "VK_KHR_dynamic_rendering_local_read has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_dynamic_rendering_local_read)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO), but its parent extension " + "VK_KHR_dynamic_rendering_local_read has not been enabled."); } } break; @@ -6763,31 +7068,25 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO: { // Covers // VUID-VkRenderingInputAttachmentIndexInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_dynamic_rendering_local_read)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO), but its parent extension " - "VK_KHR_dynamic_rendering_local_read has not been enabled."); + if (!IsExtEnabled(exts.vk_khr_dynamic_rendering_local_read)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO), but its parent extension " + "VK_KHR_dynamic_rendering_local_read has not been enabled."); } } break; // Validation code for VkBindMemoryStatus structure members case VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS: { // Covers VUID-VkBindMemoryStatus-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_KHR_maintenance6)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_khr_maintenance6))) { - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + if (!IsExtEnabled(exts.vk_khr_maintenance6)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS), but its parent extension " "VK_KHR_maintenance6 has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBindMemoryStatus); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_maintenance6"); - } VkBindMemoryStatus* structure = (VkBindMemoryStatus*)header; skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pResult), structure->pResult, "VUID-VkBindMemoryStatus-pResult-parameter"); @@ -6797,47 +7096,39 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineRobustnessCreateInfo structure members case VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO: { // Covers VUID-VkPipelineRobustnessCreateInfo-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_pipeline_robustness)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_pipeline_robustness))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO), but " - "its parent extension " - "VK_EXT_pipeline_robustness has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_pipeline_robustness)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO), " + "but its parent extension " + "VK_EXT_pipeline_robustness has not been enabled."); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineRobustnessCreateInfo); - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_robustness)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_pipeline_robustness"); - } VkPipelineRobustnessCreateInfo* structure = (VkPipelineRobustnessCreateInfo*)header; - skip |= ValidateRangedEnum(pNext_loc.dot(Field::storageBuffers), vvl::Enum::VkPipelineRobustnessBufferBehavior, - structure->storageBuffers, - "VUID-VkPipelineRobustnessCreateInfo-storageBuffers-parameter", VK_NULL_HANDLE); + skip |= + ValidateRangedEnum(pNext_loc.dot(Field::storageBuffers), vvl::Enum::VkPipelineRobustnessBufferBehavior, + structure->storageBuffers, "VUID-VkPipelineRobustnessCreateInfo-storageBuffers-parameter"); - skip |= ValidateRangedEnum(pNext_loc.dot(Field::uniformBuffers), vvl::Enum::VkPipelineRobustnessBufferBehavior, - structure->uniformBuffers, - "VUID-VkPipelineRobustnessCreateInfo-uniformBuffers-parameter", VK_NULL_HANDLE); + skip |= + ValidateRangedEnum(pNext_loc.dot(Field::uniformBuffers), vvl::Enum::VkPipelineRobustnessBufferBehavior, + structure->uniformBuffers, "VUID-VkPipelineRobustnessCreateInfo-uniformBuffers-parameter"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::vertexInputs), vvl::Enum::VkPipelineRobustnessBufferBehavior, - structure->vertexInputs, "VUID-VkPipelineRobustnessCreateInfo-vertexInputs-parameter", - VK_NULL_HANDLE); + structure->vertexInputs, "VUID-VkPipelineRobustnessCreateInfo-vertexInputs-parameter"); - skip |= - ValidateRangedEnum(pNext_loc.dot(Field::images), vvl::Enum::VkPipelineRobustnessImageBehavior, - structure->images, "VUID-VkPipelineRobustnessCreateInfo-images-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::images), vvl::Enum::VkPipelineRobustnessImageBehavior, + structure->images, "VUID-VkPipelineRobustnessCreateInfo-images-parameter"); } } break; // Validation code for VkSubresourceHostMemcpySize structure members case VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE: { // Covers VUID-VkSubresourceHostMemcpySize-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_host_image_copy)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_host_image_copy))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE), but " - "its parent extension " - "VK_EXT_host_image_copy has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_host_image_copy)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE), " + "but its parent extension " + "VK_EXT_host_image_copy has not been enabled."); } } break; @@ -6845,26 +7136,36 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY: { // Covers // VUID-VkHostImageCopyDevicePerformanceQuery-sType-sType - if ((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_VK_EXT_host_image_copy)) || - (!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_host_image_copy))) { - skip |= LogError(pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType " - "(VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY), but its parent extension " - "VK_EXT_host_image_copy has not been enabled."); + if (!IsExtEnabled(exts.vk_ext_host_image_copy)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY), but its parent extension " + "VK_EXT_host_image_copy has not been enabled."); } } break; - // No Validation code for VkImageSwapchainCreateInfoKHR structure members -- Covers - // VUID-VkImageSwapchainCreateInfoKHR-sType-sType + // Validation code for VkImageSwapchainCreateInfoKHR structure members + case VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR: { // Covers VUID-VkImageSwapchainCreateInfoKHR-sType-sType + + if ((!IsExtEnabled(exts.vk_khr_device_group)) && (!IsExtEnabled(exts.vk_khr_swapchain))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR), " + "but its parent extension " + "VK_KHR_device_group, or VK_KHR_swapchain has not been enabled."); + } + } break; // Validation code for VkBindImageMemorySwapchainInfoKHR structure members case VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR: { // Covers VUID-VkBindImageMemorySwapchainInfoKHR-sType-sType + + if ((!IsExtEnabled(exts.vk_khr_device_group)) && (!IsExtEnabled(exts.vk_khr_swapchain))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR), but its parent extension " + "VK_KHR_device_group, or VK_KHR_swapchain has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBindImageMemorySwapchainInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_swapchain) && !IsExtEnabled(device_extensions.vk_khr_device_group)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_swapchain or VK_KHR_device_group"); - } VkBindImageMemorySwapchainInfoKHR* structure = (VkBindImageMemorySwapchainInfoKHR*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::swapchain), structure->swapchain); } @@ -6872,19 +7173,22 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceGroupPresentInfoKHR structure members case VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR: { // Covers VUID-VkDeviceGroupPresentInfoKHR-sType-sType + + if ((!IsExtEnabled(exts.vk_khr_device_group)) && (!IsExtEnabled(exts.vk_khr_swapchain))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR), " + "but its parent extension " + "VK_KHR_device_group, or VK_KHR_swapchain has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceGroupPresentInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_swapchain) && !IsExtEnabled(device_extensions.vk_khr_device_group)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_swapchain or VK_KHR_device_group"); - } VkDeviceGroupPresentInfoKHR* structure = (VkDeviceGroupPresentInfoKHR*)header; skip |= ValidateArray(pNext_loc.dot(Field::swapchainCount), pNext_loc.dot(Field::pDeviceMasks), structure->swapchainCount, &structure->pDeviceMasks, false, true, kVUIDUndefined, "VUID-VkDeviceGroupPresentInfoKHR-pDeviceMasks-parameter"); skip |= ValidateFlags(pNext_loc.dot(Field::mode), vvl::FlagBitmask::VkDeviceGroupPresentModeFlagBitsKHR, - AllVkDeviceGroupPresentModeFlagBitsKHR, structure->mode, kRequiredSingleBit, VK_NULL_HANDLE, + AllVkDeviceGroupPresentModeFlagBitsKHR, structure->mode, kRequiredSingleBit, "VUID-VkDeviceGroupPresentInfoKHR-mode-parameter", "VUID-VkDeviceGroupPresentInfoKHR-mode-parameter"); } @@ -6893,15 +7197,18 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceGroupSwapchainCreateInfoKHR structure members case VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR: { // Covers // VUID-VkDeviceGroupSwapchainCreateInfoKHR-sType-sType + + if ((!IsExtEnabled(exts.vk_khr_device_group)) && (!IsExtEnabled(exts.vk_khr_swapchain))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_device_group, or VK_KHR_swapchain has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceGroupSwapchainCreateInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_swapchain) && !IsExtEnabled(device_extensions.vk_khr_device_group)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_swapchain or VK_KHR_device_group"); - } VkDeviceGroupSwapchainCreateInfoKHR* structure = (VkDeviceGroupSwapchainCreateInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::modes), vvl::FlagBitmask::VkDeviceGroupPresentModeFlagBitsKHR, - AllVkDeviceGroupPresentModeFlagBitsKHR, structure->modes, kRequiredFlags, VK_NULL_HANDLE, + AllVkDeviceGroupPresentModeFlagBitsKHR, structure->modes, kRequiredFlags, "VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-parameter", "VUID-VkDeviceGroupSwapchainCreateInfoKHR-modes-requiredbitmask"); } @@ -6909,52 +7216,87 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDisplayPresentInfoKHR structure members case VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR: { // Covers VUID-VkDisplayPresentInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_display_swapchain)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR), but " + "its parent extension " + "VK_KHR_display_swapchain has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDisplayPresentInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_display_swapchain)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_display_swapchain"); - } VkDisplayPresentInfoKHR* structure = (VkDisplayPresentInfoKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::persistent), structure->persistent); } } break; - // No Validation code for VkQueueFamilyQueryResultStatusPropertiesKHR structure members -- Covers - // VUID-VkQueueFamilyQueryResultStatusPropertiesKHR-sType-sType + // Validation code for VkQueueFamilyQueryResultStatusPropertiesKHR structure members + case VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR: { // Covers + // VUID-VkQueueFamilyQueryResultStatusPropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_queue)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR), but its parent extension " + "VK_KHR_video_queue has not been enabled."); + } + } break; + + // Validation code for VkQueueFamilyVideoPropertiesKHR structure members + case VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR: { // Covers VUID-VkQueueFamilyVideoPropertiesKHR-sType-sType - // No Validation code for VkQueueFamilyVideoPropertiesKHR structure members -- Covers - // VUID-VkQueueFamilyVideoPropertiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_queue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR), but its parent extension " + "VK_KHR_video_queue has not been enabled."); + } + } break; // Validation code for VkVideoProfileInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR: { // Covers VUID-VkVideoProfileInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_queue)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR), but its parent extension " + "VK_KHR_video_queue has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoProfileInfoKHR); VkVideoProfileInfoKHR* structure = (VkVideoProfileInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::videoCodecOperation), vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, AllVkVideoCodecOperationFlagBitsKHR, structure->videoCodecOperation, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); skip |= ValidateFlags(pNext_loc.dot(Field::chromaSubsampling), vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, AllVkVideoChromaSubsamplingFlagBitsKHR, structure->chromaSubsampling, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); skip |= ValidateFlags(pNext_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, AllVkVideoComponentBitDepthFlagBitsKHR, structure->lumaBitDepth, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", + "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); skip |= ValidateFlags(pNext_loc.dot(Field::chromaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, AllVkVideoComponentBitDepthFlagBitsKHR, structure->chromaBitDepth, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); + "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); } } break; // Validation code for VkVideoProfileListInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR: { // Covers VUID-VkVideoProfileListInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_queue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR), but " + "its parent extension " + "VK_KHR_video_queue has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoProfileListInfoKHR); VkVideoProfileListInfoKHR* structure = (VkVideoProfileListInfoKHR*)header; @@ -6969,53 +7311,92 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const skip |= ValidateFlags( pProfiles_loc.dot(Field::videoCodecOperation), vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, AllVkVideoCodecOperationFlagBitsKHR, structure->pProfiles[profileIndex].videoCodecOperation, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", + kRequiredSingleBit, "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); skip |= ValidateFlags( pProfiles_loc.dot(Field::chromaSubsampling), vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, AllVkVideoChromaSubsamplingFlagBitsKHR, structure->pProfiles[profileIndex].chromaSubsampling, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", + kRequiredFlags, "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); skip |= ValidateFlags( pProfiles_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, AllVkVideoComponentBitDepthFlagBitsKHR, structure->pProfiles[profileIndex].lumaBitDepth, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", + "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); skip |= ValidateFlags( pProfiles_loc.dot(Field::chromaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, AllVkVideoComponentBitDepthFlagBitsKHR, structure->pProfiles[profileIndex].chromaBitDepth, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); + kOptionalFlags, "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); } } } } break; - // No Validation code for VkVideoDecodeCapabilitiesKHR structure members -- Covers - // VUID-VkVideoDecodeCapabilitiesKHR-sType-sType + // Validation code for VkVideoDecodeCapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR: { // Covers VUID-VkVideoDecodeCapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_queue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR), " + "but its parent extension " + "VK_KHR_video_decode_queue has not been enabled."); + } + } break; // Validation code for VkVideoDecodeUsageInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR: { // Covers VUID-VkVideoDecodeUsageInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_queue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR), but " + "its parent extension " + "VK_KHR_video_decode_queue has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeUsageInfoKHR); VkVideoDecodeUsageInfoKHR* structure = (VkVideoDecodeUsageInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::videoUsageHints), vvl::FlagBitmask::VkVideoDecodeUsageFlagBitsKHR, - AllVkVideoDecodeUsageFlagBitsKHR, structure->videoUsageHints, kOptionalFlags, VK_NULL_HANDLE, + AllVkVideoDecodeUsageFlagBitsKHR, structure->videoUsageHints, kOptionalFlags, "VUID-VkVideoDecodeUsageInfoKHR-videoUsageHints-parameter"); } } break; - // No Validation code for VkVideoEncodeH264CapabilitiesKHR structure members -- Covers - // VUID-VkVideoEncodeH264CapabilitiesKHR-sType-sType + // Validation code for VkVideoEncodeH264CapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR: { // Covers VUID-VkVideoEncodeH264CapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } + } break; + + // Validation code for VkVideoEncodeH264QualityLevelPropertiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR: { // Covers + // VUID-VkVideoEncodeH264QualityLevelPropertiesKHR-sType-sType - // No Validation code for VkVideoEncodeH264QualityLevelPropertiesKHR structure members -- Covers - // VUID-VkVideoEncodeH264QualityLevelPropertiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeH264SessionCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_KHR: { // Covers // VUID-VkVideoEncodeH264SessionCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH264SessionCreateInfoKHR); VkVideoEncodeH264SessionCreateInfoKHR* structure = (VkVideoEncodeH264SessionCreateInfoKHR*)header; @@ -7023,12 +7404,30 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeH264SessionParametersAddInfoKHR structure members -- Covers - // VUID-VkVideoEncodeH264SessionParametersAddInfoKHR-sType-sType + // Validation code for VkVideoEncodeH264SessionParametersAddInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR: { // Covers + // VUID-VkVideoEncodeH264SessionParametersAddInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeH264SessionParametersCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR: { // Covers // VUID-VkVideoEncodeH264SessionParametersCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH264SessionParametersCreateInfoKHR); VkVideoEncodeH264SessionParametersCreateInfoKHR* structure = @@ -7043,6 +7442,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeH264SessionParametersGetInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_KHR: { // Covers // VUID-VkVideoEncodeH264SessionParametersGetInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH264SessionParametersGetInfoKHR); VkVideoEncodeH264SessionParametersGetInfoKHR* structure = (VkVideoEncodeH264SessionParametersGetInfoKHR*)header; @@ -7052,11 +7459,28 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeH264SessionParametersFeedbackInfoKHR structure members -- Covers - // VUID-VkVideoEncodeH264SessionParametersFeedbackInfoKHR-sType-sType + // Validation code for VkVideoEncodeH264SessionParametersFeedbackInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR: { // Covers + // VUID-VkVideoEncodeH264SessionParametersFeedbackInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeH264PictureInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_KHR: { // Covers VUID-VkVideoEncodeH264PictureInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH264PictureInfoKHR); VkVideoEncodeH264PictureInfoKHR* structure = (VkVideoEncodeH264PictureInfoKHR*)header; @@ -7074,8 +7498,7 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const pNext_loc.dot(Field::pNaluSliceEntries, naluSliceEntryIndex); skip |= ValidateStructPnext(pNaluSliceEntries_loc, structure->pNaluSliceEntries[naluSliceEntryIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkVideoEncodeH264NaluSliceInfoKHR-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + "VUID-VkVideoEncodeH264NaluSliceInfoKHR-pNext-pNext", kVUIDUndefined, true); skip |= ValidateRequiredPointer(pNaluSliceEntries_loc.dot(Field::pStdSliceHeader), structure->pNaluSliceEntries[naluSliceEntryIndex].pStdSliceHeader, @@ -7092,6 +7515,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeH264DpbSlotInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR: { // Covers VUID-VkVideoEncodeH264DpbSlotInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH264DpbSlotInfoKHR); VkVideoEncodeH264DpbSlotInfoKHR* structure = (VkVideoEncodeH264DpbSlotInfoKHR*)header; @@ -7100,17 +7530,32 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeH264ProfileInfoKHR structure members -- Covers - // VUID-VkVideoEncodeH264ProfileInfoKHR-sType-sType + // Validation code for VkVideoEncodeH264ProfileInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR: { // Covers VUID-VkVideoEncodeH264ProfileInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeH264RateControlInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR: { // Covers // VUID-VkVideoEncodeH264RateControlInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH264RateControlInfoKHR); VkVideoEncodeH264RateControlInfoKHR* structure = (VkVideoEncodeH264RateControlInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoEncodeH264RateControlFlagBitsKHR, - AllVkVideoEncodeH264RateControlFlagBitsKHR, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkVideoEncodeH264RateControlFlagBitsKHR, structure->flags, kOptionalFlags, "VUID-VkVideoEncodeH264RateControlInfoKHR-flags-parameter"); } } break; @@ -7118,6 +7563,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeH264RateControlLayerInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_KHR: { // Covers // VUID-VkVideoEncodeH264RateControlLayerInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH264RateControlLayerInfoKHR); VkVideoEncodeH264RateControlLayerInfoKHR* structure = (VkVideoEncodeH264RateControlLayerInfoKHR*)header; @@ -7132,6 +7584,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeH264GopRemainingFrameInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_KHR: { // Covers // VUID-VkVideoEncodeH264GopRemainingFrameInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH264GopRemainingFrameInfoKHR); VkVideoEncodeH264GopRemainingFrameInfoKHR* structure = (VkVideoEncodeH264GopRemainingFrameInfoKHR*)header; @@ -7139,12 +7598,27 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeH265CapabilitiesKHR structure members -- Covers - // VUID-VkVideoEncodeH265CapabilitiesKHR-sType-sType + // Validation code for VkVideoEncodeH265CapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR: { // Covers VUID-VkVideoEncodeH265CapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeH265SessionCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_KHR: { // Covers // VUID-VkVideoEncodeH265SessionCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH265SessionCreateInfoKHR); VkVideoEncodeH265SessionCreateInfoKHR* structure = (VkVideoEncodeH265SessionCreateInfoKHR*)header; @@ -7152,15 +7626,42 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeH265QualityLevelPropertiesKHR structure members -- Covers - // VUID-VkVideoEncodeH265QualityLevelPropertiesKHR-sType-sType + // Validation code for VkVideoEncodeH265QualityLevelPropertiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR: { // Covers + // VUID-VkVideoEncodeH265QualityLevelPropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } + } break; + + // Validation code for VkVideoEncodeH265SessionParametersAddInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR: { // Covers + // VUID-VkVideoEncodeH265SessionParametersAddInfoKHR-sType-sType - // No Validation code for VkVideoEncodeH265SessionParametersAddInfoKHR structure members -- Covers - // VUID-VkVideoEncodeH265SessionParametersAddInfoKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeH265SessionParametersCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR: { // Covers // VUID-VkVideoEncodeH265SessionParametersCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH265SessionParametersCreateInfoKHR); VkVideoEncodeH265SessionParametersCreateInfoKHR* structure = @@ -7175,6 +7676,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeH265SessionParametersGetInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_KHR: { // Covers // VUID-VkVideoEncodeH265SessionParametersGetInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH265SessionParametersGetInfoKHR); VkVideoEncodeH265SessionParametersGetInfoKHR* structure = (VkVideoEncodeH265SessionParametersGetInfoKHR*)header; @@ -7186,11 +7695,28 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeH265SessionParametersFeedbackInfoKHR structure members -- Covers - // VUID-VkVideoEncodeH265SessionParametersFeedbackInfoKHR-sType-sType + // Validation code for VkVideoEncodeH265SessionParametersFeedbackInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR: { // Covers + // VUID-VkVideoEncodeH265SessionParametersFeedbackInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeH265PictureInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_KHR: { // Covers VUID-VkVideoEncodeH265PictureInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH265PictureInfoKHR); VkVideoEncodeH265PictureInfoKHR* structure = (VkVideoEncodeH265PictureInfoKHR*)header; @@ -7210,7 +7736,7 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const skip |= ValidateStructPnext( pNaluSliceSegmentEntries_loc, structure->pNaluSliceSegmentEntries[naluSliceSegmentEntryIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, "VUID-VkVideoEncodeH265NaluSliceSegmentInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + kVUIDUndefined, true); skip |= ValidateRequiredPointer( pNaluSliceSegmentEntries_loc.dot(Field::pStdSliceSegmentHeader), @@ -7226,6 +7752,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeH265DpbSlotInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR: { // Covers VUID-VkVideoEncodeH265DpbSlotInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH265DpbSlotInfoKHR); VkVideoEncodeH265DpbSlotInfoKHR* structure = (VkVideoEncodeH265DpbSlotInfoKHR*)header; @@ -7234,17 +7767,32 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeH265ProfileInfoKHR structure members -- Covers - // VUID-VkVideoEncodeH265ProfileInfoKHR-sType-sType + // Validation code for VkVideoEncodeH265ProfileInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR: { // Covers VUID-VkVideoEncodeH265ProfileInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeH265RateControlInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR: { // Covers // VUID-VkVideoEncodeH265RateControlInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH265RateControlInfoKHR); VkVideoEncodeH265RateControlInfoKHR* structure = (VkVideoEncodeH265RateControlInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoEncodeH265RateControlFlagBitsKHR, - AllVkVideoEncodeH265RateControlFlagBitsKHR, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkVideoEncodeH265RateControlFlagBitsKHR, structure->flags, kOptionalFlags, "VUID-VkVideoEncodeH265RateControlInfoKHR-flags-parameter"); } } break; @@ -7252,6 +7800,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeH265RateControlLayerInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_KHR: { // Covers // VUID-VkVideoEncodeH265RateControlLayerInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH265RateControlLayerInfoKHR); VkVideoEncodeH265RateControlLayerInfoKHR* structure = (VkVideoEncodeH265RateControlLayerInfoKHR*)header; @@ -7266,6 +7821,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeH265GopRemainingFrameInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_KHR: { // Covers // VUID-VkVideoEncodeH265GopRemainingFrameInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeH265GopRemainingFrameInfoKHR); VkVideoEncodeH265GopRemainingFrameInfoKHR* structure = (VkVideoEncodeH265GopRemainingFrameInfoKHR*)header; @@ -7275,22 +7837,45 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeH264ProfileInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR: { // Covers VUID-VkVideoDecodeH264ProfileInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH264ProfileInfoKHR); VkVideoDecodeH264ProfileInfoKHR* structure = (VkVideoDecodeH264ProfileInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::pictureLayout), vvl::FlagBitmask::VkVideoDecodeH264PictureLayoutFlagBitsKHR, AllVkVideoDecodeH264PictureLayoutFlagBitsKHR, structure->pictureLayout, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkVideoDecodeH264ProfileInfoKHR-pictureLayout-parameter"); + "VUID-VkVideoDecodeH264ProfileInfoKHR-pictureLayout-parameter"); } } break; - // No Validation code for VkVideoDecodeH264CapabilitiesKHR structure members -- Covers - // VUID-VkVideoDecodeH264CapabilitiesKHR-sType-sType + // Validation code for VkVideoDecodeH264CapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR: { // Covers VUID-VkVideoDecodeH264CapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_decode_h264 has not been enabled."); + } + } break; // Validation code for VkVideoDecodeH264SessionParametersAddInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR: { // Covers // VUID-VkVideoDecodeH264SessionParametersAddInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h264)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH264SessionParametersAddInfoKHR); VkVideoDecodeH264SessionParametersAddInfoKHR* structure = (VkVideoDecodeH264SessionParametersAddInfoKHR*)header; @@ -7307,6 +7892,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeH264SessionParametersCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR: { // Covers // VUID-VkVideoDecodeH264SessionParametersCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h264)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH264SessionParametersCreateInfoKHR); VkVideoDecodeH264SessionParametersCreateInfoKHR* structure = @@ -7333,6 +7926,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeH264PictureInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR: { // Covers VUID-VkVideoDecodeH264PictureInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH264PictureInfoKHR); VkVideoDecodeH264PictureInfoKHR* structure = (VkVideoDecodeH264PictureInfoKHR*)header; @@ -7348,6 +7948,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeH264DpbSlotInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR: { // Covers VUID-VkVideoDecodeH264DpbSlotInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h264)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h264 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH264DpbSlotInfoKHR); VkVideoDecodeH264DpbSlotInfoKHR* structure = (VkVideoDecodeH264DpbSlotInfoKHR*)header; @@ -7359,35 +7966,49 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkImportMemoryWin32HandleInfoKHR structure members case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: { // Covers VUID-VkImportMemoryWin32HandleInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_external_memory_win32)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR), but its parent extension " + "VK_KHR_external_memory_win32 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImportMemoryWin32HandleInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_external_memory_win32)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_external_memory_win32"); - } VkImportMemoryWin32HandleInfoKHR* structure = (VkImportMemoryWin32HandleInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, AllVkExternalMemoryHandleTypeFlagBits, structure->handleType, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-parameter"); + "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-parameter"); } } break; - // No Validation code for VkExportMemoryWin32HandleInfoKHR structure members -- Covers - // VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType + // Validation code for VkExportMemoryWin32HandleInfoKHR structure members + case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: { // Covers VUID-VkExportMemoryWin32HandleInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_external_memory_win32)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR), but its parent extension " + "VK_KHR_external_memory_win32 has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_WIN32_KHR // Validation code for VkImportMemoryFdInfoKHR structure members case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: { // Covers VUID-VkImportMemoryFdInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_external_memory_fd)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR), but " + "its parent extension " + "VK_KHR_external_memory_fd has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImportMemoryFdInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_external_memory_fd)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_external_memory_fd"); - } VkImportMemoryFdInfoKHR* structure = (VkImportMemoryFdInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, AllVkExternalMemoryHandleTypeFlagBits, structure->handleType, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkImportMemoryFdInfoKHR-handleType-parameter"); + "VUID-VkImportMemoryFdInfoKHR-handleType-parameter"); } } break; #ifdef VK_USE_PLATFORM_WIN32_KHR @@ -7395,12 +8016,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkWin32KeyedMutexAcquireReleaseInfoKHR structure members case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR: { // Covers // VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_win32_keyed_mutex)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR), but its parent extension " + "VK_KHR_win32_keyed_mutex has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkWin32KeyedMutexAcquireReleaseInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_win32_keyed_mutex)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_win32_keyed_mutex"); - } VkWin32KeyedMutexAcquireReleaseInfoKHR* structure = (VkWin32KeyedMutexAcquireReleaseInfoKHR*)header; skip |= ValidateArray(pNext_loc.dot(Field::acquireCount), pNext_loc.dot(Field::pAcquireSyncs), structure->acquireCount, &structure->pAcquireSyncs, false, true, kVUIDUndefined, @@ -7424,20 +8048,41 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkExportSemaphoreWin32HandleInfoKHR structure members -- Covers - // VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType + // Validation code for VkExportSemaphoreWin32HandleInfoKHR structure members + case VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR: { // Covers + // VUID-VkExportSemaphoreWin32HandleInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_external_semaphore_win32)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR), but its parent extension " + "VK_KHR_external_semaphore_win32 has not been enabled."); + } + } break; + + // Validation code for VkD3D12FenceSubmitInfoKHR structure members + case VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR: { // Covers VUID-VkD3D12FenceSubmitInfoKHR-sType-sType - // No Validation code for VkD3D12FenceSubmitInfoKHR structure members -- Covers VUID-VkD3D12FenceSubmitInfoKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_external_semaphore_win32)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR), but " + "its parent extension " + "VK_KHR_external_semaphore_win32 has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_WIN32_KHR // Validation code for VkPresentRegionsKHR structure members case VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR: { // Covers VUID-VkPresentRegionsKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_incremental_present)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR), but its parent extension " + "VK_KHR_incremental_present has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPresentRegionsKHR); - if (!IsExtEnabled(device_extensions.vk_khr_incremental_present)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_incremental_present"); - } VkPresentRegionsKHR* structure = (VkPresentRegionsKHR*)header; skip |= ValidateArray(pNext_loc.dot(Field::swapchainCount), pNext_loc.dot(Field::pRegions), structure->swapchainCount, @@ -7459,23 +8104,43 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkSharedPresentSurfaceCapabilitiesKHR structure members -- Covers - // VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType + // Validation code for VkSharedPresentSurfaceCapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR: { // Covers + // VUID-VkSharedPresentSurfaceCapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_shared_presentable_image)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_shared_presentable_image has not been enabled."); + } + } break; #ifdef VK_USE_PLATFORM_WIN32_KHR - // No Validation code for VkExportFenceWin32HandleInfoKHR structure members -- Covers - // VUID-VkExportFenceWin32HandleInfoKHR-sType-sType + // Validation code for VkExportFenceWin32HandleInfoKHR structure members + case VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR: { // Covers VUID-VkExportFenceWin32HandleInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_external_fence_win32)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR), but its parent extension " + "VK_KHR_external_fence_win32 has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_WIN32_KHR // Validation code for VkQueryPoolPerformanceCreateInfoKHR structure members case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR: { // Covers // VUID-VkQueryPoolPerformanceCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_performance_query)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_performance_query has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkQueryPoolPerformanceCreateInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_performance_query)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_performance_query"); - } VkQueryPoolPerformanceCreateInfoKHR* structure = (VkQueryPoolPerformanceCreateInfoKHR*)header; skip |= ValidateArray(pNext_loc.dot(Field::counterIndexCount), pNext_loc.dot(Field::pCounterIndices), structure->counterIndexCount, &structure->pCounterIndices, true, true, @@ -7484,18 +8149,50 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkPerformanceQuerySubmitInfoKHR structure members -- Covers - // VUID-VkPerformanceQuerySubmitInfoKHR-sType-sType + // Validation code for VkPerformanceQuerySubmitInfoKHR structure members + case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: { // Covers VUID-VkPerformanceQuerySubmitInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_performance_query)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR), but its parent extension " + "VK_KHR_performance_query has not been enabled."); + } + } break; + + // Validation code for VkVideoDecodeH265ProfileInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR: { // Covers VUID-VkVideoDecodeH265ProfileInfoKHR-sType-sType - // No Validation code for VkVideoDecodeH265ProfileInfoKHR structure members -- Covers - // VUID-VkVideoDecodeH265ProfileInfoKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_decode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h265 has not been enabled."); + } + } break; + + // Validation code for VkVideoDecodeH265CapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR: { // Covers VUID-VkVideoDecodeH265CapabilitiesKHR-sType-sType - // No Validation code for VkVideoDecodeH265CapabilitiesKHR structure members -- Covers - // VUID-VkVideoDecodeH265CapabilitiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_decode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_decode_h265 has not been enabled."); + } + } break; // Validation code for VkVideoDecodeH265SessionParametersAddInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR: { // Covers // VUID-VkVideoDecodeH265SessionParametersAddInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h265)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH265SessionParametersAddInfoKHR); VkVideoDecodeH265SessionParametersAddInfoKHR* structure = (VkVideoDecodeH265SessionParametersAddInfoKHR*)header; @@ -7516,6 +8213,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeH265SessionParametersCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR: { // Covers // VUID-VkVideoDecodeH265SessionParametersCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h265)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH265SessionParametersCreateInfoKHR); VkVideoDecodeH265SessionParametersCreateInfoKHR* structure = @@ -7547,6 +8252,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeH265PictureInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR: { // Covers VUID-VkVideoDecodeH265PictureInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH265PictureInfoKHR); VkVideoDecodeH265PictureInfoKHR* structure = (VkVideoDecodeH265PictureInfoKHR*)header; @@ -7562,6 +8274,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeH265DpbSlotInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR: { // Covers VUID-VkVideoDecodeH265DpbSlotInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_h265)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_h265 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeH265DpbSlotInfoKHR); VkVideoDecodeH265DpbSlotInfoKHR* structure = (VkVideoDecodeH265DpbSlotInfoKHR*)header; @@ -7573,12 +8292,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkFragmentShadingRateAttachmentInfoKHR structure members case VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: { // Covers // VUID-VkFragmentShadingRateAttachmentInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR), but its parent extension " + "VK_KHR_fragment_shading_rate has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkFragmentShadingRateAttachmentInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_fragment_shading_rate"); - } VkFragmentShadingRateAttachmentInfoKHR* structure = (VkFragmentShadingRateAttachmentInfoKHR*)header; skip |= ValidateStructType(pNext_loc.dot(Field::pFragmentShadingRateAttachment), @@ -7596,46 +8318,70 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const pFragmentShadingRateAttachment_loc, structure->pFragmentShadingRateAttachment->pNext, allowed_structs_VkAttachmentReference2.size(), allowed_structs_VkAttachmentReference2.data(), GeneratedVulkanHeaderVersion, "VUID-VkAttachmentReference2-pNext-pNext", - "VUID-VkAttachmentReference2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkAttachmentReference2-sType-unique", true); skip |= ValidateRangedEnum(pFragmentShadingRateAttachment_loc.dot(Field::layout), vvl::Enum::VkImageLayout, structure->pFragmentShadingRateAttachment->layout, - "VUID-VkAttachmentReference2-layout-parameter", VK_NULL_HANDLE); + "VUID-VkAttachmentReference2-layout-parameter"); } } } break; - // No Validation code for VkPipelineFragmentShadingRateStateCreateInfoKHR structure members -- Covers - // VUID-VkPipelineFragmentShadingRateStateCreateInfoKHR-sType-sType + // Validation code for VkPipelineFragmentShadingRateStateCreateInfoKHR structure members + case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR: { // Covers + // VUID-VkPipelineFragmentShadingRateStateCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_fragment_shading_rate has not been enabled."); + } + } break; // Validation code for VkRenderingFragmentShadingRateAttachmentInfoKHR structure members case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR: { // Covers // VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR), but its parent extension " + "VK_KHR_fragment_shading_rate has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderingFragmentShadingRateAttachmentInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_fragment_shading_rate"); - } VkRenderingFragmentShadingRateAttachmentInfoKHR* structure = (VkRenderingFragmentShadingRateAttachmentInfoKHR*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, structure->imageLayout, - "VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageLayout-parameter", - VK_NULL_HANDLE); + "VUID-VkRenderingFragmentShadingRateAttachmentInfoKHR-imageLayout-parameter"); } } break; - // No Validation code for VkSurfaceProtectedCapabilitiesKHR structure members -- Covers - // VUID-VkSurfaceProtectedCapabilitiesKHR-sType-sType + // Validation code for VkSurfaceProtectedCapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: { // Covers VUID-VkSurfaceProtectedCapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_surface_protected_capabilities)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_surface_protected_capabilities has not been enabled."); + } + } break; // Validation code for VkPipelineLibraryCreateInfoKHR structure members case VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR: { // Covers VUID-VkPipelineLibraryCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_pipeline_library)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_pipeline_library has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineLibraryCreateInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_library)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_pipeline_library"); - } VkPipelineLibraryCreateInfoKHR* structure = (VkPipelineLibraryCreateInfoKHR*)header; skip |= ValidateArray(pNext_loc.dot(Field::libraryCount), pNext_loc.dot(Field::pLibraries), structure->libraryCount, &structure->pLibraries, false, true, kVUIDUndefined, @@ -7645,11 +8391,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPresentIdKHR structure members case VK_STRUCTURE_TYPE_PRESENT_ID_KHR: { // Covers VUID-VkPresentIdKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_present_id)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PRESENT_ID_KHR), but its parent extension " + "VK_KHR_present_id has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPresentIdKHR); - if (!IsExtEnabled(device_extensions.vk_khr_present_id)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_present_id"); - } VkPresentIdKHR* structure = (VkPresentIdKHR*)header; skip |= ValidateArray(pNext_loc.dot(Field::swapchainCount), pNext_loc.dot(Field::pPresentIds), @@ -7658,44 +8408,72 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeCapabilitiesKHR structure members -- Covers - // VUID-VkVideoEncodeCapabilitiesKHR-sType-sType + // Validation code for VkVideoEncodeCapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR: { // Covers VUID-VkVideoEncodeCapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR), " + "but its parent extension " + "VK_KHR_video_encode_queue has not been enabled."); + } + } break; // Validation code for VkQueryPoolVideoEncodeFeedbackCreateInfoKHR structure members case VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR: { // Covers // VUID-VkQueryPoolVideoEncodeFeedbackCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_queue has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkQueryPoolVideoEncodeFeedbackCreateInfoKHR); VkQueryPoolVideoEncodeFeedbackCreateInfoKHR* structure = (VkQueryPoolVideoEncodeFeedbackCreateInfoKHR*)header; - skip |= - ValidateFlags(pNext_loc.dot(Field::encodeFeedbackFlags), vvl::FlagBitmask::VkVideoEncodeFeedbackFlagBitsKHR, - AllVkVideoEncodeFeedbackFlagBitsKHR, structure->encodeFeedbackFlags, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkQueryPoolVideoEncodeFeedbackCreateInfoKHR-encodeFeedbackFlags-parameter", - "VUID-VkQueryPoolVideoEncodeFeedbackCreateInfoKHR-encodeFeedbackFlags-requiredbitmask"); + skip |= ValidateFlags(pNext_loc.dot(Field::encodeFeedbackFlags), vvl::FlagBitmask::VkVideoEncodeFeedbackFlagBitsKHR, + AllVkVideoEncodeFeedbackFlagBitsKHR, structure->encodeFeedbackFlags, kRequiredFlags, + "VUID-VkQueryPoolVideoEncodeFeedbackCreateInfoKHR-encodeFeedbackFlags-parameter", + "VUID-VkQueryPoolVideoEncodeFeedbackCreateInfoKHR-encodeFeedbackFlags-requiredbitmask"); } } break; // Validation code for VkVideoEncodeUsageInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR: { // Covers VUID-VkVideoEncodeUsageInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR), but " + "its parent extension " + "VK_KHR_video_encode_queue has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeUsageInfoKHR); VkVideoEncodeUsageInfoKHR* structure = (VkVideoEncodeUsageInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::videoUsageHints), vvl::FlagBitmask::VkVideoEncodeUsageFlagBitsKHR, - AllVkVideoEncodeUsageFlagBitsKHR, structure->videoUsageHints, kOptionalFlags, VK_NULL_HANDLE, + AllVkVideoEncodeUsageFlagBitsKHR, structure->videoUsageHints, kOptionalFlags, "VUID-VkVideoEncodeUsageInfoKHR-videoUsageHints-parameter"); skip |= ValidateFlags(pNext_loc.dot(Field::videoContentHints), vvl::FlagBitmask::VkVideoEncodeContentFlagBitsKHR, AllVkVideoEncodeContentFlagBitsKHR, structure->videoContentHints, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkVideoEncodeUsageInfoKHR-videoContentHints-parameter"); + "VUID-VkVideoEncodeUsageInfoKHR-videoContentHints-parameter"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::tuningMode), vvl::Enum::VkVideoEncodeTuningModeKHR, - structure->tuningMode, "VUID-VkVideoEncodeUsageInfoKHR-tuningMode-parameter", - VK_NULL_HANDLE); + structure->tuningMode, "VUID-VkVideoEncodeUsageInfoKHR-tuningMode-parameter"); } } break; // Validation code for VkVideoEncodeRateControlInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR: { // Covers VUID-VkVideoEncodeRateControlInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_queue has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeRateControlInfoKHR); VkVideoEncodeRateControlInfoKHR* structure = (VkVideoEncodeRateControlInfoKHR*)header; @@ -7705,7 +8483,7 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const skip |= ValidateFlags(pNext_loc.dot(Field::rateControlMode), vvl::FlagBitmask::VkVideoEncodeRateControlModeFlagBitsKHR, AllVkVideoEncodeRateControlModeFlagBitsKHR, structure->rateControlMode, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkVideoEncodeRateControlInfoKHR-rateControlMode-parameter"); + "VUID-VkVideoEncodeRateControlInfoKHR-rateControlMode-parameter"); skip |= ValidateStructTypeArray(pNext_loc.dot(Field::layerCount), pNext_loc.dot(Field::pLayers), structure->layerCount, @@ -7726,24 +8504,36 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const allowed_structs_VkVideoEncodeRateControlLayerInfoKHR.data(), GeneratedVulkanHeaderVersion, "VUID-VkVideoEncodeRateControlLayerInfoKHR-pNext-pNext", - "VUID-VkVideoEncodeRateControlLayerInfoKHR-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkVideoEncodeRateControlLayerInfoKHR-sType-unique", true); } } } } break; - // No Validation code for VkVideoEncodeQualityLevelInfoKHR structure members -- Covers - // VUID-VkVideoEncodeQualityLevelInfoKHR-sType-sType + // Validation code for VkVideoEncodeQualityLevelInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR: { // Covers VUID-VkVideoEncodeQualityLevelInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_queue has not been enabled."); + } + } break; // Validation code for VkDevicePipelineBinaryInternalCacheControlKHR structure members case VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR: { // Covers // VUID-VkDevicePipelineBinaryInternalCacheControlKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_pipeline_binary)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_PIPELINE_BINARY_INTERNAL_CACHE_CONTROL_KHR), but its parent extension " + "VK_KHR_pipeline_binary has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDevicePipelineBinaryInternalCacheControlKHR); - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_pipeline_binary"); - } VkDevicePipelineBinaryInternalCacheControlKHR* structure = (VkDevicePipelineBinaryInternalCacheControlKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::disableInternalCache), structure->disableInternalCache); } @@ -7751,12 +8541,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineBinaryInfoKHR structure members case VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR: { // Covers VUID-VkPipelineBinaryInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_pipeline_binary)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR), but " + "its parent extension " + "VK_KHR_pipeline_binary has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineBinaryInfoKHR); - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_pipeline_binary"); - } VkPipelineBinaryInfoKHR* structure = (VkPipelineBinaryInfoKHR*)header; skip |= ValidateArray(pNext_loc.dot(Field::binaryCount), pNext_loc.dot(Field::pPipelineBinaries), structure->binaryCount, &structure->pPipelineBinaries, false, true, kVUIDUndefined, @@ -7766,6 +8559,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeAV1ProfileInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR: { // Covers VUID-VkVideoDecodeAV1ProfileInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeAV1ProfileInfoKHR); VkVideoDecodeAV1ProfileInfoKHR* structure = (VkVideoDecodeAV1ProfileInfoKHR*)header; @@ -7773,12 +8573,28 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoDecodeAV1CapabilitiesKHR structure members -- Covers - // VUID-VkVideoDecodeAV1CapabilitiesKHR-sType-sType + // Validation code for VkVideoDecodeAV1CapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR: { // Covers VUID-VkVideoDecodeAV1CapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_decode_av1 has not been enabled."); + } + } break; // Validation code for VkVideoDecodeAV1SessionParametersCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR: { // Covers // VUID-VkVideoDecodeAV1SessionParametersCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_av1)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeAV1SessionParametersCreateInfoKHR); VkVideoDecodeAV1SessionParametersCreateInfoKHR* structure = (VkVideoDecodeAV1SessionParametersCreateInfoKHR*)header; @@ -7789,6 +8605,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeAV1PictureInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_KHR: { // Covers VUID-VkVideoDecodeAV1PictureInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeAV1PictureInfoKHR); VkVideoDecodeAV1PictureInfoKHR* structure = (VkVideoDecodeAV1PictureInfoKHR*)header; @@ -7809,6 +8632,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoDecodeAV1DpbSlotInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_KHR: { // Covers VUID-VkVideoDecodeAV1DpbSlotInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_decode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_KHR), but its parent extension " + "VK_KHR_video_decode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoDecodeAV1DpbSlotInfoKHR); VkVideoDecodeAV1DpbSlotInfoKHR* structure = (VkVideoDecodeAV1DpbSlotInfoKHR*)header; @@ -7817,15 +8647,39 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeAV1CapabilitiesKHR structure members -- Covers - // VUID-VkVideoEncodeAV1CapabilitiesKHR-sType-sType + // Validation code for VkVideoEncodeAV1CapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR: { // Covers VUID-VkVideoEncodeAV1CapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } + } break; + + // Validation code for VkVideoEncodeAV1QualityLevelPropertiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR: { // Covers + // VUID-VkVideoEncodeAV1QualityLevelPropertiesKHR-sType-sType - // No Validation code for VkVideoEncodeAV1QualityLevelPropertiesKHR structure members -- Covers - // VUID-VkVideoEncodeAV1QualityLevelPropertiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUALITY_LEVEL_PROPERTIES_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeAV1SessionCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_CREATE_INFO_KHR: { // Covers // VUID-VkVideoEncodeAV1SessionCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeAV1SessionCreateInfoKHR); VkVideoEncodeAV1SessionCreateInfoKHR* structure = (VkVideoEncodeAV1SessionCreateInfoKHR*)header; @@ -7836,6 +8690,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeAV1SessionParametersCreateInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR: { // Covers // VUID-VkVideoEncodeAV1SessionParametersCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeAV1SessionParametersCreateInfoKHR); VkVideoEncodeAV1SessionParametersCreateInfoKHR* structure = (VkVideoEncodeAV1SessionParametersCreateInfoKHR*)header; @@ -7846,16 +8708,23 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeAV1PictureInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PICTURE_INFO_KHR: { // Covers VUID-VkVideoEncodeAV1PictureInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PICTURE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeAV1PictureInfoKHR); VkVideoEncodeAV1PictureInfoKHR* structure = (VkVideoEncodeAV1PictureInfoKHR*)header; - skip |= ValidateRangedEnum(pNext_loc.dot(Field::predictionMode), vvl::Enum::VkVideoEncodeAV1PredictionModeKHR, - structure->predictionMode, - "VUID-VkVideoEncodeAV1PictureInfoKHR-predictionMode-parameter", VK_NULL_HANDLE); + skip |= + ValidateRangedEnum(pNext_loc.dot(Field::predictionMode), vvl::Enum::VkVideoEncodeAV1PredictionModeKHR, + structure->predictionMode, "VUID-VkVideoEncodeAV1PictureInfoKHR-predictionMode-parameter"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::rateControlGroup), vvl::Enum::VkVideoEncodeAV1RateControlGroupKHR, structure->rateControlGroup, - "VUID-VkVideoEncodeAV1PictureInfoKHR-rateControlGroup-parameter", VK_NULL_HANDLE); + "VUID-VkVideoEncodeAV1PictureInfoKHR-rateControlGroup-parameter"); skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pStdPictureInfo), structure->pStdPictureInfo, "VUID-VkVideoEncodeAV1PictureInfoKHR-pStdPictureInfo-parameter"); @@ -7868,6 +8737,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeAV1DpbSlotInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR: { // Covers VUID-VkVideoEncodeAV1DpbSlotInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeAV1DpbSlotInfoKHR); VkVideoEncodeAV1DpbSlotInfoKHR* structure = (VkVideoEncodeAV1DpbSlotInfoKHR*)header; @@ -7876,12 +8752,27 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoEncodeAV1ProfileInfoKHR structure members -- Covers - // VUID-VkVideoEncodeAV1ProfileInfoKHR-sType-sType + // Validation code for VkVideoEncodeAV1ProfileInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR: { // Covers VUID-VkVideoEncodeAV1ProfileInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } + } break; // Validation code for VkVideoEncodeAV1GopRemainingFrameInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_GOP_REMAINING_FRAME_INFO_KHR: { // Covers // VUID-VkVideoEncodeAV1GopRemainingFrameInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_GOP_REMAINING_FRAME_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeAV1GopRemainingFrameInfoKHR); VkVideoEncodeAV1GopRemainingFrameInfoKHR* structure = (VkVideoEncodeAV1GopRemainingFrameInfoKHR*)header; @@ -7892,11 +8783,18 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeAV1RateControlInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR: { // Covers // VUID-VkVideoEncodeAV1RateControlInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeAV1RateControlInfoKHR); VkVideoEncodeAV1RateControlInfoKHR* structure = (VkVideoEncodeAV1RateControlInfoKHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoEncodeAV1RateControlFlagBitsKHR, - AllVkVideoEncodeAV1RateControlFlagBitsKHR, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkVideoEncodeAV1RateControlFlagBitsKHR, structure->flags, kOptionalFlags, "VUID-VkVideoEncodeAV1RateControlInfoKHR-flags-parameter"); } } break; @@ -7904,6 +8802,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkVideoEncodeAV1RateControlLayerInfoKHR structure members case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_LAYER_INFO_KHR: { // Covers // VUID-VkVideoEncodeAV1RateControlLayerInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_av1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_RATE_CONTROL_LAYER_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_av1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkVideoEncodeAV1RateControlLayerInfoKHR); VkVideoEncodeAV1RateControlLayerInfoKHR* structure = (VkVideoEncodeAV1RateControlLayerInfoKHR*)header; @@ -7915,46 +8820,159 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkVideoInlineQueryInfoKHR structure members -- Covers VUID-VkVideoInlineQueryInfoKHR-sType-sType + // Validation code for VkVideoInlineQueryInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR: { // Covers VUID-VkVideoInlineQueryInfoKHR-sType-sType - // No Validation code for VkVideoEncodeQuantizationMapCapabilitiesKHR structure members -- Covers - // VUID-VkVideoEncodeQuantizationMapCapabilitiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_maintenance1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR), but " + "its parent extension " + "VK_KHR_video_maintenance1 has not been enabled."); + } + } break; + + // Validation code for VkVideoEncodeQuantizationMapCapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR: { // Covers + // VUID-VkVideoEncodeQuantizationMapCapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; + + // Validation code for VkVideoFormatQuantizationMapPropertiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR: { // Covers + // VUID-VkVideoFormatQuantizationMapPropertiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; + + // Validation code for VkVideoEncodeQuantizationMapInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_INFO_KHR: { // Covers + // VUID-VkVideoEncodeQuantizationMapInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_INFO_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; + + // Validation code for VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_SESSION_PARAMETERS_CREATE_INFO_KHR: { // Covers + // VUID-VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_SESSION_PARAMETERS_CREATE_INFO_KHR), but " + "its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; + + // Validation code for VkVideoEncodeH264QuantizationMapCapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR: { // Covers + // VUID-VkVideoEncodeH264QuantizationMapCapabilitiesKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUANTIZATION_MAP_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; + + // Validation code for VkVideoEncodeH265QuantizationMapCapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR: { // Covers + // VUID-VkVideoEncodeH265QuantizationMapCapabilitiesKHR-sType-sType - // No Validation code for VkVideoFormatQuantizationMapPropertiesKHR structure members -- Covers - // VUID-VkVideoFormatQuantizationMapPropertiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; - // No Validation code for VkVideoEncodeQuantizationMapInfoKHR structure members -- Covers - // VUID-VkVideoEncodeQuantizationMapInfoKHR-sType-sType + // Validation code for VkVideoFormatH265QuantizationMapPropertiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR: { // Covers + // VUID-VkVideoFormatH265QuantizationMapPropertiesKHR-sType-sType - // No Validation code for VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR structure members -- Covers - // VUID-VkVideoEncodeQuantizationMapSessionParametersCreateInfoKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; - // No Validation code for VkVideoEncodeH264QuantizationMapCapabilitiesKHR structure members -- Covers - // VUID-VkVideoEncodeH264QuantizationMapCapabilitiesKHR-sType-sType + // Validation code for VkVideoEncodeAV1QuantizationMapCapabilitiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR: { // Covers + // VUID-VkVideoEncodeAV1QuantizationMapCapabilitiesKHR-sType-sType - // No Validation code for VkVideoEncodeH265QuantizationMapCapabilitiesKHR structure members -- Covers - // VUID-VkVideoEncodeH265QuantizationMapCapabilitiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_QUANTIZATION_MAP_CAPABILITIES_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; - // No Validation code for VkVideoFormatH265QuantizationMapPropertiesKHR structure members -- Covers - // VUID-VkVideoFormatH265QuantizationMapPropertiesKHR-sType-sType + // Validation code for VkVideoFormatAV1QuantizationMapPropertiesKHR structure members + case VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR: { // Covers + // VUID-VkVideoFormatAV1QuantizationMapPropertiesKHR-sType-sType - // No Validation code for VkVideoEncodeAV1QuantizationMapCapabilitiesKHR structure members -- Covers - // VUID-VkVideoEncodeAV1QuantizationMapCapabilitiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_VIDEO_FORMAT_AV1_QUANTIZATION_MAP_PROPERTIES_KHR), but its parent extension " + "VK_KHR_video_encode_quantization_map has not been enabled."); + } + } break; - // No Validation code for VkVideoFormatAV1QuantizationMapPropertiesKHR structure members -- Covers - // VUID-VkVideoFormatAV1QuantizationMapPropertiesKHR-sType-sType + // Validation code for VkPhysicalDeviceLayeredApiVulkanPropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_VULKAN_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceLayeredApiVulkanPropertiesKHR-sType-sType - // No Validation code for VkPhysicalDeviceLayeredApiVulkanPropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceLayeredApiVulkanPropertiesKHR-sType-sType + if (!IsExtEnabled(exts.vk_khr_maintenance7)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_VULKAN_PROPERTIES_KHR), but its parent extension " + "VK_KHR_maintenance7 has not been enabled."); + } + } break; // Validation code for VkDebugReportCallbackCreateInfoEXT structure members case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: { // Covers // VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_debug_report)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_debug_report has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDebugReportCallbackCreateInfoEXT); VkDebugReportCallbackCreateInfoEXT* structure = (VkDebugReportCallbackCreateInfoEXT*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkDebugReportFlagBitsEXT, - AllVkDebugReportFlagBitsEXT, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkDebugReportFlagBitsEXT, structure->flags, kOptionalFlags, "VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter"); skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pfnCallback), @@ -7966,29 +8984,36 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineRasterizationStateRasterizationOrderAMD structure members case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD: { // Covers // VUID-VkPipelineRasterizationStateRasterizationOrderAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_rasterization_order)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD), but its parent extension " + "VK_AMD_rasterization_order has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineRasterizationStateRasterizationOrderAMD); - if (!IsExtEnabled(device_extensions.vk_amd_rasterization_order)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_AMD_rasterization_order"); - } VkPipelineRasterizationStateRasterizationOrderAMD* structure = (VkPipelineRasterizationStateRasterizationOrderAMD*)header; - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::rasterizationOrder), vvl::Enum::VkRasterizationOrderAMD, structure->rasterizationOrder, - "VUID-VkPipelineRasterizationStateRasterizationOrderAMD-rasterizationOrder-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::rasterizationOrder), vvl::Enum::VkRasterizationOrderAMD, + structure->rasterizationOrder, + "VUID-VkPipelineRasterizationStateRasterizationOrderAMD-rasterizationOrder-parameter"); } } break; // Validation code for VkDedicatedAllocationImageCreateInfoNV structure members case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV: { // Covers // VUID-VkDedicatedAllocationImageCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_dedicated_allocation)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV), but its parent extension " + "VK_NV_dedicated_allocation has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDedicatedAllocationImageCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_dedicated_allocation)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_dedicated_allocation"); - } VkDedicatedAllocationImageCreateInfoNV* structure = (VkDedicatedAllocationImageCreateInfoNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::dedicatedAllocation), structure->dedicatedAllocation); } @@ -7997,29 +9022,45 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDedicatedAllocationBufferCreateInfoNV structure members case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV: { // Covers // VUID-VkDedicatedAllocationBufferCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_dedicated_allocation)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV), but its parent extension " + "VK_NV_dedicated_allocation has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDedicatedAllocationBufferCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_dedicated_allocation)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_dedicated_allocation"); - } VkDedicatedAllocationBufferCreateInfoNV* structure = (VkDedicatedAllocationBufferCreateInfoNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::dedicatedAllocation), structure->dedicatedAllocation); } } break; - // No Validation code for VkDedicatedAllocationMemoryAllocateInfoNV structure members -- Covers - // VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType + // Validation code for VkDedicatedAllocationMemoryAllocateInfoNV structure members + case VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV: { // Covers + // VUID-VkDedicatedAllocationMemoryAllocateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_dedicated_allocation)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV), but its parent extension " + "VK_NV_dedicated_allocation has not been enabled."); + } + } break; // Validation code for VkPipelineRasterizationStateStreamCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_transform_feedback)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_transform_feedback has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineRasterizationStateStreamCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_transform_feedback"); - } VkPipelineRasterizationStateStreamCreateInfoEXT* structure = (VkPipelineRasterizationStateStreamCreateInfoEXT*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, @@ -8030,78 +9071,110 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkCuModuleTexturingModeCreateInfoNVX structure members case VK_STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX: { // Covers // VUID-VkCuModuleTexturingModeCreateInfoNVX-sType-sType + + if (!IsExtEnabled(exts.vk_nvx_binary_import)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX), but its parent extension " + "VK_NVX_binary_import has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkCuModuleTexturingModeCreateInfoNVX); - if (!IsExtEnabled(device_extensions.vk_nvx_binary_import)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NVX_binary_import"); - } VkCuModuleTexturingModeCreateInfoNVX* structure = (VkCuModuleTexturingModeCreateInfoNVX*)header; skip |= ValidateBool32(pNext_loc.dot(Field::use64bitTexturing), structure->use64bitTexturing); } } break; - // No Validation code for VkTextureLODGatherFormatPropertiesAMD structure members -- Covers - // VUID-VkTextureLODGatherFormatPropertiesAMD-sType-sType + // Validation code for VkTextureLODGatherFormatPropertiesAMD structure members + case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD: { // Covers + // VUID-VkTextureLODGatherFormatPropertiesAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_texture_gather_bias_lod)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD), but its parent extension " + "VK_AMD_texture_gather_bias_lod has not been enabled."); + } + } break; // Validation code for VkExternalMemoryImageCreateInfoNV structure members case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV: { // Covers VUID-VkExternalMemoryImageCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_external_memory)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV), but its parent extension " + "VK_NV_external_memory has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExternalMemoryImageCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_external_memory)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_external_memory"); - } VkExternalMemoryImageCreateInfoNV* structure = (VkExternalMemoryImageCreateInfoNV*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleTypes), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, AllVkExternalMemoryHandleTypeFlagBitsNV, structure->handleTypes, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter"); + "VUID-VkExternalMemoryImageCreateInfoNV-handleTypes-parameter"); } } break; // Validation code for VkExportMemoryAllocateInfoNV structure members case VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV: { // Covers VUID-VkExportMemoryAllocateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_external_memory)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV), " + "but its parent extension " + "VK_NV_external_memory has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportMemoryAllocateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_external_memory)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_external_memory"); - } VkExportMemoryAllocateInfoNV* structure = (VkExportMemoryAllocateInfoNV*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleTypes), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, AllVkExternalMemoryHandleTypeFlagBitsNV, structure->handleTypes, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter"); + "VUID-VkExportMemoryAllocateInfoNV-handleTypes-parameter"); } } break; #ifdef VK_USE_PLATFORM_WIN32_KHR // Validation code for VkImportMemoryWin32HandleInfoNV structure members case VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV: { // Covers VUID-VkImportMemoryWin32HandleInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_external_memory_win32)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV), but its parent extension " + "VK_NV_external_memory_win32 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImportMemoryWin32HandleInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_external_memory_win32)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_external_memory_win32"); - } VkImportMemoryWin32HandleInfoNV* structure = (VkImportMemoryWin32HandleInfoNV*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, AllVkExternalMemoryHandleTypeFlagBitsNV, structure->handleType, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImportMemoryWin32HandleInfoNV-handleType-parameter"); + "VUID-VkImportMemoryWin32HandleInfoNV-handleType-parameter"); } } break; - // No Validation code for VkExportMemoryWin32HandleInfoNV structure members -- Covers - // VUID-VkExportMemoryWin32HandleInfoNV-sType-sType + // Validation code for VkExportMemoryWin32HandleInfoNV structure members + case VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV: { // Covers VUID-VkExportMemoryWin32HandleInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_external_memory_win32)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV), but its parent extension " + "VK_NV_external_memory_win32 has not been enabled."); + } + } break; // Validation code for VkWin32KeyedMutexAcquireReleaseInfoNV structure members case VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV: { // Covers // VUID-VkWin32KeyedMutexAcquireReleaseInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_win32_keyed_mutex)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV), but its parent extension " + "VK_NV_win32_keyed_mutex has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkWin32KeyedMutexAcquireReleaseInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_win32_keyed_mutex)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_win32_keyed_mutex"); - } VkWin32KeyedMutexAcquireReleaseInfoNV* structure = (VkWin32KeyedMutexAcquireReleaseInfoNV*)header; skip |= ValidateArray(pNext_loc.dot(Field::acquireCount), pNext_loc.dot(Field::pAcquireSyncs), structure->acquireCount, &structure->pAcquireSyncs, false, true, kVUIDUndefined, @@ -8128,6 +9201,13 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkValidationFlagsEXT structure members case VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT: { // Covers VUID-VkValidationFlagsEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_validation_flags)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT), but its parent extension " + "VK_EXT_validation_flags has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkValidationFlagsEXT); VkValidationFlagsEXT* structure = (VkValidationFlagsEXT*)header; @@ -8141,28 +9221,35 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkImageViewASTCDecodeModeEXT structure members case VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT: { // Covers VUID-VkImageViewASTCDecodeModeEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_astc_decode_mode)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT), " + "but its parent extension " + "VK_EXT_astc_decode_mode has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImageViewASTCDecodeModeEXT); - if (!IsExtEnabled(device_extensions.vk_ext_astc_decode_mode)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_astc_decode_mode"); - } VkImageViewASTCDecodeModeEXT* structure = (VkImageViewASTCDecodeModeEXT*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::decodeMode), vvl::Enum::VkFormat, structure->decodeMode, - "VUID-VkImageViewASTCDecodeModeEXT-decodeMode-parameter", VK_NULL_HANDLE); + "VUID-VkImageViewASTCDecodeModeEXT-decodeMode-parameter"); } } break; // Validation code for VkCommandBufferInheritanceConditionalRenderingInfoEXT structure members case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: { // Covers // VUID-VkCommandBufferInheritanceConditionalRenderingInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_conditional_rendering)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT), but its parent extension " + "VK_EXT_conditional_rendering has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkCommandBufferInheritanceConditionalRenderingInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_conditional_rendering"); - } VkCommandBufferInheritanceConditionalRenderingInfoEXT* structure = (VkCommandBufferInheritanceConditionalRenderingInfoEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::conditionalRenderingEnable), structure->conditionalRenderingEnable); @@ -8172,12 +9259,16 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineViewportWScalingStateCreateInfoNV structure members case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV: { // Covers // VUID-VkPipelineViewportWScalingStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_clip_space_w_scaling)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_clip_space_w_scaling has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineViewportWScalingStateCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_clip_space_w_scaling)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_clip_space_w_scaling"); - } VkPipelineViewportWScalingStateCreateInfoNV* structure = (VkPipelineViewportWScalingStateCreateInfoNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::viewportWScalingEnable), structure->viewportWScalingEnable); @@ -8189,27 +9280,33 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSwapchainCounterCreateInfoEXT structure members case VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT: { // Covers VUID-VkSwapchainCounterCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_display_control)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_display_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSwapchainCounterCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_display_control)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_display_control"); - } VkSwapchainCounterCreateInfoEXT* structure = (VkSwapchainCounterCreateInfoEXT*)header; skip |= ValidateFlags(pNext_loc.dot(Field::surfaceCounters), vvl::FlagBitmask::VkSurfaceCounterFlagBitsEXT, - AllVkSurfaceCounterFlagBitsEXT, structure->surfaceCounters, kOptionalFlags, VK_NULL_HANDLE, + AllVkSurfaceCounterFlagBitsEXT, structure->surfaceCounters, kOptionalFlags, "VUID-VkSwapchainCounterCreateInfoEXT-surfaceCounters-parameter"); } } break; // Validation code for VkPresentTimesInfoGOOGLE structure members case VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE: { // Covers VUID-VkPresentTimesInfoGOOGLE-sType-sType + + if (!IsExtEnabled(exts.vk_google_display_timing)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE), but " + "its parent extension " + "VK_GOOGLE_display_timing has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPresentTimesInfoGOOGLE); - if (!IsExtEnabled(device_extensions.vk_google_display_timing)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_GOOGLE_display_timing"); - } VkPresentTimesInfoGOOGLE* structure = (VkPresentTimesInfoGOOGLE*)header; skip |= ValidateArray(pNext_loc.dot(Field::swapchainCount), pNext_loc.dot(Field::pTimes), structure->swapchainCount, &structure->pTimes, true, false, "VUID-VkPresentTimesInfoGOOGLE-swapchainCount-arraylength", @@ -8226,12 +9323,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkMultiviewPerViewAttributesInfoNVX structure members case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX: { // Covers // VUID-VkMultiviewPerViewAttributesInfoNVX-sType-sType + + if (!IsExtEnabled(exts.vk_nvx_multiview_per_view_attributes)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX), but its parent extension " + "VK_NVX_multiview_per_view_attributes has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkMultiviewPerViewAttributesInfoNVX); - if (!IsExtEnabled(device_extensions.vk_nvx_multiview_per_view_attributes)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NVX_multiview_per_view_attributes"); - } VkMultiviewPerViewAttributesInfoNVX* structure = (VkMultiviewPerViewAttributesInfoNVX*)header; skip |= ValidateBool32(pNext_loc.dot(Field::perViewAttributes), structure->perViewAttributes); @@ -8243,12 +9343,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineViewportSwizzleStateCreateInfoNV structure members case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV: { // Covers // VUID-VkPipelineViewportSwizzleStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_viewport_swizzle)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_viewport_swizzle has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineViewportSwizzleStateCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_viewport_swizzle)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_viewport_swizzle"); - } VkPipelineViewportSwizzleStateCreateInfoNV* structure = (VkPipelineViewportSwizzleStateCreateInfoNV*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, "VUID-VkPipelineViewportSwizzleStateCreateInfoNV-flags-zerobitmask"); @@ -8264,19 +9367,19 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const pNext_loc.dot(Field::pViewportSwizzles, viewportIndex); skip |= ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::x), vvl::Enum::VkViewportCoordinateSwizzleNV, structure->pViewportSwizzles[viewportIndex].x, - "VUID-VkViewportSwizzleNV-x-parameter", VK_NULL_HANDLE); + "VUID-VkViewportSwizzleNV-x-parameter"); skip |= ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::y), vvl::Enum::VkViewportCoordinateSwizzleNV, structure->pViewportSwizzles[viewportIndex].y, - "VUID-VkViewportSwizzleNV-y-parameter", VK_NULL_HANDLE); + "VUID-VkViewportSwizzleNV-y-parameter"); skip |= ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::z), vvl::Enum::VkViewportCoordinateSwizzleNV, structure->pViewportSwizzles[viewportIndex].z, - "VUID-VkViewportSwizzleNV-z-parameter", VK_NULL_HANDLE); + "VUID-VkViewportSwizzleNV-z-parameter"); skip |= ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::w), vvl::Enum::VkViewportCoordinateSwizzleNV, structure->pViewportSwizzles[viewportIndex].w, - "VUID-VkViewportSwizzleNV-w-parameter", VK_NULL_HANDLE); + "VUID-VkViewportSwizzleNV-w-parameter"); } } } @@ -8285,33 +9388,40 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineDiscardRectangleStateCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_discard_rectangles)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_discard_rectangles has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineDiscardRectangleStateCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_discard_rectangles)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_discard_rectangles"); - } VkPipelineDiscardRectangleStateCreateInfoEXT* structure = (VkPipelineDiscardRectangleStateCreateInfoEXT*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, "VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-flags-zerobitmask"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::discardRectangleMode), vvl::Enum::VkDiscardRectangleModeEXT, structure->discardRectangleMode, - "VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleMode-parameter", - VK_NULL_HANDLE); + "VUID-VkPipelineDiscardRectangleStateCreateInfoEXT-discardRectangleMode-parameter"); } } break; // Validation code for VkPipelineRasterizationConservativeStateCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_conservative_rasterization)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_conservative_rasterization has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineRasterizationConservativeStateCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_conservative_rasterization)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_conservative_rasterization"); - } VkPipelineRasterizationConservativeStateCreateInfoEXT* structure = (VkPipelineRasterizationConservativeStateCreateInfoEXT*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, @@ -8320,20 +9430,23 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const skip |= ValidateRangedEnum( pNext_loc.dot(Field::conservativeRasterizationMode), vvl::Enum::VkConservativeRasterizationModeEXT, structure->conservativeRasterizationMode, - "VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-conservativeRasterizationMode-parameter", - VK_NULL_HANDLE); + "VUID-VkPipelineRasterizationConservativeStateCreateInfoEXT-conservativeRasterizationMode-parameter"); } } break; // Validation code for VkPipelineRasterizationDepthClipStateCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineRasterizationDepthClipStateCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_clip_enable)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_depth_clip_enable has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineRasterizationDepthClipStateCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_clip_enable)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_depth_clip_enable"); - } VkPipelineRasterizationDepthClipStateCreateInfoEXT* structure = (VkPipelineRasterizationDepthClipStateCreateInfoEXT*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, @@ -8345,17 +9458,31 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDebugUtilsObjectNameInfoEXT structure members case VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT: { // Covers VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_debug_utils)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT), but its parent extension " + "VK_EXT_debug_utils has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDebugUtilsObjectNameInfoEXT); VkDebugUtilsObjectNameInfoEXT* structure = (VkDebugUtilsObjectNameInfoEXT*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::objectType), vvl::Enum::VkObjectType, structure->objectType, - "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter", VK_NULL_HANDLE); + "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter"); } } break; // Validation code for VkDebugUtilsMessengerCreateInfoEXT structure members case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT: { // Covers // VUID-VkDebugUtilsMessengerCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_debug_utils)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_debug_utils has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDebugUtilsMessengerCreateInfoEXT); VkDebugUtilsMessengerCreateInfoEXT* structure = (VkDebugUtilsMessengerCreateInfoEXT*)header; @@ -8365,11 +9492,11 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const skip |= ValidateFlags(pNext_loc.dot(Field::messageSeverity), vvl::FlagBitmask::VkDebugUtilsMessageSeverityFlagBitsEXT, AllVkDebugUtilsMessageSeverityFlagBitsEXT, structure->messageSeverity, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter", + "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter", "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-requiredbitmask"); skip |= ValidateFlags(pNext_loc.dot(Field::messageType), vvl::FlagBitmask::VkDebugUtilsMessageTypeFlagBitsEXT, - AllVkDebugUtilsMessageTypeFlagBitsEXT, structure->messageType, kRequiredFlags, VK_NULL_HANDLE, + AllVkDebugUtilsMessageTypeFlagBitsEXT, structure->messageType, kRequiredFlags, "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter", "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-requiredbitmask"); @@ -8380,49 +9507,110 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } break; #ifdef VK_USE_PLATFORM_ANDROID_KHR - // No Validation code for VkAndroidHardwareBufferUsageANDROID structure members -- Covers - // VUID-VkAndroidHardwareBufferUsageANDROID-sType-sType + // Validation code for VkAndroidHardwareBufferUsageANDROID structure members + case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID: { // Covers + // VUID-VkAndroidHardwareBufferUsageANDROID-sType-sType + + if (!IsExtEnabled(exts.vk_android_external_memory_android_hardware_buffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID), but its parent extension " + "VK_ANDROID_external_memory_android_hardware_buffer has not been enabled."); + } + } break; + + // Validation code for VkAndroidHardwareBufferFormatPropertiesANDROID structure members + case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID: { // Covers + // VUID-VkAndroidHardwareBufferFormatPropertiesANDROID-sType-sType - // No Validation code for VkAndroidHardwareBufferFormatPropertiesANDROID structure members -- Covers - // VUID-VkAndroidHardwareBufferFormatPropertiesANDROID-sType-sType + if (!IsExtEnabled(exts.vk_android_external_memory_android_hardware_buffer)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID), but its parent extension " + "VK_ANDROID_external_memory_android_hardware_buffer has not been enabled."); + } + } break; // Validation code for VkImportAndroidHardwareBufferInfoANDROID structure members case VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID: { // Covers // VUID-VkImportAndroidHardwareBufferInfoANDROID-sType-sType + + if (!IsExtEnabled(exts.vk_android_external_memory_android_hardware_buffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID), but its parent extension " + "VK_ANDROID_external_memory_android_hardware_buffer has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImportAndroidHardwareBufferInfoANDROID); - if (!IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_ANDROID_external_memory_android_hardware_buffer"); - } VkImportAndroidHardwareBufferInfoANDROID* structure = (VkImportAndroidHardwareBufferInfoANDROID*)header; skip |= ValidateRequiredPointer(pNext_loc.dot(Field::buffer), structure->buffer, "VUID-VkImportAndroidHardwareBufferInfoANDROID-buffer-parameter"); } } break; - // No Validation code for VkExternalFormatANDROID structure members -- Covers VUID-VkExternalFormatANDROID-sType-sType + // Validation code for VkExternalFormatANDROID structure members + case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID: { // Covers VUID-VkExternalFormatANDROID-sType-sType + + if (!IsExtEnabled(exts.vk_android_external_memory_android_hardware_buffer)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID), but its parent extension " + "VK_ANDROID_external_memory_android_hardware_buffer has not been enabled."); + } + } break; + + // Validation code for VkAndroidHardwareBufferFormatProperties2ANDROID structure members + case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID: { // Covers + // VUID-VkAndroidHardwareBufferFormatProperties2ANDROID-sType-sType - // No Validation code for VkAndroidHardwareBufferFormatProperties2ANDROID structure members -- Covers - // VUID-VkAndroidHardwareBufferFormatProperties2ANDROID-sType-sType + if (!IsExtEnabled(exts.vk_android_external_memory_android_hardware_buffer)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID), but its parent extension " + "VK_ANDROID_external_memory_android_hardware_buffer has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_ANDROID_KHR #ifdef VK_ENABLE_BETA_EXTENSIONS - // No Validation code for VkPipelineShaderStageNodeCreateInfoAMDX structure members -- Covers - // VUID-VkPipelineShaderStageNodeCreateInfoAMDX-sType-sType + // Validation code for VkPipelineShaderStageNodeCreateInfoAMDX structure members + case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_NODE_CREATE_INFO_AMDX: { // Covers + // VUID-VkPipelineShaderStageNodeCreateInfoAMDX-sType-sType + + if (!IsExtEnabled(exts.vk_amdx_shader_enqueue)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_NODE_CREATE_INFO_AMDX), but its parent extension " + "VK_AMDX_shader_enqueue has not been enabled."); + } + } break; #endif // VK_ENABLE_BETA_EXTENSIONS - // No Validation code for VkAttachmentSampleCountInfoAMD structure members -- Covers - // VUID-VkAttachmentSampleCountInfoAMD-sType-sType + // Validation code for VkAttachmentSampleCountInfoAMD structure members + case VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD: { // Covers VUID-VkAttachmentSampleCountInfoAMD-sType-sType + + if ((!IsExtEnabled(exts.vk_amd_mixed_attachment_samples)) && (!IsExtEnabled(exts.vk_nv_framebuffer_mixed_samples))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD), but its parent extension " + "VK_AMD_mixed_attachment_samples, or VK_NV_framebuffer_mixed_samples has not been enabled."); + } + } break; // Validation code for VkSampleLocationsInfoEXT structure members case VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT: { // Covers VUID-VkSampleLocationsInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_sample_locations)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT), but " + "its parent extension " + "VK_EXT_sample_locations has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSampleLocationsInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_sample_locations)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_sample_locations"); - } VkSampleLocationsInfoEXT* structure = (VkSampleLocationsInfoEXT*)header; skip |= ValidateArray(pNext_loc.dot(Field::sampleLocationsCount), pNext_loc.dot(Field::pSampleLocations), structure->sampleLocationsCount, &structure->pSampleLocations, false, true, kVUIDUndefined, @@ -8441,12 +9629,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkRenderPassSampleLocationsBeginInfoEXT structure members case VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT: { // Covers // VUID-VkRenderPassSampleLocationsBeginInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_sample_locations)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT), but its parent extension " + "VK_EXT_sample_locations has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassSampleLocationsBeginInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_sample_locations)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_sample_locations"); - } VkRenderPassSampleLocationsBeginInfoEXT* structure = (VkRenderPassSampleLocationsBeginInfoEXT*)header; skip |= ValidateArray(pNext_loc.dot(Field::attachmentInitialSampleLocationsCount), pNext_loc.dot(Field::pAttachmentInitialSampleLocations), @@ -8534,12 +9725,16 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineSampleLocationsStateCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineSampleLocationsStateCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_sample_locations)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_sample_locations has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineSampleLocationsStateCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_sample_locations)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_sample_locations"); - } VkPipelineSampleLocationsStateCreateInfoEXT* structure = (VkPipelineSampleLocationsStateCreateInfoEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::sampleLocationsEnable), structure->sampleLocationsEnable); @@ -8565,32 +9760,40 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineColorBlendAdvancedStateCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_blend_operation_advanced)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_blend_operation_advanced has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineColorBlendAdvancedStateCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_blend_operation_advanced)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_blend_operation_advanced"); - } VkPipelineColorBlendAdvancedStateCreateInfoEXT* structure = (VkPipelineColorBlendAdvancedStateCreateInfoEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::srcPremultiplied), structure->srcPremultiplied); skip |= ValidateBool32(pNext_loc.dot(Field::dstPremultiplied), structure->dstPremultiplied); - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::blendOverlap), vvl::Enum::VkBlendOverlapEXT, structure->blendOverlap, - "VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter", VK_NULL_HANDLE); + skip |= + ValidateRangedEnum(pNext_loc.dot(Field::blendOverlap), vvl::Enum::VkBlendOverlapEXT, structure->blendOverlap, + "VUID-VkPipelineColorBlendAdvancedStateCreateInfoEXT-blendOverlap-parameter"); } } break; // Validation code for VkPipelineCoverageToColorStateCreateInfoNV structure members case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV: { // Covers // VUID-VkPipelineCoverageToColorStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_fragment_coverage_to_color)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_fragment_coverage_to_color has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineCoverageToColorStateCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_fragment_coverage_to_color)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_fragment_coverage_to_color"); - } VkPipelineCoverageToColorStateCreateInfoNV* structure = (VkPipelineCoverageToColorStateCreateInfoNV*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, "VUID-VkPipelineCoverageToColorStateCreateInfoNV-flags-zerobitmask"); @@ -8602,54 +9805,72 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineCoverageModulationStateCreateInfoNV structure members case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV: { // Covers // VUID-VkPipelineCoverageModulationStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_framebuffer_mixed_samples)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_framebuffer_mixed_samples has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineCoverageModulationStateCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_framebuffer_mixed_samples"); - } VkPipelineCoverageModulationStateCreateInfoNV* structure = (VkPipelineCoverageModulationStateCreateInfoNV*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, "VUID-VkPipelineCoverageModulationStateCreateInfoNV-flags-zerobitmask"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::coverageModulationMode), vvl::Enum::VkCoverageModulationModeNV, structure->coverageModulationMode, - "VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter", - VK_NULL_HANDLE); + "VUID-VkPipelineCoverageModulationStateCreateInfoNV-coverageModulationMode-parameter"); skip |= ValidateBool32(pNext_loc.dot(Field::coverageModulationTableEnable), structure->coverageModulationTableEnable); } } break; - // No Validation code for VkDrmFormatModifierPropertiesListEXT structure members -- Covers - // VUID-VkDrmFormatModifierPropertiesListEXT-sType-sType + // Validation code for VkDrmFormatModifierPropertiesListEXT structure members + case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT: { // Covers + // VUID-VkDrmFormatModifierPropertiesListEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_drm_format_modifier)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT), but its parent extension " + "VK_EXT_image_drm_format_modifier has not been enabled."); + } + } break; // Validation code for VkPhysicalDeviceImageDrmFormatModifierInfoEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT: { // Covers // VUID-VkPhysicalDeviceImageDrmFormatModifierInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_drm_format_modifier)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT), but its parent extension " + "VK_EXT_image_drm_format_modifier has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageDrmFormatModifierInfoEXT); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier))) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_image_drm_format_modifier"); - } VkPhysicalDeviceImageDrmFormatModifierInfoEXT* structure = (VkPhysicalDeviceImageDrmFormatModifierInfoEXT*)header; - skip |= - ValidateRangedEnum(pNext_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, structure->sharingMode, - "VUID-VkPhysicalDeviceImageDrmFormatModifierInfoEXT-sharingMode-parameter", physicalDevice); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, structure->sharingMode, + "VUID-VkPhysicalDeviceImageDrmFormatModifierInfoEXT-sharingMode-parameter"); } } break; // Validation code for VkImageDrmFormatModifierListCreateInfoEXT structure members case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT: { // Covers // VUID-VkImageDrmFormatModifierListCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_drm_format_modifier)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_image_drm_format_modifier has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImageDrmFormatModifierListCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_image_drm_format_modifier"); - } VkImageDrmFormatModifierListCreateInfoEXT* structure = (VkImageDrmFormatModifierListCreateInfoEXT*)header; skip |= ValidateArray(pNext_loc.dot(Field::drmFormatModifierCount), pNext_loc.dot(Field::pDrmFormatModifiers), structure->drmFormatModifierCount, &structure->pDrmFormatModifiers, true, true, @@ -8661,12 +9882,16 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkImageDrmFormatModifierExplicitCreateInfoEXT structure members case VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT: { // Covers // VUID-VkImageDrmFormatModifierExplicitCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_drm_format_modifier)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_image_drm_format_modifier has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImageDrmFormatModifierExplicitCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_image_drm_format_modifier"); - } VkImageDrmFormatModifierExplicitCreateInfoEXT* structure = (VkImageDrmFormatModifierExplicitCreateInfoEXT*)header; skip |= ValidateArray(pNext_loc.dot(Field::drmFormatModifierPlaneCount), pNext_loc.dot(Field::pPlaneLayouts), structure->drmFormatModifierPlaneCount, &structure->pPlaneLayouts, true, true, @@ -8683,18 +9908,30 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkDrmFormatModifierPropertiesList2EXT structure members -- Covers - // VUID-VkDrmFormatModifierPropertiesList2EXT-sType-sType + // Validation code for VkDrmFormatModifierPropertiesList2EXT structure members + case VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT: { // Covers + // VUID-VkDrmFormatModifierPropertiesList2EXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_drm_format_modifier)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT), but its parent extension " + "VK_EXT_image_drm_format_modifier has not been enabled."); + } + } break; // Validation code for VkShaderModuleValidationCacheCreateInfoEXT structure members case VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT: { // Covers // VUID-VkShaderModuleValidationCacheCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_validation_cache)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_validation_cache has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkShaderModuleValidationCacheCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_validation_cache"); - } VkShaderModuleValidationCacheCreateInfoEXT* structure = (VkShaderModuleValidationCacheCreateInfoEXT*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::validationCache), structure->validationCache); } @@ -8703,12 +9940,16 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineViewportShadingRateImageStateCreateInfoNV structure members case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV: { // Covers // VUID-VkPipelineViewportShadingRateImageStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_shading_rate_image)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_shading_rate_image has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineViewportShadingRateImageStateCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_shading_rate_image"); - } VkPipelineViewportShadingRateImageStateCreateInfoNV* structure = (VkPipelineViewportShadingRateImageStateCreateInfoNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shadingRateImageEnable), structure->shadingRateImageEnable); @@ -8718,17 +9959,21 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineViewportCoarseSampleOrderStateCreateInfoNV structure members case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV: { // Covers // VUID-VkPipelineViewportCoarseSampleOrderStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_shading_rate_image)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_shading_rate_image has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineViewportCoarseSampleOrderStateCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_shading_rate_image"); - } VkPipelineViewportCoarseSampleOrderStateCreateInfoNV* structure = (VkPipelineViewportCoarseSampleOrderStateCreateInfoNV*)header; - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::sampleOrderType), vvl::Enum::VkCoarseSampleOrderTypeNV, structure->sampleOrderType, - "VUID-VkPipelineViewportCoarseSampleOrderStateCreateInfoNV-sampleOrderType-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::sampleOrderType), vvl::Enum::VkCoarseSampleOrderTypeNV, + structure->sampleOrderType, + "VUID-VkPipelineViewportCoarseSampleOrderStateCreateInfoNV-sampleOrderType-parameter"); skip |= ValidateArray(pNext_loc.dot(Field::customSampleOrderCount), pNext_loc.dot(Field::pCustomSampleOrders), @@ -8743,7 +9988,7 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const skip |= ValidateRangedEnum(pCustomSampleOrders_loc.dot(Field::shadingRate), vvl::Enum::VkShadingRatePaletteEntryNV, structure->pCustomSampleOrders[customSampleOrderIndex].shadingRate, - "VUID-VkCoarseSampleOrderCustomNV-shadingRate-parameter", VK_NULL_HANDLE); + "VUID-VkCoarseSampleOrderCustomNV-shadingRate-parameter"); skip |= ValidateArray(pCustomSampleOrders_loc.dot(Field::sampleLocationCount), pCustomSampleOrders_loc.dot(Field::pSampleLocations), @@ -8768,11 +10013,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkWriteDescriptorSetAccelerationStructureNV structure members case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV: { // Covers // VUID-VkWriteDescriptorSetAccelerationStructureNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_ray_tracing)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV), but its parent extension " + "VK_NV_ray_tracing has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkWriteDescriptorSetAccelerationStructureNV); - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_ray_tracing"); - } VkWriteDescriptorSetAccelerationStructureNV* structure = (VkWriteDescriptorSetAccelerationStructureNV*)header; skip |= ValidateArray(pNext_loc.dot(Field::accelerationStructureCount), pNext_loc.dot(Field::pAccelerationStructures), @@ -8785,13 +10034,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineRepresentativeFragmentTestStateCreateInfoNV structure members case VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV: { // Covers // VUID-VkPipelineRepresentativeFragmentTestStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_representative_fragment_test)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_representative_fragment_test has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineRepresentativeFragmentTestStateCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_representative_fragment_test)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_representative_fragment_test"); - } VkPipelineRepresentativeFragmentTestStateCreateInfoNV* structure = (VkPipelineRepresentativeFragmentTestStateCreateInfoNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::representativeFragmentTestEnable), @@ -8802,34 +10055,51 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPhysicalDeviceImageViewImageFormatInfoEXT structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT: { // Covers // VUID-VkPhysicalDeviceImageViewImageFormatInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_filter_cubic)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT), but its parent extension " + "VK_EXT_filter_cubic has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceImageViewImageFormatInfoEXT); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_filter_cubic))) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_filter_cubic"); - } VkPhysicalDeviceImageViewImageFormatInfoEXT* structure = (VkPhysicalDeviceImageViewImageFormatInfoEXT*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::imageViewType), vvl::Enum::VkImageViewType, structure->imageViewType, - "VUID-VkPhysicalDeviceImageViewImageFormatInfoEXT-imageViewType-parameter", physicalDevice); + "VUID-VkPhysicalDeviceImageViewImageFormatInfoEXT-imageViewType-parameter"); } } break; - // No Validation code for VkFilterCubicImageViewImageFormatPropertiesEXT structure members -- Covers - // VUID-VkFilterCubicImageViewImageFormatPropertiesEXT-sType-sType + // Validation code for VkFilterCubicImageViewImageFormatPropertiesEXT structure members + case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: { // Covers + // VUID-VkFilterCubicImageViewImageFormatPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_filter_cubic)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT), but its parent extension " + "VK_EXT_filter_cubic has not been enabled."); + } + } break; // Validation code for VkImportMemoryHostPointerInfoEXT structure members case VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT: { // Covers VUID-VkImportMemoryHostPointerInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_external_memory_host)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT), but its parent extension " + "VK_EXT_external_memory_host has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImportMemoryHostPointerInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_external_memory_host)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_external_memory_host"); - } VkImportMemoryHostPointerInfoEXT* structure = (VkImportMemoryHostPointerInfoEXT*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, AllVkExternalMemoryHandleTypeFlagBits, structure->handleType, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter", + "VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter", "VUID-VkImportMemoryHostPointerInfoEXT-handleType-parameter"); skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pHostPointer), structure->pHostPointer, @@ -8840,12 +10110,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineCompilerControlCreateInfoAMD structure members case VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD: { // Covers // VUID-VkPipelineCompilerControlCreateInfoAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_pipeline_compiler_control)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD), but its parent extension " + "VK_AMD_pipeline_compiler_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineCompilerControlCreateInfoAMD); - if (!IsExtEnabled(device_extensions.vk_amd_pipeline_compiler_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_AMD_pipeline_compiler_control"); - } VkPipelineCompilerControlCreateInfoAMD* structure = (VkPipelineCompilerControlCreateInfoAMD*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::compilerControlFlags), structure->compilerControlFlags, "VUID-VkPipelineCompilerControlCreateInfoAMD-compilerControlFlags-zerobitmask"); @@ -8855,62 +10128,115 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceMemoryOverallocationCreateInfoAMD structure members case VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD: { // Covers // VUID-VkDeviceMemoryOverallocationCreateInfoAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_memory_overallocation_behavior)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD), but its parent extension " + "VK_AMD_memory_overallocation_behavior has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceMemoryOverallocationCreateInfoAMD); - if (!IsExtEnabled(device_extensions.vk_amd_memory_overallocation_behavior)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_AMD_memory_overallocation_behavior"); - } VkDeviceMemoryOverallocationCreateInfoAMD* structure = (VkDeviceMemoryOverallocationCreateInfoAMD*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::overallocationBehavior), vvl::Enum::VkMemoryOverallocationBehaviorAMD, structure->overallocationBehavior, - "VUID-VkDeviceMemoryOverallocationCreateInfoAMD-overallocationBehavior-parameter", - VK_NULL_HANDLE); + "VUID-VkDeviceMemoryOverallocationCreateInfoAMD-overallocationBehavior-parameter"); } } break; #ifdef VK_USE_PLATFORM_GGP - // No Validation code for VkPresentFrameTokenGGP structure members -- Covers VUID-VkPresentFrameTokenGGP-sType-sType + // Validation code for VkPresentFrameTokenGGP structure members + case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: { // Covers VUID-VkPresentFrameTokenGGP-sType-sType + + if (!IsExtEnabled(exts.vk_ggp_frame_token)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP), but its parent extension " + "VK_GGP_frame_token has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_GGP - // No Validation code for VkPipelineViewportExclusiveScissorStateCreateInfoNV structure members -- Covers - // VUID-VkPipelineViewportExclusiveScissorStateCreateInfoNV-sType-sType + // Validation code for VkPipelineViewportExclusiveScissorStateCreateInfoNV structure members + case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV: { // Covers + // VUID-VkPipelineViewportExclusiveScissorStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_scissor_exclusive)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_scissor_exclusive has not been enabled."); + } + } break; + + // Validation code for VkQueueFamilyCheckpointPropertiesNV structure members + case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV: { // Covers + // VUID-VkQueueFamilyCheckpointPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_device_diagnostic_checkpoints)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV), but its parent extension " + "VK_NV_device_diagnostic_checkpoints has not been enabled."); + } + } break; - // No Validation code for VkQueueFamilyCheckpointPropertiesNV structure members -- Covers - // VUID-VkQueueFamilyCheckpointPropertiesNV-sType-sType + // Validation code for VkQueueFamilyCheckpointProperties2NV structure members + case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: { // Covers + // VUID-VkQueueFamilyCheckpointProperties2NV-sType-sType - // No Validation code for VkQueueFamilyCheckpointProperties2NV structure members -- Covers - // VUID-VkQueueFamilyCheckpointProperties2NV-sType-sType + if (!IsExtEnabled(exts.vk_nv_device_diagnostic_checkpoints)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV), but its parent extension " + "VK_NV_device_diagnostic_checkpoints has not been enabled."); + } + } break; // Validation code for VkQueryPoolPerformanceQueryCreateInfoINTEL structure members case VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL: { // Covers // VUID-VkQueryPoolPerformanceQueryCreateInfoINTEL-sType-sType + + if (!IsExtEnabled(exts.vk_intel_performance_query)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL), but its parent extension " + "VK_INTEL_performance_query has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkQueryPoolPerformanceQueryCreateInfoINTEL); - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_INTEL_performance_query"); - } VkQueryPoolPerformanceQueryCreateInfoINTEL* structure = (VkQueryPoolPerformanceQueryCreateInfoINTEL*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::performanceCountersSampling), vvl::Enum::VkQueryPoolSamplingModeINTEL, structure->performanceCountersSampling, - "VUID-VkQueryPoolPerformanceQueryCreateInfoINTEL-performanceCountersSampling-parameter", - VK_NULL_HANDLE); + "VUID-VkQueryPoolPerformanceQueryCreateInfoINTEL-performanceCountersSampling-parameter"); } } break; - // No Validation code for VkDisplayNativeHdrSurfaceCapabilitiesAMD structure members -- Covers - // VUID-VkDisplayNativeHdrSurfaceCapabilitiesAMD-sType-sType + // Validation code for VkDisplayNativeHdrSurfaceCapabilitiesAMD structure members + case VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD: { // Covers + // VUID-VkDisplayNativeHdrSurfaceCapabilitiesAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_display_native_hdr)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD), but its parent extension " + "VK_AMD_display_native_hdr has not been enabled."); + } + } break; // Validation code for VkSwapchainDisplayNativeHdrCreateInfoAMD structure members case VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD: { // Covers // VUID-VkSwapchainDisplayNativeHdrCreateInfoAMD-sType-sType + + if (!IsExtEnabled(exts.vk_amd_display_native_hdr)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD), but its parent extension " + "VK_AMD_display_native_hdr has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSwapchainDisplayNativeHdrCreateInfoAMD); - if (!IsExtEnabled(device_extensions.vk_amd_display_native_hdr)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_AMD_display_native_hdr"); - } VkSwapchainDisplayNativeHdrCreateInfoAMD* structure = (VkSwapchainDisplayNativeHdrCreateInfoAMD*)header; skip |= ValidateBool32(pNext_loc.dot(Field::localDimmingEnable), structure->localDimmingEnable); } @@ -8919,48 +10245,88 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkRenderPassFragmentDensityMapCreateInfoEXT structure members case VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT: { // Covers // VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_fragment_density_map has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassFragmentDensityMapCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_fragment_density_map"); - } VkRenderPassFragmentDensityMapCreateInfoEXT* structure = (VkRenderPassFragmentDensityMapCreateInfoEXT*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::layout), vvl::Enum::VkImageLayout, structure->fragmentDensityMapAttachment.layout, - "VUID-VkAttachmentReference-layout-parameter", VK_NULL_HANDLE); + "VUID-VkAttachmentReference-layout-parameter"); } } break; // Validation code for VkRenderingFragmentDensityMapAttachmentInfoEXT structure members case VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT: { // Covers // VUID-VkRenderingFragmentDensityMapAttachmentInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT), but its parent extension " + "VK_EXT_fragment_density_map has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderingFragmentDensityMapAttachmentInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_fragment_density_map"); - } VkRenderingFragmentDensityMapAttachmentInfoEXT* structure = (VkRenderingFragmentDensityMapAttachmentInfoEXT*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::imageView), structure->imageView); - skip |= - ValidateRangedEnum(pNext_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, structure->imageLayout, - "VUID-VkRenderingFragmentDensityMapAttachmentInfoEXT-imageLayout-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, structure->imageLayout, + "VUID-VkRenderingFragmentDensityMapAttachmentInfoEXT-imageLayout-parameter"); } } break; - // No Validation code for VkPhysicalDeviceMemoryBudgetPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceMemoryBudgetPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceMemoryBudgetPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceMemoryBudgetPropertiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_memory_budget)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT), but its parent extension " + "VK_EXT_memory_budget has not been enabled."); + } + } break; + + // Validation code for VkMemoryPriorityAllocateInfoEXT structure members + case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: { // Covers VUID-VkMemoryPriorityAllocateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_memory_priority)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT), but its parent extension " + "VK_EXT_memory_priority has not been enabled."); + } + } break; - // No Validation code for VkMemoryPriorityAllocateInfoEXT structure members -- Covers - // VUID-VkMemoryPriorityAllocateInfoEXT-sType-sType + // Validation code for VkBufferDeviceAddressCreateInfoEXT structure members + case VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT: { // Covers + // VUID-VkBufferDeviceAddressCreateInfoEXT-sType-sType - // No Validation code for VkBufferDeviceAddressCreateInfoEXT structure members -- Covers - // VUID-VkBufferDeviceAddressCreateInfoEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_buffer_device_address)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_buffer_device_address has not been enabled."); + } + } break; // Validation code for VkValidationFeaturesEXT structure members case VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT: { // Covers VUID-VkValidationFeaturesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_validation_features)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT), but its parent extension " + "VK_EXT_validation_features has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkValidationFeaturesEXT); VkValidationFeaturesEXT* structure = (VkValidationFeaturesEXT*)header; @@ -8981,38 +10347,45 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineCoverageReductionStateCreateInfoNV structure members case VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV: { // Covers // VUID-VkPipelineCoverageReductionStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_coverage_reduction_mode)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_coverage_reduction_mode has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineCoverageReductionStateCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_coverage_reduction_mode)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_coverage_reduction_mode"); - } VkPipelineCoverageReductionStateCreateInfoNV* structure = (VkPipelineCoverageReductionStateCreateInfoNV*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, "VUID-VkPipelineCoverageReductionStateCreateInfoNV-flags-zerobitmask"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::coverageReductionMode), vvl::Enum::VkCoverageReductionModeNV, structure->coverageReductionMode, - "VUID-VkPipelineCoverageReductionStateCreateInfoNV-coverageReductionMode-parameter", - VK_NULL_HANDLE); + "VUID-VkPipelineCoverageReductionStateCreateInfoNV-coverageReductionMode-parameter"); } } break; // Validation code for VkPipelineRasterizationProvokingVertexStateCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineRasterizationProvokingVertexStateCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_provoking_vertex)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_provoking_vertex has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineRasterizationProvokingVertexStateCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_provoking_vertex)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_provoking_vertex"); - } VkPipelineRasterizationProvokingVertexStateCreateInfoEXT* structure = (VkPipelineRasterizationProvokingVertexStateCreateInfoEXT*)header; skip |= ValidateRangedEnum( pNext_loc.dot(Field::provokingVertexMode), vvl::Enum::VkProvokingVertexModeEXT, structure->provokingVertexMode, - "VUID-VkPipelineRasterizationProvokingVertexStateCreateInfoEXT-provokingVertexMode-parameter", VK_NULL_HANDLE); + "VUID-VkPipelineRasterizationProvokingVertexStateCreateInfoEXT-provokingVertexMode-parameter"); } } break; #ifdef VK_USE_PLATFORM_WIN32_KHR @@ -9020,52 +10393,110 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSurfaceFullScreenExclusiveInfoEXT structure members case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT: { // Covers // VUID-VkSurfaceFullScreenExclusiveInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_full_screen_exclusive)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT), but its parent extension " + "VK_EXT_full_screen_exclusive has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSurfaceFullScreenExclusiveInfoEXT); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_full_screen_exclusive))) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_full_screen_exclusive"); - } VkSurfaceFullScreenExclusiveInfoEXT* structure = (VkSurfaceFullScreenExclusiveInfoEXT*)header; - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::fullScreenExclusive), vvl::Enum::VkFullScreenExclusiveEXT, structure->fullScreenExclusive, - "VUID-VkSurfaceFullScreenExclusiveInfoEXT-fullScreenExclusive-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::fullScreenExclusive), vvl::Enum::VkFullScreenExclusiveEXT, + structure->fullScreenExclusive, + "VUID-VkSurfaceFullScreenExclusiveInfoEXT-fullScreenExclusive-parameter"); + } + } break; + + // Validation code for VkSurfaceCapabilitiesFullScreenExclusiveEXT structure members + case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT: { // Covers + // VUID-VkSurfaceCapabilitiesFullScreenExclusiveEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_full_screen_exclusive)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT), but its parent extension " + "VK_EXT_full_screen_exclusive has not been enabled."); } } break; - // No Validation code for VkSurfaceCapabilitiesFullScreenExclusiveEXT structure members -- Covers - // VUID-VkSurfaceCapabilitiesFullScreenExclusiveEXT-sType-sType + // Validation code for VkSurfaceFullScreenExclusiveWin32InfoEXT structure members + case VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT: { // Covers + // VUID-VkSurfaceFullScreenExclusiveWin32InfoEXT-sType-sType - // No Validation code for VkSurfaceFullScreenExclusiveWin32InfoEXT structure members -- Covers - // VUID-VkSurfaceFullScreenExclusiveWin32InfoEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_full_screen_exclusive)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT), but its parent extension " + "VK_EXT_full_screen_exclusive has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_WIN32_KHR - // No Validation code for VkMemoryMapPlacedInfoEXT structure members -- Covers VUID-VkMemoryMapPlacedInfoEXT-sType-sType + // Validation code for VkMemoryMapPlacedInfoEXT structure members + case VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT: { // Covers VUID-VkMemoryMapPlacedInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_map_memory_placed)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT), but " + "its parent extension " + "VK_EXT_map_memory_placed has not been enabled."); + } + } break; // Validation code for VkSurfacePresentModeEXT structure members case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT: { // Covers VUID-VkSurfacePresentModeEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_surface_maintenance1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT), but " + "its parent extension " + "VK_EXT_surface_maintenance1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSurfacePresentModeEXT); VkSurfacePresentModeEXT* structure = (VkSurfacePresentModeEXT*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::presentMode), vvl::Enum::VkPresentModeKHR, structure->presentMode, - "VUID-VkSurfacePresentModeEXT-presentMode-parameter", VK_NULL_HANDLE); + "VUID-VkSurfacePresentModeEXT-presentMode-parameter"); + } + } break; + + // Validation code for VkSurfacePresentScalingCapabilitiesEXT structure members + case VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT: { // Covers + // VUID-VkSurfacePresentScalingCapabilitiesEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_surface_maintenance1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT), but its parent extension " + "VK_EXT_surface_maintenance1 has not been enabled."); } } break; - // No Validation code for VkSurfacePresentScalingCapabilitiesEXT structure members -- Covers - // VUID-VkSurfacePresentScalingCapabilitiesEXT-sType-sType + // Validation code for VkSurfacePresentModeCompatibilityEXT structure members + case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: { // Covers + // VUID-VkSurfacePresentModeCompatibilityEXT-sType-sType - // No Validation code for VkSurfacePresentModeCompatibilityEXT structure members -- Covers - // VUID-VkSurfacePresentModeCompatibilityEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_surface_maintenance1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT), but its parent extension " + "VK_EXT_surface_maintenance1 has not been enabled."); + } + } break; // Validation code for VkSwapchainPresentFenceInfoEXT structure members case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT: { // Covers VUID-VkSwapchainPresentFenceInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_swapchain_maintenance1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT), but its parent extension " + "VK_EXT_swapchain_maintenance1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSwapchainPresentFenceInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_swapchain_maintenance1"); - } VkSwapchainPresentFenceInfoEXT* structure = (VkSwapchainPresentFenceInfoEXT*)header; skip |= ValidateArray(pNext_loc.dot(Field::swapchainCount), pNext_loc.dot(Field::pFences), structure->swapchainCount, &structure->pFences, true, false, @@ -9077,12 +10508,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSwapchainPresentModesCreateInfoEXT structure members case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT: { // Covers // VUID-VkSwapchainPresentModesCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_swapchain_maintenance1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_swapchain_maintenance1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSwapchainPresentModesCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_swapchain_maintenance1"); - } VkSwapchainPresentModesCreateInfoEXT* structure = (VkSwapchainPresentModesCreateInfoEXT*)header; skip |= ValidateRangedEnumArray(pNext_loc.dot(Field::presentModeCount), pNext_loc.dot(Field::pPresentModes), @@ -9094,12 +10528,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSwapchainPresentModeInfoEXT structure members case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT: { // Covers VUID-VkSwapchainPresentModeInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_swapchain_maintenance1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT), " + "but its parent extension " + "VK_EXT_swapchain_maintenance1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSwapchainPresentModeInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_swapchain_maintenance1"); - } VkSwapchainPresentModeInfoEXT* structure = (VkSwapchainPresentModeInfoEXT*)header; skip |= ValidateRangedEnumArray(pNext_loc.dot(Field::swapchainCount), pNext_loc.dot(Field::pPresentModes), vvl::Enum::VkPresentModeKHR, structure->swapchainCount, structure->pPresentModes, @@ -9111,23 +10548,26 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSwapchainPresentScalingCreateInfoEXT structure members case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT: { // Covers // VUID-VkSwapchainPresentScalingCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_swapchain_maintenance1)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_swapchain_maintenance1 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSwapchainPresentScalingCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_swapchain_maintenance1"); - } VkSwapchainPresentScalingCreateInfoEXT* structure = (VkSwapchainPresentScalingCreateInfoEXT*)header; skip |= ValidateFlags(pNext_loc.dot(Field::scalingBehavior), vvl::FlagBitmask::VkPresentScalingFlagBitsEXT, - AllVkPresentScalingFlagBitsEXT, structure->scalingBehavior, kOptionalFlags, VK_NULL_HANDLE, + AllVkPresentScalingFlagBitsEXT, structure->scalingBehavior, kOptionalFlags, "VUID-VkSwapchainPresentScalingCreateInfoEXT-scalingBehavior-parameter"); skip |= ValidateFlags(pNext_loc.dot(Field::presentGravityX), vvl::FlagBitmask::VkPresentGravityFlagBitsEXT, - AllVkPresentGravityFlagBitsEXT, structure->presentGravityX, kOptionalFlags, VK_NULL_HANDLE, + AllVkPresentGravityFlagBitsEXT, structure->presentGravityX, kOptionalFlags, "VUID-VkSwapchainPresentScalingCreateInfoEXT-presentGravityX-parameter"); skip |= ValidateFlags(pNext_loc.dot(Field::presentGravityY), vvl::FlagBitmask::VkPresentGravityFlagBitsEXT, - AllVkPresentGravityFlagBitsEXT, structure->presentGravityY, kOptionalFlags, VK_NULL_HANDLE, + AllVkPresentGravityFlagBitsEXT, structure->presentGravityY, kOptionalFlags, "VUID-VkSwapchainPresentScalingCreateInfoEXT-presentGravityY-parameter"); } } break; @@ -9135,12 +10575,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkGraphicsPipelineShaderGroupsCreateInfoNV structure members case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV: { // Covers // VUID-VkGraphicsPipelineShaderGroupsCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_device_generated_commands)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV), but its parent extension " + "VK_NV_device_generated_commands has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkGraphicsPipelineShaderGroupsCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_device_generated_commands"); - } VkGraphicsPipelineShaderGroupsCreateInfoNV* structure = (VkGraphicsPipelineShaderGroupsCreateInfoNV*)header; skip |= ValidateStructTypeArray(pNext_loc.dot(Field::groupCount), pNext_loc.dot(Field::pGroups), structure->groupCount, @@ -9151,9 +10594,9 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const if (structure->pGroups != nullptr) { for (uint32_t groupIndex = 0; groupIndex < structure->groupCount; ++groupIndex) { [[maybe_unused]] const Location pGroups_loc = pNext_loc.dot(Field::pGroups, groupIndex); - skip |= ValidateStructPnext( - pGroups_loc, structure->pGroups[groupIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkGraphicsShaderGroupCreateInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= ValidateStructPnext(pGroups_loc, structure->pGroups[groupIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, + "VUID-VkGraphicsShaderGroupCreateInfoNV-pNext-pNext", kVUIDUndefined, true); skip |= ValidateStructTypeArray(pGroups_loc.dot(Field::stageCount), pGroups_loc.dot(Field::pStages), structure->pGroups[groupIndex].stageCount, @@ -9175,23 +10618,23 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext( - pStages_loc, structure->pGroups[groupIndex].pStages[stageIndex].pNext, - allowed_structs_VkPipelineShaderStageCreateInfo.size(), - allowed_structs_VkPipelineShaderStageCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", - "VUID-VkPipelineShaderStageCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= ValidateStructPnext(pStages_loc, structure->pGroups[groupIndex].pStages[stageIndex].pNext, + allowed_structs_VkPipelineShaderStageCreateInfo.size(), + allowed_structs_VkPipelineShaderStageCreateInfo.data(), + GeneratedVulkanHeaderVersion, + "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", + "VUID-VkPipelineShaderStageCreateInfo-sType-unique", true); skip |= ValidateFlags(pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, AllVkPipelineShaderStageCreateFlagBits, structure->pGroups[groupIndex].pStages[stageIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); skip |= ValidateFlags(pStages_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, structure->pGroups[groupIndex].pStages[stageIndex].stage, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); skip |= ValidateRequiredPointer(pStages_loc.dot(Field::pName), @@ -9239,37 +10682,62 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkCommandBufferInheritanceViewportScissorInfoNV structure members case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV: { // Covers // VUID-VkCommandBufferInheritanceViewportScissorInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_inherited_viewport_scissor)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV), but its parent extension " + "VK_NV_inherited_viewport_scissor has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkCommandBufferInheritanceViewportScissorInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_inherited_viewport_scissor)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_inherited_viewport_scissor"); - } VkCommandBufferInheritanceViewportScissorInfoNV* structure = (VkCommandBufferInheritanceViewportScissorInfoNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::viewportScissor2D), structure->viewportScissor2D); } } break; - // No Validation code for VkRenderPassTransformBeginInfoQCOM structure members -- Covers - // VUID-VkRenderPassTransformBeginInfoQCOM-sType-sType + // Validation code for VkRenderPassTransformBeginInfoQCOM structure members + case VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM: { // Covers + // VUID-VkRenderPassTransformBeginInfoQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_render_pass_transform)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM), but its parent extension " + "VK_QCOM_render_pass_transform has not been enabled."); + } + } break; + + // Validation code for VkCommandBufferInheritanceRenderPassTransformInfoQCOM structure members + case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM: { // Covers + // VUID-VkCommandBufferInheritanceRenderPassTransformInfoQCOM-sType-sType - // No Validation code for VkCommandBufferInheritanceRenderPassTransformInfoQCOM structure members -- Covers - // VUID-VkCommandBufferInheritanceRenderPassTransformInfoQCOM-sType-sType + if (!IsExtEnabled(exts.vk_qcom_render_pass_transform)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM), but its parent extension " + "VK_QCOM_render_pass_transform has not been enabled."); + } + } break; // Validation code for VkDepthBiasRepresentationInfoEXT structure members case VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT: { // Covers VUID-VkDepthBiasRepresentationInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_bias_control)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT), but its parent extension " + "VK_EXT_depth_bias_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDepthBiasRepresentationInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_bias_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_depth_bias_control"); - } VkDepthBiasRepresentationInfoEXT* structure = (VkDepthBiasRepresentationInfoEXT*)header; - skip |= - ValidateRangedEnum(pNext_loc.dot(Field::depthBiasRepresentation), vvl::Enum::VkDepthBiasRepresentationEXT, - structure->depthBiasRepresentation, - "VUID-VkDepthBiasRepresentationInfoEXT-depthBiasRepresentation-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::depthBiasRepresentation), vvl::Enum::VkDepthBiasRepresentationEXT, + structure->depthBiasRepresentation, + "VUID-VkDepthBiasRepresentationInfoEXT-depthBiasRepresentation-parameter"); skip |= ValidateBool32(pNext_loc.dot(Field::depthBiasExact), structure->depthBiasExact); } @@ -9278,12 +10746,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceDeviceMemoryReportCreateInfoEXT structure members case VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT: { // Covers // VUID-VkDeviceDeviceMemoryReportCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_device_memory_report)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_device_memory_report has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceDeviceMemoryReportCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_device_memory_report)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_device_memory_report"); - } VkDeviceDeviceMemoryReportCreateInfoEXT* structure = (VkDeviceDeviceMemoryReportCreateInfoEXT*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, "VUID-VkDeviceDeviceMemoryReportCreateInfoEXT-flags-zerobitmask"); @@ -9300,30 +10771,45 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSamplerCustomBorderColorCreateInfoEXT structure members case VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT: { // Covers // VUID-VkSamplerCustomBorderColorCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_custom_border_color)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_custom_border_color has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSamplerCustomBorderColorCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_custom_border_color)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_custom_border_color"); - } VkSamplerCustomBorderColorCreateInfoEXT* structure = (VkSamplerCustomBorderColorCreateInfoEXT*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::format), vvl::Enum::VkFormat, structure->format, - "VUID-VkSamplerCustomBorderColorCreateInfoEXT-format-parameter", VK_NULL_HANDLE); + "VUID-VkSamplerCustomBorderColorCreateInfoEXT-format-parameter"); } } break; - // No Validation code for VkSurfaceCapabilitiesPresentBarrierNV structure members -- Covers - // VUID-VkSurfaceCapabilitiesPresentBarrierNV-sType-sType + // Validation code for VkSurfaceCapabilitiesPresentBarrierNV structure members + case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV: { // Covers + // VUID-VkSurfaceCapabilitiesPresentBarrierNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_present_barrier)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV), but its parent extension " + "VK_NV_present_barrier has not been enabled."); + } + } break; // Validation code for VkSwapchainPresentBarrierCreateInfoNV structure members case VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV: { // Covers // VUID-VkSwapchainPresentBarrierCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_present_barrier)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV), but its parent extension " + "VK_NV_present_barrier has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSwapchainPresentBarrierCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_present_barrier)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_present_barrier"); - } VkSwapchainPresentBarrierCreateInfoNV* structure = (VkSwapchainPresentBarrierCreateInfoNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::presentBarrierEnable), structure->presentBarrierEnable); } @@ -9332,26 +10818,33 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceDiagnosticsConfigCreateInfoNV structure members case VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV: { // Covers // VUID-VkDeviceDiagnosticsConfigCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_device_diagnostics_config)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV), but its parent extension " + "VK_NV_device_diagnostics_config has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceDiagnosticsConfigCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_device_diagnostics_config)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_device_diagnostics_config"); - } VkDeviceDiagnosticsConfigCreateInfoNV* structure = (VkDeviceDiagnosticsConfigCreateInfoNV*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkDeviceDiagnosticsConfigFlagBitsNV, - AllVkDeviceDiagnosticsConfigFlagBitsNV, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkDeviceDiagnosticsConfigFlagBitsNV, structure->flags, kOptionalFlags, "VUID-VkDeviceDiagnosticsConfigCreateInfoNV-flags-parameter"); } } break; // Validation code for VkQueryLowLatencySupportNV structure members case VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV: { // Covers VUID-VkQueryLowLatencySupportNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_low_latency)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV), " + "but its parent extension " + "VK_NV_low_latency has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkQueryLowLatencySupportNV); - if (!IsExtEnabled(device_extensions.vk_nv_low_latency)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_low_latency"); - } VkQueryLowLatencySupportNV* structure = (VkQueryLowLatencySupportNV*)header; skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pQueriedLowLatencyData), structure->pQueriedLowLatencyData, "VUID-VkQueryLowLatencySupportNV-pQueriedLowLatencyData-parameter"); @@ -9361,30 +10854,44 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkExportMetalObjectCreateInfoEXT structure members case VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT: { // Covers VUID-VkExportMetalObjectCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportMetalObjectCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_metal_objects)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_metal_objects"); - } VkExportMetalObjectCreateInfoEXT* structure = (VkExportMetalObjectCreateInfoEXT*)header; skip |= ValidateFlags(pNext_loc.dot(Field::exportObjectType), vvl::FlagBitmask::VkExportMetalObjectTypeFlagBitsEXT, AllVkExportMetalObjectTypeFlagBitsEXT, structure->exportObjectType, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkExportMetalObjectCreateInfoEXT-exportObjectType-parameter"); + "VUID-VkExportMetalObjectCreateInfoEXT-exportObjectType-parameter"); } } break; - // No Validation code for VkExportMetalDeviceInfoEXT structure members -- Covers - // VUID-VkExportMetalDeviceInfoEXT-sType-sType + // Validation code for VkExportMetalDeviceInfoEXT structure members + case VK_STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT: { // Covers VUID-VkExportMetalDeviceInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT), " + "but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } + } break; // Validation code for VkExportMetalCommandQueueInfoEXT structure members case VK_STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT: { // Covers VUID-VkExportMetalCommandQueueInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT), but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportMetalCommandQueueInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_metal_objects)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_metal_objects"); - } VkExportMetalCommandQueueInfoEXT* structure = (VkExportMetalCommandQueueInfoEXT*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::queue), structure->queue); } @@ -9392,85 +10899,133 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkExportMetalBufferInfoEXT structure members case VK_STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT: { // Covers VUID-VkExportMetalBufferInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT), " + "but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportMetalBufferInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_metal_objects)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_metal_objects"); - } VkExportMetalBufferInfoEXT* structure = (VkExportMetalBufferInfoEXT*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::memory), structure->memory); } } break; - // No Validation code for VkImportMetalBufferInfoEXT structure members -- Covers - // VUID-VkImportMetalBufferInfoEXT-sType-sType + // Validation code for VkImportMetalBufferInfoEXT structure members + case VK_STRUCTURE_TYPE_IMPORT_METAL_BUFFER_INFO_EXT: { // Covers VUID-VkImportMetalBufferInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMPORT_METAL_BUFFER_INFO_EXT), " + "but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } + } break; // Validation code for VkExportMetalTextureInfoEXT structure members case VK_STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT: { // Covers VUID-VkExportMetalTextureInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT), " + "but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } if (is_const_param) { - [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportMetalTextureInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_metal_objects)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_metal_objects"); - } + [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportMetalTextureInfoEXT); VkExportMetalTextureInfoEXT* structure = (VkExportMetalTextureInfoEXT*)header; - skip |= ValidateFlags(pNext_loc.dot(Field::plane), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, structure->plane, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkExportMetalTextureInfoEXT-plane-parameter", - "VUID-VkExportMetalTextureInfoEXT-plane-parameter"); + skip |= + ValidateFlags(pNext_loc.dot(Field::plane), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, + structure->plane, kRequiredSingleBit, "VUID-VkExportMetalTextureInfoEXT-plane-parameter", + "VUID-VkExportMetalTextureInfoEXT-plane-parameter"); } } break; // Validation code for VkImportMetalTextureInfoEXT structure members case VK_STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT: { // Covers VUID-VkImportMetalTextureInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT), " + "but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImportMetalTextureInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_metal_objects)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_metal_objects"); - } VkImportMetalTextureInfoEXT* structure = (VkImportMetalTextureInfoEXT*)header; - skip |= ValidateFlags(pNext_loc.dot(Field::plane), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, structure->plane, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkImportMetalTextureInfoEXT-plane-parameter", - "VUID-VkImportMetalTextureInfoEXT-plane-parameter"); + skip |= + ValidateFlags(pNext_loc.dot(Field::plane), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, + structure->plane, kRequiredSingleBit, "VUID-VkImportMetalTextureInfoEXT-plane-parameter", + "VUID-VkImportMetalTextureInfoEXT-plane-parameter"); } } break; // Validation code for VkExportMetalIOSurfaceInfoEXT structure members case VK_STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT: { // Covers VUID-VkExportMetalIOSurfaceInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT), but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExportMetalIOSurfaceInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_metal_objects)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_metal_objects"); - } VkExportMetalIOSurfaceInfoEXT* structure = (VkExportMetalIOSurfaceInfoEXT*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::image), structure->image); } } break; - // No Validation code for VkImportMetalIOSurfaceInfoEXT structure members -- Covers - // VUID-VkImportMetalIOSurfaceInfoEXT-sType-sType + // Validation code for VkImportMetalIOSurfaceInfoEXT structure members + case VK_STRUCTURE_TYPE_IMPORT_METAL_IO_SURFACE_INFO_EXT: { // Covers VUID-VkImportMetalIOSurfaceInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMPORT_METAL_IO_SURFACE_INFO_EXT), but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } + } break; + + // Validation code for VkExportMetalSharedEventInfoEXT structure members + case VK_STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT: { // Covers VUID-VkExportMetalSharedEventInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT), but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } + } break; - // No Validation code for VkExportMetalSharedEventInfoEXT structure members -- Covers - // VUID-VkExportMetalSharedEventInfoEXT-sType-sType + // Validation code for VkImportMetalSharedEventInfoEXT structure members + case VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT: { // Covers VUID-VkImportMetalSharedEventInfoEXT-sType-sType - // No Validation code for VkImportMetalSharedEventInfoEXT structure members -- Covers - // VUID-VkImportMetalSharedEventInfoEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_metal_objects)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT), but its parent extension " + "VK_EXT_metal_objects has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_METAL_EXT // Validation code for VkDescriptorBufferBindingPushDescriptorBufferHandleEXT structure members case VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT: { // Covers // VUID-VkDescriptorBufferBindingPushDescriptorBufferHandleEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT), but its parent extension " + "VK_EXT_descriptor_buffer has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDescriptorBufferBindingPushDescriptorBufferHandleEXT); - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_descriptor_buffer"); - } VkDescriptorBufferBindingPushDescriptorBufferHandleEXT* structure = (VkDescriptorBufferBindingPushDescriptorBufferHandleEXT*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::buffer), structure->buffer); @@ -9480,12 +11035,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkOpaqueCaptureDescriptorDataCreateInfoEXT structure members case VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT: { // Covers // VUID-VkOpaqueCaptureDescriptorDataCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_descriptor_buffer has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkOpaqueCaptureDescriptorDataCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_descriptor_buffer"); - } VkOpaqueCaptureDescriptorDataCreateInfoEXT* structure = (VkOpaqueCaptureDescriptorDataCreateInfoEXT*)header; skip |= ValidateRequiredPointer( pNext_loc.dot(Field::opaqueCaptureDescriptorData), structure->opaqueCaptureDescriptorData, @@ -9496,61 +11054,112 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkGraphicsPipelineLibraryCreateInfoEXT structure members case VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT: { // Covers // VUID-VkGraphicsPipelineLibraryCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_graphics_pipeline_library)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_graphics_pipeline_library has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkGraphicsPipelineLibraryCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_graphics_pipeline_library"); - } VkGraphicsPipelineLibraryCreateInfoEXT* structure = (VkGraphicsPipelineLibraryCreateInfoEXT*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkGraphicsPipelineLibraryFlagBitsEXT, - AllVkGraphicsPipelineLibraryFlagBitsEXT, structure->flags, kRequiredFlags, VK_NULL_HANDLE, + AllVkGraphicsPipelineLibraryFlagBitsEXT, structure->flags, kRequiredFlags, "VUID-VkGraphicsPipelineLibraryCreateInfoEXT-flags-parameter", "VUID-VkGraphicsPipelineLibraryCreateInfoEXT-flags-requiredbitmask"); } } break; - // No Validation code for VkPipelineFragmentShadingRateEnumStateCreateInfoNV structure members -- Covers - // VUID-VkPipelineFragmentShadingRateEnumStateCreateInfoNV-sType-sType + // Validation code for VkPipelineFragmentShadingRateEnumStateCreateInfoNV structure members + case VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV: { // Covers + // VUID-VkPipelineFragmentShadingRateEnumStateCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_fragment_shading_rate_enums)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV), but its parent extension " + "VK_NV_fragment_shading_rate_enums has not been enabled."); + } + } break; + + // Validation code for VkAccelerationStructureGeometryMotionTrianglesDataNV structure members + case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV: { // Covers + // VUID-VkAccelerationStructureGeometryMotionTrianglesDataNV-sType-sType - // No Validation code for VkAccelerationStructureGeometryMotionTrianglesDataNV structure members -- Covers - // VUID-VkAccelerationStructureGeometryMotionTrianglesDataNV-sType-sType + if (!IsExtEnabled(exts.vk_nv_ray_tracing_motion_blur)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV), but its parent extension " + "VK_NV_ray_tracing_motion_blur has not been enabled."); + } + } break; // Validation code for VkAccelerationStructureMotionInfoNV structure members case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV: { // Covers // VUID-VkAccelerationStructureMotionInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_ray_tracing_motion_blur)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV), but its parent extension " + "VK_NV_ray_tracing_motion_blur has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkAccelerationStructureMotionInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing_motion_blur)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_ray_tracing_motion_blur"); - } VkAccelerationStructureMotionInfoNV* structure = (VkAccelerationStructureMotionInfoNV*)header; skip |= ValidateReservedFlags(pNext_loc.dot(Field::flags), structure->flags, "VUID-VkAccelerationStructureMotionInfoNV-flags-zerobitmask"); } } break; - // No Validation code for VkCopyCommandTransformInfoQCOM structure members -- Covers - // VUID-VkCopyCommandTransformInfoQCOM-sType-sType + // Validation code for VkCopyCommandTransformInfoQCOM structure members + case VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM: { // Covers VUID-VkCopyCommandTransformInfoQCOM-sType-sType - // No Validation code for VkImageCompressionControlEXT structure members -- Covers - // VUID-VkImageCompressionControlEXT-sType-sType + if (!IsExtEnabled(exts.vk_qcom_rotated_copy_commands)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM), but its parent extension " + "VK_QCOM_rotated_copy_commands has not been enabled."); + } + } break; + + // Validation code for VkImageCompressionControlEXT structure members + case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT: { // Covers VUID-VkImageCompressionControlEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_compression_control)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT), " + "but its parent extension " + "VK_EXT_image_compression_control has not been enabled."); + } + } break; + + // Validation code for VkImageCompressionPropertiesEXT structure members + case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: { // Covers VUID-VkImageCompressionPropertiesEXT-sType-sType - // No Validation code for VkImageCompressionPropertiesEXT structure members -- Covers - // VUID-VkImageCompressionPropertiesEXT-sType-sType + if (!IsExtEnabled(exts.vk_ext_image_compression_control)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT), but its parent extension " + "VK_EXT_image_compression_control has not been enabled."); + } + } break; // Validation code for VkMutableDescriptorTypeCreateInfoEXT structure members case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT: { // Covers // VUID-VkMutableDescriptorTypeCreateInfoEXT-sType-sType + + if ((!IsExtEnabled(exts.vk_ext_mutable_descriptor_type)) && (!IsExtEnabled(exts.vk_valve_mutable_descriptor_type))) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_mutable_descriptor_type, or VK_VALVE_mutable_descriptor_type has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkMutableDescriptorTypeCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_valve_mutable_descriptor_type) && - !IsExtEnabled(device_extensions.vk_ext_mutable_descriptor_type)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_VALVE_mutable_descriptor_type or " - "VK_EXT_mutable_descriptor_type"); - } VkMutableDescriptorTypeCreateInfoEXT* structure = (VkMutableDescriptorTypeCreateInfoEXT*)header; skip |= ValidateArray(pNext_loc.dot(Field::mutableDescriptorTypeListCount), pNext_loc.dot(Field::pMutableDescriptorTypeLists), structure->mutableDescriptorTypeListCount, @@ -9577,32 +11186,39 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDeviceAddressBindingCallbackDataEXT structure members case VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT: { // Covers // VUID-VkDeviceAddressBindingCallbackDataEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_device_address_binding_report)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT), but its parent extension " + "VK_EXT_device_address_binding_report has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDeviceAddressBindingCallbackDataEXT); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_ext_device_address_binding_report))) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_device_address_binding_report"); - } VkDeviceAddressBindingCallbackDataEXT* structure = (VkDeviceAddressBindingCallbackDataEXT*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkDeviceAddressBindingFlagBitsEXT, - AllVkDeviceAddressBindingFlagBitsEXT, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkDeviceAddressBindingFlagBitsEXT, structure->flags, kOptionalFlags, "VUID-VkDeviceAddressBindingCallbackDataEXT-flags-parameter"); - skip |= ValidateRangedEnum(pNext_loc.dot(Field::bindingType), vvl::Enum::VkDeviceAddressBindingTypeEXT, - structure->bindingType, - "VUID-VkDeviceAddressBindingCallbackDataEXT-bindingType-parameter", VK_NULL_HANDLE); + skip |= + ValidateRangedEnum(pNext_loc.dot(Field::bindingType), vvl::Enum::VkDeviceAddressBindingTypeEXT, + structure->bindingType, "VUID-VkDeviceAddressBindingCallbackDataEXT-bindingType-parameter"); } } break; // Validation code for VkPipelineViewportDepthClipControlCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineViewportDepthClipControlCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_clip_control)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_depth_clip_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineViewportDepthClipControlCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_clip_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_depth_clip_control"); - } VkPipelineViewportDepthClipControlCreateInfoEXT* structure = (VkPipelineViewportDepthClipControlCreateInfoEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::negativeOneToOne), structure->negativeOneToOne); @@ -9613,28 +11229,34 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkImportMemoryZirconHandleInfoFUCHSIA structure members case VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA: { // Covers // VUID-VkImportMemoryZirconHandleInfoFUCHSIA-sType-sType + + if (!IsExtEnabled(exts.vk_fuchsia_external_memory)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA), but its parent extension " + "VK_FUCHSIA_external_memory has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImportMemoryZirconHandleInfoFUCHSIA); - if (!IsExtEnabled(device_extensions.vk_fuchsia_external_memory)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_FUCHSIA_external_memory"); - } VkImportMemoryZirconHandleInfoFUCHSIA* structure = (VkImportMemoryZirconHandleInfoFUCHSIA*)header; skip |= ValidateFlags(pNext_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, AllVkExternalMemoryHandleTypeFlagBits, structure->handleType, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkImportMemoryZirconHandleInfoFUCHSIA-handleType-parameter"); + "VUID-VkImportMemoryZirconHandleInfoFUCHSIA-handleType-parameter"); } } break; // Validation code for VkImportMemoryBufferCollectionFUCHSIA structure members case VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA: { // Covers // VUID-VkImportMemoryBufferCollectionFUCHSIA-sType-sType + + if (!IsExtEnabled(exts.vk_fuchsia_buffer_collection)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA), but its parent extension " + "VK_FUCHSIA_buffer_collection has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkImportMemoryBufferCollectionFUCHSIA); - if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_FUCHSIA_buffer_collection"); - } VkImportMemoryBufferCollectionFUCHSIA* structure = (VkImportMemoryBufferCollectionFUCHSIA*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::collection), structure->collection); } @@ -9643,12 +11265,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkBufferCollectionImageCreateInfoFUCHSIA structure members case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA: { // Covers // VUID-VkBufferCollectionImageCreateInfoFUCHSIA-sType-sType + + if (!IsExtEnabled(exts.vk_fuchsia_buffer_collection)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA), but its parent extension " + "VK_FUCHSIA_buffer_collection has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBufferCollectionImageCreateInfoFUCHSIA); - if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_FUCHSIA_buffer_collection"); - } VkBufferCollectionImageCreateInfoFUCHSIA* structure = (VkBufferCollectionImageCreateInfoFUCHSIA*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::collection), structure->collection); } @@ -9657,12 +11282,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkBufferCollectionBufferCreateInfoFUCHSIA structure members case VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA: { // Covers // VUID-VkBufferCollectionBufferCreateInfoFUCHSIA-sType-sType + + if (!IsExtEnabled(exts.vk_fuchsia_buffer_collection)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA), but its parent extension " + "VK_FUCHSIA_buffer_collection has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBufferCollectionBufferCreateInfoFUCHSIA); - if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_FUCHSIA_buffer_collection"); - } VkBufferCollectionBufferCreateInfoFUCHSIA* structure = (VkBufferCollectionBufferCreateInfoFUCHSIA*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::collection), structure->collection); } @@ -9672,12 +11300,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSubpassShadingPipelineCreateInfoHUAWEI structure members case VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI: { // Covers // VUID-VkSubpassShadingPipelineCreateInfoHUAWEI-sType-sType + + if (!IsExtEnabled(exts.vk_huawei_subpass_shading)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI), but its parent extension " + "VK_HUAWEI_subpass_shading has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSubpassShadingPipelineCreateInfoHUAWEI); - if (!IsExtEnabled(device_extensions.vk_huawei_subpass_shading)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_HUAWEI_subpass_shading"); - } VkSubpassShadingPipelineCreateInfoHUAWEI* structure = (VkSubpassShadingPipelineCreateInfoHUAWEI*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::renderPass), structure->renderPass); } @@ -9685,37 +11316,52 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkFrameBoundaryEXT structure members case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: { // Covers VUID-VkFrameBoundaryEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_frame_boundary)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT), but its parent extension " + "VK_EXT_frame_boundary has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkFrameBoundaryEXT); - if (!IsExtEnabled(device_extensions.vk_ext_frame_boundary)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_EXT_frame_boundary"); - } VkFrameBoundaryEXT* structure = (VkFrameBoundaryEXT*)header; skip |= ValidateFlags(pNext_loc.dot(Field::flags), vvl::FlagBitmask::VkFrameBoundaryFlagBitsEXT, - AllVkFrameBoundaryFlagBitsEXT, structure->flags, kOptionalFlags, VK_NULL_HANDLE, + AllVkFrameBoundaryFlagBitsEXT, structure->flags, kOptionalFlags, "VUID-VkFrameBoundaryEXT-flags-parameter"); } } break; - // No Validation code for VkSubpassResolvePerformanceQueryEXT structure members -- Covers - // VUID-VkSubpassResolvePerformanceQueryEXT-sType-sType + // Validation code for VkSubpassResolvePerformanceQueryEXT structure members + case VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT: { // Covers + // VUID-VkSubpassResolvePerformanceQueryEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_multisampled_render_to_single_sampled)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT), but its parent extension " + "VK_EXT_multisampled_render_to_single_sampled has not been enabled."); + } + } break; // Validation code for VkMultisampledRenderToSingleSampledInfoEXT structure members case VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT: { // Covers // VUID-VkMultisampledRenderToSingleSampledInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_multisampled_render_to_single_sampled)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT), but its parent extension " + "VK_EXT_multisampled_render_to_single_sampled has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkMultisampledRenderToSingleSampledInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_multisampled_render_to_single_sampled)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_multisampled_render_to_single_sampled"); - } VkMultisampledRenderToSingleSampledInfoEXT* structure = (VkMultisampledRenderToSingleSampledInfoEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::multisampledRenderToSingleSampledEnable), structure->multisampledRenderToSingleSampledEnable); skip |= ValidateFlags(pNext_loc.dot(Field::rasterizationSamples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, structure->rasterizationSamples, kRequiredSingleBit, VK_NULL_HANDLE, + AllVkSampleCountFlagBits, structure->rasterizationSamples, kRequiredSingleBit, "VUID-VkMultisampledRenderToSingleSampledInfoEXT-rasterizationSamples-parameter", "VUID-VkMultisampledRenderToSingleSampledInfoEXT-rasterizationSamples-parameter"); } @@ -9723,12 +11369,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineColorWriteCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT: { // Covers VUID-VkPipelineColorWriteCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_color_write_enable)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_color_write_enable has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineColorWriteCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_color_write_enable)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_color_write_enable"); - } VkPipelineColorWriteCreateInfoEXT* structure = (VkPipelineColorWriteCreateInfoEXT*)header; skip |= ValidateBool32Array(pNext_loc.dot(Field::attachmentCount), pNext_loc.dot(Field::pColorWriteEnables), structure->attachmentCount, structure->pColorWriteEnables, false, true, kVUIDUndefined, @@ -9736,23 +11385,34 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkImageViewMinLodCreateInfoEXT structure members -- Covers - // VUID-VkImageViewMinLodCreateInfoEXT-sType-sType + // Validation code for VkImageViewMinLodCreateInfoEXT structure members + case VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT: { // Covers VUID-VkImageViewMinLodCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_view_min_lod)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_image_view_min_lod has not been enabled."); + } + } break; // Validation code for VkAccelerationStructureTrianglesOpacityMicromapEXT structure members case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT: { // Covers // VUID-VkAccelerationStructureTrianglesOpacityMicromapEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT), but its parent extension " + "VK_EXT_opacity_micromap has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkAccelerationStructureTrianglesOpacityMicromapEXT); - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_opacity_micromap"); - } VkAccelerationStructureTrianglesOpacityMicromapEXT* structure = (VkAccelerationStructureTrianglesOpacityMicromapEXT*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::indexType), vvl::Enum::VkIndexType, structure->indexType, - "VUID-VkAccelerationStructureTrianglesOpacityMicromapEXT-indexType-parameter", - VK_NULL_HANDLE); + "VUID-VkAccelerationStructureTrianglesOpacityMicromapEXT-indexType-parameter"); if (structure->pUsageCounts != nullptr) { for (uint32_t usageIndexsIndex = 0; usageIndexsIndex < structure->usageCountsCount; ++usageIndexsIndex) { @@ -9772,29 +11432,30 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkAccelerationStructureTrianglesDisplacementMicromapNV structure members case VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_DISPLACEMENT_MICROMAP_NV: { // Covers // VUID-VkAccelerationStructureTrianglesDisplacementMicromapNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_displacement_micromap)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_DISPLACEMENT_MICROMAP_NV), but its parent extension " + "VK_NV_displacement_micromap has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkAccelerationStructureTrianglesDisplacementMicromapNV); - if (!IsExtEnabled(device_extensions.vk_nv_displacement_micromap)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_NV_displacement_micromap"); - } VkAccelerationStructureTrianglesDisplacementMicromapNV* structure = (VkAccelerationStructureTrianglesDisplacementMicromapNV*)header; skip |= ValidateRangedEnum( pNext_loc.dot(Field::displacementBiasAndScaleFormat), vvl::Enum::VkFormat, structure->displacementBiasAndScaleFormat, - "VUID-VkAccelerationStructureTrianglesDisplacementMicromapNV-displacementBiasAndScaleFormat-parameter", - VK_NULL_HANDLE); + "VUID-VkAccelerationStructureTrianglesDisplacementMicromapNV-displacementBiasAndScaleFormat-parameter"); skip |= ValidateRangedEnum( pNext_loc.dot(Field::displacementVectorFormat), vvl::Enum::VkFormat, structure->displacementVectorFormat, - "VUID-VkAccelerationStructureTrianglesDisplacementMicromapNV-displacementVectorFormat-parameter", - VK_NULL_HANDLE); + "VUID-VkAccelerationStructureTrianglesDisplacementMicromapNV-displacementVectorFormat-parameter"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::indexType), vvl::Enum::VkIndexType, structure->indexType, - "VUID-VkAccelerationStructureTrianglesDisplacementMicromapNV-indexType-parameter", - VK_NULL_HANDLE); + "VUID-VkAccelerationStructureTrianglesDisplacementMicromapNV-indexType-parameter"); if (structure->pUsageCounts != nullptr) { for (uint32_t usageIndexsIndex = 0; usageIndexsIndex < structure->usageCountsCount; ++usageIndexsIndex) { @@ -9814,13 +11475,17 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_VRS_FEATURES_HUAWEI: { // Covers // VUID-VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI-sType-sType + + if (!IsExtEnabled(exts.vk_huawei_cluster_culling_shader)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_VRS_FEATURES_HUAWEI), but its parent extension " + "VK_HUAWEI_cluster_culling_shader has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI); - if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_HUAWEI_cluster_culling_shader"); - } VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI* structure = (VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI*)header; skip |= ValidateBool32(pNext_loc.dot(Field::clusterShadingRate), structure->clusterShadingRate); @@ -9830,44 +11495,69 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSamplerBorderColorComponentMappingCreateInfoEXT structure members case VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT: { // Covers // VUID-VkSamplerBorderColorComponentMappingCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_border_color_swizzle)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_border_color_swizzle has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSamplerBorderColorComponentMappingCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_border_color_swizzle)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_border_color_swizzle"); - } VkSamplerBorderColorComponentMappingCreateInfoEXT* structure = (VkSamplerBorderColorComponentMappingCreateInfoEXT*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::r), vvl::Enum::VkComponentSwizzle, structure->components.r, - "VUID-VkComponentMapping-r-parameter", VK_NULL_HANDLE); + "VUID-VkComponentMapping-r-parameter"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::g), vvl::Enum::VkComponentSwizzle, structure->components.g, - "VUID-VkComponentMapping-g-parameter", VK_NULL_HANDLE); + "VUID-VkComponentMapping-g-parameter"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::b), vvl::Enum::VkComponentSwizzle, structure->components.b, - "VUID-VkComponentMapping-b-parameter", VK_NULL_HANDLE); + "VUID-VkComponentMapping-b-parameter"); skip |= ValidateRangedEnum(pNext_loc.dot(Field::a), vvl::Enum::VkComponentSwizzle, structure->components.a, - "VUID-VkComponentMapping-a-parameter", VK_NULL_HANDLE); + "VUID-VkComponentMapping-a-parameter"); skip |= ValidateBool32(pNext_loc.dot(Field::srgb), structure->srgb); } } break; - // No Validation code for VkDeviceQueueShaderCoreControlCreateInfoARM structure members -- Covers - // VUID-VkDeviceQueueShaderCoreControlCreateInfoARM-sType-sType + // Validation code for VkDeviceQueueShaderCoreControlCreateInfoARM structure members + case VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM: { // Covers + // VUID-VkDeviceQueueShaderCoreControlCreateInfoARM-sType-sType - // No Validation code for VkImageViewSlicedCreateInfoEXT structure members -- Covers - // VUID-VkImageViewSlicedCreateInfoEXT-sType-sType + if (!IsExtEnabled(exts.vk_arm_scheduling_controls)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM), but its parent extension " + "VK_ARM_scheduling_controls has not been enabled."); + } + } break; + + // Validation code for VkImageViewSlicedCreateInfoEXT structure members + case VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT: { // Covers VUID-VkImageViewSlicedCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_image_sliced_view_of_3d)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_image_sliced_view_of_3d has not been enabled."); + } + } break; // Validation code for VkRenderPassStripeBeginInfoARM structure members case VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM: { // Covers VUID-VkRenderPassStripeBeginInfoARM-sType-sType + + if (!IsExtEnabled(exts.vk_arm_render_pass_striped)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM), but its parent extension " + "VK_ARM_render_pass_striped has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassStripeBeginInfoARM); - if (!IsExtEnabled(device_extensions.vk_arm_render_pass_striped)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_ARM_render_pass_striped"); - } VkRenderPassStripeBeginInfoARM* structure = (VkRenderPassStripeBeginInfoARM*)header; skip |= ValidateStructTypeArray( pNext_loc.dot(Field::stripeInfoCount), pNext_loc.dot(Field::pStripeInfos), structure->stripeInfoCount, @@ -9880,7 +11570,7 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const [[maybe_unused]] const Location pStripeInfos_loc = pNext_loc.dot(Field::pStripeInfos, stripeInfoIndex); skip |= ValidateStructPnext(pStripeInfos_loc, structure->pStripeInfos[stripeInfoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, "VUID-VkRenderPassStripeInfoARM-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + kVUIDUndefined, true); } } } @@ -9888,12 +11578,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkRenderPassStripeSubmitInfoARM structure members case VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM: { // Covers VUID-VkRenderPassStripeSubmitInfoARM-sType-sType + + if (!IsExtEnabled(exts.vk_arm_render_pass_striped)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM), but its parent extension " + "VK_ARM_render_pass_striped has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassStripeSubmitInfoARM); - if (!IsExtEnabled(device_extensions.vk_arm_render_pass_striped)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_ARM_render_pass_striped"); - } VkRenderPassStripeSubmitInfoARM* structure = (VkRenderPassStripeSubmitInfoARM*)header; skip |= ValidateStructTypeArray(pNext_loc.dot(Field::stripeSemaphoreInfoCount), pNext_loc.dot(Field::pStripeSemaphoreInfos), structure->stripeSemaphoreInfoCount, @@ -9907,10 +11600,9 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const ++stripeSemaphoreInfoIndex) { [[maybe_unused]] const Location pStripeSemaphoreInfos_loc = pNext_loc.dot(Field::pStripeSemaphoreInfos, stripeSemaphoreInfoIndex); - skip |= ValidateStructPnext(pStripeSemaphoreInfos_loc, - structure->pStripeSemaphoreInfos[stripeSemaphoreInfoIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreSubmitInfo-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= ValidateStructPnext( + pStripeSemaphoreInfos_loc, structure->pStripeSemaphoreInfos[stripeSemaphoreInfoIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreSubmitInfo-pNext-pNext", kVUIDUndefined, true); skip |= ValidateRequiredHandle(pStripeSemaphoreInfos_loc.dot(Field::semaphore), structure->pStripeSemaphoreInfos[stripeSemaphoreInfoIndex].semaphore); @@ -9918,7 +11610,7 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const skip |= ValidateFlags(pStripeSemaphoreInfos_loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, structure->pStripeSemaphoreInfos[stripeSemaphoreInfoIndex].stageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkSemaphoreSubmitInfo-stageMask-parameter"); + "VUID-VkSemaphoreSubmitInfo-stageMask-parameter"); } } } @@ -9927,12 +11619,16 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSubpassFragmentDensityMapOffsetEndInfoQCOM structure members case VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM: { // Covers // VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_fragment_density_map_offset)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM), but its parent extension " + "VK_QCOM_fragment_density_map_offset has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSubpassFragmentDensityMapOffsetEndInfoQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_fragment_density_map_offset)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_QCOM_fragment_density_map_offset"); - } VkSubpassFragmentDensityMapOffsetEndInfoQCOM* structure = (VkSubpassFragmentDensityMapOffsetEndInfoQCOM*)header; skip |= ValidateArray(pNext_loc.dot(Field::fragmentDensityOffsetCount), pNext_loc.dot(Field::pFragmentDensityOffsets), structure->fragmentDensityOffsetCount, @@ -9949,21 +11645,42 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkComputePipelineIndirectBufferInfoNV structure members -- Covers - // VUID-VkComputePipelineIndirectBufferInfoNV-sType-sType + // Validation code for VkComputePipelineIndirectBufferInfoNV structure members + case VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV: { // Covers + // VUID-VkComputePipelineIndirectBufferInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_device_generated_commands_compute)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV), but its parent extension " + "VK_NV_device_generated_commands_compute has not been enabled."); + } + } break; + + // Validation code for VkImageViewSampleWeightCreateInfoQCOM structure members + case VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM: { // Covers + // VUID-VkImageViewSampleWeightCreateInfoQCOM-sType-sType - // No Validation code for VkImageViewSampleWeightCreateInfoQCOM structure members -- Covers - // VUID-VkImageViewSampleWeightCreateInfoQCOM-sType-sType + if (!IsExtEnabled(exts.vk_qcom_image_processing)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM), but its parent extension " + "VK_QCOM_image_processing has not been enabled."); + } + } break; // Validation code for VkExternalMemoryAcquireUnmodifiedEXT structure members case VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT: { // Covers // VUID-VkExternalMemoryAcquireUnmodifiedEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_external_memory_acquire_unmodified)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT), but its parent extension " + "VK_EXT_external_memory_acquire_unmodified has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkExternalMemoryAcquireUnmodifiedEXT); - if (!IsExtEnabled(device_extensions.vk_ext_external_memory_acquire_unmodified)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_external_memory_acquire_unmodified"); - } VkExternalMemoryAcquireUnmodifiedEXT* structure = (VkExternalMemoryAcquireUnmodifiedEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::acquireUnmodifiedMemory), structure->acquireUnmodifiedMemory); } @@ -9971,12 +11688,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkRenderPassCreationControlEXT structure members case VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT: { // Covers VUID-VkRenderPassCreationControlEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_subpass_merge_feedback)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT), but its parent extension " + "VK_EXT_subpass_merge_feedback has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassCreationControlEXT); - if (!IsExtEnabled(device_extensions.vk_ext_subpass_merge_feedback)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_subpass_merge_feedback"); - } VkRenderPassCreationControlEXT* structure = (VkRenderPassCreationControlEXT*)header; skip |= ValidateBool32(pNext_loc.dot(Field::disallowMerging), structure->disallowMerging); } @@ -9985,12 +11705,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkRenderPassCreationFeedbackCreateInfoEXT structure members case VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT: { // Covers // VUID-VkRenderPassCreationFeedbackCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_subpass_merge_feedback)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_subpass_merge_feedback has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassCreationFeedbackCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_subpass_merge_feedback)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_subpass_merge_feedback"); - } VkRenderPassCreationFeedbackCreateInfoEXT* structure = (VkRenderPassCreationFeedbackCreateInfoEXT*)header; skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pRenderPassFeedback), structure->pRenderPassFeedback, "VUID-VkRenderPassCreationFeedbackCreateInfoEXT-pRenderPassFeedback-parameter"); @@ -10000,12 +11723,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkRenderPassSubpassFeedbackCreateInfoEXT structure members case VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT: { // Covers // VUID-VkRenderPassSubpassFeedbackCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_subpass_merge_feedback)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_subpass_merge_feedback has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkRenderPassSubpassFeedbackCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_subpass_merge_feedback)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_subpass_merge_feedback"); - } VkRenderPassSubpassFeedbackCreateInfoEXT* structure = (VkRenderPassSubpassFeedbackCreateInfoEXT*)header; skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pSubpassFeedback), structure->pSubpassFeedback, "VUID-VkRenderPassSubpassFeedbackCreateInfoEXT-pSubpassFeedback-parameter"); @@ -10014,11 +11740,18 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDirectDriverLoadingListLUNARG structure members case VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_LIST_LUNARG: { // Covers VUID-VkDirectDriverLoadingListLUNARG-sType-sType + + if (!IsExtEnabled(exts.vk_lunarg_direct_driver_loading)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_LIST_LUNARG), but its parent extension " + "VK_LUNARG_direct_driver_loading has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDirectDriverLoadingListLUNARG); VkDirectDriverLoadingListLUNARG* structure = (VkDirectDriverLoadingListLUNARG*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::mode), vvl::Enum::VkDirectDriverLoadingModeLUNARG, structure->mode, - "VUID-VkDirectDriverLoadingListLUNARG-mode-parameter", VK_NULL_HANDLE); + "VUID-VkDirectDriverLoadingListLUNARG-mode-parameter"); skip |= ValidateStructTypeArray( pNext_loc.dot(Field::driverCount), pNext_loc.dot(Field::pDrivers), structure->driverCount, structure->pDrivers, @@ -10039,12 +11772,16 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkPipelineShaderStageModuleIdentifierCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineShaderStageModuleIdentifierCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_shader_module_identifier)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_shader_module_identifier has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineShaderStageModuleIdentifierCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_shader_module_identifier)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_shader_module_identifier"); - } VkPipelineShaderStageModuleIdentifierCreateInfoEXT* structure = (VkPipelineShaderStageModuleIdentifierCreateInfoEXT*)header; skip |= ValidateArray(pNext_loc.dot(Field::identifierSize), pNext_loc.dot(Field::pIdentifier), @@ -10055,14 +11792,18 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkOpticalFlowImageFormatInfoNV structure members case VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV: { // Covers VUID-VkOpticalFlowImageFormatInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_optical_flow)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV), but its parent extension " + "VK_NV_optical_flow has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkOpticalFlowImageFormatInfoNV); - if ((!is_physdev_api && !IsExtEnabled(device_extensions.vk_nv_optical_flow))) { - skip |= LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_optical_flow"); - } VkOpticalFlowImageFormatInfoNV* structure = (VkOpticalFlowImageFormatInfoNV*)header; skip |= ValidateFlags(pNext_loc.dot(Field::usage), vvl::FlagBitmask::VkOpticalFlowUsageFlagBitsNV, - AllVkOpticalFlowUsageFlagBitsNV, structure->usage, kRequiredFlags, VK_NULL_HANDLE, + AllVkOpticalFlowUsageFlagBitsNV, structure->usage, kRequiredFlags, "VUID-VkOpticalFlowImageFormatInfoNV-usage-parameter", "VUID-VkOpticalFlowImageFormatInfoNV-usage-requiredbitmask"); } @@ -10071,11 +11812,16 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkOpticalFlowSessionCreatePrivateDataInfoNV structure members case VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV: { // Covers // VUID-VkOpticalFlowSessionCreatePrivateDataInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_optical_flow)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV), but its parent extension " + "VK_NV_optical_flow has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkOpticalFlowSessionCreatePrivateDataInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_optical_flow)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_optical_flow"); - } VkOpticalFlowSessionCreatePrivateDataInfoNV* structure = (VkOpticalFlowSessionCreatePrivateDataInfoNV*)header; skip |= ValidateRequiredPointer(pNext_loc.dot(Field::pPrivateData), structure->pPrivateData, "VUID-VkOpticalFlowSessionCreatePrivateDataInfoNV-pPrivateData-parameter"); @@ -10083,40 +11829,82 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } break; #ifdef VK_USE_PLATFORM_ANDROID_KHR - // No Validation code for VkAndroidHardwareBufferFormatResolvePropertiesANDROID structure members -- Covers - // VUID-VkAndroidHardwareBufferFormatResolvePropertiesANDROID-sType-sType + // Validation code for VkAndroidHardwareBufferFormatResolvePropertiesANDROID structure members + case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID: { // Covers + // VUID-VkAndroidHardwareBufferFormatResolvePropertiesANDROID-sType-sType + + if (!IsExtEnabled(exts.vk_android_external_format_resolve)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID), but its parent extension " + "VK_ANDROID_external_format_resolve has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_ANDROID_KHR - // No Validation code for VkAmigoProfilingSubmitInfoSEC structure members -- Covers - // VUID-VkAmigoProfilingSubmitInfoSEC-sType-sType + // Validation code for VkAmigoProfilingSubmitInfoSEC structure members + case VK_STRUCTURE_TYPE_AMIGO_PROFILING_SUBMIT_INFO_SEC: { // Covers VUID-VkAmigoProfilingSubmitInfoSEC-sType-sType + + if (!IsExtEnabled(exts.vk_sec_amigo_profiling)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_AMIGO_PROFILING_SUBMIT_INFO_SEC), " + "but its parent extension " + "VK_SEC_amigo_profiling has not been enabled."); + } + } break; - // No Validation code for VkLatencySubmissionPresentIdNV structure members -- Covers - // VUID-VkLatencySubmissionPresentIdNV-sType-sType + // Validation code for VkLatencySubmissionPresentIdNV structure members + case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: { // Covers VUID-VkLatencySubmissionPresentIdNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_low_latency2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV), but its parent extension " + "VK_NV_low_latency2 has not been enabled."); + } + } break; // Validation code for VkSwapchainLatencyCreateInfoNV structure members case VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV: { // Covers VUID-VkSwapchainLatencyCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_low_latency2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV), but its parent extension " + "VK_NV_low_latency2 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSwapchainLatencyCreateInfoNV); - if (!IsExtEnabled(device_extensions.vk_nv_low_latency2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_NV_low_latency2"); - } VkSwapchainLatencyCreateInfoNV* structure = (VkSwapchainLatencyCreateInfoNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::latencyModeEnable), structure->latencyModeEnable); } } break; - // No Validation code for VkLatencySurfaceCapabilitiesNV structure members -- Covers - // VUID-VkLatencySurfaceCapabilitiesNV-sType-sType + // Validation code for VkLatencySurfaceCapabilitiesNV structure members + case VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV: { // Covers VUID-VkLatencySurfaceCapabilitiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_low_latency2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV), " + "but its parent extension " + "VK_NV_low_latency2 has not been enabled."); + } + } break; // Validation code for VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM structure members case VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM: { // Covers // VUID-VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_multiview_per_view_render_areas)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM), but its parent extension " + "VK_QCOM_multiview_per_view_render_areas has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_multiview_per_view_render_areas)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_QCOM_multiview_per_view_render_areas"); - } VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM* structure = (VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM*)header; skip |= @@ -10129,60 +11917,71 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkSamplerBlockMatchWindowCreateInfoQCOM structure members case VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM: { // Covers // VUID-VkSamplerBlockMatchWindowCreateInfoQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_image_processing2)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM), but its parent extension " + "VK_QCOM_image_processing2 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSamplerBlockMatchWindowCreateInfoQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_image_processing2)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_QCOM_image_processing2"); - } VkSamplerBlockMatchWindowCreateInfoQCOM* structure = (VkSamplerBlockMatchWindowCreateInfoQCOM*)header; - skip |= - ValidateRangedEnum(pNext_loc.dot(Field::windowCompareMode), vvl::Enum::VkBlockMatchWindowCompareModeQCOM, - structure->windowCompareMode, - "VUID-VkSamplerBlockMatchWindowCreateInfoQCOM-windowCompareMode-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::windowCompareMode), vvl::Enum::VkBlockMatchWindowCompareModeQCOM, + structure->windowCompareMode, + "VUID-VkSamplerBlockMatchWindowCreateInfoQCOM-windowCompareMode-parameter"); } } break; // Validation code for VkSamplerCubicWeightsCreateInfoQCOM structure members case VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM: { // Covers // VUID-VkSamplerCubicWeightsCreateInfoQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_filter_cubic_weights)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM), but its parent extension " + "VK_QCOM_filter_cubic_weights has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSamplerCubicWeightsCreateInfoQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_filter_cubic_weights)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_QCOM_filter_cubic_weights"); - } VkSamplerCubicWeightsCreateInfoQCOM* structure = (VkSamplerCubicWeightsCreateInfoQCOM*)header; - skip |= ValidateRangedEnum(pNext_loc.dot(Field::cubicWeights), vvl::Enum::VkCubicFilterWeightsQCOM, - structure->cubicWeights, - "VUID-VkSamplerCubicWeightsCreateInfoQCOM-cubicWeights-parameter", VK_NULL_HANDLE); + skip |= + ValidateRangedEnum(pNext_loc.dot(Field::cubicWeights), vvl::Enum::VkCubicFilterWeightsQCOM, + structure->cubicWeights, "VUID-VkSamplerCubicWeightsCreateInfoQCOM-cubicWeights-parameter"); } } break; // Validation code for VkBlitImageCubicWeightsInfoQCOM structure members case VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM: { // Covers VUID-VkBlitImageCubicWeightsInfoQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_filter_cubic_weights)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM), but its parent extension " + "VK_QCOM_filter_cubic_weights has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkBlitImageCubicWeightsInfoQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_filter_cubic_weights)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_QCOM_filter_cubic_weights"); - } VkBlitImageCubicWeightsInfoQCOM* structure = (VkBlitImageCubicWeightsInfoQCOM*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::cubicWeights), vvl::Enum::VkCubicFilterWeightsQCOM, - structure->cubicWeights, "VUID-VkBlitImageCubicWeightsInfoQCOM-cubicWeights-parameter", - VK_NULL_HANDLE); + structure->cubicWeights, "VUID-VkBlitImageCubicWeightsInfoQCOM-cubicWeights-parameter"); } } break; // Validation code for VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM structure members case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM: { // Covers // VUID-VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM-sType-sType + + if (!IsExtEnabled(exts.vk_qcom_ycbcr_degamma)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM), but its parent extension " + "VK_QCOM_ycbcr_degamma has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM); - if (!IsExtEnabled(device_extensions.vk_qcom_ycbcr_degamma)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_QCOM_ycbcr_degamma"); - } VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM* structure = (VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::enableYDegamma), structure->enableYDegamma); @@ -10192,39 +11991,81 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } break; #ifdef VK_USE_PLATFORM_SCREEN_QNX - // No Validation code for VkScreenBufferFormatPropertiesQNX structure members -- Covers - // VUID-VkScreenBufferFormatPropertiesQNX-sType-sType + // Validation code for VkScreenBufferFormatPropertiesQNX structure members + case VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX: { // Covers VUID-VkScreenBufferFormatPropertiesQNX-sType-sType + + if (!IsExtEnabled(exts.vk_qnx_external_memory_screen_buffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX), but its parent extension " + "VK_QNX_external_memory_screen_buffer has not been enabled."); + } + } break; + + // Validation code for VkImportScreenBufferInfoQNX structure members + case VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX: { // Covers VUID-VkImportScreenBufferInfoQNX-sType-sType + + if (!IsExtEnabled(exts.vk_qnx_external_memory_screen_buffer)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX), " + "but its parent extension " + "VK_QNX_external_memory_screen_buffer has not been enabled."); + } + } break; - // No Validation code for VkImportScreenBufferInfoQNX structure members -- Covers - // VUID-VkImportScreenBufferInfoQNX-sType-sType + // Validation code for VkExternalFormatQNX structure members + case VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX: { // Covers VUID-VkExternalFormatQNX-sType-sType - // No Validation code for VkExternalFormatQNX structure members -- Covers VUID-VkExternalFormatQNX-sType-sType + if (!IsExtEnabled(exts.vk_qnx_external_memory_screen_buffer)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType (VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX), but its parent extension " + "VK_QNX_external_memory_screen_buffer has not been enabled."); + } + } break; #endif // VK_USE_PLATFORM_SCREEN_QNX // Validation code for VkDisplaySurfaceStereoCreateInfoNV structure members case VK_STRUCTURE_TYPE_DISPLAY_SURFACE_STEREO_CREATE_INFO_NV: { // Covers // VUID-VkDisplaySurfaceStereoCreateInfoNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_display_stereo)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DISPLAY_SURFACE_STEREO_CREATE_INFO_NV), but its parent extension " + "VK_NV_display_stereo has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkDisplaySurfaceStereoCreateInfoNV); VkDisplaySurfaceStereoCreateInfoNV* structure = (VkDisplaySurfaceStereoCreateInfoNV*)header; skip |= ValidateRangedEnum(pNext_loc.dot(Field::stereoType), vvl::Enum::VkDisplaySurfaceStereoTypeNV, - structure->stereoType, "VUID-VkDisplaySurfaceStereoCreateInfoNV-stereoType-parameter", - VK_NULL_HANDLE); + structure->stereoType, "VUID-VkDisplaySurfaceStereoCreateInfoNV-stereoType-parameter"); } } break; - // No Validation code for VkDisplayModeStereoPropertiesNV structure members -- Covers - // VUID-VkDisplayModeStereoPropertiesNV-sType-sType + // Validation code for VkDisplayModeStereoPropertiesNV structure members + case VK_STRUCTURE_TYPE_DISPLAY_MODE_STEREO_PROPERTIES_NV: { // Covers VUID-VkDisplayModeStereoPropertiesNV-sType-sType + + if (!IsExtEnabled(exts.vk_nv_display_stereo)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_DISPLAY_MODE_STEREO_PROPERTIES_NV), but its parent extension " + "VK_NV_display_stereo has not been enabled."); + } + } break; // Validation code for VkGeneratedCommandsPipelineInfoEXT structure members case VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT: { // Covers // VUID-VkGeneratedCommandsPipelineInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_device_generated_commands)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT), but its parent extension " + "VK_EXT_device_generated_commands has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkGeneratedCommandsPipelineInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_device_generated_commands"); - } VkGeneratedCommandsPipelineInfoEXT* structure = (VkGeneratedCommandsPipelineInfoEXT*)header; skip |= ValidateRequiredHandle(pNext_loc.dot(Field::pipeline), structure->pipeline); } @@ -10232,12 +12073,15 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkGeneratedCommandsShaderInfoEXT structure members case VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT: { // Covers VUID-VkGeneratedCommandsShaderInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_device_generated_commands)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT), but its parent extension " + "VK_EXT_device_generated_commands has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkGeneratedCommandsShaderInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_device_generated_commands"); - } VkGeneratedCommandsShaderInfoEXT* structure = (VkGeneratedCommandsShaderInfoEXT*)header; skip |= ValidateHandleArray(pNext_loc.dot(Field::shaderCount), pNext_loc.dot(Field::pShaders), structure->shaderCount, structure->pShaders, true, true, @@ -10245,34 +12089,50 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const } } break; - // No Validation code for VkImageAlignmentControlCreateInfoMESA structure members -- Covers - // VUID-VkImageAlignmentControlCreateInfoMESA-sType-sType + // Validation code for VkImageAlignmentControlCreateInfoMESA structure members + case VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA: { // Covers + // VUID-VkImageAlignmentControlCreateInfoMESA-sType-sType + + if (!IsExtEnabled(exts.vk_mesa_image_alignment_control)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA), but its parent extension " + "VK_MESA_image_alignment_control has not been enabled."); + } + } break; // Validation code for VkPipelineViewportDepthClampControlCreateInfoEXT structure members case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLAMP_CONTROL_CREATE_INFO_EXT: { // Covers // VUID-VkPipelineViewportDepthClampControlCreateInfoEXT-sType-sType + + if (!IsExtEnabled(exts.vk_ext_depth_clamp_control)) { + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLAMP_CONTROL_CREATE_INFO_EXT), but its parent extension " + "VK_EXT_depth_clamp_control has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPipelineViewportDepthClampControlCreateInfoEXT); - if (!IsExtEnabled(device_extensions.vk_ext_depth_clamp_control)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_EXT_depth_clamp_control"); - } VkPipelineViewportDepthClampControlCreateInfoEXT* structure = (VkPipelineViewportDepthClampControlCreateInfoEXT*)header; - skip |= ValidateRangedEnum( - pNext_loc.dot(Field::depthClampMode), vvl::Enum::VkDepthClampModeEXT, structure->depthClampMode, - "VUID-VkPipelineViewportDepthClampControlCreateInfoEXT-depthClampMode-parameter", VK_NULL_HANDLE); + skip |= ValidateRangedEnum(pNext_loc.dot(Field::depthClampMode), vvl::Enum::VkDepthClampModeEXT, + structure->depthClampMode, + "VUID-VkPipelineViewportDepthClampControlCreateInfoEXT-depthClampMode-parameter"); } } break; // Validation code for VkHdrVividDynamicMetadataHUAWEI structure members case VK_STRUCTURE_TYPE_HDR_VIVID_DYNAMIC_METADATA_HUAWEI: { // Covers VUID-VkHdrVividDynamicMetadataHUAWEI-sType-sType + + if (!IsExtEnabled(exts.vk_huawei_hdr_vivid)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_HDR_VIVID_DYNAMIC_METADATA_HUAWEI), but its parent extension " + "VK_HUAWEI_hdr_vivid has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkHdrVividDynamicMetadataHUAWEI); - if (!IsExtEnabled(device_extensions.vk_huawei_hdr_vivid)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_HUAWEI_hdr_vivid"); - } VkHdrVividDynamicMetadataHUAWEI* structure = (VkHdrVividDynamicMetadataHUAWEI*)header; skip |= ValidateArray(pNext_loc.dot(Field::dynamicMetadataSize), pNext_loc.dot(Field::pDynamicMetadata), structure->dynamicMetadataSize, &structure->pDynamicMetadata, true, true, @@ -10284,12 +12144,16 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkWriteDescriptorSetAccelerationStructureKHR structure members case VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR: { // Covers // VUID-VkWriteDescriptorSetAccelerationStructureKHR-sType-sType + + if (!IsExtEnabled(exts.vk_khr_acceleration_structure)) { + skip |= + log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR), but its parent extension " + "VK_KHR_acceleration_structure has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkWriteDescriptorSetAccelerationStructureKHR); - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "extended struct requires the extensions VK_KHR_acceleration_structure"); - } VkWriteDescriptorSetAccelerationStructureKHR* structure = (VkWriteDescriptorSetAccelerationStructureKHR*)header; skip |= ValidateArray(pNext_loc.dot(Field::accelerationStructureCount), pNext_loc.dot(Field::pAccelerationStructures), @@ -10305,68 +12169,14 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const return skip; } -bool StatelessValidation::PreCallValidateCreateInstance(const VkInstanceCreateInfo* pCreateInfo, - const VkAllocationCallbacks* pAllocator, VkInstance* pInstance, - const ErrorObject& error_obj) const { - bool skip = false; - [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, true, - "VUID-vkCreateInstance-pCreateInfo-parameter", "VUID-VkInstanceCreateInfo-sType-sType"); - if (pCreateInfo != nullptr) { - [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - constexpr std::array allowed_structs_VkInstanceCreateInfo = {VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, - VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT, - VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_LIST_LUNARG, - VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT, - VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, - VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT, - VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT}; - - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkInstanceCreateInfo.size(), - allowed_structs_VkInstanceCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkInstanceCreateInfo-pNext-pNext", "VUID-VkInstanceCreateInfo-sType-unique", - VK_NULL_HANDLE, true); - - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkInstanceCreateFlagBits, - AllVkInstanceCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkInstanceCreateInfo-flags-parameter"); - - skip |= ValidateStructType(pCreateInfo_loc.dot(Field::pApplicationInfo), pCreateInfo->pApplicationInfo, - VK_STRUCTURE_TYPE_APPLICATION_INFO, false, - "VUID-VkInstanceCreateInfo-pApplicationInfo-parameter", "VUID-VkApplicationInfo-sType-sType"); - - if (pCreateInfo->pApplicationInfo != nullptr) { - [[maybe_unused]] const Location pApplicationInfo_loc = pCreateInfo_loc.dot(Field::pApplicationInfo); - skip |= ValidateStructPnext(pApplicationInfo_loc, pCreateInfo->pApplicationInfo->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkApplicationInfo-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); - } - - skip |= ValidateStringArray(pCreateInfo_loc.dot(Field::enabledLayerCount), pCreateInfo_loc.dot(Field::ppEnabledLayerNames), - pCreateInfo->enabledLayerCount, pCreateInfo->ppEnabledLayerNames, false, true, kVUIDUndefined, - "VUID-VkInstanceCreateInfo-ppEnabledLayerNames-parameter"); - - skip |= ValidateStringArray(pCreateInfo_loc.dot(Field::enabledExtensionCount), - pCreateInfo_loc.dot(Field::ppEnabledExtensionNames), pCreateInfo->enabledExtensionCount, - pCreateInfo->ppEnabledExtensionNames, false, true, kVUIDUndefined, - "VUID-VkInstanceCreateInfo-ppEnabledExtensionNames-parameter"); - } - if (pAllocator != nullptr) { - [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); - } - skip |= ValidateRequiredPointer(loc.dot(Field::pInstance), pInstance, "VUID-vkCreateInstance-pInstance-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateInstance(pCreateInfo, pAllocator, pInstance, error_obj); - return skip; -} - bool StatelessValidation::PreCallValidateDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -10375,11 +12185,12 @@ bool StatelessValidation::PreCallValidateEnumeratePhysicalDevices(VkInstance ins VkPhysicalDevice* pPhysicalDevices, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidatePointerArray(loc.dot(Field::pPhysicalDeviceCount), loc.dot(Field::pPhysicalDevices), pPhysicalDeviceCount, - &pPhysicalDevices, true, false, false, - "VUID-vkEnumeratePhysicalDevices-pPhysicalDeviceCount-parameter", kVUIDUndefined, - "VUID-vkEnumeratePhysicalDevices-pPhysicalDevices-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pPhysicalDeviceCount), loc.dot(Field::pPhysicalDevices), pPhysicalDeviceCount, + &pPhysicalDevices, true, false, false, + "VUID-vkEnumeratePhysicalDevices-pPhysicalDeviceCount-parameter", kVUIDUndefined, + "VUID-vkEnumeratePhysicalDevices-pPhysicalDevices-parameter"); return skip; } @@ -10387,8 +12198,12 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFeatures(VkPhysicalDev VkPhysicalDeviceFeatures* pFeatures, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredPointer(loc.dot(Field::pFeatures), pFeatures, "VUID-vkGetPhysicalDeviceFeatures-pFeatures-parameter"); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::pFeatures), pFeatures, "VUID-vkGetPhysicalDeviceFeatures-pFeatures-parameter"); return skip; } @@ -10396,11 +12211,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFormatProperties(VkPhy VkFormatProperties* pFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, - "VUID-vkGetPhysicalDeviceFormatProperties-format-parameter", physicalDevice); - skip |= ValidateRequiredPointer(loc.dot(Field::pFormatProperties), pFormatProperties, - "VUID-vkGetPhysicalDeviceFormatProperties-pFormatProperties-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceFormatProperties-format-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFormatProperties), pFormatProperties, + "VUID-vkGetPhysicalDeviceFormatProperties-pFormatProperties-parameter"); return skip; } @@ -10410,23 +12228,26 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceImageFormatProperties( VkImageFormatProperties* pImageFormatProperties, const ErrorObject& error_obj) const { bool skip = false; - [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, - "VUID-vkGetPhysicalDeviceImageFormatProperties-format-parameter", physicalDevice); - skip |= ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, - "VUID-vkGetPhysicalDeviceImageFormatProperties-type-parameter", physicalDevice); - skip |= ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, - "VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-parameter", physicalDevice); - skip |= ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, - kRequiredFlags, physicalDevice, "VUID-vkGetPhysicalDeviceImageFormatProperties-usage-parameter", - "VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask"); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, flags, - kOptionalFlags, physicalDevice, "VUID-vkGetPhysicalDeviceImageFormatProperties-flags-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pImageFormatProperties), pImageFormatProperties, - "VUID-vkGetPhysicalDeviceImageFormatProperties-pImageFormatProperties-parameter"); + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); + [[maybe_unused]] const Location loc = error_obj.location; + skip |= state.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceImageFormatProperties-format-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, + "VUID-vkGetPhysicalDeviceImageFormatProperties-type-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, + "VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, + kRequiredFlags, "VUID-vkGetPhysicalDeviceImageFormatProperties-usage-parameter", + "VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask"); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, flags, + kOptionalFlags, "VUID-vkGetPhysicalDeviceImageFormatProperties-flags-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pImageFormatProperties), pImageFormatProperties, + "VUID-vkGetPhysicalDeviceImageFormatProperties-pImageFormatProperties-parameter"); if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, - pImageFormatProperties, error_obj); + pImageFormatProperties, state); return skip; } @@ -10434,9 +12255,12 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceProperties(VkPhysicalD VkPhysicalDeviceProperties* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredPointer(loc.dot(Field::pProperties), pProperties, - "VUID-vkGetPhysicalDeviceProperties-pProperties-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pProperties), pProperties, + "VUID-vkGetPhysicalDeviceProperties-pProperties-parameter"); return skip; } @@ -10445,11 +12269,15 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceQueueFamilyProperties( VkQueueFamilyProperties* pQueueFamilyProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidatePointerArray(loc.dot(Field::pQueueFamilyPropertyCount), loc.dot(Field::pQueueFamilyProperties), - pQueueFamilyPropertyCount, &pQueueFamilyProperties, true, false, false, - "VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyPropertyCount-parameter", - kVUIDUndefined, "VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyProperties-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pQueueFamilyPropertyCount), loc.dot(Field::pQueueFamilyProperties), + pQueueFamilyPropertyCount, &pQueueFamilyProperties, true, false, false, + "VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyPropertyCount-parameter", + kVUIDUndefined, + "VUID-vkGetPhysicalDeviceQueueFamilyProperties-pQueueFamilyProperties-parameter"); if (pQueueFamilyProperties != nullptr) { for (uint32_t pQueueFamilyPropertyIndex = 0; pQueueFamilyPropertyIndex < *pQueueFamilyPropertyCount; ++pQueueFamilyPropertyIndex) { @@ -10465,9 +12293,12 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceMemoryProperties(VkPhy VkPhysicalDeviceMemoryProperties* pMemoryProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredPointer(loc.dot(Field::pMemoryProperties), pMemoryProperties, - "VUID-vkGetPhysicalDeviceMemoryProperties-pMemoryProperties-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMemoryProperties), pMemoryProperties, + "VUID-vkGetPhysicalDeviceMemoryProperties-pMemoryProperties-parameter"); return skip; } @@ -10475,9 +12306,12 @@ bool StatelessValidation::PreCallValidateCreateDevice(VkPhysicalDevice physicalD const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, true, - "VUID-vkCreateDevice-pCreateInfo-parameter", "VUID-VkDeviceCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, true, + "VUID-vkCreateDevice-pCreateInfo-parameter", "VUID-VkDeviceCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkDeviceCreateInfo = { @@ -10694,15 +12528,14 @@ bool StatelessValidation::PreCallValidateCreateDevice(VkPhysicalDevice physicalD VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDeviceCreateInfo.size(), - allowed_structs_VkDeviceCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDeviceCreateInfo-pNext-pNext", "VUID-VkDeviceCreateInfo-sType-unique", physicalDevice, - true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDeviceCreateInfo.size(), + allowed_structs_VkDeviceCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDeviceCreateInfo-pNext-pNext", "VUID-VkDeviceCreateInfo-sType-unique", true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkDeviceCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkDeviceCreateInfo-flags-zerobitmask"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pCreateInfo_loc.dot(Field::queueCreateInfoCount), pCreateInfo_loc.dot(Field::pQueueCreateInfos), pCreateInfo->queueCreateInfoCount, pCreateInfo->pQueueCreateInfos, VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, true, true, "VUID-VkDeviceQueueCreateInfo-sType-sType", "VUID-VkDeviceCreateInfo-pQueueCreateInfos-parameter", @@ -10717,50 +12550,53 @@ bool StatelessValidation::PreCallValidateCreateDevice(VkPhysicalDevice physicalD VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO, VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM}; - skip |= ValidateStructPnext(pQueueCreateInfos_loc, pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].pNext, - allowed_structs_VkDeviceQueueCreateInfo.size(), - allowed_structs_VkDeviceQueueCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDeviceQueueCreateInfo-pNext-pNext", "VUID-VkDeviceQueueCreateInfo-sType-unique", - physicalDevice, true); - - skip |= ValidateFlags(pQueueCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkDeviceQueueCreateFlagBits, - AllVkDeviceQueueCreateFlagBits, pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkDeviceQueueCreateInfo-flags-parameter"); + skip |= state.ValidateStructPnext(pQueueCreateInfos_loc, pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].pNext, + allowed_structs_VkDeviceQueueCreateInfo.size(), + allowed_structs_VkDeviceQueueCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDeviceQueueCreateInfo-pNext-pNext", + "VUID-VkDeviceQueueCreateInfo-sType-unique", true); skip |= - ValidateArray(pQueueCreateInfos_loc.dot(Field::queueCount), pQueueCreateInfos_loc.dot(Field::pQueuePriorities), - pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].queueCount, - &pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].pQueuePriorities, true, true, - "VUID-VkDeviceQueueCreateInfo-queueCount-arraylength", - "VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter"); + state.ValidateFlags(pQueueCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkDeviceQueueCreateFlagBits, + AllVkDeviceQueueCreateFlagBits, pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].flags, + kOptionalFlags, "VUID-VkDeviceQueueCreateInfo-flags-parameter"); + + skip |= state.ValidateArray(pQueueCreateInfos_loc.dot(Field::queueCount), + pQueueCreateInfos_loc.dot(Field::pQueuePriorities), + pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].queueCount, + &pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].pQueuePriorities, true, true, + "VUID-VkDeviceQueueCreateInfo-queueCount-arraylength", + "VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter"); } } - skip |= ValidateStringArray(pCreateInfo_loc.dot(Field::enabledLayerCount), pCreateInfo_loc.dot(Field::ppEnabledLayerNames), - pCreateInfo->enabledLayerCount, pCreateInfo->ppEnabledLayerNames, false, true, kVUIDUndefined, - "VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter"); + skip |= state.ValidateStringArray(pCreateInfo_loc.dot(Field::enabledLayerCount), + pCreateInfo_loc.dot(Field::ppEnabledLayerNames), pCreateInfo->enabledLayerCount, + pCreateInfo->ppEnabledLayerNames, false, true, kVUIDUndefined, + "VUID-VkDeviceCreateInfo-ppEnabledLayerNames-parameter"); - skip |= ValidateStringArray(pCreateInfo_loc.dot(Field::enabledExtensionCount), - pCreateInfo_loc.dot(Field::ppEnabledExtensionNames), pCreateInfo->enabledExtensionCount, - pCreateInfo->ppEnabledExtensionNames, false, true, kVUIDUndefined, - "VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter"); + skip |= state.ValidateStringArray(pCreateInfo_loc.dot(Field::enabledExtensionCount), + pCreateInfo_loc.dot(Field::ppEnabledExtensionNames), pCreateInfo->enabledExtensionCount, + pCreateInfo->ppEnabledExtensionNames, false, true, kVUIDUndefined, + "VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pDevice), pDevice, "VUID-vkCreateDevice-pDevice-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pDevice), pDevice, "VUID-vkCreateDevice-pDevice-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice, state); return skip; } bool StatelessValidation::PreCallValidateDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -10768,18 +12604,20 @@ bool StatelessValidation::PreCallValidateDestroyDevice(VkDevice device, const Vk bool StatelessValidation::PreCallValidateGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredPointer(loc.dot(Field::pQueue), pQueue, "VUID-vkGetDeviceQueue-pQueue-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pQueue), pQueue, "VUID-vkGetDeviceQueue-pQueue-parameter"); return skip; } bool StatelessValidation::PreCallValidateQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray(loc.dot(Field::submitCount), loc.dot(Field::pSubmits), submitCount, pSubmits, - VK_STRUCTURE_TYPE_SUBMIT_INFO, false, true, "VUID-VkSubmitInfo-sType-sType", - "VUID-vkQueueSubmit-pSubmits-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::submitCount), loc.dot(Field::pSubmits), submitCount, pSubmits, + VK_STRUCTURE_TYPE_SUBMIT_INFO, false, true, "VUID-VkSubmitInfo-sType-sType", + "VUID-vkQueueSubmit-pSubmits-parameter", kVUIDUndefined); if (pSubmits != nullptr) { for (uint32_t submitIndex = 0; submitIndex < submitCount; ++submitIndex) { [[maybe_unused]] const Location pSubmits_loc = loc.dot(Field::pSubmits, submitIndex); @@ -10794,26 +12632,26 @@ bool StatelessValidation::PreCallValidateQueueSubmit(VkQueue queue, uint32_t sub VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR, VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV}; - skip |= ValidateStructPnext(pSubmits_loc, pSubmits[submitIndex].pNext, allowed_structs_VkSubmitInfo.size(), - allowed_structs_VkSubmitInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSubmitInfo-pNext-pNext", "VUID-VkSubmitInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSubmits_loc, pSubmits[submitIndex].pNext, allowed_structs_VkSubmitInfo.size(), + allowed_structs_VkSubmitInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSubmitInfo-pNext-pNext", "VUID-VkSubmitInfo-sType-unique", true); - skip |= ValidateArray(pSubmits_loc.dot(Field::waitSemaphoreCount), pSubmits_loc.dot(Field::pWaitSemaphores), - pSubmits[submitIndex].waitSemaphoreCount, &pSubmits[submitIndex].pWaitSemaphores, false, true, - kVUIDUndefined, "VUID-VkSubmitInfo-pWaitSemaphores-parameter"); + skip |= state.ValidateArray(pSubmits_loc.dot(Field::waitSemaphoreCount), pSubmits_loc.dot(Field::pWaitSemaphores), + pSubmits[submitIndex].waitSemaphoreCount, &pSubmits[submitIndex].pWaitSemaphores, false, + true, kVUIDUndefined, "VUID-VkSubmitInfo-pWaitSemaphores-parameter"); - skip |= ValidateFlagsArray(pSubmits_loc.dot(Field::waitSemaphoreCount), pSubmits_loc.dot(Field::pWaitDstStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - pSubmits[submitIndex].waitSemaphoreCount, pSubmits[submitIndex].pWaitDstStageMask, false, - kVUIDUndefined, "VUID-VkSubmitInfo-pWaitDstStageMask-parameter"); + skip |= state.ValidateFlagsArray( + pSubmits_loc.dot(Field::waitSemaphoreCount), pSubmits_loc.dot(Field::pWaitDstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, pSubmits[submitIndex].waitSemaphoreCount, + pSubmits[submitIndex].pWaitDstStageMask, false, kVUIDUndefined, "VUID-VkSubmitInfo-pWaitDstStageMask-parameter"); - skip |= ValidateArray(pSubmits_loc.dot(Field::commandBufferCount), pSubmits_loc.dot(Field::pCommandBuffers), - pSubmits[submitIndex].commandBufferCount, &pSubmits[submitIndex].pCommandBuffers, false, true, - kVUIDUndefined, "VUID-VkSubmitInfo-pCommandBuffers-parameter"); + skip |= state.ValidateArray(pSubmits_loc.dot(Field::commandBufferCount), pSubmits_loc.dot(Field::pCommandBuffers), + pSubmits[submitIndex].commandBufferCount, &pSubmits[submitIndex].pCommandBuffers, false, + true, kVUIDUndefined, "VUID-VkSubmitInfo-pCommandBuffers-parameter"); - skip |= ValidateArray(pSubmits_loc.dot(Field::signalSemaphoreCount), pSubmits_loc.dot(Field::pSignalSemaphores), - pSubmits[submitIndex].signalSemaphoreCount, &pSubmits[submitIndex].pSignalSemaphores, false, true, - kVUIDUndefined, "VUID-VkSubmitInfo-pSignalSemaphores-parameter"); + skip |= state.ValidateArray(pSubmits_loc.dot(Field::signalSemaphoreCount), pSubmits_loc.dot(Field::pSignalSemaphores), + pSubmits[submitIndex].signalSemaphoreCount, &pSubmits[submitIndex].pSignalSemaphores, false, + true, kVUIDUndefined, "VUID-VkSubmitInfo-pSignalSemaphores-parameter"); } } return skip; @@ -10821,6 +12659,7 @@ bool StatelessValidation::PreCallValidateQueueSubmit(VkQueue queue, uint32_t sub bool StatelessValidation::PreCallValidateQueueWaitIdle(VkQueue queue, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -10828,6 +12667,7 @@ bool StatelessValidation::PreCallValidateQueueWaitIdle(VkQueue queue, const Erro bool StatelessValidation::PreCallValidateDeviceWaitIdle(VkDevice device, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -10837,9 +12677,10 @@ bool StatelessValidation::PreCallValidateAllocateMemory(VkDevice device, const V const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pAllocateInfo), pAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, true, - "VUID-vkAllocateMemory-pAllocateInfo-parameter", "VUID-VkMemoryAllocateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pAllocateInfo), pAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, true, + "VUID-vkAllocateMemory-pAllocateInfo-parameter", "VUID-VkMemoryAllocateInfo-sType-sType"); if (pAllocateInfo != nullptr) { [[maybe_unused]] const Location pAllocateInfo_loc = loc.dot(Field::pAllocateInfo); constexpr std::array allowed_structs_VkMemoryAllocateInfo = {VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV, @@ -10862,27 +12703,27 @@ bool StatelessValidation::PreCallValidateAllocateMemory(VkDevice device, const V VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO, VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT}; - skip |= ValidateStructPnext(pAllocateInfo_loc, pAllocateInfo->pNext, allowed_structs_VkMemoryAllocateInfo.size(), - allowed_structs_VkMemoryAllocateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkMemoryAllocateInfo-pNext-pNext", "VUID-VkMemoryAllocateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pAllocateInfo_loc, pAllocateInfo->pNext, allowed_structs_VkMemoryAllocateInfo.size(), + allowed_structs_VkMemoryAllocateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkMemoryAllocateInfo-pNext-pNext", "VUID-VkMemoryAllocateInfo-sType-unique", true); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pMemory), pMemory, "VUID-vkAllocateMemory-pMemory-parameter"); - if (!skip) skip |= manual_PreCallValidateAllocateMemory(device, pAllocateInfo, pAllocator, pMemory, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMemory), pMemory, "VUID-vkAllocateMemory-pMemory-parameter"); + if (!skip) skip |= manual_PreCallValidateAllocateMemory(device, pAllocateInfo, pAllocator, pMemory, state); return skip; } bool StatelessValidation::PreCallValidateFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -10890,18 +12731,20 @@ bool StatelessValidation::PreCallValidateFreeMemory(VkDevice device, VkDeviceMem bool StatelessValidation::PreCallValidateMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkMemoryMapFlagBits, AllVkMemoryMapFlagBits, flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkMapMemory-flags-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::ppData), ppData, "VUID-vkMapMemory-ppData-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkMemoryMapFlagBits, AllVkMemoryMapFlagBits, flags, + kOptionalFlags, "VUID-vkMapMemory-flags-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::ppData), ppData, "VUID-vkMapMemory-ppData-parameter"); return skip; } bool StatelessValidation::PreCallValidateUnmapMemory(VkDevice device, VkDeviceMemory memory, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= state.ValidateRequiredHandle(loc.dot(Field::memory), memory); return skip; } @@ -10909,19 +12752,20 @@ bool StatelessValidation::PreCallValidateFlushMappedMemoryRanges(VkDevice device const VkMappedMemoryRange* pMemoryRanges, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::memoryRangeCount), loc.dot(Field::pMemoryRanges), memoryRangeCount, pMemoryRanges, VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, true, true, "VUID-VkMappedMemoryRange-sType-sType", "VUID-vkFlushMappedMemoryRanges-pMemoryRanges-parameter", "VUID-vkFlushMappedMemoryRanges-memoryRangeCount-arraylength"); if (pMemoryRanges != nullptr) { for (uint32_t memoryRangeIndex = 0; memoryRangeIndex < memoryRangeCount; ++memoryRangeIndex) { [[maybe_unused]] const Location pMemoryRanges_loc = loc.dot(Field::pMemoryRanges, memoryRangeIndex); - skip |= ValidateStructPnext(pMemoryRanges_loc, pMemoryRanges[memoryRangeIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMappedMemoryRange-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMemoryRanges_loc, pMemoryRanges[memoryRangeIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMappedMemoryRange-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateRequiredHandle(pMemoryRanges_loc.dot(Field::memory), pMemoryRanges[memoryRangeIndex].memory); + skip |= state.ValidateRequiredHandle(pMemoryRanges_loc.dot(Field::memory), pMemoryRanges[memoryRangeIndex].memory); } } return skip; @@ -10931,20 +12775,21 @@ bool StatelessValidation::PreCallValidateInvalidateMappedMemoryRanges(VkDevice d const VkMappedMemoryRange* pMemoryRanges, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= - ValidateStructTypeArray(loc.dot(Field::memoryRangeCount), loc.dot(Field::pMemoryRanges), memoryRangeCount, pMemoryRanges, - VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, true, true, "VUID-VkMappedMemoryRange-sType-sType", - "VUID-vkInvalidateMappedMemoryRanges-pMemoryRanges-parameter", - "VUID-vkInvalidateMappedMemoryRanges-memoryRangeCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::memoryRangeCount), loc.dot(Field::pMemoryRanges), memoryRangeCount, + pMemoryRanges, VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, true, true, + "VUID-VkMappedMemoryRange-sType-sType", + "VUID-vkInvalidateMappedMemoryRanges-pMemoryRanges-parameter", + "VUID-vkInvalidateMappedMemoryRanges-memoryRangeCount-arraylength"); if (pMemoryRanges != nullptr) { for (uint32_t memoryRangeIndex = 0; memoryRangeIndex < memoryRangeCount; ++memoryRangeIndex) { [[maybe_unused]] const Location pMemoryRanges_loc = loc.dot(Field::pMemoryRanges, memoryRangeIndex); - skip |= ValidateStructPnext(pMemoryRanges_loc, pMemoryRanges[memoryRangeIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMappedMemoryRange-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMemoryRanges_loc, pMemoryRanges[memoryRangeIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMappedMemoryRange-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateRequiredHandle(pMemoryRanges_loc.dot(Field::memory), pMemoryRanges[memoryRangeIndex].memory); + skip |= state.ValidateRequiredHandle(pMemoryRanges_loc.dot(Field::memory), pMemoryRanges[memoryRangeIndex].memory); } } return skip; @@ -10954,28 +12799,31 @@ bool StatelessValidation::PreCallValidateGetDeviceMemoryCommitment(VkDevice devi VkDeviceSize* pCommittedMemoryInBytes, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); - skip |= ValidateRequiredPointer(loc.dot(Field::pCommittedMemoryInBytes), pCommittedMemoryInBytes, - "VUID-vkGetDeviceMemoryCommitment-pCommittedMemoryInBytes-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCommittedMemoryInBytes), pCommittedMemoryInBytes, + "VUID-vkGetDeviceMemoryCommitment-pCommittedMemoryInBytes-parameter"); return skip; } bool StatelessValidation::PreCallValidateBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::memory), memory); return skip; } bool StatelessValidation::PreCallValidateBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= state.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= state.ValidateRequiredHandle(loc.dot(Field::memory), memory); return skip; } @@ -10983,10 +12831,11 @@ bool StatelessValidation::PreCallValidateGetBufferMemoryRequirements(VkDevice de VkMemoryRequirements* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, - "VUID-vkGetBufferMemoryRequirements-pMemoryRequirements-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, + "VUID-vkGetBufferMemoryRequirements-pMemoryRequirements-parameter"); return skip; } @@ -10994,10 +12843,11 @@ bool StatelessValidation::PreCallValidateGetImageMemoryRequirements(VkDevice dev VkMemoryRequirements* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, - "VUID-vkGetImageMemoryRequirements-pMemoryRequirements-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, + "VUID-vkGetImageMemoryRequirements-pMemoryRequirements-parameter"); return skip; } @@ -11005,12 +12855,14 @@ bool StatelessValidation::PreCallValidateGetImageSparseMemoryRequirements( VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidatePointerArray(loc.dot(Field::pSparseMemoryRequirementCount), loc.dot(Field::pSparseMemoryRequirements), - pSparseMemoryRequirementCount, &pSparseMemoryRequirements, true, false, false, - "VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirementCount-parameter", kVUIDUndefined, - "VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirements-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= + state.ValidatePointerArray(loc.dot(Field::pSparseMemoryRequirementCount), loc.dot(Field::pSparseMemoryRequirements), + pSparseMemoryRequirementCount, &pSparseMemoryRequirements, true, false, false, + "VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirementCount-parameter", + kVUIDUndefined, "VUID-vkGetImageSparseMemoryRequirements-pSparseMemoryRequirements-parameter"); if (pSparseMemoryRequirements != nullptr) { for (uint32_t pSparseMemoryRequirementIndex = 0; pSparseMemoryRequirementIndex < *pSparseMemoryRequirementCount; ++pSparseMemoryRequirementIndex) { @@ -11027,23 +12879,26 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSparseImageFormatPrope VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties, const ErrorObject& error_obj) const { bool skip = false; - [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, - "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter", physicalDevice); - skip |= ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, - "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-parameter", physicalDevice); + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); + [[maybe_unused]] const Location loc = error_obj.location; + skip |= state.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, samples, + kRequiredSingleBit, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-parameter", + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, + kRequiredFlags, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-parameter", + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-requiredbitmask"); + skip |= state.ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-tiling-parameter"); skip |= - ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, samples, - kRequiredSingleBit, physicalDevice, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-parameter", - "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-parameter"); - skip |= ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, - kRequiredFlags, physicalDevice, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-parameter", - "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-requiredbitmask"); - skip |= ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, - "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-tiling-parameter", physicalDevice); - skip |= ValidatePointerArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, &pProperties, true, - false, false, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pPropertyCount-parameter", - kVUIDUndefined, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pProperties-parameter"); + state.ValidatePointerArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, &pProperties, true, + false, false, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pPropertyCount-parameter", + kVUIDUndefined, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-pProperties-parameter"); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); @@ -11056,10 +12911,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSparseImageFormatPrope bool StatelessValidation::PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray(loc.dot(Field::bindInfoCount), loc.dot(Field::pBindInfo), bindInfoCount, pBindInfo, - VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, false, true, "VUID-VkBindSparseInfo-sType-sType", - "VUID-vkQueueBindSparse-pBindInfo-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::bindInfoCount), loc.dot(Field::pBindInfo), bindInfoCount, pBindInfo, + VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, false, true, "VUID-VkBindSparseInfo-sType-sType", + "VUID-vkQueueBindSparse-pBindInfo-parameter", kVUIDUndefined); if (pBindInfo != nullptr) { for (uint32_t bindInfoIndex = 0; bindInfoIndex < bindInfoCount; ++bindInfoIndex) { [[maybe_unused]] const Location pBindInfo_loc = loc.dot(Field::pBindInfo, bindInfoIndex); @@ -11067,122 +12923,125 @@ bool StatelessValidation::PreCallValidateQueueBindSparse(VkQueue queue, uint32_t VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT, VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO}; - skip |= ValidateStructPnext(pBindInfo_loc, pBindInfo[bindInfoIndex].pNext, allowed_structs_VkBindSparseInfo.size(), - allowed_structs_VkBindSparseInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkBindSparseInfo-pNext-pNext", "VUID-VkBindSparseInfo-sType-unique", VK_NULL_HANDLE, - true); + skip |= + state.ValidateStructPnext(pBindInfo_loc, pBindInfo[bindInfoIndex].pNext, allowed_structs_VkBindSparseInfo.size(), + allowed_structs_VkBindSparseInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBindSparseInfo-pNext-pNext", "VUID-VkBindSparseInfo-sType-unique", true); - skip |= ValidateArray(pBindInfo_loc.dot(Field::waitSemaphoreCount), pBindInfo_loc.dot(Field::pWaitSemaphores), - pBindInfo[bindInfoIndex].waitSemaphoreCount, &pBindInfo[bindInfoIndex].pWaitSemaphores, false, - true, kVUIDUndefined, "VUID-VkBindSparseInfo-pWaitSemaphores-parameter"); + skip |= state.ValidateArray(pBindInfo_loc.dot(Field::waitSemaphoreCount), pBindInfo_loc.dot(Field::pWaitSemaphores), + pBindInfo[bindInfoIndex].waitSemaphoreCount, &pBindInfo[bindInfoIndex].pWaitSemaphores, + false, true, kVUIDUndefined, "VUID-VkBindSparseInfo-pWaitSemaphores-parameter"); - skip |= ValidateArray(pBindInfo_loc.dot(Field::bufferBindCount), pBindInfo_loc.dot(Field::pBufferBinds), - pBindInfo[bindInfoIndex].bufferBindCount, &pBindInfo[bindInfoIndex].pBufferBinds, false, true, - kVUIDUndefined, "VUID-VkBindSparseInfo-pBufferBinds-parameter"); + skip |= state.ValidateArray(pBindInfo_loc.dot(Field::bufferBindCount), pBindInfo_loc.dot(Field::pBufferBinds), + pBindInfo[bindInfoIndex].bufferBindCount, &pBindInfo[bindInfoIndex].pBufferBinds, false, + true, kVUIDUndefined, "VUID-VkBindSparseInfo-pBufferBinds-parameter"); if (pBindInfo[bindInfoIndex].pBufferBinds != nullptr) { for (uint32_t bufferBindIndex = 0; bufferBindIndex < pBindInfo[bindInfoIndex].bufferBindCount; ++bufferBindIndex) { [[maybe_unused]] const Location pBufferBinds_loc = pBindInfo_loc.dot(Field::pBufferBinds, bufferBindIndex); - skip |= ValidateRequiredHandle(pBufferBinds_loc.dot(Field::buffer), - pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].buffer); + skip |= state.ValidateRequiredHandle(pBufferBinds_loc.dot(Field::buffer), + pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].buffer); - skip |= ValidateArray(pBufferBinds_loc.dot(Field::bindCount), pBufferBinds_loc.dot(Field::pBinds), - pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].bindCount, - &pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].pBinds, true, true, - "VUID-VkSparseBufferMemoryBindInfo-bindCount-arraylength", - "VUID-VkSparseBufferMemoryBindInfo-pBinds-parameter"); + skip |= state.ValidateArray(pBufferBinds_loc.dot(Field::bindCount), pBufferBinds_loc.dot(Field::pBinds), + pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].bindCount, + &pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].pBinds, true, true, + "VUID-VkSparseBufferMemoryBindInfo-bindCount-arraylength", + "VUID-VkSparseBufferMemoryBindInfo-pBinds-parameter"); if (pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].pBinds != nullptr) { for (uint32_t bindIndex = 0; bindIndex < pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].bindCount; ++bindIndex) { [[maybe_unused]] const Location pBinds_loc = pBufferBinds_loc.dot(Field::pBinds, bindIndex); - skip |= ValidateFlags(pBinds_loc.dot(Field::flags), vvl::FlagBitmask::VkSparseMemoryBindFlagBits, - AllVkSparseMemoryBindFlagBits, - pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].pBinds[bindIndex].flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSparseMemoryBind-flags-parameter"); + skip |= + state.ValidateFlags(pBinds_loc.dot(Field::flags), vvl::FlagBitmask::VkSparseMemoryBindFlagBits, + AllVkSparseMemoryBindFlagBits, + pBindInfo[bindInfoIndex].pBufferBinds[bufferBindIndex].pBinds[bindIndex].flags, + kOptionalFlags, "VUID-VkSparseMemoryBind-flags-parameter"); } } } } - skip |= ValidateArray(pBindInfo_loc.dot(Field::imageOpaqueBindCount), pBindInfo_loc.dot(Field::pImageOpaqueBinds), - pBindInfo[bindInfoIndex].imageOpaqueBindCount, &pBindInfo[bindInfoIndex].pImageOpaqueBinds, false, - true, kVUIDUndefined, "VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter"); + skip |= state.ValidateArray(pBindInfo_loc.dot(Field::imageOpaqueBindCount), pBindInfo_loc.dot(Field::pImageOpaqueBinds), + pBindInfo[bindInfoIndex].imageOpaqueBindCount, &pBindInfo[bindInfoIndex].pImageOpaqueBinds, + false, true, kVUIDUndefined, "VUID-VkBindSparseInfo-pImageOpaqueBinds-parameter"); if (pBindInfo[bindInfoIndex].pImageOpaqueBinds != nullptr) { for (uint32_t imageOpaqueBindIndex = 0; imageOpaqueBindIndex < pBindInfo[bindInfoIndex].imageOpaqueBindCount; ++imageOpaqueBindIndex) { [[maybe_unused]] const Location pImageOpaqueBinds_loc = pBindInfo_loc.dot(Field::pImageOpaqueBinds, imageOpaqueBindIndex); - skip |= ValidateRequiredHandle(pImageOpaqueBinds_loc.dot(Field::image), - pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].image); + skip |= state.ValidateRequiredHandle(pImageOpaqueBinds_loc.dot(Field::image), + pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].image); - skip |= ValidateArray(pImageOpaqueBinds_loc.dot(Field::bindCount), pImageOpaqueBinds_loc.dot(Field::pBinds), - pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].bindCount, - &pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].pBinds, true, true, - "VUID-VkSparseImageOpaqueMemoryBindInfo-bindCount-arraylength", - "VUID-VkSparseImageOpaqueMemoryBindInfo-pBinds-parameter"); + skip |= + state.ValidateArray(pImageOpaqueBinds_loc.dot(Field::bindCount), pImageOpaqueBinds_loc.dot(Field::pBinds), + pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].bindCount, + &pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].pBinds, true, true, + "VUID-VkSparseImageOpaqueMemoryBindInfo-bindCount-arraylength", + "VUID-VkSparseImageOpaqueMemoryBindInfo-pBinds-parameter"); if (pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].pBinds != nullptr) { for (uint32_t bindIndex = 0; bindIndex < pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].bindCount; ++bindIndex) { [[maybe_unused]] const Location pBinds_loc = pImageOpaqueBinds_loc.dot(Field::pBinds, bindIndex); - skip |= ValidateFlags( + skip |= state.ValidateFlags( pBinds_loc.dot(Field::flags), vvl::FlagBitmask::VkSparseMemoryBindFlagBits, AllVkSparseMemoryBindFlagBits, pBindInfo[bindInfoIndex].pImageOpaqueBinds[imageOpaqueBindIndex].pBinds[bindIndex].flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSparseMemoryBind-flags-parameter"); + kOptionalFlags, "VUID-VkSparseMemoryBind-flags-parameter"); } } } } - skip |= ValidateArray(pBindInfo_loc.dot(Field::imageBindCount), pBindInfo_loc.dot(Field::pImageBinds), - pBindInfo[bindInfoIndex].imageBindCount, &pBindInfo[bindInfoIndex].pImageBinds, false, true, - kVUIDUndefined, "VUID-VkBindSparseInfo-pImageBinds-parameter"); + skip |= state.ValidateArray(pBindInfo_loc.dot(Field::imageBindCount), pBindInfo_loc.dot(Field::pImageBinds), + pBindInfo[bindInfoIndex].imageBindCount, &pBindInfo[bindInfoIndex].pImageBinds, false, true, + kVUIDUndefined, "VUID-VkBindSparseInfo-pImageBinds-parameter"); if (pBindInfo[bindInfoIndex].pImageBinds != nullptr) { for (uint32_t imageBindIndex = 0; imageBindIndex < pBindInfo[bindInfoIndex].imageBindCount; ++imageBindIndex) { [[maybe_unused]] const Location pImageBinds_loc = pBindInfo_loc.dot(Field::pImageBinds, imageBindIndex); - skip |= ValidateRequiredHandle(pImageBinds_loc.dot(Field::image), - pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].image); + skip |= state.ValidateRequiredHandle(pImageBinds_loc.dot(Field::image), + pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].image); - skip |= ValidateArray(pImageBinds_loc.dot(Field::bindCount), pImageBinds_loc.dot(Field::pBinds), - pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].bindCount, - &pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].pBinds, true, true, - "VUID-VkSparseImageMemoryBindInfo-bindCount-arraylength", - "VUID-VkSparseImageMemoryBindInfo-pBinds-parameter"); + skip |= state.ValidateArray(pImageBinds_loc.dot(Field::bindCount), pImageBinds_loc.dot(Field::pBinds), + pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].bindCount, + &pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].pBinds, true, true, + "VUID-VkSparseImageMemoryBindInfo-bindCount-arraylength", + "VUID-VkSparseImageMemoryBindInfo-pBinds-parameter"); if (pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].pBinds != nullptr) { for (uint32_t bindIndex = 0; bindIndex < pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].bindCount; ++bindIndex) { [[maybe_unused]] const Location pBinds_loc = pImageBinds_loc.dot(Field::pBinds, bindIndex); - skip |= ValidateFlags( + skip |= state.ValidateFlags( pBinds_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].pBinds[bindIndex].subresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresource-aspectMask-parameter", + kRequiredFlags, "VUID-VkImageSubresource-aspectMask-parameter", "VUID-VkImageSubresource-aspectMask-requiredbitmask"); // No xml-driven validation // No xml-driven validation - skip |= ValidateFlags(pBinds_loc.dot(Field::flags), vvl::FlagBitmask::VkSparseMemoryBindFlagBits, - AllVkSparseMemoryBindFlagBits, - pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].pBinds[bindIndex].flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSparseImageMemoryBind-flags-parameter"); + skip |= + state.ValidateFlags(pBinds_loc.dot(Field::flags), vvl::FlagBitmask::VkSparseMemoryBindFlagBits, + AllVkSparseMemoryBindFlagBits, + pBindInfo[bindInfoIndex].pImageBinds[imageBindIndex].pBinds[bindIndex].flags, + kOptionalFlags, "VUID-VkSparseImageMemoryBind-flags-parameter"); } } } } - skip |= ValidateArray(pBindInfo_loc.dot(Field::signalSemaphoreCount), pBindInfo_loc.dot(Field::pSignalSemaphores), - pBindInfo[bindInfoIndex].signalSemaphoreCount, &pBindInfo[bindInfoIndex].pSignalSemaphores, false, - true, kVUIDUndefined, "VUID-VkBindSparseInfo-pSignalSemaphores-parameter"); + skip |= state.ValidateArray(pBindInfo_loc.dot(Field::signalSemaphoreCount), pBindInfo_loc.dot(Field::pSignalSemaphores), + pBindInfo[bindInfoIndex].signalSemaphoreCount, &pBindInfo[bindInfoIndex].pSignalSemaphores, + false, true, kVUIDUndefined, "VUID-VkBindSparseInfo-pSignalSemaphores-parameter"); } } - if (!skip) skip |= manual_PreCallValidateQueueBindSparse(queue, bindInfoCount, pBindInfo, fence, error_obj); + if (!skip) skip |= manual_PreCallValidateQueueBindSparse(queue, bindInfoCount, pBindInfo, fence, state); return skip; } @@ -11190,37 +13049,39 @@ bool StatelessValidation::PreCallValidateCreateFence(VkDevice device, const VkFe const VkAllocationCallbacks* pAllocator, VkFence* pFence, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, true, - "VUID-vkCreateFence-pCreateInfo-parameter", "VUID-VkFenceCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, true, + "VUID-vkCreateFence-pCreateInfo-parameter", "VUID-VkFenceCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkFenceCreateInfo = {VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR}; - skip |= - ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkFenceCreateInfo.size(), - allowed_structs_VkFenceCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkFenceCreateInfo-pNext-pNext", "VUID-VkFenceCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkFenceCreateInfo.size(), + allowed_structs_VkFenceCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkFenceCreateInfo-pNext-pNext", "VUID-VkFenceCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkFenceCreateFlagBits, AllVkFenceCreateFlagBits, - pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkFenceCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkFenceCreateFlagBits, + AllVkFenceCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkFenceCreateInfo-flags-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkCreateFence-pFence-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkCreateFence-pFence-parameter"); return skip; } bool StatelessValidation::PreCallValidateDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11228,26 +13089,29 @@ bool StatelessValidation::PreCallValidateDestroyFence(VkDevice device, VkFence f bool StatelessValidation::PreCallValidateResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateHandleArray(loc.dot(Field::fenceCount), loc.dot(Field::pFences), fenceCount, pFences, true, true, - "VUID-vkResetFences-fenceCount-arraylength"); + skip |= state.ValidateHandleArray(loc.dot(Field::fenceCount), loc.dot(Field::pFences), fenceCount, pFences, true, true, + "VUID-vkResetFences-fenceCount-arraylength"); return skip; } bool StatelessValidation::PreCallValidateGetFenceStatus(VkDevice device, VkFence fence, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::fence), fence); + skip |= state.ValidateRequiredHandle(loc.dot(Field::fence), fence); return skip; } bool StatelessValidation::PreCallValidateWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateHandleArray(loc.dot(Field::fenceCount), loc.dot(Field::pFences), fenceCount, pFences, true, true, - "VUID-vkWaitForFences-fenceCount-arraylength"); - skip |= ValidateBool32(loc.dot(Field::waitAll), waitAll); + skip |= state.ValidateHandleArray(loc.dot(Field::fenceCount), loc.dot(Field::pFences), fenceCount, pFences, true, true, + "VUID-vkWaitForFences-fenceCount-arraylength"); + skip |= state.ValidateBool32(loc.dot(Field::waitAll), waitAll); return skip; } @@ -11255,9 +13119,10 @@ bool StatelessValidation::PreCallValidateCreateSemaphore(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, true, - "VUID-vkCreateSemaphore-pCreateInfo-parameter", "VUID-VkSemaphoreCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, true, + "VUID-vkCreateSemaphore-pCreateInfo-parameter", "VUID-VkSemaphoreCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkSemaphoreCreateInfo = { @@ -11265,20 +13130,20 @@ bool StatelessValidation::PreCallValidateCreateSemaphore(VkDevice device, const VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR, VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT, VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV, VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkSemaphoreCreateInfo.size(), - allowed_structs_VkSemaphoreCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSemaphoreCreateInfo-pNext-pNext", "VUID-VkSemaphoreCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkSemaphoreCreateInfo.size(), + allowed_structs_VkSemaphoreCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSemaphoreCreateInfo-pNext-pNext", "VUID-VkSemaphoreCreateInfo-sType-unique", true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkSemaphoreCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkSemaphoreCreateInfo-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSemaphore), pSemaphore, "VUID-vkCreateSemaphore-pSemaphore-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSemaphore), pSemaphore, "VUID-vkCreateSemaphore-pSemaphore-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore, state); return skip; } @@ -11286,10 +13151,11 @@ bool StatelessValidation::PreCallValidateDestroySemaphore(VkDevice device, VkSem const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11298,60 +13164,65 @@ bool StatelessValidation::PreCallValidateCreateEvent(VkDevice device, const VkEv const VkAllocationCallbacks* pAllocator, VkEvent* pEvent, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, true, - "VUID-vkCreateEvent-pCreateInfo-parameter", "VUID-VkEventCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, true, + "VUID-vkCreateEvent-pCreateInfo-parameter", "VUID-VkEventCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkEventCreateInfo = {VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT}; - skip |= - ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkEventCreateInfo.size(), - allowed_structs_VkEventCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkEventCreateInfo-pNext-pNext", "VUID-VkEventCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkEventCreateInfo.size(), + allowed_structs_VkEventCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkEventCreateInfo-pNext-pNext", "VUID-VkEventCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkEventCreateFlagBits, AllVkEventCreateFlagBits, - pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkEventCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkEventCreateFlagBits, + AllVkEventCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkEventCreateInfo-flags-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pEvent), pEvent, "VUID-vkCreateEvent-pEvent-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateEvent(device, pCreateInfo, pAllocator, pEvent, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pEvent), pEvent, "VUID-vkCreateEvent-pEvent-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateEvent(device, pCreateInfo, pAllocator, pEvent, state); return skip; } bool StatelessValidation::PreCallValidateDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } bool StatelessValidation::PreCallValidateGetEventStatus(VkDevice device, VkEvent event, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= state.ValidateRequiredHandle(loc.dot(Field::event), event); return skip; } bool StatelessValidation::PreCallValidateSetEvent(VkDevice device, VkEvent event, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= state.ValidateRequiredHandle(loc.dot(Field::event), event); return skip; } bool StatelessValidation::PreCallValidateResetEvent(VkDevice device, VkEvent event, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= state.ValidateRequiredHandle(loc.dot(Field::event), event); return skip; } @@ -11359,9 +13230,10 @@ bool StatelessValidation::PreCallValidateCreateQueryPool(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO, true, - "VUID-vkCreateQueryPool-pCreateInfo-parameter", "VUID-VkQueryPoolCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO, true, + "VUID-vkCreateQueryPool-pCreateInfo-parameter", "VUID-VkQueryPoolCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkQueryPoolCreateInfo = { @@ -11378,23 +13250,23 @@ bool StatelessValidation::PreCallValidateCreateQueryPool(VkDevice device, const VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkQueryPoolCreateInfo.size(), - allowed_structs_VkQueryPoolCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkQueryPoolCreateInfo-pNext-pNext", "VUID-VkQueryPoolCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkQueryPoolCreateInfo.size(), + allowed_structs_VkQueryPoolCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkQueryPoolCreateInfo-pNext-pNext", "VUID-VkQueryPoolCreateInfo-sType-unique", true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkQueryPoolCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkQueryPoolCreateInfo-flags-zerobitmask"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::queryType), vvl::Enum::VkQueryType, pCreateInfo->queryType, - "VUID-VkQueryPoolCreateInfo-queryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::queryType), vvl::Enum::VkQueryType, pCreateInfo->queryType, + "VUID-VkQueryPoolCreateInfo-queryType-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pQueryPool), pQueryPool, "VUID-vkCreateQueryPool-pQueryPool-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pQueryPool), pQueryPool, "VUID-vkCreateQueryPool-pQueryPool-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool, state); return skip; } @@ -11402,10 +13274,11 @@ bool StatelessValidation::PreCallValidateDestroyQueryPool(VkDevice device, VkQue const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11414,15 +13287,16 @@ bool StatelessValidation::PreCallValidateGetQueryPoolResults(VkDevice device, Vk uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); - skip |= ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, - "VUID-vkGetQueryPoolResults-dataSize-arraylength", "VUID-vkGetQueryPoolResults-pData-parameter"); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryResultFlagBits, AllVkQueryResultFlagBits, flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkGetQueryPoolResults-flags-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkGetQueryPoolResults-dataSize-arraylength", "VUID-vkGetQueryPoolResults-pData-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryResultFlagBits, AllVkQueryResultFlagBits, flags, + kOptionalFlags, "VUID-vkGetQueryPoolResults-flags-parameter"); if (!skip) skip |= manual_PreCallValidateGetQueryPoolResults(device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags, - error_obj); + state); return skip; } @@ -11430,9 +13304,10 @@ bool StatelessValidation::PreCallValidateCreateBuffer(VkDevice device, const VkB const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, true, - "VUID-vkCreateBuffer-pCreateInfo-parameter", "VUID-VkBufferCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, true, + "VUID-vkCreateBuffer-pCreateInfo-parameter", "VUID-VkBufferCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkBufferCreateInfo = {VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA, @@ -11444,34 +13319,34 @@ bool StatelessValidation::PreCallValidateCreateBuffer(VkDevice device, const VkB VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkBufferCreateInfo.size(), - allowed_structs_VkBufferCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkBufferCreateInfo-pNext-pNext", "VUID-VkBufferCreateInfo-sType-unique", VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkBufferCreateInfo.size(), + allowed_structs_VkBufferCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBufferCreateInfo-pNext-pNext", "VUID-VkBufferCreateInfo-sType-unique", true); - skip |= - ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, AllVkBufferCreateFlagBits, - pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, + AllVkBufferCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkBufferCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, pCreateInfo->sharingMode, - "VUID-VkBufferCreateInfo-sharingMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, + pCreateInfo->sharingMode, "VUID-VkBufferCreateInfo-sharingMode-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pBuffer), pBuffer, "VUID-vkCreateBuffer-pBuffer-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateBuffer(device, pCreateInfo, pAllocator, pBuffer, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pBuffer), pBuffer, "VUID-vkCreateBuffer-pBuffer-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateBuffer(device, pCreateInfo, pAllocator, pBuffer, state); return skip; } bool StatelessValidation::PreCallValidateDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11480,33 +13355,34 @@ bool StatelessValidation::PreCallValidateCreateBufferView(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkBufferView* pView, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO, true, - "VUID-vkCreateBufferView-pCreateInfo-parameter", "VUID-VkBufferViewCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO, true, + "VUID-vkCreateBufferView-pCreateInfo-parameter", "VUID-VkBufferViewCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkBufferViewCreateInfo = {VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO, VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkBufferViewCreateInfo.size(), - allowed_structs_VkBufferViewCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkBufferViewCreateInfo-pNext-pNext", "VUID-VkBufferViewCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkBufferViewCreateInfo.size(), + allowed_structs_VkBufferViewCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBufferViewCreateInfo-pNext-pNext", "VUID-VkBufferViewCreateInfo-sType-unique", true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkBufferViewCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkBufferViewCreateInfo-flags-zerobitmask"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::buffer), pCreateInfo->buffer); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::buffer), pCreateInfo->buffer); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pCreateInfo->format, - "VUID-VkBufferViewCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pCreateInfo->format, + "VUID-VkBufferViewCreateInfo-format-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pView), pView, "VUID-vkCreateBufferView-pView-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateBufferView(device, pCreateInfo, pAllocator, pView, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pView), pView, "VUID-vkCreateBufferView-pView-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateBufferView(device, pCreateInfo, pAllocator, pView, state); return skip; } @@ -11514,10 +13390,11 @@ bool StatelessValidation::PreCallValidateDestroyBufferView(VkDevice device, VkBu const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11526,9 +13403,10 @@ bool StatelessValidation::PreCallValidateCreateImage(VkDevice device, const VkIm const VkAllocationCallbacks* pAllocator, VkImage* pImage, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, true, - "VUID-vkCreateImage-pCreateInfo-parameter", "VUID-VkImageCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, true, + "VUID-vkCreateImage-pCreateInfo-parameter", "VUID-VkImageCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkImageCreateInfo = { @@ -11552,55 +13430,56 @@ bool StatelessValidation::PreCallValidateCreateImage(VkDevice device, const VkIm VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= - ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkImageCreateInfo.size(), - allowed_structs_VkImageCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkImageCreateInfo.size(), + allowed_structs_VkImageCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, - pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, + AllVkImageCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkImageCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, pCreateInfo->imageType, - "VUID-VkImageCreateInfo-imageType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, pCreateInfo->imageType, + "VUID-VkImageCreateInfo-imageType-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pCreateInfo->format, - "VUID-VkImageCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pCreateInfo->format, + "VUID-VkImageCreateInfo-format-parameter"); // No xml-driven validation - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, pCreateInfo->samples, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, pCreateInfo->samples, kRequiredSingleBit, + "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pCreateInfo->tiling, - "VUID-VkImageCreateInfo-tiling-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pCreateInfo->tiling, + "VUID-VkImageCreateInfo-tiling-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, - pCreateInfo->usage, kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-usage-parameter", - "VUID-VkImageCreateInfo-usage-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pCreateInfo->usage, kRequiredFlags, + "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, pCreateInfo->sharingMode, - "VUID-VkImageCreateInfo-sharingMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, + pCreateInfo->sharingMode, "VUID-VkImageCreateInfo-sharingMode-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, pCreateInfo->initialLayout, - "VUID-VkImageCreateInfo-initialLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, + pCreateInfo->initialLayout, "VUID-VkImageCreateInfo-initialLayout-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pImage), pImage, "VUID-vkCreateImage-pImage-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateImage(device, pCreateInfo, pAllocator, pImage, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pImage), pImage, "VUID-vkCreateImage-pImage-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateImage(device, pCreateInfo, pAllocator, pImage, state); return skip; } bool StatelessValidation::PreCallValidateDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11610,17 +13489,19 @@ bool StatelessValidation::PreCallValidateGetImageSubresourceLayout(VkDevice devi VkSubresourceLayout* pLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidateRequiredPointer(loc.dot(Field::pSubresource), pSubresource, - "VUID-vkGetImageSubresourceLayout-pSubresource-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSubresource), pSubresource, + "VUID-vkGetImageSubresourceLayout-pSubresource-parameter"); if (pSubresource != nullptr) { [[maybe_unused]] const Location pSubresource_loc = loc.dot(Field::pSubresource); - skip |= ValidateFlags(pSubresource_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pSubresource->aspectMask, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageSubresource-aspectMask-parameter", "VUID-VkImageSubresource-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pSubresource_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pSubresource->aspectMask, kRequiredFlags, + "VUID-VkImageSubresource-aspectMask-parameter", + "VUID-VkImageSubresource-aspectMask-requiredbitmask"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pLayout), pLayout, "VUID-vkGetImageSubresourceLayout-pLayout-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pLayout), pLayout, "VUID-vkGetImageSubresourceLayout-pLayout-parameter"); return skip; } @@ -11628,9 +13509,10 @@ bool StatelessValidation::PreCallValidateCreateImageView(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkImageView* pView, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, true, - "VUID-vkCreateImageView-pCreateInfo-parameter", "VUID-VkImageViewCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, true, + "VUID-vkCreateImageView-pCreateInfo-parameter", "VUID-VkImageViewCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkImageViewCreateInfo = { @@ -11643,46 +13525,46 @@ bool StatelessValidation::PreCallValidateCreateImageView(VkDevice device, const VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkImageViewCreateInfo.size(), - allowed_structs_VkImageViewCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkImageViewCreateInfo-pNext-pNext", "VUID-VkImageViewCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkImageViewCreateInfo.size(), + allowed_structs_VkImageViewCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkImageViewCreateInfo-pNext-pNext", "VUID-VkImageViewCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageViewCreateFlagBits, - AllVkImageViewCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkImageViewCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageViewCreateFlagBits, + AllVkImageViewCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkImageViewCreateInfo-flags-parameter"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::image), pCreateInfo->image); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::image), pCreateInfo->image); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::viewType), vvl::Enum::VkImageViewType, pCreateInfo->viewType, - "VUID-VkImageViewCreateInfo-viewType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::viewType), vvl::Enum::VkImageViewType, pCreateInfo->viewType, + "VUID-VkImageViewCreateInfo-viewType-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pCreateInfo->format, - "VUID-VkImageViewCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pCreateInfo->format, + "VUID-VkImageViewCreateInfo-format-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::r), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.r, - "VUID-VkComponentMapping-r-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::r), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.r, + "VUID-VkComponentMapping-r-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::g), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.g, - "VUID-VkComponentMapping-g-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::g), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.g, + "VUID-VkComponentMapping-g-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::b), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.b, - "VUID-VkComponentMapping-b-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::b), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.b, + "VUID-VkComponentMapping-b-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::a), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.a, - "VUID-VkComponentMapping-a-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::a), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.a, + "VUID-VkComponentMapping-a-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pCreateInfo->subresourceRange.aspectMask, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageSubresourceRange-aspectMask-parameter", - "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pCreateInfo->subresourceRange.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceRange-aspectMask-parameter", + "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pView), pView, "VUID-vkCreateImageView-pView-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateImageView(device, pCreateInfo, pAllocator, pView, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pView), pView, "VUID-vkCreateImageView-pView-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateImageView(device, pCreateInfo, pAllocator, pView, state); return skip; } @@ -11690,10 +13572,11 @@ bool StatelessValidation::PreCallValidateDestroyImageView(VkDevice device, VkIma const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11702,25 +13585,27 @@ bool StatelessValidation::PreCallValidateCreateShaderModule(VkDevice device, con const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, true, - "VUID-vkCreateShaderModule-pCreateInfo-parameter", "VUID-VkShaderModuleCreateInfo-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, true, + "VUID-vkCreateShaderModule-pCreateInfo-parameter", "VUID-VkShaderModuleCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkShaderModuleCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkShaderModuleCreateInfo-flags-zerobitmask"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::codeSize), pCreateInfo_loc.dot(Field::pCode), pCreateInfo->codeSize / 4, - &pCreateInfo->pCode, true, true, "VUID-VkShaderModuleCreateInfo-codeSize-01085", - "VUID-VkShaderModuleCreateInfo-pCode-parameter"); + skip |= state.ValidateArray( + pCreateInfo_loc.dot(Field::codeSize), pCreateInfo_loc.dot(Field::pCode), pCreateInfo->codeSize / 4, &pCreateInfo->pCode, + true, true, "VUID-VkShaderModuleCreateInfo-codeSize-01085", "VUID-VkShaderModuleCreateInfo-pCode-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pShaderModule), pShaderModule, "VUID-vkCreateShaderModule-pShaderModule-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pShaderModule), pShaderModule, + "VUID-vkCreateShaderModule-pShaderModule-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule, state); return skip; } @@ -11728,10 +13613,11 @@ bool StatelessValidation::PreCallValidateDestroyShaderModule(VkDevice device, Vk const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11740,29 +13626,31 @@ bool StatelessValidation::PreCallValidateCreatePipelineCache(VkDevice device, co const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO, true, - "VUID-vkCreatePipelineCache-pCreateInfo-parameter", "VUID-VkPipelineCacheCreateInfo-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO, true, + "VUID-vkCreatePipelineCache-pCreateInfo-parameter", "VUID-VkPipelineCacheCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineCacheCreateInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineCacheCreateInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineCacheCreateFlagBits, - AllVkPipelineCacheCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineCacheCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineCacheCreateFlagBits, + AllVkPipelineCacheCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkPipelineCacheCreateInfo-flags-parameter"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::initialDataSize), pCreateInfo_loc.dot(Field::pInitialData), - pCreateInfo->initialDataSize, &pCreateInfo->pInitialData, false, true, kVUIDUndefined, - "VUID-VkPipelineCacheCreateInfo-pInitialData-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::initialDataSize), pCreateInfo_loc.dot(Field::pInitialData), + pCreateInfo->initialDataSize, &pCreateInfo->pInitialData, false, true, kVUIDUndefined, + "VUID-VkPipelineCacheCreateInfo-pInitialData-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pPipelineCache), pPipelineCache, - "VUID-vkCreatePipelineCache-pPipelineCache-parameter"); - if (!skip) skip |= manual_PreCallValidateCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pPipelineCache), pPipelineCache, + "VUID-vkCreatePipelineCache-pPipelineCache-parameter"); + if (!skip) skip |= manual_PreCallValidateCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache, state); return skip; } @@ -11770,10 +13658,11 @@ bool StatelessValidation::PreCallValidateDestroyPipelineCache(VkDevice device, V const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11781,11 +13670,12 @@ bool StatelessValidation::PreCallValidateDestroyPipelineCache(VkDevice device, V bool StatelessValidation::PreCallValidateGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::pipelineCache), pipelineCache); - skip |= ValidatePointerArray(loc.dot(Field::pDataSize), loc.dot(Field::pData), pDataSize, &pData, true, false, false, - "VUID-vkGetPipelineCacheData-pDataSize-parameter", kVUIDUndefined, - "VUID-vkGetPipelineCacheData-pData-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipelineCache), pipelineCache); + skip |= state.ValidatePointerArray(loc.dot(Field::pDataSize), loc.dot(Field::pData), pDataSize, &pData, true, false, false, + "VUID-vkGetPipelineCacheData-pDataSize-parameter", kVUIDUndefined, + "VUID-vkGetPipelineCacheData-pData-parameter"); return skip; } @@ -11793,11 +13683,12 @@ bool StatelessValidation::PreCallValidateMergePipelineCaches(VkDevice device, Vk const VkPipelineCache* pSrcCaches, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::dstCache), dstCache); - skip |= ValidateHandleArray(loc.dot(Field::srcCacheCount), loc.dot(Field::pSrcCaches), srcCacheCount, pSrcCaches, true, true, - "VUID-vkMergePipelineCaches-srcCacheCount-arraylength"); - if (!skip) skip |= manual_PreCallValidateMergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstCache), dstCache); + skip |= state.ValidateHandleArray(loc.dot(Field::srcCacheCount), loc.dot(Field::pSrcCaches), srcCacheCount, pSrcCaches, true, + true, "VUID-vkMergePipelineCaches-srcCacheCount-arraylength"); + if (!skip) skip |= manual_PreCallValidateMergePipelineCaches(device, dstCache, srcCacheCount, pSrcCaches, state); return skip; } @@ -11807,8 +13698,9 @@ bool StatelessValidation::PreCallValidateCreateGraphicsPipelines(VkDevice device const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, pCreateInfos, VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, true, true, "VUID-VkGraphicsPipelineCreateInfo-sType-sType", "VUID-vkCreateGraphicsPipelines-pCreateInfos-parameter", "VUID-vkCreateGraphicsPipelines-createInfoCount-arraylength"); @@ -11835,45 +13727,44 @@ bool StatelessValidation::PreCallValidateCreateGraphicsPipelines(VkDevice device VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO, VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO}; - skip |= ValidateStructPnext(pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, - allowed_structs_VkGraphicsPipelineCreateInfo.size(), - allowed_structs_VkGraphicsPipelineCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkGraphicsPipelineCreateInfo-pNext-pNext", - "VUID-VkGraphicsPipelineCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, allowed_structs_VkGraphicsPipelineCreateInfo.size(), + allowed_structs_VkGraphicsPipelineCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkGraphicsPipelineCreateInfo-pNext-pNext", "VUID-VkGraphicsPipelineCreateInfo-sType-unique", true); - skip |= ValidateStructType(pCreateInfos_loc.dot(Field::pDynamicState), pCreateInfos[createInfoIndex].pDynamicState, - VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, false, - "VUID-VkGraphicsPipelineCreateInfo-pDynamicState-parameter", - "VUID-VkPipelineDynamicStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType( + pCreateInfos_loc.dot(Field::pDynamicState), pCreateInfos[createInfoIndex].pDynamicState, + VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, false, + "VUID-VkGraphicsPipelineCreateInfo-pDynamicState-parameter", "VUID-VkPipelineDynamicStateCreateInfo-sType-sType"); if (pCreateInfos[createInfoIndex].pDynamicState != nullptr) { [[maybe_unused]] const Location pDynamicState_loc = pCreateInfos_loc.dot(Field::pDynamicState); - skip |= ValidateStructPnext(pDynamicState_loc, pCreateInfos[createInfoIndex].pDynamicState->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkPipelineDynamicStateCreateInfo-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDynamicState_loc, pCreateInfos[createInfoIndex].pDynamicState->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineDynamicStateCreateInfo-pNext-pNext", + kVUIDUndefined, true); - skip |= - ValidateReservedFlags(pDynamicState_loc.dot(Field::flags), pCreateInfos[createInfoIndex].pDynamicState->flags, - "VUID-VkPipelineDynamicStateCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pDynamicState_loc.dot(Field::flags), + pCreateInfos[createInfoIndex].pDynamicState->flags, + "VUID-VkPipelineDynamicStateCreateInfo-flags-zerobitmask"); - skip |= ValidateRangedEnumArray(pDynamicState_loc.dot(Field::dynamicStateCount), - pDynamicState_loc.dot(Field::pDynamicStates), vvl::Enum::VkDynamicState, - pCreateInfos[createInfoIndex].pDynamicState->dynamicStateCount, - pCreateInfos[createInfoIndex].pDynamicState->pDynamicStates, false, true, - kVUIDUndefined, "VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-parameter"); + skip |= state.ValidateRangedEnumArray( + pDynamicState_loc.dot(Field::dynamicStateCount), pDynamicState_loc.dot(Field::pDynamicStates), + vvl::Enum::VkDynamicState, pCreateInfos[createInfoIndex].pDynamicState->dynamicStateCount, + pCreateInfos[createInfoIndex].pDynamicState->pDynamicStates, false, true, kVUIDUndefined, + "VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-parameter"); } } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, true, - "VUID-vkCreateGraphicsPipelines-createInfoCount-arraylength", - "VUID-vkCreateGraphicsPipelines-pPipelines-parameter"); + skip |= state.ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, + true, "VUID-vkCreateGraphicsPipelines-createInfoCount-arraylength", + "VUID-vkCreateGraphicsPipelines-pPipelines-parameter"); if (!skip) skip |= manual_PreCallValidateCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, - pPipelines, error_obj); + pPipelines, state); return skip; } @@ -11883,8 +13774,9 @@ bool StatelessValidation::PreCallValidateCreateComputePipelines(VkDevice device, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, pCreateInfos, VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, true, true, "VUID-VkComputePipelineCreateInfo-sType-sType", "VUID-vkCreateComputePipelines-pCreateInfos-parameter", "VUID-vkCreateComputePipelines-createInfoCount-arraylength"); @@ -11897,15 +13789,14 @@ bool StatelessValidation::PreCallValidateCreateComputePipelines(VkDevice device, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO, VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI}; - skip |= ValidateStructPnext(pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, - allowed_structs_VkComputePipelineCreateInfo.size(), - allowed_structs_VkComputePipelineCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkComputePipelineCreateInfo-pNext-pNext", - "VUID-VkComputePipelineCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, allowed_structs_VkComputePipelineCreateInfo.size(), + allowed_structs_VkComputePipelineCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkComputePipelineCreateInfo-pNext-pNext", "VUID-VkComputePipelineCreateInfo-sType-unique", true); - skip |= ValidateStructType(pCreateInfos_loc.dot(Field::stage), &(pCreateInfos[createInfoIndex].stage), - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineShaderStageCreateInfo-sType-sType"); + skip |= state.ValidateStructType(pCreateInfos_loc.dot(Field::stage), &(pCreateInfos[createInfoIndex].stage), + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineShaderStageCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkPipelineShaderStageCreateInfo = { VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, @@ -11916,31 +13807,30 @@ bool StatelessValidation::PreCallValidateCreateComputePipelines(VkDevice device, VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pCreateInfos_loc, pCreateInfos[createInfoIndex].stage.pNext, - allowed_structs_VkPipelineShaderStageCreateInfo.size(), - allowed_structs_VkPipelineShaderStageCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", - "VUID-VkPipelineShaderStageCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfos_loc, pCreateInfos[createInfoIndex].stage.pNext, allowed_structs_VkPipelineShaderStageCreateInfo.size(), + allowed_structs_VkPipelineShaderStageCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", "VUID-VkPipelineShaderStageCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, pCreateInfos[createInfoIndex].stage.flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, pCreateInfos[createInfoIndex].stage.flags, + kOptionalFlags, "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].stage.stage, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", - "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].stage.stage, kRequiredSingleBit, + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); - skip |= ValidateRequiredPointer(pCreateInfos_loc.dot(Field::pName), pCreateInfos[createInfoIndex].stage.pName, - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + skip |= state.ValidateRequiredPointer(pCreateInfos_loc.dot(Field::pName), pCreateInfos[createInfoIndex].stage.pName, + "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); if (pCreateInfos[createInfoIndex].stage.pSpecializationInfo != nullptr) { [[maybe_unused]] const Location pSpecializationInfo_loc = pCreateInfos_loc.dot(Field::pSpecializationInfo); - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), - pSpecializationInfo_loc.dot(Field::pMapEntries), - pCreateInfos[createInfoIndex].stage.pSpecializationInfo->mapEntryCount, - &pCreateInfos[createInfoIndex].stage.pSpecializationInfo->pMapEntries, false, true, - kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), + pSpecializationInfo_loc.dot(Field::pMapEntries), + pCreateInfos[createInfoIndex].stage.pSpecializationInfo->mapEntryCount, + &pCreateInfos[createInfoIndex].stage.pSpecializationInfo->pMapEntries, false, true, + kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); if (pCreateInfos[createInfoIndex].stage.pSpecializationInfo->pMapEntries != nullptr) { for (uint32_t mapEntryIndex = 0; @@ -11951,25 +13841,25 @@ bool StatelessValidation::PreCallValidateCreateComputePipelines(VkDevice device, } } - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), - pCreateInfos[createInfoIndex].stage.pSpecializationInfo->dataSize, - &pCreateInfos[createInfoIndex].stage.pSpecializationInfo->pData, false, true, kVUIDUndefined, - "VUID-VkSpecializationInfo-pData-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), + pCreateInfos[createInfoIndex].stage.pSpecializationInfo->dataSize, + &pCreateInfos[createInfoIndex].stage.pSpecializationInfo->pData, false, true, + kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); } - skip |= ValidateRequiredHandle(pCreateInfos_loc.dot(Field::layout), pCreateInfos[createInfoIndex].layout); + skip |= state.ValidateRequiredHandle(pCreateInfos_loc.dot(Field::layout), pCreateInfos[createInfoIndex].layout); } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, true, - "VUID-vkCreateComputePipelines-createInfoCount-arraylength", - "VUID-vkCreateComputePipelines-pPipelines-parameter"); + skip |= state.ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, + true, "VUID-vkCreateComputePipelines-createInfoCount-arraylength", + "VUID-vkCreateComputePipelines-pPipelines-parameter"); if (!skip) skip |= manual_PreCallValidateCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, - pPipelines, error_obj); + pPipelines, state); return skip; } @@ -11977,10 +13867,11 @@ bool StatelessValidation::PreCallValidateDestroyPipeline(VkDevice device, VkPipe const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11990,38 +13881,41 @@ bool StatelessValidation::PreCallValidateCreatePipelineLayout(VkDevice device, c VkPipelineLayout* pPipelineLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, true, - "VUID-vkCreatePipelineLayout-pCreateInfo-parameter", "VUID-VkPipelineLayoutCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, true, + "VUID-vkCreatePipelineLayout-pCreateInfo-parameter", + "VUID-VkPipelineLayoutCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineLayoutCreateFlagBits, - AllVkPipelineLayoutCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineLayoutCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineLayoutCreateFlagBits, + AllVkPipelineLayoutCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkPipelineLayoutCreateInfo-flags-parameter"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::pushConstantRangeCount), pCreateInfo_loc.dot(Field::pPushConstantRanges), - pCreateInfo->pushConstantRangeCount, &pCreateInfo->pPushConstantRanges, false, true, kVUIDUndefined, - "VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-parameter"); + skip |= + state.ValidateArray(pCreateInfo_loc.dot(Field::pushConstantRangeCount), pCreateInfo_loc.dot(Field::pPushConstantRanges), + pCreateInfo->pushConstantRangeCount, &pCreateInfo->pPushConstantRanges, false, true, kVUIDUndefined, + "VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-parameter"); if (pCreateInfo->pPushConstantRanges != nullptr) { for (uint32_t pushConstantRangeIndex = 0; pushConstantRangeIndex < pCreateInfo->pushConstantRangeCount; ++pushConstantRangeIndex) { [[maybe_unused]] const Location pPushConstantRanges_loc = pCreateInfo_loc.dot(Field::pPushConstantRanges, pushConstantRangeIndex); - skip |= ValidateFlags(pPushConstantRanges_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfo->pPushConstantRanges[pushConstantRangeIndex].stageFlags, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkPushConstantRange-stageFlags-parameter", - "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); + skip |= state.ValidateFlags( + pPushConstantRanges_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfo->pPushConstantRanges[pushConstantRangeIndex].stageFlags, kRequiredFlags, + "VUID-VkPushConstantRange-stageFlags-parameter", "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); } } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pPipelineLayout), pPipelineLayout, - "VUID-vkCreatePipelineLayout-pPipelineLayout-parameter"); - if (!skip) skip |= manual_PreCallValidateCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pPipelineLayout), pPipelineLayout, + "VUID-vkCreatePipelineLayout-pPipelineLayout-parameter"); + if (!skip) skip |= manual_PreCallValidateCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout, state); return skip; } @@ -12029,10 +13923,11 @@ bool StatelessValidation::PreCallValidateDestroyPipelineLayout(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12041,9 +13936,10 @@ bool StatelessValidation::PreCallValidateCreateSampler(VkDevice device, const Vk const VkAllocationCallbacks* pAllocator, VkSampler* pSampler, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, true, - "VUID-vkCreateSampler-pCreateInfo-parameter", "VUID-VkSamplerCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, true, + "VUID-vkCreateSampler-pCreateInfo-parameter", "VUID-VkSamplerCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkSamplerCreateInfo = { @@ -12055,55 +13951,55 @@ bool StatelessValidation::PreCallValidateCreateSampler(VkDevice device, const Vk VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkSamplerCreateInfo.size(), - allowed_structs_VkSamplerCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSamplerCreateInfo-pNext-pNext", "VUID-VkSamplerCreateInfo-sType-unique", VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkSamplerCreateInfo.size(), + allowed_structs_VkSamplerCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSamplerCreateInfo-pNext-pNext", "VUID-VkSamplerCreateInfo-sType-unique", true); - skip |= - ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSamplerCreateFlagBits, AllVkSamplerCreateFlagBits, - pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSamplerCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSamplerCreateFlagBits, + AllVkSamplerCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkSamplerCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::magFilter), vvl::Enum::VkFilter, pCreateInfo->magFilter, - "VUID-VkSamplerCreateInfo-magFilter-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::magFilter), vvl::Enum::VkFilter, pCreateInfo->magFilter, + "VUID-VkSamplerCreateInfo-magFilter-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::minFilter), vvl::Enum::VkFilter, pCreateInfo->minFilter, - "VUID-VkSamplerCreateInfo-minFilter-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::minFilter), vvl::Enum::VkFilter, pCreateInfo->minFilter, + "VUID-VkSamplerCreateInfo-minFilter-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::mipmapMode), vvl::Enum::VkSamplerMipmapMode, pCreateInfo->mipmapMode, - "VUID-VkSamplerCreateInfo-mipmapMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::mipmapMode), vvl::Enum::VkSamplerMipmapMode, + pCreateInfo->mipmapMode, "VUID-VkSamplerCreateInfo-mipmapMode-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::addressModeU), vvl::Enum::VkSamplerAddressMode, - pCreateInfo->addressModeU, "VUID-VkSamplerCreateInfo-addressModeU-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::addressModeU), vvl::Enum::VkSamplerAddressMode, + pCreateInfo->addressModeU, "VUID-VkSamplerCreateInfo-addressModeU-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::addressModeV), vvl::Enum::VkSamplerAddressMode, - pCreateInfo->addressModeV, "VUID-VkSamplerCreateInfo-addressModeV-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::addressModeV), vvl::Enum::VkSamplerAddressMode, + pCreateInfo->addressModeV, "VUID-VkSamplerCreateInfo-addressModeV-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::addressModeW), vvl::Enum::VkSamplerAddressMode, - pCreateInfo->addressModeW, "VUID-VkSamplerCreateInfo-addressModeW-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::addressModeW), vvl::Enum::VkSamplerAddressMode, + pCreateInfo->addressModeW, "VUID-VkSamplerCreateInfo-addressModeW-parameter"); - skip |= ValidateBool32(pCreateInfo_loc.dot(Field::anisotropyEnable), pCreateInfo->anisotropyEnable); + skip |= state.ValidateBool32(pCreateInfo_loc.dot(Field::anisotropyEnable), pCreateInfo->anisotropyEnable); - skip |= ValidateBool32(pCreateInfo_loc.dot(Field::compareEnable), pCreateInfo->compareEnable); + skip |= state.ValidateBool32(pCreateInfo_loc.dot(Field::compareEnable), pCreateInfo->compareEnable); - skip |= ValidateBool32(pCreateInfo_loc.dot(Field::unnormalizedCoordinates), pCreateInfo->unnormalizedCoordinates); + skip |= state.ValidateBool32(pCreateInfo_loc.dot(Field::unnormalizedCoordinates), pCreateInfo->unnormalizedCoordinates); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSampler), pSampler, "VUID-vkCreateSampler-pSampler-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateSampler(device, pCreateInfo, pAllocator, pSampler, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSampler), pSampler, "VUID-vkCreateSampler-pSampler-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateSampler(device, pCreateInfo, pAllocator, pSampler, state); return skip; } bool StatelessValidation::PreCallValidateDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12114,45 +14010,46 @@ bool StatelessValidation::PreCallValidateCreateDescriptorSetLayout(VkDevice devi VkDescriptorSetLayout* pSetLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, true, - "VUID-vkCreateDescriptorSetLayout-pCreateInfo-parameter", - "VUID-VkDescriptorSetLayoutCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, + true, "VUID-vkCreateDescriptorSetLayout-pCreateInfo-parameter", + "VUID-VkDescriptorSetLayoutCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkDescriptorSetLayoutCreateInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDescriptorSetLayoutCreateInfo.size(), - allowed_structs_VkDescriptorSetLayoutCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext", - "VUID-VkDescriptorSetLayoutCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDescriptorSetLayoutCreateInfo.size(), + allowed_structs_VkDescriptorSetLayoutCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext", "VUID-VkDescriptorSetLayoutCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDescriptorSetLayoutCreateFlagBits, - AllVkDescriptorSetLayoutCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDescriptorSetLayoutCreateFlagBits, + AllVkDescriptorSetLayoutCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::bindingCount), pCreateInfo_loc.dot(Field::pBindings), - pCreateInfo->bindingCount, &pCreateInfo->pBindings, false, true, kVUIDUndefined, - "VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::bindingCount), pCreateInfo_loc.dot(Field::pBindings), + pCreateInfo->bindingCount, &pCreateInfo->pBindings, false, true, kVUIDUndefined, + "VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter"); if (pCreateInfo->pBindings != nullptr) { for (uint32_t bindingIndex = 0; bindingIndex < pCreateInfo->bindingCount; ++bindingIndex) { [[maybe_unused]] const Location pBindings_loc = pCreateInfo_loc.dot(Field::pBindings, bindingIndex); - skip |= ValidateRangedEnum(pBindings_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, - pCreateInfo->pBindings[bindingIndex].descriptorType, - "VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pBindings_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, + pCreateInfo->pBindings[bindingIndex].descriptorType, + "VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter"); } } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pSetLayout), pSetLayout, "VUID-vkCreateDescriptorSetLayout-pSetLayout-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSetLayout), pSetLayout, + "VUID-vkCreateDescriptorSetLayout-pSetLayout-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout, state); return skip; } @@ -12160,10 +14057,11 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorSetLayout(VkDevice dev const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12173,44 +14071,46 @@ bool StatelessValidation::PreCallValidateCreateDescriptorPool(VkDevice device, c VkDescriptorPool* pDescriptorPool, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, true, - "VUID-vkCreateDescriptorPool-pCreateInfo-parameter", "VUID-VkDescriptorPoolCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, true, + "VUID-vkCreateDescriptorPool-pCreateInfo-parameter", + "VUID-VkDescriptorPoolCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkDescriptorPoolCreateInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO, VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDescriptorPoolCreateInfo.size(), - allowed_structs_VkDescriptorPoolCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorPoolCreateInfo-pNext-pNext", "VUID-VkDescriptorPoolCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDescriptorPoolCreateInfo.size(), + allowed_structs_VkDescriptorPoolCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorPoolCreateInfo-pNext-pNext", + "VUID-VkDescriptorPoolCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDescriptorPoolCreateFlagBits, - AllVkDescriptorPoolCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkDescriptorPoolCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDescriptorPoolCreateFlagBits, + AllVkDescriptorPoolCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkDescriptorPoolCreateInfo-flags-parameter"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::poolSizeCount), pCreateInfo_loc.dot(Field::pPoolSizes), - pCreateInfo->poolSizeCount, &pCreateInfo->pPoolSizes, false, true, kVUIDUndefined, - "VUID-VkDescriptorPoolCreateInfo-pPoolSizes-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::poolSizeCount), pCreateInfo_loc.dot(Field::pPoolSizes), + pCreateInfo->poolSizeCount, &pCreateInfo->pPoolSizes, false, true, kVUIDUndefined, + "VUID-VkDescriptorPoolCreateInfo-pPoolSizes-parameter"); if (pCreateInfo->pPoolSizes != nullptr) { for (uint32_t poolSizeIndex = 0; poolSizeIndex < pCreateInfo->poolSizeCount; ++poolSizeIndex) { [[maybe_unused]] const Location pPoolSizes_loc = pCreateInfo_loc.dot(Field::pPoolSizes, poolSizeIndex); - skip |= ValidateRangedEnum(pPoolSizes_loc.dot(Field::type), vvl::Enum::VkDescriptorType, - pCreateInfo->pPoolSizes[poolSizeIndex].type, "VUID-VkDescriptorPoolSize-type-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pPoolSizes_loc.dot(Field::type), vvl::Enum::VkDescriptorType, + pCreateInfo->pPoolSizes[poolSizeIndex].type, + "VUID-VkDescriptorPoolSize-type-parameter"); } } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pDescriptorPool), pDescriptorPool, - "VUID-vkCreateDescriptorPool-pDescriptorPool-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pDescriptorPool), pDescriptorPool, + "VUID-vkCreateDescriptorPool-pDescriptorPool-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool, state); return skip; } @@ -12218,10 +14118,11 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorPool(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12229,9 +14130,10 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorPool(VkDevice device, bool StatelessValidation::PreCallValidateResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorPool), descriptorPool); - skip |= ValidateReservedFlags(loc.dot(Field::flags), flags, "VUID-vkResetDescriptorPool-flags-zerobitmask"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::descriptorPool), descriptorPool); + skip |= state.ValidateReservedFlags(loc.dot(Field::flags), flags, "VUID-vkResetDescriptorPool-flags-zerobitmask"); return skip; } @@ -12239,31 +14141,33 @@ bool StatelessValidation::PreCallValidateAllocateDescriptorSets(VkDevice device, VkDescriptorSet* pDescriptorSets, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= - ValidateStructType(loc.dot(Field::pAllocateInfo), pAllocateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, true, - "VUID-vkAllocateDescriptorSets-pAllocateInfo-parameter", "VUID-VkDescriptorSetAllocateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pAllocateInfo), pAllocateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, + true, "VUID-vkAllocateDescriptorSets-pAllocateInfo-parameter", + "VUID-VkDescriptorSetAllocateInfo-sType-sType"); if (pAllocateInfo != nullptr) { [[maybe_unused]] const Location pAllocateInfo_loc = loc.dot(Field::pAllocateInfo); constexpr std::array allowed_structs_VkDescriptorSetAllocateInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO}; - skip |= ValidateStructPnext(pAllocateInfo_loc, pAllocateInfo->pNext, allowed_structs_VkDescriptorSetAllocateInfo.size(), - allowed_structs_VkDescriptorSetAllocateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorSetAllocateInfo-pNext-pNext", "VUID-VkDescriptorSetAllocateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pAllocateInfo_loc, pAllocateInfo->pNext, allowed_structs_VkDescriptorSetAllocateInfo.size(), + allowed_structs_VkDescriptorSetAllocateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorSetAllocateInfo-pNext-pNext", "VUID-VkDescriptorSetAllocateInfo-sType-unique", true); - skip |= ValidateRequiredHandle(pAllocateInfo_loc.dot(Field::descriptorPool), pAllocateInfo->descriptorPool); + skip |= state.ValidateRequiredHandle(pAllocateInfo_loc.dot(Field::descriptorPool), pAllocateInfo->descriptorPool); - skip |= ValidateHandleArray(pAllocateInfo_loc.dot(Field::descriptorSetCount), pAllocateInfo_loc.dot(Field::pSetLayouts), - pAllocateInfo->descriptorSetCount, pAllocateInfo->pSetLayouts, true, true, - "VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength"); + skip |= + state.ValidateHandleArray(pAllocateInfo_loc.dot(Field::descriptorSetCount), pAllocateInfo_loc.dot(Field::pSetLayouts), + pAllocateInfo->descriptorSetCount, pAllocateInfo->pSetLayouts, true, true, + "VUID-VkDescriptorSetAllocateInfo-descriptorSetCount-arraylength"); } if (pAllocateInfo != nullptr) { - skip |= ValidateArray(loc.dot(Field::pAllocateInfo).dot(Field::descriptorSetCount), loc.dot(Field::pDescriptorSets), - pAllocateInfo->descriptorSetCount, &pDescriptorSets, true, true, - "VUID-vkAllocateDescriptorSets-pAllocateInfo::descriptorSetCount-arraylength", - "VUID-vkAllocateDescriptorSets-pDescriptorSets-parameter"); + skip |= state.ValidateArray(loc.dot(Field::pAllocateInfo).dot(Field::descriptorSetCount), loc.dot(Field::pDescriptorSets), + pAllocateInfo->descriptorSetCount, &pDescriptorSets, true, true, + "VUID-vkAllocateDescriptorSets-pAllocateInfo::descriptorSetCount-arraylength", + "VUID-vkAllocateDescriptorSets-pDescriptorSets-parameter"); } return skip; } @@ -12272,12 +14176,12 @@ bool StatelessValidation::PreCallValidateFreeDescriptorSets(VkDevice device, VkD uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorPool), descriptorPool); - skip |= ValidateArray(loc.dot(Field::descriptorSetCount), loc, descriptorSetCount, &pDescriptorSets, true, false, - "VUID-vkFreeDescriptorSets-descriptorSetCount-arraylength", kVUIDUndefined); - if (!skip) - skip |= manual_PreCallValidateFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::descriptorPool), descriptorPool); + skip |= state.ValidateArray(loc.dot(Field::descriptorSetCount), loc, descriptorSetCount, &pDescriptorSets, true, false, + "VUID-vkFreeDescriptorSets-descriptorSetCount-arraylength", kVUIDUndefined); + if (!skip) skip |= manual_PreCallValidateFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets, state); return skip; } @@ -12287,11 +14191,12 @@ bool StatelessValidation::PreCallValidateUpdateDescriptorSets(VkDevice device, u const VkCopyDescriptorSet* pDescriptorCopies, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray(loc.dot(Field::descriptorWriteCount), loc.dot(Field::pDescriptorWrites), descriptorWriteCount, - pDescriptorWrites, VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, false, true, - "VUID-VkWriteDescriptorSet-sType-sType", - "VUID-vkUpdateDescriptorSets-pDescriptorWrites-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::descriptorWriteCount), loc.dot(Field::pDescriptorWrites), + descriptorWriteCount, pDescriptorWrites, VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, false, + true, "VUID-VkWriteDescriptorSet-sType-sType", + "VUID-vkUpdateDescriptorSets-pDescriptorWrites-parameter", kVUIDUndefined); if (pDescriptorWrites != nullptr) { for (uint32_t descriptorWriteIndex = 0; descriptorWriteIndex < descriptorWriteCount; ++descriptorWriteIndex) { [[maybe_unused]] const Location pDescriptorWrites_loc = loc.dot(Field::pDescriptorWrites, descriptorWriteIndex); @@ -12300,40 +14205,42 @@ bool StatelessValidation::PreCallValidateUpdateDescriptorSets(VkDevice device, u VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV, VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK}; - skip |= ValidateStructPnext(pDescriptorWrites_loc, pDescriptorWrites[descriptorWriteIndex].pNext, - allowed_structs_VkWriteDescriptorSet.size(), allowed_structs_VkWriteDescriptorSet.data(), - GeneratedVulkanHeaderVersion, "VUID-VkWriteDescriptorSet-pNext-pNext", - "VUID-VkWriteDescriptorSet-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pDescriptorWrites_loc, pDescriptorWrites[descriptorWriteIndex].pNext, allowed_structs_VkWriteDescriptorSet.size(), + allowed_structs_VkWriteDescriptorSet.data(), GeneratedVulkanHeaderVersion, "VUID-VkWriteDescriptorSet-pNext-pNext", + "VUID-VkWriteDescriptorSet-sType-unique", true); - skip |= ValidateRangedEnum(pDescriptorWrites_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, - pDescriptorWrites[descriptorWriteIndex].descriptorType, - "VUID-VkWriteDescriptorSet-descriptorType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDescriptorWrites_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, + pDescriptorWrites[descriptorWriteIndex].descriptorType, + "VUID-VkWriteDescriptorSet-descriptorType-parameter"); - skip |= ValidateArray(pDescriptorWrites_loc.dot(Field::descriptorCount), loc, - pDescriptorWrites[descriptorWriteIndex].descriptorCount, - &pDescriptorWrites[descriptorWriteIndex].pImageInfo, true, false, - "VUID-VkWriteDescriptorSet-descriptorCount-arraylength", kVUIDUndefined); + skip |= state.ValidateArray(pDescriptorWrites_loc.dot(Field::descriptorCount), loc, + pDescriptorWrites[descriptorWriteIndex].descriptorCount, + &pDescriptorWrites[descriptorWriteIndex].pImageInfo, true, false, + "VUID-VkWriteDescriptorSet-descriptorCount-arraylength", kVUIDUndefined); } } - skip |= ValidateStructTypeArray(loc.dot(Field::descriptorCopyCount), loc.dot(Field::pDescriptorCopies), descriptorCopyCount, - pDescriptorCopies, VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET, false, true, - "VUID-VkCopyDescriptorSet-sType-sType", - "VUID-vkUpdateDescriptorSets-pDescriptorCopies-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::descriptorCopyCount), loc.dot(Field::pDescriptorCopies), + descriptorCopyCount, pDescriptorCopies, VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET, false, + true, "VUID-VkCopyDescriptorSet-sType-sType", + "VUID-vkUpdateDescriptorSets-pDescriptorCopies-parameter", kVUIDUndefined); if (pDescriptorCopies != nullptr) { for (uint32_t descriptorCopyIndex = 0; descriptorCopyIndex < descriptorCopyCount; ++descriptorCopyIndex) { [[maybe_unused]] const Location pDescriptorCopies_loc = loc.dot(Field::pDescriptorCopies, descriptorCopyIndex); - skip |= ValidateStructPnext(pDescriptorCopies_loc, pDescriptorCopies[descriptorCopyIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkCopyDescriptorSet-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDescriptorCopies_loc, pDescriptorCopies[descriptorCopyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCopyDescriptorSet-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateRequiredHandle(pDescriptorCopies_loc.dot(Field::srcSet), pDescriptorCopies[descriptorCopyIndex].srcSet); + skip |= state.ValidateRequiredHandle(pDescriptorCopies_loc.dot(Field::srcSet), + pDescriptorCopies[descriptorCopyIndex].srcSet); - skip |= ValidateRequiredHandle(pDescriptorCopies_loc.dot(Field::dstSet), pDescriptorCopies[descriptorCopyIndex].dstSet); + skip |= state.ValidateRequiredHandle(pDescriptorCopies_loc.dot(Field::dstSet), + pDescriptorCopies[descriptorCopyIndex].dstSet); } } if (!skip) skip |= manual_PreCallValidateUpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, - pDescriptorCopies, error_obj); + pDescriptorCopies, state); return skip; } @@ -12341,30 +14248,32 @@ bool StatelessValidation::PreCallValidateCreateFramebuffer(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, true, - "VUID-vkCreateFramebuffer-pCreateInfo-parameter", "VUID-VkFramebufferCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, true, + "VUID-vkCreateFramebuffer-pCreateInfo-parameter", "VUID-VkFramebufferCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkFramebufferCreateInfo = {VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkFramebufferCreateInfo.size(), - allowed_structs_VkFramebufferCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkFramebufferCreateInfo-pNext-pNext", "VUID-VkFramebufferCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkFramebufferCreateInfo.size(), + allowed_structs_VkFramebufferCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkFramebufferCreateInfo-pNext-pNext", "VUID-VkFramebufferCreateInfo-sType-unique", + true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkFramebufferCreateFlagBits, - AllVkFramebufferCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkFramebufferCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkFramebufferCreateFlagBits, + AllVkFramebufferCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkFramebufferCreateInfo-flags-parameter"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::renderPass), pCreateInfo->renderPass); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::renderPass), pCreateInfo->renderPass); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFramebuffer), pFramebuffer, "VUID-vkCreateFramebuffer-pFramebuffer-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFramebuffer), pFramebuffer, + "VUID-vkCreateFramebuffer-pFramebuffer-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer, state); return skip; } @@ -12372,10 +14281,11 @@ bool StatelessValidation::PreCallValidateDestroyFramebuffer(VkDevice device, VkF const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12384,90 +14294,92 @@ bool StatelessValidation::PreCallValidateCreateRenderPass(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, true, - "VUID-vkCreateRenderPass-pCreateInfo-parameter", "VUID-VkRenderPassCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, true, + "VUID-vkCreateRenderPass-pCreateInfo-parameter", "VUID-VkRenderPassCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkRenderPassCreateInfo = { VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkRenderPassCreateInfo.size(), - allowed_structs_VkRenderPassCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkRenderPassCreateInfo-pNext-pNext", "VUID-VkRenderPassCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkRenderPassCreateInfo.size(), + allowed_structs_VkRenderPassCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkRenderPassCreateInfo-pNext-pNext", "VUID-VkRenderPassCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderPassCreateFlagBits, - AllVkRenderPassCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkRenderPassCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderPassCreateFlagBits, + AllVkRenderPassCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkRenderPassCreateInfo-flags-parameter"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::attachmentCount), pCreateInfo_loc.dot(Field::pAttachments), - pCreateInfo->attachmentCount, &pCreateInfo->pAttachments, false, true, kVUIDUndefined, - "VUID-VkRenderPassCreateInfo-pAttachments-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::attachmentCount), pCreateInfo_loc.dot(Field::pAttachments), + pCreateInfo->attachmentCount, &pCreateInfo->pAttachments, false, true, kVUIDUndefined, + "VUID-VkRenderPassCreateInfo-pAttachments-parameter"); if (pCreateInfo->pAttachments != nullptr) { for (uint32_t attachmentIndex = 0; attachmentIndex < pCreateInfo->attachmentCount; ++attachmentIndex) { [[maybe_unused]] const Location pAttachments_loc = pCreateInfo_loc.dot(Field::pAttachments, attachmentIndex); - skip |= ValidateFlags(pAttachments_loc.dot(Field::flags), vvl::FlagBitmask::VkAttachmentDescriptionFlagBits, - AllVkAttachmentDescriptionFlagBits, pCreateInfo->pAttachments[attachmentIndex].flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkAttachmentDescription-flags-parameter"); + skip |= state.ValidateFlags(pAttachments_loc.dot(Field::flags), vvl::FlagBitmask::VkAttachmentDescriptionFlagBits, + AllVkAttachmentDescriptionFlagBits, pCreateInfo->pAttachments[attachmentIndex].flags, + kOptionalFlags, "VUID-VkAttachmentDescription-flags-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::format), vvl::Enum::VkFormat, - pCreateInfo->pAttachments[attachmentIndex].format, - "VUID-VkAttachmentDescription-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::format), vvl::Enum::VkFormat, + pCreateInfo->pAttachments[attachmentIndex].format, + "VUID-VkAttachmentDescription-format-parameter"); - skip |= ValidateFlags(pAttachments_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, pCreateInfo->pAttachments[attachmentIndex].samples, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkAttachmentDescription-samples-parameter", - "VUID-VkAttachmentDescription-samples-parameter"); + skip |= state.ValidateFlags(pAttachments_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, pCreateInfo->pAttachments[attachmentIndex].samples, + kRequiredSingleBit, "VUID-VkAttachmentDescription-samples-parameter", + "VUID-VkAttachmentDescription-samples-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, - pCreateInfo->pAttachments[attachmentIndex].loadOp, - "VUID-VkAttachmentDescription-loadOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, + pCreateInfo->pAttachments[attachmentIndex].loadOp, + "VUID-VkAttachmentDescription-loadOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, - pCreateInfo->pAttachments[attachmentIndex].storeOp, - "VUID-VkAttachmentDescription-storeOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, + pCreateInfo->pAttachments[attachmentIndex].storeOp, + "VUID-VkAttachmentDescription-storeOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::stencilLoadOp), vvl::Enum::VkAttachmentLoadOp, - pCreateInfo->pAttachments[attachmentIndex].stencilLoadOp, - "VUID-VkAttachmentDescription-stencilLoadOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::stencilLoadOp), vvl::Enum::VkAttachmentLoadOp, + pCreateInfo->pAttachments[attachmentIndex].stencilLoadOp, + "VUID-VkAttachmentDescription-stencilLoadOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::stencilStoreOp), vvl::Enum::VkAttachmentStoreOp, - pCreateInfo->pAttachments[attachmentIndex].stencilStoreOp, - "VUID-VkAttachmentDescription-stencilStoreOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::stencilStoreOp), vvl::Enum::VkAttachmentStoreOp, + pCreateInfo->pAttachments[attachmentIndex].stencilStoreOp, + "VUID-VkAttachmentDescription-stencilStoreOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, - pCreateInfo->pAttachments[attachmentIndex].initialLayout, - "VUID-VkAttachmentDescription-initialLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, + pCreateInfo->pAttachments[attachmentIndex].initialLayout, + "VUID-VkAttachmentDescription-initialLayout-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::finalLayout), vvl::Enum::VkImageLayout, - pCreateInfo->pAttachments[attachmentIndex].finalLayout, - "VUID-VkAttachmentDescription-finalLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::finalLayout), vvl::Enum::VkImageLayout, + pCreateInfo->pAttachments[attachmentIndex].finalLayout, + "VUID-VkAttachmentDescription-finalLayout-parameter"); } } - skip |= ValidateArray(pCreateInfo_loc.dot(Field::subpassCount), pCreateInfo_loc.dot(Field::pSubpasses), - pCreateInfo->subpassCount, &pCreateInfo->pSubpasses, true, true, - "VUID-VkRenderPassCreateInfo-subpassCount-arraylength", - "VUID-VkRenderPassCreateInfo-pSubpasses-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::subpassCount), pCreateInfo_loc.dot(Field::pSubpasses), + pCreateInfo->subpassCount, &pCreateInfo->pSubpasses, true, true, + "VUID-VkRenderPassCreateInfo-subpassCount-arraylength", + "VUID-VkRenderPassCreateInfo-pSubpasses-parameter"); if (pCreateInfo->pSubpasses != nullptr) { for (uint32_t subpassIndex = 0; subpassIndex < pCreateInfo->subpassCount; ++subpassIndex) { [[maybe_unused]] const Location pSubpasses_loc = pCreateInfo_loc.dot(Field::pSubpasses, subpassIndex); - skip |= ValidateFlags(pSubpasses_loc.dot(Field::flags), vvl::FlagBitmask::VkSubpassDescriptionFlagBits, - AllVkSubpassDescriptionFlagBits, pCreateInfo->pSubpasses[subpassIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkSubpassDescription-flags-parameter"); + skip |= state.ValidateFlags(pSubpasses_loc.dot(Field::flags), vvl::FlagBitmask::VkSubpassDescriptionFlagBits, + AllVkSubpassDescriptionFlagBits, pCreateInfo->pSubpasses[subpassIndex].flags, + kOptionalFlags, "VUID-VkSubpassDescription-flags-parameter"); - skip |= ValidateRangedEnum(pSubpasses_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, - pCreateInfo->pSubpasses[subpassIndex].pipelineBindPoint, - "VUID-VkSubpassDescription-pipelineBindPoint-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pSubpasses_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pCreateInfo->pSubpasses[subpassIndex].pipelineBindPoint, + "VUID-VkSubpassDescription-pipelineBindPoint-parameter"); - skip |= ValidateArray(pSubpasses_loc.dot(Field::inputAttachmentCount), pSubpasses_loc.dot(Field::pInputAttachments), - pCreateInfo->pSubpasses[subpassIndex].inputAttachmentCount, - &pCreateInfo->pSubpasses[subpassIndex].pInputAttachments, false, true, kVUIDUndefined, - "VUID-VkSubpassDescription-pInputAttachments-parameter"); + skip |= state.ValidateArray(pSubpasses_loc.dot(Field::inputAttachmentCount), + pSubpasses_loc.dot(Field::pInputAttachments), + pCreateInfo->pSubpasses[subpassIndex].inputAttachmentCount, + &pCreateInfo->pSubpasses[subpassIndex].pInputAttachments, false, true, kVUIDUndefined, + "VUID-VkSubpassDescription-pInputAttachments-parameter"); if (pCreateInfo->pSubpasses[subpassIndex].pInputAttachments != nullptr) { for (uint32_t inputAttachmentIndex = 0; @@ -12475,17 +14387,18 @@ bool StatelessValidation::PreCallValidateCreateRenderPass(VkDevice device, const ++inputAttachmentIndex) { [[maybe_unused]] const Location pInputAttachments_loc = pSubpasses_loc.dot(Field::pInputAttachments, inputAttachmentIndex); - skip |= - ValidateRangedEnum(pInputAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, - pCreateInfo->pSubpasses[subpassIndex].pInputAttachments[inputAttachmentIndex].layout, - "VUID-VkAttachmentReference-layout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum( + pInputAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pInputAttachments[inputAttachmentIndex].layout, + "VUID-VkAttachmentReference-layout-parameter"); } } - skip |= ValidateArray(pSubpasses_loc.dot(Field::colorAttachmentCount), pSubpasses_loc.dot(Field::pColorAttachments), - pCreateInfo->pSubpasses[subpassIndex].colorAttachmentCount, - &pCreateInfo->pSubpasses[subpassIndex].pColorAttachments, false, true, kVUIDUndefined, - "VUID-VkSubpassDescription-pColorAttachments-parameter"); + skip |= state.ValidateArray(pSubpasses_loc.dot(Field::colorAttachmentCount), + pSubpasses_loc.dot(Field::pColorAttachments), + pCreateInfo->pSubpasses[subpassIndex].colorAttachmentCount, + &pCreateInfo->pSubpasses[subpassIndex].pColorAttachments, false, true, kVUIDUndefined, + "VUID-VkSubpassDescription-pColorAttachments-parameter"); if (pCreateInfo->pSubpasses[subpassIndex].pColorAttachments != nullptr) { for (uint32_t colorAttachmentIndex = 0; @@ -12493,10 +14406,10 @@ bool StatelessValidation::PreCallValidateCreateRenderPass(VkDevice device, const ++colorAttachmentIndex) { [[maybe_unused]] const Location pColorAttachments_loc = pSubpasses_loc.dot(Field::pColorAttachments, colorAttachmentIndex); - skip |= - ValidateRangedEnum(pColorAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, - pCreateInfo->pSubpasses[subpassIndex].pColorAttachments[colorAttachmentIndex].layout, - "VUID-VkAttachmentReference-layout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum( + pColorAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pColorAttachments[colorAttachmentIndex].layout, + "VUID-VkAttachmentReference-layout-parameter"); } } @@ -12506,64 +14419,65 @@ bool StatelessValidation::PreCallValidateCreateRenderPass(VkDevice device, const ++colorAttachmentIndex) { [[maybe_unused]] const Location pResolveAttachments_loc = pSubpasses_loc.dot(Field::pResolveAttachments, colorAttachmentIndex); - skip |= ValidateRangedEnum( + skip |= state.ValidateRangedEnum( pResolveAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, pCreateInfo->pSubpasses[subpassIndex].pResolveAttachments[colorAttachmentIndex].layout, - "VUID-VkAttachmentReference-layout-parameter", VK_NULL_HANDLE); + "VUID-VkAttachmentReference-layout-parameter"); } } if (pCreateInfo->pSubpasses[subpassIndex].pDepthStencilAttachment != nullptr) { [[maybe_unused]] const Location pDepthStencilAttachment_loc = pSubpasses_loc.dot(Field::pDepthStencilAttachment); - skip |= ValidateRangedEnum(pDepthStencilAttachment_loc.dot(Field::layout), vvl::Enum::VkImageLayout, - pCreateInfo->pSubpasses[subpassIndex].pDepthStencilAttachment->layout, - "VUID-VkAttachmentReference-layout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthStencilAttachment_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pDepthStencilAttachment->layout, + "VUID-VkAttachmentReference-layout-parameter"); } - skip |= ValidateArray(pSubpasses_loc.dot(Field::preserveAttachmentCount), - pSubpasses_loc.dot(Field::pPreserveAttachments), - pCreateInfo->pSubpasses[subpassIndex].preserveAttachmentCount, - &pCreateInfo->pSubpasses[subpassIndex].pPreserveAttachments, false, true, kVUIDUndefined, - "VUID-VkSubpassDescription-pPreserveAttachments-parameter"); + skip |= state.ValidateArray(pSubpasses_loc.dot(Field::preserveAttachmentCount), + pSubpasses_loc.dot(Field::pPreserveAttachments), + pCreateInfo->pSubpasses[subpassIndex].preserveAttachmentCount, + &pCreateInfo->pSubpasses[subpassIndex].pPreserveAttachments, false, true, + kVUIDUndefined, "VUID-VkSubpassDescription-pPreserveAttachments-parameter"); } } - skip |= ValidateArray(pCreateInfo_loc.dot(Field::dependencyCount), pCreateInfo_loc.dot(Field::pDependencies), - pCreateInfo->dependencyCount, &pCreateInfo->pDependencies, false, true, kVUIDUndefined, - "VUID-VkRenderPassCreateInfo-pDependencies-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::dependencyCount), pCreateInfo_loc.dot(Field::pDependencies), + pCreateInfo->dependencyCount, &pCreateInfo->pDependencies, false, true, kVUIDUndefined, + "VUID-VkRenderPassCreateInfo-pDependencies-parameter"); if (pCreateInfo->pDependencies != nullptr) { for (uint32_t dependencyIndex = 0; dependencyIndex < pCreateInfo->dependencyCount; ++dependencyIndex) { [[maybe_unused]] const Location pDependencies_loc = pCreateInfo_loc.dot(Field::pDependencies, dependencyIndex); - skip |= ValidateFlags(pDependencies_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, - AllVkPipelineStageFlagBits, pCreateInfo->pDependencies[dependencyIndex].srcStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency-srcStageMask-parameter"); + skip |= state.ValidateFlags(pDependencies_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, + AllVkPipelineStageFlagBits, pCreateInfo->pDependencies[dependencyIndex].srcStageMask, + kOptionalFlags, "VUID-VkSubpassDependency-srcStageMask-parameter"); - skip |= ValidateFlags(pDependencies_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, - AllVkPipelineStageFlagBits, pCreateInfo->pDependencies[dependencyIndex].dstStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency-dstStageMask-parameter"); + skip |= state.ValidateFlags(pDependencies_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, + AllVkPipelineStageFlagBits, pCreateInfo->pDependencies[dependencyIndex].dstStageMask, + kOptionalFlags, "VUID-VkSubpassDependency-dstStageMask-parameter"); - skip |= ValidateFlags(pDependencies_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits, - AllVkAccessFlagBits, pCreateInfo->pDependencies[dependencyIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pDependencies_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits, + AllVkAccessFlagBits, pCreateInfo->pDependencies[dependencyIndex].srcAccessMask, + kOptionalFlags, "VUID-VkSubpassDependency-srcAccessMask-parameter"); - skip |= ValidateFlags(pDependencies_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits, - AllVkAccessFlagBits, pCreateInfo->pDependencies[dependencyIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pDependencies_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits, + AllVkAccessFlagBits, pCreateInfo->pDependencies[dependencyIndex].dstAccessMask, + kOptionalFlags, "VUID-VkSubpassDependency-dstAccessMask-parameter"); - skip |= ValidateFlags(pDependencies_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, - AllVkDependencyFlagBits, pCreateInfo->pDependencies[dependencyIndex].dependencyFlags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency-dependencyFlags-parameter"); + skip |= state.ValidateFlags(pDependencies_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, + AllVkDependencyFlagBits, pCreateInfo->pDependencies[dependencyIndex].dependencyFlags, + kOptionalFlags, "VUID-VkSubpassDependency-dependencyFlags-parameter"); } } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pRenderPass), pRenderPass, "VUID-vkCreateRenderPass-pRenderPass-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass, error_obj); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::pRenderPass), pRenderPass, "VUID-vkCreateRenderPass-pRenderPass-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass, state); return skip; } @@ -12571,10 +14485,11 @@ bool StatelessValidation::PreCallValidateDestroyRenderPass(VkDevice device, VkRe const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12582,10 +14497,11 @@ bool StatelessValidation::PreCallValidateDestroyRenderPass(VkDevice device, VkRe bool StatelessValidation::PreCallValidateGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::renderPass), renderPass); - skip |= ValidateRequiredPointer(loc.dot(Field::pGranularity), pGranularity, - "VUID-vkGetRenderAreaGranularity-pGranularity-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::renderPass), renderPass); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pGranularity), pGranularity, + "VUID-vkGetRenderAreaGranularity-pGranularity-parameter"); return skip; } @@ -12593,23 +14509,25 @@ bool StatelessValidation::PreCallValidateCreateCommandPool(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, true, - "VUID-vkCreateCommandPool-pCreateInfo-parameter", "VUID-VkCommandPoolCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, true, + "VUID-vkCreateCommandPool-pCreateInfo-parameter", "VUID-VkCommandPoolCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCommandPoolCreateInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCommandPoolCreateInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkCommandPoolCreateFlagBits, - AllVkCommandPoolCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkCommandPoolCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkCommandPoolCreateFlagBits, + AllVkCommandPoolCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkCommandPoolCreateInfo-flags-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pCommandPool), pCommandPool, "VUID-vkCreateCommandPool-pCommandPool-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCommandPool), pCommandPool, + "VUID-vkCreateCommandPool-pCommandPool-parameter"); return skip; } @@ -12617,10 +14535,11 @@ bool StatelessValidation::PreCallValidateDestroyCommandPool(VkDevice device, VkC const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12628,10 +14547,11 @@ bool StatelessValidation::PreCallValidateDestroyCommandPool(VkDevice device, VkC bool StatelessValidation::PreCallValidateResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkCommandPoolResetFlagBits, AllVkCommandPoolResetFlagBits, flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkResetCommandPool-flags-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkCommandPoolResetFlagBits, AllVkCommandPoolResetFlagBits, + flags, kOptionalFlags, "VUID-vkResetCommandPool-flags-parameter"); return skip; } @@ -12639,25 +14559,26 @@ bool StatelessValidation::PreCallValidateAllocateCommandBuffers(VkDevice device, VkCommandBuffer* pCommandBuffers, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= - ValidateStructType(loc.dot(Field::pAllocateInfo), pAllocateInfo, VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, true, - "VUID-vkAllocateCommandBuffers-pAllocateInfo-parameter", "VUID-VkCommandBufferAllocateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pAllocateInfo), pAllocateInfo, VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, + true, "VUID-vkAllocateCommandBuffers-pAllocateInfo-parameter", + "VUID-VkCommandBufferAllocateInfo-sType-sType"); if (pAllocateInfo != nullptr) { [[maybe_unused]] const Location pAllocateInfo_loc = loc.dot(Field::pAllocateInfo); - skip |= ValidateStructPnext(pAllocateInfo_loc, pAllocateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCommandBufferAllocateInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pAllocateInfo_loc, pAllocateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCommandBufferAllocateInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pAllocateInfo_loc.dot(Field::commandPool), pAllocateInfo->commandPool); + skip |= state.ValidateRequiredHandle(pAllocateInfo_loc.dot(Field::commandPool), pAllocateInfo->commandPool); - skip |= ValidateRangedEnum(pAllocateInfo_loc.dot(Field::level), vvl::Enum::VkCommandBufferLevel, pAllocateInfo->level, - "VUID-VkCommandBufferAllocateInfo-level-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAllocateInfo_loc.dot(Field::level), vvl::Enum::VkCommandBufferLevel, pAllocateInfo->level, + "VUID-VkCommandBufferAllocateInfo-level-parameter"); } if (pAllocateInfo != nullptr) { - skip |= ValidateArray(loc.dot(Field::pAllocateInfo).dot(Field::commandBufferCount), loc.dot(Field::pCommandBuffers), - pAllocateInfo->commandBufferCount, &pCommandBuffers, true, true, - "VUID-vkAllocateCommandBuffers-pAllocateInfo::commandBufferCount-arraylength", - "VUID-vkAllocateCommandBuffers-pCommandBuffers-parameter"); + skip |= state.ValidateArray(loc.dot(Field::pAllocateInfo).dot(Field::commandBufferCount), loc.dot(Field::pCommandBuffers), + pAllocateInfo->commandBufferCount, &pCommandBuffers, true, true, + "VUID-vkAllocateCommandBuffers-pAllocateInfo::commandBufferCount-arraylength", + "VUID-vkAllocateCommandBuffers-pCommandBuffers-parameter"); } return skip; } @@ -12666,12 +14587,12 @@ bool StatelessValidation::PreCallValidateFreeCommandBuffers(VkDevice device, VkC const VkCommandBuffer* pCommandBuffers, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); - skip |= ValidateArray(loc.dot(Field::commandBufferCount), loc, commandBufferCount, &pCommandBuffers, true, false, - "VUID-vkFreeCommandBuffers-commandBufferCount-arraylength", kVUIDUndefined); - if (!skip) - skip |= manual_PreCallValidateFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); + skip |= state.ValidateArray(loc.dot(Field::commandBufferCount), loc, commandBufferCount, &pCommandBuffers, true, false, + "VUID-vkFreeCommandBuffers-commandBufferCount-arraylength", kVUIDUndefined); + if (!skip) skip |= manual_PreCallValidateFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers, state); return skip; } @@ -12679,28 +14600,30 @@ bool StatelessValidation::PreCallValidateBeginCommandBuffer(VkCommandBuffer comm const VkCommandBufferBeginInfo* pBeginInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pBeginInfo), pBeginInfo, VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, true, - "VUID-vkBeginCommandBuffer-pBeginInfo-parameter", "VUID-VkCommandBufferBeginInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pBeginInfo), pBeginInfo, VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, true, + "VUID-vkBeginCommandBuffer-pBeginInfo-parameter", "VUID-VkCommandBufferBeginInfo-sType-sType"); if (pBeginInfo != nullptr) { [[maybe_unused]] const Location pBeginInfo_loc = loc.dot(Field::pBeginInfo); constexpr std::array allowed_structs_VkCommandBufferBeginInfo = {VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO}; - skip |= ValidateStructPnext(pBeginInfo_loc, pBeginInfo->pNext, allowed_structs_VkCommandBufferBeginInfo.size(), - allowed_structs_VkCommandBufferBeginInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkCommandBufferBeginInfo-pNext-pNext", "VUID-VkCommandBufferBeginInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBeginInfo_loc, pBeginInfo->pNext, allowed_structs_VkCommandBufferBeginInfo.size(), + allowed_structs_VkCommandBufferBeginInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkCommandBufferBeginInfo-pNext-pNext", "VUID-VkCommandBufferBeginInfo-sType-unique", + true); - skip |= ValidateFlags(pBeginInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkCommandBufferUsageFlagBits, - AllVkCommandBufferUsageFlagBits, pBeginInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkCommandBufferBeginInfo-flags-parameter"); + skip |= state.ValidateFlags(pBeginInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkCommandBufferUsageFlagBits, + AllVkCommandBufferUsageFlagBits, pBeginInfo->flags, kOptionalFlags, + "VUID-VkCommandBufferBeginInfo-flags-parameter"); } - if (!skip) skip |= manual_PreCallValidateBeginCommandBuffer(commandBuffer, pBeginInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateBeginCommandBuffer(commandBuffer, pBeginInfo, state); return skip; } bool StatelessValidation::PreCallValidateEndCommandBuffer(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12709,19 +14632,22 @@ bool StatelessValidation::PreCallValidateEndCommandBuffer(VkCommandBuffer comman bool StatelessValidation::PreCallValidateResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkCommandBufferResetFlagBits, AllVkCommandBufferResetFlagBits, - flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkResetCommandBuffer-flags-parameter"); + skip |= + state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkCommandBufferResetFlagBits, AllVkCommandBufferResetFlagBits, + flags, kOptionalFlags, "VUID-vkResetCommandBuffer-flags-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, - "VUID-vkCmdBindPipeline-pipelineBindPoint-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= state.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdBindPipeline-pipelineBindPoint-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); return skip; } @@ -12729,35 +14655,38 @@ bool StatelessValidation::PreCallValidateCmdSetViewport(VkCommandBuffer commandB uint32_t viewportCount, const VkViewport* pViewports, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pViewports), viewportCount, &pViewports, true, true, - "VUID-vkCmdSetViewport-viewportCount-arraylength", "VUID-vkCmdSetViewport-pViewports-parameter"); + skip |= state.ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pViewports), viewportCount, &pViewports, true, true, + "VUID-vkCmdSetViewport-viewportCount-arraylength", "VUID-vkCmdSetViewport-pViewports-parameter"); if (pViewports != nullptr) { for (uint32_t viewportIndex = 0; viewportIndex < viewportCount; ++viewportIndex) { [[maybe_unused]] const Location pViewports_loc = loc.dot(Field::pViewports, viewportIndex); // No xml-driven validation } } - if (!skip) skip |= manual_PreCallValidateCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports, state); return skip; } bool StatelessValidation::PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateArray(loc.dot(Field::scissorCount), loc.dot(Field::pScissors), scissorCount, &pScissors, true, true, - "VUID-vkCmdSetScissor-scissorCount-arraylength", "VUID-vkCmdSetScissor-pScissors-parameter"); - if (!skip) skip |= manual_PreCallValidateCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors, error_obj); + skip |= state.ValidateArray(loc.dot(Field::scissorCount), loc.dot(Field::pScissors), scissorCount, &pScissors, true, true, + "VUID-vkCmdSetScissor-scissorCount-arraylength", "VUID-vkCmdSetScissor-pScissors-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors, state); return skip; } bool StatelessValidation::PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation - if (!skip) skip |= manual_PreCallValidateCmdSetLineWidth(commandBuffer, lineWidth, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdSetLineWidth(commandBuffer, lineWidth, state); return skip; } @@ -12765,6 +14694,7 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBias(VkCommandBuffer command float depthBiasClamp, float depthBiasSlopeFactor, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12773,6 +14703,7 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBias(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4], const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12781,6 +14712,7 @@ bool StatelessValidation::PreCallValidateCmdSetBlendConstants(VkCommandBuffer co bool StatelessValidation::PreCallValidateCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12789,30 +14721,33 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBounds(VkCommandBuffer comma bool StatelessValidation::PreCallValidateCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, faceMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-vkCmdSetStencilCompareMask-faceMask-parameter", - "VUID-vkCmdSetStencilCompareMask-faceMask-requiredbitmask"); + skip |= state.ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, + faceMask, kRequiredFlags, "VUID-vkCmdSetStencilCompareMask-faceMask-parameter", + "VUID-vkCmdSetStencilCompareMask-faceMask-requiredbitmask"); return skip; } bool StatelessValidation::PreCallValidateCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, faceMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-vkCmdSetStencilWriteMask-faceMask-parameter", - "VUID-vkCmdSetStencilWriteMask-faceMask-requiredbitmask"); + skip |= state.ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, + faceMask, kRequiredFlags, "VUID-vkCmdSetStencilWriteMask-faceMask-parameter", + "VUID-vkCmdSetStencilWriteMask-faceMask-requiredbitmask"); return skip; } bool StatelessValidation::PreCallValidateCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, faceMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-vkCmdSetStencilReference-faceMask-parameter", - "VUID-vkCmdSetStencilReference-faceMask-requiredbitmask"); + skip |= state.ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, + faceMask, kRequiredFlags, "VUID-vkCmdSetStencilReference-faceMask-parameter", + "VUID-vkCmdSetStencilReference-faceMask-requiredbitmask"); return skip; } @@ -12822,25 +14757,28 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorSets(VkCommandBuffer c uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, - "VUID-vkCmdBindDescriptorSets-pipelineBindPoint-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); - skip |= ValidateArray(loc.dot(Field::descriptorSetCount), loc.dot(Field::pDescriptorSets), descriptorSetCount, &pDescriptorSets, - true, false, "VUID-vkCmdBindDescriptorSets-descriptorSetCount-arraylength", - "VUID-vkCmdBindDescriptorSets-pDescriptorSets-parameter"); - skip |= ValidateArray(loc.dot(Field::dynamicOffsetCount), loc.dot(Field::pDynamicOffsets), dynamicOffsetCount, &pDynamicOffsets, - false, true, kVUIDUndefined, "VUID-vkCmdBindDescriptorSets-pDynamicOffsets-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdBindDescriptorSets-pipelineBindPoint-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= state.ValidateArray(loc.dot(Field::descriptorSetCount), loc.dot(Field::pDescriptorSets), descriptorSetCount, + &pDescriptorSets, true, false, "VUID-vkCmdBindDescriptorSets-descriptorSetCount-arraylength", + "VUID-vkCmdBindDescriptorSets-pDescriptorSets-parameter"); + skip |= state.ValidateArray(loc.dot(Field::dynamicOffsetCount), loc.dot(Field::pDynamicOffsets), dynamicOffsetCount, + &pDynamicOffsets, false, true, kVUIDUndefined, + "VUID-vkCmdBindDescriptorSets-pDynamicOffsets-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::indexType), vvl::Enum::VkIndexType, indexType, - "VUID-vkCmdBindIndexBuffer-indexType-parameter", VK_NULL_HANDLE); - if (!skip) skip |= manual_PreCallValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, error_obj); + skip |= state.ValidateRangedEnum(loc.dot(Field::indexType), vvl::Enum::VkIndexType, indexType, + "VUID-vkCmdBindIndexBuffer-indexType-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, state); return skip; } @@ -12848,20 +14786,23 @@ bool StatelessValidation::PreCallValidateCmdBindVertexBuffers(VkCommandBuffer co uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateArray(loc.dot(Field::bindingCount), loc.dot(Field::pBuffers), bindingCount, &pBuffers, true, false, - "VUID-vkCmdBindVertexBuffers-bindingCount-arraylength", "VUID-vkCmdBindVertexBuffers-pBuffers-parameter"); - skip |= ValidateArray(loc.dot(Field::bindingCount), loc.dot(Field::pOffsets), bindingCount, &pOffsets, true, true, - "VUID-vkCmdBindVertexBuffers-bindingCount-arraylength", "VUID-vkCmdBindVertexBuffers-pOffsets-parameter"); + skip |= state.ValidateArray(loc.dot(Field::bindingCount), loc.dot(Field::pBuffers), bindingCount, &pBuffers, true, false, + "VUID-vkCmdBindVertexBuffers-bindingCount-arraylength", + "VUID-vkCmdBindVertexBuffers-pBuffers-parameter"); + skip |= state.ValidateArray(loc.dot(Field::bindingCount), loc.dot(Field::pOffsets), bindingCount, &pOffsets, true, true, + "VUID-vkCmdBindVertexBuffers-bindingCount-arraylength", + "VUID-vkCmdBindVertexBuffers-pOffsets-parameter"); if (!skip) - skip |= - manual_PreCallValidateCmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, error_obj); + skip |= manual_PreCallValidateCmdBindVertexBuffers(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, state); return skip; } bool StatelessValidation::PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12871,6 +14812,7 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexed(VkCommandBuffer commandB uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12879,8 +14821,9 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexed(VkCommandBuffer commandB bool StatelessValidation::PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } @@ -12888,14 +14831,16 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer uint32_t drawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } bool StatelessValidation::PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12904,8 +14849,9 @@ bool StatelessValidation::PreCallValidateCmdDispatch(VkCommandBuffer commandBuff bool StatelessValidation::PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } @@ -12913,18 +14859,19 @@ bool StatelessValidation::PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBu uint32_t regionCount, const VkBufferCopy* pRegions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::srcBuffer), srcBuffer); - skip |= ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); - skip |= ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, - "VUID-vkCmdCopyBuffer-regionCount-arraylength", "VUID-vkCmdCopyBuffer-pRegions-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::srcBuffer), srcBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= state.ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, + "VUID-vkCmdCopyBuffer-regionCount-arraylength", "VUID-vkCmdCopyBuffer-pRegions-parameter"); if (pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = loc.dot(Field::pRegions, regionIndex); // No xml-driven validation } } - if (!skip) skip |= manual_PreCallValidateCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions, state); return skip; } @@ -12932,29 +14879,30 @@ bool StatelessValidation::PreCallValidateCmdCopyImage(VkCommandBuffer commandBuf VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); - skip |= ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, - "VUID-vkCmdCopyImage-srcImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); - skip |= ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, - "VUID-vkCmdCopyImage-dstImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, - "VUID-vkCmdCopyImage-regionCount-arraylength", "VUID-vkCmdCopyImage-pRegions-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, + "VUID-vkCmdCopyImage-srcImageLayout-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdCopyImage-dstImageLayout-parameter"); + skip |= state.ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, + "VUID-vkCmdCopyImage-regionCount-arraylength", "VUID-vkCmdCopyImage-pRegions-parameter"); if (pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = loc.dot(Field::pRegions, regionIndex); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRegions[regionIndex].dstSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].dstSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -12969,31 +14917,31 @@ bool StatelessValidation::PreCallValidateCmdBlitImage(VkCommandBuffer commandBuf const VkImageBlit* pRegions, VkFilter filter, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); - skip |= ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, - "VUID-vkCmdBlitImage-srcImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); - skip |= ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, - "VUID-vkCmdBlitImage-dstImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, - "VUID-vkCmdBlitImage-regionCount-arraylength", "VUID-vkCmdBlitImage-pRegions-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, + "VUID-vkCmdBlitImage-srcImageLayout-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdBlitImage-dstImageLayout-parameter"); + skip |= state.ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, + "VUID-vkCmdBlitImage-regionCount-arraylength", "VUID-vkCmdBlitImage-pRegions-parameter"); if (pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = loc.dot(Field::pRegions, regionIndex); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); - - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRegions[regionIndex].dstSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].dstSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); } } - skip |= ValidateRangedEnum(loc.dot(Field::filter), vvl::Enum::VkFilter, filter, "VUID-vkCmdBlitImage-filter-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::filter), vvl::Enum::VkFilter, filter, "VUID-vkCmdBlitImage-filter-parameter"); return skip; } @@ -13002,20 +14950,22 @@ bool StatelessValidation::PreCallValidateCmdCopyBufferToImage(VkCommandBuffer co const VkBufferImageCopy* pRegions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::srcBuffer), srcBuffer); - skip |= ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); - skip |= ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, - "VUID-vkCmdCopyBufferToImage-dstImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, - "VUID-vkCmdCopyBufferToImage-regionCount-arraylength", "VUID-vkCmdCopyBufferToImage-pRegions-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::srcBuffer), srcBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdCopyBufferToImage-dstImageLayout-parameter"); + skip |= state.ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, + "VUID-vkCmdCopyBufferToImage-regionCount-arraylength", + "VUID-vkCmdCopyBufferToImage-pRegions-parameter"); if (pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = loc.dot(Field::pRegions, regionIndex); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRegions[regionIndex].imageSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].imageSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -13030,20 +14980,22 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer co uint32_t regionCount, const VkBufferImageCopy* pRegions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); - skip |= ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, - "VUID-vkCmdCopyImageToBuffer-srcImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); - skip |= ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, - "VUID-vkCmdCopyImageToBuffer-regionCount-arraylength", "VUID-vkCmdCopyImageToBuffer-pRegions-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, + "VUID-vkCmdCopyImageToBuffer-srcImageLayout-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= state.ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, + "VUID-vkCmdCopyImageToBuffer-regionCount-arraylength", + "VUID-vkCmdCopyImageToBuffer-pRegions-parameter"); if (pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = loc.dot(Field::pRegions, regionIndex); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRegions[regionIndex].imageSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].imageSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -13057,20 +15009,22 @@ bool StatelessValidation::PreCallValidateCmdUpdateBuffer(VkCommandBuffer command VkDeviceSize dataSize, const void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); - skip |= ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, - "VUID-vkCmdUpdateBuffer-dataSize-arraylength", "VUID-vkCmdUpdateBuffer-pData-parameter"); - if (!skip) skip |= manual_PreCallValidateCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= state.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkCmdUpdateBuffer-dataSize-arraylength", "VUID-vkCmdUpdateBuffer-pData-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdUpdateBuffer(commandBuffer, dstBuffer, dstOffset, dataSize, pData, state); return skip; } bool StatelessValidation::PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); - if (!skip) skip |= manual_PreCallValidateCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + if (!skip) skip |= manual_PreCallValidateCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data, state); return skip; } @@ -13079,23 +15033,24 @@ bool StatelessValidation::PreCallValidateCmdClearColorImage(VkCommandBuffer comm const VkImageSubresourceRange* pRanges, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, - "VUID-vkCmdClearColorImage-imageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::rangeCount), loc.dot(Field::pRanges), rangeCount, &pRanges, true, true, - "VUID-vkCmdClearColorImage-rangeCount-arraylength", "VUID-vkCmdClearColorImage-pRanges-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= state.ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, + "VUID-vkCmdClearColorImage-imageLayout-parameter"); + skip |= state.ValidateArray(loc.dot(Field::rangeCount), loc.dot(Field::pRanges), rangeCount, &pRanges, true, true, + "VUID-vkCmdClearColorImage-rangeCount-arraylength", "VUID-vkCmdClearColorImage-pRanges-parameter"); if (pRanges != nullptr) { for (uint32_t rangeIndex = 0; rangeIndex < rangeCount; ++rangeIndex) { [[maybe_unused]] const Location pRanges_loc = loc.dot(Field::pRanges, rangeIndex); - skip |= ValidateFlags(pRanges_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRanges[rangeIndex].aspectMask, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageSubresourceRange-aspectMask-parameter", - "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRanges_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRanges[rangeIndex].aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceRange-aspectMask-parameter", + "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } if (!skip) - skip |= manual_PreCallValidateCmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges, error_obj); + skip |= manual_PreCallValidateCmdClearColorImage(commandBuffer, image, imageLayout, pColor, rangeCount, pRanges, state); return skip; } @@ -13105,22 +15060,23 @@ bool StatelessValidation::PreCallValidateCmdClearDepthStencilImage(VkCommandBuff uint32_t rangeCount, const VkImageSubresourceRange* pRanges, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, - "VUID-vkCmdClearDepthStencilImage-imageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredPointer(loc.dot(Field::pDepthStencil), pDepthStencil, - "VUID-vkCmdClearDepthStencilImage-pDepthStencil-parameter"); - skip |= ValidateArray(loc.dot(Field::rangeCount), loc.dot(Field::pRanges), rangeCount, &pRanges, true, true, - "VUID-vkCmdClearDepthStencilImage-rangeCount-arraylength", - "VUID-vkCmdClearDepthStencilImage-pRanges-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= state.ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, + "VUID-vkCmdClearDepthStencilImage-imageLayout-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pDepthStencil), pDepthStencil, + "VUID-vkCmdClearDepthStencilImage-pDepthStencil-parameter"); + skip |= state.ValidateArray(loc.dot(Field::rangeCount), loc.dot(Field::pRanges), rangeCount, &pRanges, true, true, + "VUID-vkCmdClearDepthStencilImage-rangeCount-arraylength", + "VUID-vkCmdClearDepthStencilImage-pRanges-parameter"); if (pRanges != nullptr) { for (uint32_t rangeIndex = 0; rangeIndex < rangeCount; ++rangeIndex) { [[maybe_unused]] const Location pRanges_loc = loc.dot(Field::pRanges, rangeIndex); - skip |= ValidateFlags(pRanges_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRanges[rangeIndex].aspectMask, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageSubresourceRange-aspectMask-parameter", - "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRanges_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRanges[rangeIndex].aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceRange-aspectMask-parameter", + "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } return skip; @@ -13130,21 +15086,22 @@ bool StatelessValidation::PreCallValidateCmdClearAttachments(VkCommandBuffer com const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateArray(loc.dot(Field::attachmentCount), loc.dot(Field::pAttachments), attachmentCount, &pAttachments, true, true, - "VUID-vkCmdClearAttachments-attachmentCount-arraylength", - "VUID-vkCmdClearAttachments-pAttachments-parameter"); + skip |= state.ValidateArray(loc.dot(Field::attachmentCount), loc.dot(Field::pAttachments), attachmentCount, &pAttachments, true, + true, "VUID-vkCmdClearAttachments-attachmentCount-arraylength", + "VUID-vkCmdClearAttachments-pAttachments-parameter"); if (pAttachments != nullptr) { for (uint32_t attachmentIndex = 0; attachmentIndex < attachmentCount; ++attachmentIndex) { [[maybe_unused]] const Location pAttachments_loc = loc.dot(Field::pAttachments, attachmentIndex); - skip |= - ValidateFlags(pAttachments_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pAttachments[attachmentIndex].aspectMask, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkClearAttachment-aspectMask-parameter", "VUID-VkClearAttachment-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pAttachments_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pAttachments[attachmentIndex].aspectMask, kRequiredFlags, + "VUID-VkClearAttachment-aspectMask-parameter", + "VUID-VkClearAttachment-aspectMask-requiredbitmask"); } } - skip |= ValidateArray(loc.dot(Field::rectCount), loc.dot(Field::pRects), rectCount, &pRects, true, true, - "VUID-vkCmdClearAttachments-rectCount-arraylength", "VUID-vkCmdClearAttachments-pRects-parameter"); + skip |= state.ValidateArray(loc.dot(Field::rectCount), loc.dot(Field::pRects), rectCount, &pRects, true, true, + "VUID-vkCmdClearAttachments-rectCount-arraylength", "VUID-vkCmdClearAttachments-pRects-parameter"); if (pRects != nullptr) { for (uint32_t rectIndex = 0; rectIndex < rectCount; ++rectIndex) { [[maybe_unused]] const Location pRects_loc = loc.dot(Field::pRects, rectIndex); @@ -13154,8 +15111,7 @@ bool StatelessValidation::PreCallValidateCmdClearAttachments(VkCommandBuffer com } } if (!skip) - skip |= - manual_PreCallValidateCmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects, error_obj); + skip |= manual_PreCallValidateCmdClearAttachments(commandBuffer, attachmentCount, pAttachments, rectCount, pRects, state); return skip; } @@ -13164,29 +15120,30 @@ bool StatelessValidation::PreCallValidateCmdResolveImage(VkCommandBuffer command VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); - skip |= ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, - "VUID-vkCmdResolveImage-srcImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); - skip |= ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, - "VUID-vkCmdResolveImage-dstImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, - "VUID-vkCmdResolveImage-regionCount-arraylength", "VUID-vkCmdResolveImage-pRegions-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, + "VUID-vkCmdResolveImage-srcImageLayout-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdResolveImage-dstImageLayout-parameter"); + skip |= state.ValidateArray(loc.dot(Field::regionCount), loc.dot(Field::pRegions), regionCount, &pRegions, true, true, + "VUID-vkCmdResolveImage-regionCount-arraylength", "VUID-vkCmdResolveImage-pRegions-parameter"); if (pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = loc.dot(Field::pRegions, regionIndex); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pRegions[regionIndex].dstSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].dstSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -13199,20 +15156,22 @@ bool StatelessValidation::PreCallValidateCmdResolveImage(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); - skip |= ValidateFlags(loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - stageMask, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdSetEvent-stageMask-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= state.ValidateFlags(loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + stageMask, kOptionalFlags, "VUID-vkCmdSetEvent-stageMask-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); - skip |= ValidateFlags(loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - stageMask, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdResetEvent-stageMask-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= state.ValidateFlags(loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + stageMask, kOptionalFlags, "VUID-vkCmdResetEvent-stageMask-parameter"); return skip; } @@ -13222,37 +15181,38 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents( uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers, const ErrorObject& error_obj) const { bool skip = false; - [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateHandleArray(loc.dot(Field::eventCount), loc.dot(Field::pEvents), eventCount, pEvents, true, true, - "VUID-vkCmdWaitEvents-eventCount-arraylength"); - skip |= ValidateFlags(loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - srcStageMask, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdWaitEvents-srcStageMask-parameter"); - skip |= ValidateFlags(loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - dstStageMask, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdWaitEvents-dstStageMask-parameter"); - skip |= - ValidateStructTypeArray(loc.dot(Field::memoryBarrierCount), loc.dot(Field::pMemoryBarriers), memoryBarrierCount, - pMemoryBarriers, VK_STRUCTURE_TYPE_MEMORY_BARRIER, false, true, "VUID-VkMemoryBarrier-sType-sType", - "VUID-vkCmdWaitEvents-pMemoryBarriers-parameter", kVUIDUndefined); + vvl::stateless::State state(*this, error_obj, device_extensions); + [[maybe_unused]] const Location loc = error_obj.location; + skip |= state.ValidateHandleArray(loc.dot(Field::eventCount), loc.dot(Field::pEvents), eventCount, pEvents, true, true, + "VUID-vkCmdWaitEvents-eventCount-arraylength"); + skip |= state.ValidateFlags(loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + srcStageMask, kOptionalFlags, "VUID-vkCmdWaitEvents-srcStageMask-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + dstStageMask, kOptionalFlags, "VUID-vkCmdWaitEvents-dstStageMask-parameter"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::memoryBarrierCount), loc.dot(Field::pMemoryBarriers), memoryBarrierCount, + pMemoryBarriers, VK_STRUCTURE_TYPE_MEMORY_BARRIER, false, true, + "VUID-VkMemoryBarrier-sType-sType", "VUID-vkCmdWaitEvents-pMemoryBarriers-parameter", + kVUIDUndefined); if (pMemoryBarriers != nullptr) { for (uint32_t memoryBarrierIndex = 0; memoryBarrierIndex < memoryBarrierCount; ++memoryBarrierIndex) { [[maybe_unused]] const Location pMemoryBarriers_loc = loc.dot(Field::pMemoryBarriers, memoryBarrierIndex); - skip |= ValidateStructPnext(pMemoryBarriers_loc, pMemoryBarriers[memoryBarrierIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMemoryBarrier-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pMemoryBarriers_loc, pMemoryBarriers[memoryBarrierIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryBarrier-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits, - AllVkAccessFlagBits, pMemoryBarriers[memoryBarrierIndex].srcAccessMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkMemoryBarrier-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits, + AllVkAccessFlagBits, pMemoryBarriers[memoryBarrierIndex].srcAccessMask, kOptionalFlags, + "VUID-VkMemoryBarrier-srcAccessMask-parameter"); - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits, - AllVkAccessFlagBits, pMemoryBarriers[memoryBarrierIndex].dstAccessMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkMemoryBarrier-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits, + AllVkAccessFlagBits, pMemoryBarriers[memoryBarrierIndex].dstAccessMask, kOptionalFlags, + "VUID-VkMemoryBarrier-dstAccessMask-parameter"); } } - skip |= ValidateStructTypeArray(loc.dot(Field::bufferMemoryBarrierCount), loc.dot(Field::pBufferMemoryBarriers), - bufferMemoryBarrierCount, pBufferMemoryBarriers, VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, false, - true, "VUID-VkBufferMemoryBarrier-sType-sType", - "VUID-vkCmdWaitEvents-pBufferMemoryBarriers-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::bufferMemoryBarrierCount), loc.dot(Field::pBufferMemoryBarriers), + bufferMemoryBarrierCount, pBufferMemoryBarriers, VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, + false, true, "VUID-VkBufferMemoryBarrier-sType-sType", + "VUID-vkCmdWaitEvents-pBufferMemoryBarriers-parameter", kVUIDUndefined); if (pBufferMemoryBarriers != nullptr) { for (uint32_t bufferMemoryBarrierIndex = 0; bufferMemoryBarrierIndex < bufferMemoryBarrierCount; ++bufferMemoryBarrierIndex) { @@ -13260,19 +15220,20 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents( loc.dot(Field::pBufferMemoryBarriers, bufferMemoryBarrierIndex); constexpr std::array allowed_structs_VkBufferMemoryBarrier = {VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT}; - skip |= ValidateStructPnext(pBufferMemoryBarriers_loc, pBufferMemoryBarriers[bufferMemoryBarrierIndex].pNext, - allowed_structs_VkBufferMemoryBarrier.size(), allowed_structs_VkBufferMemoryBarrier.data(), - GeneratedVulkanHeaderVersion, "VUID-VkBufferMemoryBarrier-pNext-pNext", - "VUID-VkBufferMemoryBarrier-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBufferMemoryBarriers_loc, pBufferMemoryBarriers[bufferMemoryBarrierIndex].pNext, + allowed_structs_VkBufferMemoryBarrier.size(), + allowed_structs_VkBufferMemoryBarrier.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBufferMemoryBarrier-pNext-pNext", "VUID-VkBufferMemoryBarrier-sType-unique", + true); - skip |= ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), - pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); + skip |= state.ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), + pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); } } - skip |= ValidateStructTypeArray(loc.dot(Field::imageMemoryBarrierCount), loc.dot(Field::pImageMemoryBarriers), - imageMemoryBarrierCount, pImageMemoryBarriers, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, false, - true, "VUID-VkImageMemoryBarrier-sType-sType", - "VUID-vkCmdWaitEvents-pImageMemoryBarriers-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::imageMemoryBarrierCount), loc.dot(Field::pImageMemoryBarriers), + imageMemoryBarrierCount, pImageMemoryBarriers, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + false, true, "VUID-VkImageMemoryBarrier-sType-sType", + "VUID-vkCmdWaitEvents-pImageMemoryBarriers-parameter", kVUIDUndefined); if (pImageMemoryBarriers != nullptr) { for (uint32_t imageMemoryBarrierIndex = 0; imageMemoryBarrierIndex < imageMemoryBarrierCount; ++imageMemoryBarrierIndex) { [[maybe_unused]] const Location pImageMemoryBarriers_loc = @@ -13280,25 +15241,26 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents( constexpr std::array allowed_structs_VkImageMemoryBarrier = {VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}; - skip |= ValidateStructPnext(pImageMemoryBarriers_loc, pImageMemoryBarriers[imageMemoryBarrierIndex].pNext, - allowed_structs_VkImageMemoryBarrier.size(), allowed_structs_VkImageMemoryBarrier.data(), - GeneratedVulkanHeaderVersion, "VUID-VkImageMemoryBarrier-pNext-pNext", - "VUID-VkImageMemoryBarrier-sType-unique", VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pImageMemoryBarriers_loc, pImageMemoryBarriers[imageMemoryBarrierIndex].pNext, + allowed_structs_VkImageMemoryBarrier.size(), allowed_structs_VkImageMemoryBarrier.data(), + GeneratedVulkanHeaderVersion, "VUID-VkImageMemoryBarrier-pNext-pNext", + "VUID-VkImageMemoryBarrier-sType-unique", true); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, - pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, - "VUID-VkImageMemoryBarrier-oldLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, + "VUID-VkImageMemoryBarrier-oldLayout-parameter"); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, - "VUID-VkImageMemoryBarrier-newLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, + "VUID-VkImageMemoryBarrier-newLayout-parameter"); - skip |= ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), - pImageMemoryBarriers[imageMemoryBarrierIndex].image); + skip |= state.ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), + pImageMemoryBarriers[imageMemoryBarrierIndex].image); - skip |= ValidateFlags( + skip |= state.ValidateFlags( pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, - pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, kRequiredFlags, VK_NULL_HANDLE, + pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, kRequiredFlags, "VUID-VkImageSubresourceRange-aspectMask-parameter", "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } @@ -13311,37 +15273,38 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier( uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers, const ErrorObject& error_obj) const { bool skip = false; - [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - srcStageMask, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdPipelineBarrier-srcStageMask-parameter"); - skip |= ValidateFlags(loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - dstStageMask, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdPipelineBarrier-dstStageMask-parameter"); - skip |= ValidateFlags(loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, AllVkDependencyFlagBits, - dependencyFlags, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdPipelineBarrier-dependencyFlags-parameter"); - skip |= - ValidateStructTypeArray(loc.dot(Field::memoryBarrierCount), loc.dot(Field::pMemoryBarriers), memoryBarrierCount, - pMemoryBarriers, VK_STRUCTURE_TYPE_MEMORY_BARRIER, false, true, "VUID-VkMemoryBarrier-sType-sType", - "VUID-vkCmdPipelineBarrier-pMemoryBarriers-parameter", kVUIDUndefined); + vvl::stateless::State state(*this, error_obj, device_extensions); + [[maybe_unused]] const Location loc = error_obj.location; + skip |= state.ValidateFlags(loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + srcStageMask, kOptionalFlags, "VUID-vkCmdPipelineBarrier-srcStageMask-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + dstStageMask, kOptionalFlags, "VUID-vkCmdPipelineBarrier-dstStageMask-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, AllVkDependencyFlagBits, + dependencyFlags, kOptionalFlags, "VUID-vkCmdPipelineBarrier-dependencyFlags-parameter"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::memoryBarrierCount), loc.dot(Field::pMemoryBarriers), memoryBarrierCount, + pMemoryBarriers, VK_STRUCTURE_TYPE_MEMORY_BARRIER, false, true, + "VUID-VkMemoryBarrier-sType-sType", "VUID-vkCmdPipelineBarrier-pMemoryBarriers-parameter", + kVUIDUndefined); if (pMemoryBarriers != nullptr) { for (uint32_t memoryBarrierIndex = 0; memoryBarrierIndex < memoryBarrierCount; ++memoryBarrierIndex) { [[maybe_unused]] const Location pMemoryBarriers_loc = loc.dot(Field::pMemoryBarriers, memoryBarrierIndex); - skip |= ValidateStructPnext(pMemoryBarriers_loc, pMemoryBarriers[memoryBarrierIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMemoryBarrier-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pMemoryBarriers_loc, pMemoryBarriers[memoryBarrierIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryBarrier-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits, - AllVkAccessFlagBits, pMemoryBarriers[memoryBarrierIndex].srcAccessMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkMemoryBarrier-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits, + AllVkAccessFlagBits, pMemoryBarriers[memoryBarrierIndex].srcAccessMask, kOptionalFlags, + "VUID-VkMemoryBarrier-srcAccessMask-parameter"); - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits, - AllVkAccessFlagBits, pMemoryBarriers[memoryBarrierIndex].dstAccessMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkMemoryBarrier-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits, + AllVkAccessFlagBits, pMemoryBarriers[memoryBarrierIndex].dstAccessMask, kOptionalFlags, + "VUID-VkMemoryBarrier-dstAccessMask-parameter"); } } - skip |= ValidateStructTypeArray(loc.dot(Field::bufferMemoryBarrierCount), loc.dot(Field::pBufferMemoryBarriers), - bufferMemoryBarrierCount, pBufferMemoryBarriers, VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, false, - true, "VUID-VkBufferMemoryBarrier-sType-sType", - "VUID-vkCmdPipelineBarrier-pBufferMemoryBarriers-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::bufferMemoryBarrierCount), loc.dot(Field::pBufferMemoryBarriers), + bufferMemoryBarrierCount, pBufferMemoryBarriers, VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, + false, true, "VUID-VkBufferMemoryBarrier-sType-sType", + "VUID-vkCmdPipelineBarrier-pBufferMemoryBarriers-parameter", kVUIDUndefined); if (pBufferMemoryBarriers != nullptr) { for (uint32_t bufferMemoryBarrierIndex = 0; bufferMemoryBarrierIndex < bufferMemoryBarrierCount; ++bufferMemoryBarrierIndex) { @@ -13349,19 +15312,20 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier( loc.dot(Field::pBufferMemoryBarriers, bufferMemoryBarrierIndex); constexpr std::array allowed_structs_VkBufferMemoryBarrier = {VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT}; - skip |= ValidateStructPnext(pBufferMemoryBarriers_loc, pBufferMemoryBarriers[bufferMemoryBarrierIndex].pNext, - allowed_structs_VkBufferMemoryBarrier.size(), allowed_structs_VkBufferMemoryBarrier.data(), - GeneratedVulkanHeaderVersion, "VUID-VkBufferMemoryBarrier-pNext-pNext", - "VUID-VkBufferMemoryBarrier-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBufferMemoryBarriers_loc, pBufferMemoryBarriers[bufferMemoryBarrierIndex].pNext, + allowed_structs_VkBufferMemoryBarrier.size(), + allowed_structs_VkBufferMemoryBarrier.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBufferMemoryBarrier-pNext-pNext", "VUID-VkBufferMemoryBarrier-sType-unique", + true); - skip |= ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), - pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); + skip |= state.ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), + pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); } } - skip |= ValidateStructTypeArray(loc.dot(Field::imageMemoryBarrierCount), loc.dot(Field::pImageMemoryBarriers), - imageMemoryBarrierCount, pImageMemoryBarriers, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, false, - true, "VUID-VkImageMemoryBarrier-sType-sType", - "VUID-vkCmdPipelineBarrier-pImageMemoryBarriers-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::imageMemoryBarrierCount), loc.dot(Field::pImageMemoryBarriers), + imageMemoryBarrierCount, pImageMemoryBarriers, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, + false, true, "VUID-VkImageMemoryBarrier-sType-sType", + "VUID-vkCmdPipelineBarrier-pImageMemoryBarriers-parameter", kVUIDUndefined); if (pImageMemoryBarriers != nullptr) { for (uint32_t imageMemoryBarrierIndex = 0; imageMemoryBarrierIndex < imageMemoryBarrierCount; ++imageMemoryBarrierIndex) { [[maybe_unused]] const Location pImageMemoryBarriers_loc = @@ -13369,25 +15333,26 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier( constexpr std::array allowed_structs_VkImageMemoryBarrier = {VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}; - skip |= ValidateStructPnext(pImageMemoryBarriers_loc, pImageMemoryBarriers[imageMemoryBarrierIndex].pNext, - allowed_structs_VkImageMemoryBarrier.size(), allowed_structs_VkImageMemoryBarrier.data(), - GeneratedVulkanHeaderVersion, "VUID-VkImageMemoryBarrier-pNext-pNext", - "VUID-VkImageMemoryBarrier-sType-unique", VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pImageMemoryBarriers_loc, pImageMemoryBarriers[imageMemoryBarrierIndex].pNext, + allowed_structs_VkImageMemoryBarrier.size(), allowed_structs_VkImageMemoryBarrier.data(), + GeneratedVulkanHeaderVersion, "VUID-VkImageMemoryBarrier-pNext-pNext", + "VUID-VkImageMemoryBarrier-sType-unique", true); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, - pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, - "VUID-VkImageMemoryBarrier-oldLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, + "VUID-VkImageMemoryBarrier-oldLayout-parameter"); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, - "VUID-VkImageMemoryBarrier-newLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, + "VUID-VkImageMemoryBarrier-newLayout-parameter"); - skip |= ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), - pImageMemoryBarriers[imageMemoryBarrierIndex].image); + skip |= state.ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), + pImageMemoryBarriers[imageMemoryBarrierIndex].image); - skip |= ValidateFlags( + skip |= state.ValidateFlags( pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, - pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, kRequiredFlags, VK_NULL_HANDLE, + pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, kRequiredFlags, "VUID-VkImageSubresourceRange-aspectMask-parameter", "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } @@ -13397,18 +15362,20 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier( bool StatelessValidation::PreCallValidateCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryControlFlagBits, AllVkQueryControlFlagBits, flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdBeginQuery-flags-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryControlFlagBits, AllVkQueryControlFlagBits, flags, + kOptionalFlags, "VUID-vkCmdBeginQuery-flags-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } @@ -13416,8 +15383,9 @@ bool StatelessValidation::PreCallValidateCmdResetQueryPool(VkCommandBuffer comma uint32_t firstQuery, uint32_t queryCount, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } @@ -13425,11 +15393,12 @@ bool StatelessValidation::PreCallValidateCmdWriteTimestamp(VkCommandBuffer comma VkQueryPool queryPool, uint32_t query, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::pipelineStage), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - pipelineStage, kRequiredSingleBit, VK_NULL_HANDLE, "VUID-vkCmdWriteTimestamp-pipelineStage-parameter", - "VUID-vkCmdWriteTimestamp-pipelineStage-parameter"); - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateFlags( + loc.dot(Field::pipelineStage), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, pipelineStage, + kRequiredSingleBit, "VUID-vkCmdWriteTimestamp-pipelineStage-parameter", "VUID-vkCmdWriteTimestamp-pipelineStage-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } @@ -13438,11 +15407,12 @@ bool StatelessValidation::PreCallValidateCmdCopyQueryPoolResults(VkCommandBuffer VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); - skip |= ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryResultFlagBits, AllVkQueryResultFlagBits, flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdCopyQueryPoolResults-flags-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryResultFlagBits, AllVkQueryResultFlagBits, flags, + kOptionalFlags, "VUID-vkCmdCopyQueryPoolResults-flags-parameter"); return skip; } @@ -13450,14 +15420,15 @@ bool StatelessValidation::PreCallValidateCmdPushConstants(VkCommandBuffer comman VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); - skip |= ValidateFlags(loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, stageFlags, - kRequiredFlags, VK_NULL_HANDLE, "VUID-vkCmdPushConstants-stageFlags-parameter", - "VUID-vkCmdPushConstants-stageFlags-requiredbitmask"); - skip |= ValidateArray(loc.dot(Field::size), loc.dot(Field::pValues), size, &pValues, true, true, - "VUID-vkCmdPushConstants-size-arraylength", "VUID-vkCmdPushConstants-pValues-parameter"); - if (!skip) skip |= manual_PreCallValidateCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= state.ValidateFlags(loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, + stageFlags, kRequiredFlags, "VUID-vkCmdPushConstants-stageFlags-parameter", + "VUID-vkCmdPushConstants-stageFlags-requiredbitmask"); + skip |= state.ValidateArray(loc.dot(Field::size), loc.dot(Field::pValues), size, &pValues, true, true, + "VUID-vkCmdPushConstants-size-arraylength", "VUID-vkCmdPushConstants-pValues-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdPushConstants(commandBuffer, layout, stageFlags, offset, size, pValues, state); return skip; } @@ -13465,9 +15436,11 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderPass(VkCommandBuffer comm const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pRenderPassBegin), pRenderPassBegin, VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, true, - "VUID-vkCmdBeginRenderPass-pRenderPassBegin-parameter", "VUID-VkRenderPassBeginInfo-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pRenderPassBegin), pRenderPassBegin, VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, true, + "VUID-vkCmdBeginRenderPass-pRenderPassBegin-parameter", "VUID-VkRenderPassBeginInfo-sType-sType"); if (pRenderPassBegin != nullptr) { [[maybe_unused]] const Location pRenderPassBegin_loc = loc.dot(Field::pRenderPassBegin); constexpr std::array allowed_structs_VkRenderPassBeginInfo = { @@ -13478,36 +15451,38 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderPass(VkCommandBuffer comm VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM, VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM}; - skip |= ValidateStructPnext(pRenderPassBegin_loc, pRenderPassBegin->pNext, allowed_structs_VkRenderPassBeginInfo.size(), - allowed_structs_VkRenderPassBeginInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkRenderPassBeginInfo-pNext-pNext", "VUID-VkRenderPassBeginInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pRenderPassBegin_loc, pRenderPassBegin->pNext, allowed_structs_VkRenderPassBeginInfo.size(), + allowed_structs_VkRenderPassBeginInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkRenderPassBeginInfo-pNext-pNext", "VUID-VkRenderPassBeginInfo-sType-unique", true); - skip |= ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::renderPass), pRenderPassBegin->renderPass); + skip |= state.ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::renderPass), pRenderPassBegin->renderPass); - skip |= ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::framebuffer), pRenderPassBegin->framebuffer); + skip |= state.ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::framebuffer), pRenderPassBegin->framebuffer); // No xml-driven validation // No xml-driven validation } - skip |= ValidateRangedEnum(loc.dot(Field::contents), vvl::Enum::VkSubpassContents, contents, - "VUID-vkCmdBeginRenderPass-contents-parameter", VK_NULL_HANDLE); - if (!skip) skip |= manual_PreCallValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents, error_obj); + skip |= state.ValidateRangedEnum(loc.dot(Field::contents), vvl::Enum::VkSubpassContents, contents, + "VUID-vkCmdBeginRenderPass-contents-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents, state); return skip; } bool StatelessValidation::PreCallValidateCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::contents), vvl::Enum::VkSubpassContents, contents, - "VUID-vkCmdNextSubpass-contents-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::contents), vvl::Enum::VkSubpassContents, contents, + "VUID-vkCmdNextSubpass-contents-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdEndRenderPass(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -13517,9 +15492,10 @@ bool StatelessValidation::PreCallValidateCmdExecuteCommands(VkCommandBuffer comm const VkCommandBuffer* pCommandBuffers, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateHandleArray(loc.dot(Field::commandBufferCount), loc.dot(Field::pCommandBuffers), commandBufferCount, - pCommandBuffers, true, true, "VUID-vkCmdExecuteCommands-commandBufferCount-arraylength"); + skip |= state.ValidateHandleArray(loc.dot(Field::commandBufferCount), loc.dot(Field::pCommandBuffers), commandBufferCount, + pCommandBuffers, true, true, "VUID-vkCmdExecuteCommands-commandBufferCount-arraylength"); return skip; } @@ -13527,25 +15503,26 @@ bool StatelessValidation::PreCallValidateBindBufferMemory2(VkDevice device, uint const VkBindBufferMemoryInfo* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray(loc.dot(Field::bindInfoCount), loc.dot(Field::pBindInfos), bindInfoCount, pBindInfos, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, true, true, - "VUID-VkBindBufferMemoryInfo-sType-sType", "VUID-vkBindBufferMemory2-pBindInfos-parameter", - "VUID-vkBindBufferMemory2-bindInfoCount-arraylength"); + skip |= state.ValidateStructTypeArray( + loc.dot(Field::bindInfoCount), loc.dot(Field::pBindInfos), bindInfoCount, pBindInfos, + VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, true, true, "VUID-VkBindBufferMemoryInfo-sType-sType", + "VUID-vkBindBufferMemory2-pBindInfos-parameter", "VUID-vkBindBufferMemory2-bindInfoCount-arraylength"); if (pBindInfos != nullptr) { for (uint32_t bindInfoIndex = 0; bindInfoIndex < bindInfoCount; ++bindInfoIndex) { [[maybe_unused]] const Location pBindInfos_loc = loc.dot(Field::pBindInfos, bindInfoIndex); constexpr std::array allowed_structs_VkBindBufferMemoryInfo = {VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pBindInfos_loc, pBindInfos[bindInfoIndex].pNext, allowed_structs_VkBindBufferMemoryInfo.size(), allowed_structs_VkBindBufferMemoryInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkBindBufferMemoryInfo-pNext-pNext", "VUID-VkBindBufferMemoryInfo-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkBindBufferMemoryInfo-pNext-pNext", "VUID-VkBindBufferMemoryInfo-sType-unique", true); - skip |= ValidateRequiredHandle(pBindInfos_loc.dot(Field::buffer), pBindInfos[bindInfoIndex].buffer); + skip |= state.ValidateRequiredHandle(pBindInfos_loc.dot(Field::buffer), pBindInfos[bindInfoIndex].buffer); - skip |= ValidateRequiredHandle(pBindInfos_loc.dot(Field::memory), pBindInfos[bindInfoIndex].memory); + skip |= state.ValidateRequiredHandle(pBindInfos_loc.dot(Field::memory), pBindInfos[bindInfoIndex].memory); } } return skip; @@ -13555,11 +15532,12 @@ bool StatelessValidation::PreCallValidateBindImageMemory2(VkDevice device, uint3 const VkBindImageMemoryInfo* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray(loc.dot(Field::bindInfoCount), loc.dot(Field::pBindInfos), bindInfoCount, pBindInfos, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, true, true, "VUID-VkBindImageMemoryInfo-sType-sType", - "VUID-vkBindImageMemory2-pBindInfos-parameter", - "VUID-vkBindImageMemory2-bindInfoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::bindInfoCount), loc.dot(Field::pBindInfos), bindInfoCount, pBindInfos, + VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, true, true, + "VUID-VkBindImageMemoryInfo-sType-sType", "VUID-vkBindImageMemory2-pBindInfos-parameter", + "VUID-vkBindImageMemory2-bindInfoCount-arraylength"); if (pBindInfos != nullptr) { for (uint32_t bindInfoIndex = 0; bindInfoIndex < bindInfoCount; ++bindInfoIndex) { [[maybe_unused]] const Location pBindInfos_loc = loc.dot(Field::pBindInfos, bindInfoIndex); @@ -13567,12 +15545,12 @@ bool StatelessValidation::PreCallValidateBindImageMemory2(VkDevice device, uint3 VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO, VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR, VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS}; - skip |= ValidateStructPnext(pBindInfos_loc, pBindInfos[bindInfoIndex].pNext, - allowed_structs_VkBindImageMemoryInfo.size(), allowed_structs_VkBindImageMemoryInfo.data(), - GeneratedVulkanHeaderVersion, "VUID-VkBindImageMemoryInfo-pNext-pNext", - "VUID-VkBindImageMemoryInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pBindInfos_loc, pBindInfos[bindInfoIndex].pNext, allowed_structs_VkBindImageMemoryInfo.size(), + allowed_structs_VkBindImageMemoryInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBindImageMemoryInfo-pNext-pNext", "VUID-VkBindImageMemoryInfo-sType-unique", true); - skip |= ValidateRequiredHandle(pBindInfos_loc.dot(Field::image), pBindInfos[bindInfoIndex].image); + skip |= state.ValidateRequiredHandle(pBindInfos_loc.dot(Field::image), pBindInfos[bindInfoIndex].image); } } return skip; @@ -13583,15 +15561,17 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupPeerMemoryFeatures(VkDevi VkPeerMemoryFeatureFlags* pPeerMemoryFeatures, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredPointer(loc.dot(Field::pPeerMemoryFeatures), pPeerMemoryFeatures, - "VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pPeerMemoryFeatures), pPeerMemoryFeatures, + "VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -13601,6 +15581,7 @@ bool StatelessValidation::PreCallValidateCmdDispatchBase(VkCommandBuffer command uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -13610,24 +15591,24 @@ bool StatelessValidation::PreCallValidateEnumeratePhysicalDeviceGroups( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkEnumeratePhysicalDeviceGroups && CheckPromotedApiAgainstVulkanVersion(instance, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateStructTypeArray(loc.dot(Field::pPhysicalDeviceGroupCount), loc.dot(Field::pPhysicalDeviceGroupProperties), - pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, true, false, false, - "VUID-VkPhysicalDeviceGroupProperties-sType-sType", kVUIDUndefined, - "VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + loc.dot(Field::pPhysicalDeviceGroupCount), loc.dot(Field::pPhysicalDeviceGroupProperties), pPhysicalDeviceGroupCount, + pPhysicalDeviceGroupProperties, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, true, false, false, + "VUID-VkPhysicalDeviceGroupProperties-sType-sType", kVUIDUndefined, + "VUID-vkEnumeratePhysicalDeviceGroups-pPhysicalDeviceGroupCount-parameter", kVUIDUndefined); if (pPhysicalDeviceGroupProperties != nullptr) { for (uint32_t pPhysicalDeviceGroupIndex = 0; pPhysicalDeviceGroupIndex < *pPhysicalDeviceGroupCount; ++pPhysicalDeviceGroupIndex) { [[maybe_unused]] const Location pPhysicalDeviceGroupProperties_loc = loc.dot(Field::pPhysicalDeviceGroupProperties, pPhysicalDeviceGroupIndex); - skip |= ValidateStructPnext(pPhysicalDeviceGroupProperties_loc, - pPhysicalDeviceGroupProperties[pPhysicalDeviceGroupIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceGroupProperties-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pPhysicalDeviceGroupProperties_loc, pPhysicalDeviceGroupProperties[pPhysicalDeviceGroupIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceGroupProperties-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -13637,33 +15618,34 @@ bool StatelessValidation::PreCallValidateGetImageMemoryRequirements2(VkDevice de VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= - ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, true, - "VUID-vkGetImageMemoryRequirements2-pInfo-parameter", "VUID-VkImageMemoryRequirementsInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, true, + "VUID-vkGetImageMemoryRequirements2-pInfo-parameter", + "VUID-VkImageMemoryRequirementsInfo2-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); constexpr std::array allowed_structs_VkImageMemoryRequirementsInfo2 = { VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO}; - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, allowed_structs_VkImageMemoryRequirementsInfo2.size(), - allowed_structs_VkImageMemoryRequirementsInfo2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkImageMemoryRequirementsInfo2-pNext-pNext", - "VUID-VkImageMemoryRequirementsInfo2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, allowed_structs_VkImageMemoryRequirementsInfo2.size(), + allowed_structs_VkImageMemoryRequirementsInfo2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkImageMemoryRequirementsInfo2-pNext-pNext", + "VUID-VkImageMemoryRequirementsInfo2-sType-unique", true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); } - skip |= ValidateStructType(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - true, "VUID-vkGetImageMemoryRequirements2-pMemoryRequirements-parameter", - "VUID-VkMemoryRequirements2-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, true, + "VUID-vkGetImageMemoryRequirements2-pMemoryRequirements-parameter", "VUID-VkMemoryRequirements2-sType-sType"); if (pMemoryRequirements != nullptr) { [[maybe_unused]] const Location pMemoryRequirements_loc = loc.dot(Field::pMemoryRequirements); constexpr std::array allowed_structs_VkMemoryRequirements2 = {VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS}; - skip |= ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements->pNext, - allowed_structs_VkMemoryRequirements2.size(), allowed_structs_VkMemoryRequirements2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", - "VUID-VkMemoryRequirements2-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pMemoryRequirements_loc, pMemoryRequirements->pNext, allowed_structs_VkMemoryRequirements2.size(), + allowed_structs_VkMemoryRequirements2.data(), GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", + "VUID-VkMemoryRequirements2-sType-unique", false); } return skip; } @@ -13672,28 +15654,29 @@ bool StatelessValidation::PreCallValidateGetBufferMemoryRequirements2(VkDevice d VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, true, - "VUID-vkGetBufferMemoryRequirements2-pInfo-parameter", - "VUID-VkBufferMemoryRequirementsInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, true, + "VUID-vkGetBufferMemoryRequirements2-pInfo-parameter", + "VUID-VkBufferMemoryRequirementsInfo2-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkBufferMemoryRequirementsInfo2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferMemoryRequirementsInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); } - skip |= ValidateStructType(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - true, "VUID-vkGetBufferMemoryRequirements2-pMemoryRequirements-parameter", - "VUID-VkMemoryRequirements2-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, true, + "VUID-vkGetBufferMemoryRequirements2-pMemoryRequirements-parameter", "VUID-VkMemoryRequirements2-sType-sType"); if (pMemoryRequirements != nullptr) { [[maybe_unused]] const Location pMemoryRequirements_loc = loc.dot(Field::pMemoryRequirements); constexpr std::array allowed_structs_VkMemoryRequirements2 = {VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS}; - skip |= ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements->pNext, - allowed_structs_VkMemoryRequirements2.size(), allowed_structs_VkMemoryRequirements2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", - "VUID-VkMemoryRequirements2-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pMemoryRequirements_loc, pMemoryRequirements->pNext, allowed_structs_VkMemoryRequirements2.size(), + allowed_structs_VkMemoryRequirements2.data(), GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", + "VUID-VkMemoryRequirements2-sType-unique", false); } return skip; } @@ -13702,18 +15685,19 @@ bool StatelessValidation::PreCallValidateGetImageSparseMemoryRequirements2( VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, true, - "VUID-vkGetImageSparseMemoryRequirements2-pInfo-parameter", - "VUID-VkImageSparseMemoryRequirementsInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, true, + "VUID-vkGetImageSparseMemoryRequirements2-pInfo-parameter", + "VUID-VkImageSparseMemoryRequirementsInfo2-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageSparseMemoryRequirementsInfo2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageSparseMemoryRequirementsInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pSparseMemoryRequirementCount), loc.dot(Field::pSparseMemoryRequirements), pSparseMemoryRequirementCount, pSparseMemoryRequirements, VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, true, false, false, "VUID-VkSparseImageMemoryRequirements2-sType-sType", kVUIDUndefined, @@ -13723,10 +15707,9 @@ bool StatelessValidation::PreCallValidateGetImageSparseMemoryRequirements2( ++pSparseMemoryRequirementIndex) { [[maybe_unused]] const Location pSparseMemoryRequirements_loc = loc.dot(Field::pSparseMemoryRequirements, pSparseMemoryRequirementIndex); - skip |= - ValidateStructPnext(pSparseMemoryRequirements_loc, pSparseMemoryRequirements[pSparseMemoryRequirementIndex].pNext, - 0, nullptr, GeneratedVulkanHeaderVersion, "VUID-VkSparseImageMemoryRequirements2-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pSparseMemoryRequirements_loc, pSparseMemoryRequirements[pSparseMemoryRequirementIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSparseImageMemoryRequirements2-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -13736,13 +15719,16 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFeatures2(VkPhysicalDe VkPhysicalDeviceFeatures2* pFeatures, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceFeatures2 && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= - ValidateStructType(loc.dot(Field::pFeatures), pFeatures, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, true, - "VUID-vkGetPhysicalDeviceFeatures2-pFeatures-parameter", "VUID-VkPhysicalDeviceFeatures2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pFeatures), pFeatures, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, true, + "VUID-vkGetPhysicalDeviceFeatures2-pFeatures-parameter", + "VUID-VkPhysicalDeviceFeatures2-sType-sType"); return skip; } @@ -13750,13 +15736,16 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceProperties2(VkPhysical VkPhysicalDeviceProperties2* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceProperties2 && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, true, - "VUID-vkGetPhysicalDeviceProperties2-pProperties-parameter", - "VUID-VkPhysicalDeviceProperties2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, true, + "VUID-vkGetPhysicalDeviceProperties2-pProperties-parameter", + "VUID-VkPhysicalDeviceProperties2-sType-sType"); if (pProperties != nullptr) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties); constexpr std::array allowed_structs_VkPhysicalDeviceProperties2 = { @@ -13859,12 +15848,12 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceProperties2(VkPhysical VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES}; - skip |= ValidateStructPnext(pProperties_loc, pProperties->pNext, allowed_structs_VkPhysicalDeviceProperties2.size(), - allowed_structs_VkPhysicalDeviceProperties2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceProperties2-pNext-pNext", "VUID-VkPhysicalDeviceProperties2-sType-unique", - physicalDevice, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties->pNext, allowed_structs_VkPhysicalDeviceProperties2.size(), + allowed_structs_VkPhysicalDeviceProperties2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceProperties2-pNext-pNext", + "VUID-VkPhysicalDeviceProperties2-sType-unique", false); } - if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceProperties2(physicalDevice, pProperties, error_obj); + if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceProperties2(physicalDevice, pProperties, state); return skip; } @@ -13872,25 +15861,28 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFormatProperties2(VkPh VkFormatProperties2* pFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceFormatProperties2 && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, - "VUID-vkGetPhysicalDeviceFormatProperties2-format-parameter", physicalDevice); - skip |= ValidateStructType(loc.dot(Field::pFormatProperties), pFormatProperties, VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, true, - "VUID-vkGetPhysicalDeviceFormatProperties2-pFormatProperties-parameter", - "VUID-VkFormatProperties2-sType-sType"); + skip |= state.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceFormatProperties2-format-parameter"); + skip |= state.ValidateStructType(loc.dot(Field::pFormatProperties), pFormatProperties, VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, + true, "VUID-vkGetPhysicalDeviceFormatProperties2-pFormatProperties-parameter", + "VUID-VkFormatProperties2-sType-sType"); if (pFormatProperties != nullptr) { [[maybe_unused]] const Location pFormatProperties_loc = loc.dot(Field::pFormatProperties); constexpr std::array allowed_structs_VkFormatProperties2 = { VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT, VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT, VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3, VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT}; - skip |= ValidateStructPnext(pFormatProperties_loc, pFormatProperties->pNext, allowed_structs_VkFormatProperties2.size(), - allowed_structs_VkFormatProperties2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkFormatProperties2-pNext-pNext", "VUID-VkFormatProperties2-sType-unique", physicalDevice, - false); + skip |= + state.ValidateStructPnext(pFormatProperties_loc, pFormatProperties->pNext, allowed_structs_VkFormatProperties2.size(), + allowed_structs_VkFormatProperties2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkFormatProperties2-pNext-pNext", "VUID-VkFormatProperties2-sType-unique", false); } return skip; } @@ -13899,14 +15891,17 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceImageFormatProperties2 VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceImageFormatProperties2 && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateStructType(loc.dot(Field::pImageFormatInfo), pImageFormatInfo, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, true, - "VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatInfo-parameter", - "VUID-VkPhysicalDeviceImageFormatInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pImageFormatInfo), pImageFormatInfo, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, true, + "VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatInfo-parameter", + "VUID-VkPhysicalDeviceImageFormatInfo2-sType-sType"); if (pImageFormatInfo != nullptr) { [[maybe_unused]] const Location pImageFormatInfo_loc = loc.dot(Field::pImageFormatInfo); constexpr std::array allowed_structs_VkPhysicalDeviceImageFormatInfo2 = { @@ -13919,34 +15914,33 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceImageFormatProperties2 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pImageFormatInfo_loc, pImageFormatInfo->pNext, - allowed_structs_VkPhysicalDeviceImageFormatInfo2.size(), - allowed_structs_VkPhysicalDeviceImageFormatInfo2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceImageFormatInfo2-pNext-pNext", - "VUID-VkPhysicalDeviceImageFormatInfo2-sType-unique", physicalDevice, true); + skip |= state.ValidateStructPnext( + pImageFormatInfo_loc, pImageFormatInfo->pNext, allowed_structs_VkPhysicalDeviceImageFormatInfo2.size(), + allowed_structs_VkPhysicalDeviceImageFormatInfo2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceImageFormatInfo2-pNext-pNext", "VUID-VkPhysicalDeviceImageFormatInfo2-sType-unique", true); - skip |= ValidateRangedEnum(pImageFormatInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pImageFormatInfo->format, - "VUID-VkPhysicalDeviceImageFormatInfo2-format-parameter", physicalDevice); + skip |= state.ValidateRangedEnum(pImageFormatInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pImageFormatInfo->format, + "VUID-VkPhysicalDeviceImageFormatInfo2-format-parameter"); - skip |= ValidateRangedEnum(pImageFormatInfo_loc.dot(Field::type), vvl::Enum::VkImageType, pImageFormatInfo->type, - "VUID-VkPhysicalDeviceImageFormatInfo2-type-parameter", physicalDevice); + skip |= state.ValidateRangedEnum(pImageFormatInfo_loc.dot(Field::type), vvl::Enum::VkImageType, pImageFormatInfo->type, + "VUID-VkPhysicalDeviceImageFormatInfo2-type-parameter"); - skip |= ValidateRangedEnum(pImageFormatInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pImageFormatInfo->tiling, - "VUID-VkPhysicalDeviceImageFormatInfo2-tiling-parameter", physicalDevice); + skip |= state.ValidateRangedEnum(pImageFormatInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, + pImageFormatInfo->tiling, "VUID-VkPhysicalDeviceImageFormatInfo2-tiling-parameter"); - skip |= ValidateFlags(pImageFormatInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, - AllVkImageUsageFlagBits, pImageFormatInfo->usage, kRequiredFlags, physicalDevice, - "VUID-VkPhysicalDeviceImageFormatInfo2-usage-parameter", - "VUID-VkPhysicalDeviceImageFormatInfo2-usage-requiredbitmask"); + skip |= state.ValidateFlags(pImageFormatInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pImageFormatInfo->usage, kRequiredFlags, + "VUID-VkPhysicalDeviceImageFormatInfo2-usage-parameter", + "VUID-VkPhysicalDeviceImageFormatInfo2-usage-requiredbitmask"); - skip |= ValidateFlags(pImageFormatInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, - AllVkImageCreateFlagBits, pImageFormatInfo->flags, kOptionalFlags, physicalDevice, - "VUID-VkPhysicalDeviceImageFormatInfo2-flags-parameter"); + skip |= state.ValidateFlags(pImageFormatInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, + AllVkImageCreateFlagBits, pImageFormatInfo->flags, kOptionalFlags, + "VUID-VkPhysicalDeviceImageFormatInfo2-flags-parameter"); } - skip |= ValidateStructType(loc.dot(Field::pImageFormatProperties), pImageFormatProperties, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, true, - "VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatProperties-parameter", - "VUID-VkImageFormatProperties2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pImageFormatProperties), pImageFormatProperties, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, true, + "VUID-vkGetPhysicalDeviceImageFormatProperties2-pImageFormatProperties-parameter", + "VUID-VkImageFormatProperties2-sType-sType"); if (pImageFormatProperties != nullptr) { [[maybe_unused]] const Location pImageFormatProperties_loc = loc.dot(Field::pImageFormatProperties); constexpr std::array allowed_structs_VkImageFormatProperties2 = { @@ -13958,14 +15952,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceImageFormatProperties2 VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES, VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pImageFormatProperties_loc, pImageFormatProperties->pNext, allowed_structs_VkImageFormatProperties2.size(), allowed_structs_VkImageFormatProperties2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkImageFormatProperties2-pNext-pNext", "VUID-VkImageFormatProperties2-sType-unique", physicalDevice, false); + "VUID-VkImageFormatProperties2-pNext-pNext", "VUID-VkImageFormatProperties2-sType-unique", false); } if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo, - pImageFormatProperties, error_obj); + pImageFormatProperties, state); return skip; } @@ -13974,15 +15968,18 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceQueueFamilyProperties2 VkQueueFamilyProperties2* pQueueFamilyProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceQueueFamilyProperties2 && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateStructTypeArray(loc.dot(Field::pQueueFamilyPropertyCount), loc.dot(Field::pQueueFamilyProperties), - pQueueFamilyPropertyCount, pQueueFamilyProperties, VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, - true, false, false, "VUID-VkQueueFamilyProperties2-sType-sType", kVUIDUndefined, - "VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyPropertyCount-parameter", - kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + loc.dot(Field::pQueueFamilyPropertyCount), loc.dot(Field::pQueueFamilyProperties), pQueueFamilyPropertyCount, + pQueueFamilyProperties, VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, true, false, false, + "VUID-VkQueueFamilyProperties2-sType-sType", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceQueueFamilyProperties2-pQueueFamilyPropertyCount-parameter", kVUIDUndefined); if (pQueueFamilyProperties != nullptr) { for (uint32_t pQueueFamilyPropertyIndex = 0; pQueueFamilyPropertyIndex < *pQueueFamilyPropertyCount; ++pQueueFamilyPropertyIndex) { @@ -13994,11 +15991,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceQueueFamilyProperties2 VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR, VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR}; - skip |= ValidateStructPnext(pQueueFamilyProperties_loc, pQueueFamilyProperties[pQueueFamilyPropertyIndex].pNext, - allowed_structs_VkQueueFamilyProperties2.size(), - allowed_structs_VkQueueFamilyProperties2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkQueueFamilyProperties2-pNext-pNext", "VUID-VkQueueFamilyProperties2-sType-unique", - physicalDevice, false); + skip |= state.ValidateStructPnext(pQueueFamilyProperties_loc, pQueueFamilyProperties[pQueueFamilyPropertyIndex].pNext, + allowed_structs_VkQueueFamilyProperties2.size(), + allowed_structs_VkQueueFamilyProperties2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkQueueFamilyProperties2-pNext-pNext", + "VUID-VkQueueFamilyProperties2-sType-unique", false); } } return skip; @@ -14008,24 +16005,26 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceMemoryProperties2(VkPh VkPhysicalDeviceMemoryProperties2* pMemoryProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceMemoryProperties2 && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateStructType(loc.dot(Field::pMemoryProperties), pMemoryProperties, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, true, - "VUID-vkGetPhysicalDeviceMemoryProperties2-pMemoryProperties-parameter", - "VUID-VkPhysicalDeviceMemoryProperties2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pMemoryProperties), pMemoryProperties, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, true, + "VUID-vkGetPhysicalDeviceMemoryProperties2-pMemoryProperties-parameter", + "VUID-VkPhysicalDeviceMemoryProperties2-sType-sType"); if (pMemoryProperties != nullptr) { [[maybe_unused]] const Location pMemoryProperties_loc = loc.dot(Field::pMemoryProperties); constexpr std::array allowed_structs_VkPhysicalDeviceMemoryProperties2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT}; - skip |= ValidateStructPnext(pMemoryProperties_loc, pMemoryProperties->pNext, - allowed_structs_VkPhysicalDeviceMemoryProperties2.size(), - allowed_structs_VkPhysicalDeviceMemoryProperties2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceMemoryProperties2-pNext-pNext", - "VUID-VkPhysicalDeviceMemoryProperties2-sType-unique", physicalDevice, false); + skip |= state.ValidateStructPnext( + pMemoryProperties_loc, pMemoryProperties->pNext, allowed_structs_VkPhysicalDeviceMemoryProperties2.size(), + allowed_structs_VkPhysicalDeviceMemoryProperties2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceMemoryProperties2-pNext-pNext", "VUID-VkPhysicalDeviceMemoryProperties2-sType-unique", false); } return skip; } @@ -14034,49 +16033,51 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSparseImageFormatPrope VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceSparseImageFormatProperties2 && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= - ValidateStructType(loc.dot(Field::pFormatInfo), pFormatInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, - true, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pFormatInfo-parameter", - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pFormatInfo), pFormatInfo, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, true, + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pFormatInfo-parameter", + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-sType-sType"); if (pFormatInfo != nullptr) { [[maybe_unused]] const Location pFormatInfo_loc = loc.dot(Field::pFormatInfo); - skip |= - ValidateStructPnext(pFormatInfo_loc, pFormatInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-pNext-pNext", kVUIDUndefined, physicalDevice, true); + skip |= state.ValidateStructPnext(pFormatInfo_loc, pFormatInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pFormatInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pFormatInfo->format, - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-format-parameter", physicalDevice); + skip |= state.ValidateRangedEnum(pFormatInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pFormatInfo->format, + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-format-parameter"); - skip |= ValidateRangedEnum(pFormatInfo_loc.dot(Field::type), vvl::Enum::VkImageType, pFormatInfo->type, - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-type-parameter", physicalDevice); + skip |= state.ValidateRangedEnum(pFormatInfo_loc.dot(Field::type), vvl::Enum::VkImageType, pFormatInfo->type, + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-type-parameter"); - skip |= ValidateFlags(pFormatInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, pFormatInfo->samples, kRequiredSingleBit, physicalDevice, - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-parameter", - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-parameter"); + skip |= state.ValidateFlags(pFormatInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, pFormatInfo->samples, kRequiredSingleBit, + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-parameter", + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-samples-parameter"); - skip |= ValidateFlags(pFormatInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, - pFormatInfo->usage, kRequiredFlags, physicalDevice, - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-parameter", - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-requiredbitmask"); + skip |= + state.ValidateFlags(pFormatInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, + pFormatInfo->usage, kRequiredFlags, "VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-parameter", + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-usage-requiredbitmask"); - skip |= ValidateRangedEnum(pFormatInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pFormatInfo->tiling, - "VUID-VkPhysicalDeviceSparseImageFormatInfo2-tiling-parameter", physicalDevice); + skip |= state.ValidateRangedEnum(pFormatInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pFormatInfo->tiling, + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-tiling-parameter"); } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2, true, false, false, "VUID-VkSparseImageFormatProperties2-sType-sType", kVUIDUndefined, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties2-pPropertyCount-parameter", kVUIDUndefined); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); - skip |= - ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSparseImageFormatProperties2-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSparseImageFormatProperties2-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -14085,28 +16086,30 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSparseImageFormatPrope bool StatelessValidation::PreCallValidateTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); - skip |= ValidateReservedFlags(loc.dot(Field::flags), flags, "VUID-vkTrimCommandPool-flags-zerobitmask"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); + skip |= state.ValidateReservedFlags(loc.dot(Field::flags), flags, "VUID-vkTrimCommandPool-flags-zerobitmask"); return skip; } bool StatelessValidation::PreCallValidateGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pQueueInfo), pQueueInfo, VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2, true, - "VUID-vkGetDeviceQueue2-pQueueInfo-parameter", "VUID-VkDeviceQueueInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pQueueInfo), pQueueInfo, VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2, true, + "VUID-vkGetDeviceQueue2-pQueueInfo-parameter", "VUID-VkDeviceQueueInfo2-sType-sType"); if (pQueueInfo != nullptr) { [[maybe_unused]] const Location pQueueInfo_loc = loc.dot(Field::pQueueInfo); - skip |= ValidateStructPnext(pQueueInfo_loc, pQueueInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceQueueInfo2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pQueueInfo_loc, pQueueInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceQueueInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pQueueInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDeviceQueueCreateFlagBits, - AllVkDeviceQueueCreateFlagBits, pQueueInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkDeviceQueueInfo2-flags-parameter"); + skip |= state.ValidateFlags(pQueueInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDeviceQueueCreateFlagBits, + AllVkDeviceQueueCreateFlagBits, pQueueInfo->flags, kOptionalFlags, + "VUID-VkDeviceQueueInfo2-flags-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pQueue), pQueue, "VUID-vkGetDeviceQueue2-pQueue-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pQueue), pQueue, "VUID-vkGetDeviceQueue2-pQueue-parameter"); return skip; } @@ -14116,64 +16119,64 @@ bool StatelessValidation::PreCallValidateCreateSamplerYcbcrConversion(VkDevice d VkSamplerYcbcrConversion* pYcbcrConversion, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, - true, "VUID-vkCreateSamplerYcbcrConversion-pCreateInfo-parameter", - "VUID-VkSamplerYcbcrConversionCreateInfo-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, true, + "VUID-vkCreateSamplerYcbcrConversion-pCreateInfo-parameter", "VUID-VkSamplerYcbcrConversionCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkSamplerYcbcrConversionCreateInfo = { VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID, VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkSamplerYcbcrConversionCreateInfo.size(), - allowed_structs_VkSamplerYcbcrConversionCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSamplerYcbcrConversionCreateInfo-pNext-pNext", - "VUID-VkSamplerYcbcrConversionCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkSamplerYcbcrConversionCreateInfo.size(), + allowed_structs_VkSamplerYcbcrConversionCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSamplerYcbcrConversionCreateInfo-pNext-pNext", "VUID-VkSamplerYcbcrConversionCreateInfo-sType-unique", true); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pCreateInfo->format, - "VUID-VkSamplerYcbcrConversionCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pCreateInfo->format, + "VUID-VkSamplerYcbcrConversionCreateInfo-format-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::ycbcrModel), vvl::Enum::VkSamplerYcbcrModelConversion, - pCreateInfo->ycbcrModel, "VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::ycbcrModel), vvl::Enum::VkSamplerYcbcrModelConversion, + pCreateInfo->ycbcrModel, "VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrModel-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::ycbcrRange), vvl::Enum::VkSamplerYcbcrRange, pCreateInfo->ycbcrRange, - "VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrRange-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::ycbcrRange), vvl::Enum::VkSamplerYcbcrRange, + pCreateInfo->ycbcrRange, "VUID-VkSamplerYcbcrConversionCreateInfo-ycbcrRange-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::r), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.r, - "VUID-VkComponentMapping-r-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::r), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.r, + "VUID-VkComponentMapping-r-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::g), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.g, - "VUID-VkComponentMapping-g-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::g), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.g, + "VUID-VkComponentMapping-g-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::b), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.b, - "VUID-VkComponentMapping-b-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::b), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.b, + "VUID-VkComponentMapping-b-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::a), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.a, - "VUID-VkComponentMapping-a-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::a), vvl::Enum::VkComponentSwizzle, pCreateInfo->components.a, + "VUID-VkComponentMapping-a-parameter"); skip |= - ValidateRangedEnum(pCreateInfo_loc.dot(Field::xChromaOffset), vvl::Enum::VkChromaLocation, pCreateInfo->xChromaOffset, - "VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-parameter", VK_NULL_HANDLE); + state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::xChromaOffset), vvl::Enum::VkChromaLocation, + pCreateInfo->xChromaOffset, "VUID-VkSamplerYcbcrConversionCreateInfo-xChromaOffset-parameter"); skip |= - ValidateRangedEnum(pCreateInfo_loc.dot(Field::yChromaOffset), vvl::Enum::VkChromaLocation, pCreateInfo->yChromaOffset, - "VUID-VkSamplerYcbcrConversionCreateInfo-yChromaOffset-parameter", VK_NULL_HANDLE); + state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::yChromaOffset), vvl::Enum::VkChromaLocation, + pCreateInfo->yChromaOffset, "VUID-VkSamplerYcbcrConversionCreateInfo-yChromaOffset-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::chromaFilter), vvl::Enum::VkFilter, pCreateInfo->chromaFilter, - "VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::chromaFilter), vvl::Enum::VkFilter, pCreateInfo->chromaFilter, + "VUID-VkSamplerYcbcrConversionCreateInfo-chromaFilter-parameter"); - skip |= ValidateBool32(pCreateInfo_loc.dot(Field::forceExplicitReconstruction), pCreateInfo->forceExplicitReconstruction); + skip |= + state.ValidateBool32(pCreateInfo_loc.dot(Field::forceExplicitReconstruction), pCreateInfo->forceExplicitReconstruction); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pYcbcrConversion), pYcbcrConversion, - "VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter"); - if (!skip) - skip |= manual_PreCallValidateCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pYcbcrConversion), pYcbcrConversion, + "VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion, state); return skip; } @@ -14181,10 +16184,11 @@ bool StatelessValidation::PreCallValidateDestroySamplerYcbcrConversion(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -14195,45 +16199,47 @@ bool StatelessValidation::PreCallValidateCreateDescriptorUpdateTemplate(VkDevice VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, - true, "VUID-vkCreateDescriptorUpdateTemplate-pCreateInfo-parameter", - "VUID-VkDescriptorUpdateTemplateCreateInfo-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, true, + "VUID-vkCreateDescriptorUpdateTemplate-pCreateInfo-parameter", "VUID-VkDescriptorUpdateTemplateCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorUpdateTemplateCreateInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorUpdateTemplateCreateInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkDescriptorUpdateTemplateCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkDescriptorUpdateTemplateCreateInfo-flags-zerobitmask"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::descriptorUpdateEntryCount), - pCreateInfo_loc.dot(Field::pDescriptorUpdateEntries), pCreateInfo->descriptorUpdateEntryCount, - &pCreateInfo->pDescriptorUpdateEntries, true, true, - "VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorUpdateEntryCount-arraylength", - "VUID-VkDescriptorUpdateTemplateCreateInfo-pDescriptorUpdateEntries-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::descriptorUpdateEntryCount), + pCreateInfo_loc.dot(Field::pDescriptorUpdateEntries), pCreateInfo->descriptorUpdateEntryCount, + &pCreateInfo->pDescriptorUpdateEntries, true, true, + "VUID-VkDescriptorUpdateTemplateCreateInfo-descriptorUpdateEntryCount-arraylength", + "VUID-VkDescriptorUpdateTemplateCreateInfo-pDescriptorUpdateEntries-parameter"); if (pCreateInfo->pDescriptorUpdateEntries != nullptr) { for (uint32_t descriptorUpdateEntryIndex = 0; descriptorUpdateEntryIndex < pCreateInfo->descriptorUpdateEntryCount; ++descriptorUpdateEntryIndex) { [[maybe_unused]] const Location pDescriptorUpdateEntries_loc = pCreateInfo_loc.dot(Field::pDescriptorUpdateEntries, descriptorUpdateEntryIndex); - skip |= ValidateRangedEnum(pDescriptorUpdateEntries_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, - pCreateInfo->pDescriptorUpdateEntries[descriptorUpdateEntryIndex].descriptorType, - "VUID-VkDescriptorUpdateTemplateEntry-descriptorType-parameter", VK_NULL_HANDLE); + skip |= + state.ValidateRangedEnum(pDescriptorUpdateEntries_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, + pCreateInfo->pDescriptorUpdateEntries[descriptorUpdateEntryIndex].descriptorType, + "VUID-VkDescriptorUpdateTemplateEntry-descriptorType-parameter"); } } - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::templateType), vvl::Enum::VkDescriptorUpdateTemplateType, - pCreateInfo->templateType, "VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-parameter", - VK_NULL_HANDLE); + skip |= + state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::templateType), vvl::Enum::VkDescriptorUpdateTemplateType, + pCreateInfo->templateType, "VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pDescriptorUpdateTemplate), pDescriptorUpdateTemplate, - "VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pDescriptorUpdateTemplate), pDescriptorUpdateTemplate, + "VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter"); return skip; } @@ -14242,10 +16248,11 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorUpdateTemplate(VkDevic const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -14254,9 +16261,10 @@ bool StatelessValidation::PreCallValidateUpdateDescriptorSetWithTemplate(VkDevic VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorSet), descriptorSet); - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorUpdateTemplate), descriptorUpdateTemplate); + skip |= state.ValidateRequiredHandle(loc.dot(Field::descriptorSet), descriptorSet); + skip |= state.ValidateRequiredHandle(loc.dot(Field::descriptorUpdateTemplate), descriptorUpdateTemplate); return skip; } @@ -14264,47 +16272,50 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalBufferProperti VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceExternalBufferProperties && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateStructType(loc.dot(Field::pExternalBufferInfo), pExternalBufferInfo, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, true, - "VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferInfo-parameter", - "VUID-VkPhysicalDeviceExternalBufferInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pExternalBufferInfo), pExternalBufferInfo, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, true, + "VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferInfo-parameter", + "VUID-VkPhysicalDeviceExternalBufferInfo-sType-sType"); if (pExternalBufferInfo != nullptr) { [[maybe_unused]] const Location pExternalBufferInfo_loc = loc.dot(Field::pExternalBufferInfo); constexpr std::array allowed_structs_VkPhysicalDeviceExternalBufferInfo = { VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO}; - skip |= ValidateStructPnext(pExternalBufferInfo_loc, pExternalBufferInfo->pNext, - allowed_structs_VkPhysicalDeviceExternalBufferInfo.size(), - allowed_structs_VkPhysicalDeviceExternalBufferInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceExternalBufferInfo-pNext-pNext", - "VUID-VkPhysicalDeviceExternalBufferInfo-sType-unique", physicalDevice, true); - - skip |= ValidateFlags(pExternalBufferInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, - AllVkBufferCreateFlagBits, pExternalBufferInfo->flags, kOptionalFlags, physicalDevice, - "VUID-VkPhysicalDeviceExternalBufferInfo-flags-parameter"); - - skip |= ValidateFlags(pExternalBufferInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, pExternalBufferInfo->handleType, kRequiredSingleBit, - physicalDevice, "VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter", - "VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter"); - } - skip |= ValidateStructType(loc.dot(Field::pExternalBufferProperties), pExternalBufferProperties, - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, true, - "VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferProperties-parameter", - "VUID-VkExternalBufferProperties-sType-sType"); + skip |= state.ValidateStructPnext( + pExternalBufferInfo_loc, pExternalBufferInfo->pNext, allowed_structs_VkPhysicalDeviceExternalBufferInfo.size(), + allowed_structs_VkPhysicalDeviceExternalBufferInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceExternalBufferInfo-pNext-pNext", "VUID-VkPhysicalDeviceExternalBufferInfo-sType-unique", true); + + skip |= state.ValidateFlags(pExternalBufferInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, + AllVkBufferCreateFlagBits, pExternalBufferInfo->flags, kOptionalFlags, + "VUID-VkPhysicalDeviceExternalBufferInfo-flags-parameter"); + + skip |= state.ValidateFlags(pExternalBufferInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, AllVkExternalMemoryHandleTypeFlagBits, + pExternalBufferInfo->handleType, kRequiredSingleBit, + "VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter", + "VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter"); + } + skip |= state.ValidateStructType(loc.dot(Field::pExternalBufferProperties), pExternalBufferProperties, + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, true, + "VUID-vkGetPhysicalDeviceExternalBufferProperties-pExternalBufferProperties-parameter", + "VUID-VkExternalBufferProperties-sType-sType"); if (pExternalBufferProperties != nullptr) { [[maybe_unused]] const Location pExternalBufferProperties_loc = loc.dot(Field::pExternalBufferProperties); - skip |= ValidateStructPnext(pExternalBufferProperties_loc, pExternalBufferProperties->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkExternalBufferProperties-pNext-pNext", kVUIDUndefined, - physicalDevice, false); + skip |= state.ValidateStructPnext(pExternalBufferProperties_loc, pExternalBufferProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkExternalBufferProperties-pNext-pNext", + kVUIDUndefined, false); } if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, - pExternalBufferProperties, error_obj); + pExternalBufferProperties, state); return skip; } @@ -14312,33 +16323,38 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalFencePropertie VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceExternalFenceProperties && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateStructType(loc.dot(Field::pExternalFenceInfo), pExternalFenceInfo, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, true, - "VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceInfo-parameter", - "VUID-VkPhysicalDeviceExternalFenceInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pExternalFenceInfo), pExternalFenceInfo, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, true, + "VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceInfo-parameter", + "VUID-VkPhysicalDeviceExternalFenceInfo-sType-sType"); if (pExternalFenceInfo != nullptr) { [[maybe_unused]] const Location pExternalFenceInfo_loc = loc.dot(Field::pExternalFenceInfo); - skip |= ValidateStructPnext(pExternalFenceInfo_loc, pExternalFenceInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceExternalFenceInfo-pNext-pNext", kVUIDUndefined, physicalDevice, true); - - skip |= ValidateFlags(pExternalFenceInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, - AllVkExternalFenceHandleTypeFlagBits, pExternalFenceInfo->handleType, kRequiredSingleBit, - physicalDevice, "VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter", - "VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter"); - } - skip |= ValidateStructType(loc.dot(Field::pExternalFenceProperties), pExternalFenceProperties, - VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, true, - "VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceProperties-parameter", - "VUID-VkExternalFenceProperties-sType-sType"); + skip |= + state.ValidateStructPnext(pExternalFenceInfo_loc, pExternalFenceInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceExternalFenceInfo-pNext-pNext", kVUIDUndefined, true); + + skip |= + state.ValidateFlags(pExternalFenceInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, + AllVkExternalFenceHandleTypeFlagBits, pExternalFenceInfo->handleType, kRequiredSingleBit, + "VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter", + "VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter"); + } + skip |= state.ValidateStructType(loc.dot(Field::pExternalFenceProperties), pExternalFenceProperties, + VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, true, + "VUID-vkGetPhysicalDeviceExternalFenceProperties-pExternalFenceProperties-parameter", + "VUID-VkExternalFenceProperties-sType-sType"); if (pExternalFenceProperties != nullptr) { [[maybe_unused]] const Location pExternalFenceProperties_loc = loc.dot(Field::pExternalFenceProperties); - skip |= ValidateStructPnext(pExternalFenceProperties_loc, pExternalFenceProperties->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkExternalFenceProperties-pNext-pNext", kVUIDUndefined, - physicalDevice, false); + skip |= state.ValidateStructPnext(pExternalFenceProperties_loc, pExternalFenceProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkExternalFenceProperties-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -14347,39 +16363,42 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalSemaphorePrope VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceExternalSemaphoreProperties && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_1)) return true; - skip |= ValidateStructType(loc.dot(Field::pExternalSemaphoreInfo), pExternalSemaphoreInfo, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, true, - "VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreInfo-parameter", - "VUID-VkPhysicalDeviceExternalSemaphoreInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pExternalSemaphoreInfo), pExternalSemaphoreInfo, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, true, + "VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreInfo-parameter", + "VUID-VkPhysicalDeviceExternalSemaphoreInfo-sType-sType"); if (pExternalSemaphoreInfo != nullptr) { [[maybe_unused]] const Location pExternalSemaphoreInfo_loc = loc.dot(Field::pExternalSemaphoreInfo); constexpr std::array allowed_structs_VkPhysicalDeviceExternalSemaphoreInfo = {VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO}; - skip |= ValidateStructPnext(pExternalSemaphoreInfo_loc, pExternalSemaphoreInfo->pNext, - allowed_structs_VkPhysicalDeviceExternalSemaphoreInfo.size(), - allowed_structs_VkPhysicalDeviceExternalSemaphoreInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceExternalSemaphoreInfo-pNext-pNext", - "VUID-VkPhysicalDeviceExternalSemaphoreInfo-sType-unique", physicalDevice, true); - - skip |= ValidateFlags(pExternalSemaphoreInfo_loc.dot(Field::handleType), - vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, AllVkExternalSemaphoreHandleTypeFlagBits, - pExternalSemaphoreInfo->handleType, kRequiredSingleBit, physicalDevice, - "VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter", - "VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter"); - } - skip |= ValidateStructType(loc.dot(Field::pExternalSemaphoreProperties), pExternalSemaphoreProperties, - VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, true, - "VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreProperties-parameter", - "VUID-VkExternalSemaphoreProperties-sType-sType"); + skip |= state.ValidateStructPnext(pExternalSemaphoreInfo_loc, pExternalSemaphoreInfo->pNext, + allowed_structs_VkPhysicalDeviceExternalSemaphoreInfo.size(), + allowed_structs_VkPhysicalDeviceExternalSemaphoreInfo.data(), + GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceExternalSemaphoreInfo-pNext-pNext", + "VUID-VkPhysicalDeviceExternalSemaphoreInfo-sType-unique", true); + + skip |= state.ValidateFlags(pExternalSemaphoreInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, + AllVkExternalSemaphoreHandleTypeFlagBits, pExternalSemaphoreInfo->handleType, + kRequiredSingleBit, "VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter", + "VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter"); + } + skip |= state.ValidateStructType(loc.dot(Field::pExternalSemaphoreProperties), pExternalSemaphoreProperties, + VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, true, + "VUID-vkGetPhysicalDeviceExternalSemaphoreProperties-pExternalSemaphoreProperties-parameter", + "VUID-VkExternalSemaphoreProperties-sType-sType"); if (pExternalSemaphoreProperties != nullptr) { [[maybe_unused]] const Location pExternalSemaphoreProperties_loc = loc.dot(Field::pExternalSemaphoreProperties); - skip |= ValidateStructPnext(pExternalSemaphoreProperties_loc, pExternalSemaphoreProperties->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkExternalSemaphoreProperties-pNext-pNext", kVUIDUndefined, - physicalDevice, false); + skip |= state.ValidateStructPnext(pExternalSemaphoreProperties_loc, pExternalSemaphoreProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkExternalSemaphoreProperties-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -14389,52 +16408,53 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutSupport(VkDevice VkDescriptorSetLayoutSupport* pSupport, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, true, - "VUID-vkGetDescriptorSetLayoutSupport-pCreateInfo-parameter", - "VUID-VkDescriptorSetLayoutCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, + true, "VUID-vkGetDescriptorSetLayoutSupport-pCreateInfo-parameter", + "VUID-VkDescriptorSetLayoutCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkDescriptorSetLayoutCreateInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDescriptorSetLayoutCreateInfo.size(), - allowed_structs_VkDescriptorSetLayoutCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext", - "VUID-VkDescriptorSetLayoutCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDescriptorSetLayoutCreateInfo.size(), + allowed_structs_VkDescriptorSetLayoutCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorSetLayoutCreateInfo-pNext-pNext", "VUID-VkDescriptorSetLayoutCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDescriptorSetLayoutCreateFlagBits, - AllVkDescriptorSetLayoutCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDescriptorSetLayoutCreateFlagBits, + AllVkDescriptorSetLayoutCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkDescriptorSetLayoutCreateInfo-flags-parameter"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::bindingCount), pCreateInfo_loc.dot(Field::pBindings), - pCreateInfo->bindingCount, &pCreateInfo->pBindings, false, true, kVUIDUndefined, - "VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::bindingCount), pCreateInfo_loc.dot(Field::pBindings), + pCreateInfo->bindingCount, &pCreateInfo->pBindings, false, true, kVUIDUndefined, + "VUID-VkDescriptorSetLayoutCreateInfo-pBindings-parameter"); if (pCreateInfo->pBindings != nullptr) { for (uint32_t bindingIndex = 0; bindingIndex < pCreateInfo->bindingCount; ++bindingIndex) { [[maybe_unused]] const Location pBindings_loc = pCreateInfo_loc.dot(Field::pBindings, bindingIndex); - skip |= ValidateRangedEnum(pBindings_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, - pCreateInfo->pBindings[bindingIndex].descriptorType, - "VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pBindings_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, + pCreateInfo->pBindings[bindingIndex].descriptorType, + "VUID-VkDescriptorSetLayoutBinding-descriptorType-parameter"); } } } - skip |= ValidateStructType(loc.dot(Field::pSupport), pSupport, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, true, - "VUID-vkGetDescriptorSetLayoutSupport-pSupport-parameter", - "VUID-VkDescriptorSetLayoutSupport-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pSupport), pSupport, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, true, + "VUID-vkGetDescriptorSetLayoutSupport-pSupport-parameter", + "VUID-VkDescriptorSetLayoutSupport-sType-sType"); if (pSupport != nullptr) { [[maybe_unused]] const Location pSupport_loc = loc.dot(Field::pSupport); constexpr std::array allowed_structs_VkDescriptorSetLayoutSupport = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT}; - skip |= ValidateStructPnext(pSupport_loc, pSupport->pNext, allowed_structs_VkDescriptorSetLayoutSupport.size(), - allowed_structs_VkDescriptorSetLayoutSupport.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorSetLayoutSupport-pNext-pNext", - "VUID-VkDescriptorSetLayoutSupport-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pSupport_loc, pSupport->pNext, allowed_structs_VkDescriptorSetLayoutSupport.size(), + allowed_structs_VkDescriptorSetLayoutSupport.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorSetLayoutSupport-pNext-pNext", + "VUID-VkDescriptorSetLayoutSupport-sType-unique", false); } - if (!skip) skip |= manual_PreCallValidateGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport, error_obj); + if (!skip) skip |= manual_PreCallValidateGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport, state); return skip; } @@ -14443,9 +16463,10 @@ bool StatelessValidation::PreCallValidateCmdDrawIndirectCount(VkCommandBuffer co uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); return skip; } @@ -14454,9 +16475,10 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBu VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); return skip; } @@ -14464,25 +16486,26 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, true, - "VUID-vkCreateRenderPass2-pCreateInfo-parameter", "VUID-VkRenderPassCreateInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, true, + "VUID-vkCreateRenderPass2-pCreateInfo-parameter", "VUID-VkRenderPassCreateInfo2-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkRenderPassCreateInfo2 = { VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT, VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkRenderPassCreateInfo2.size(), - allowed_structs_VkRenderPassCreateInfo2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkRenderPassCreateInfo2-pNext-pNext", "VUID-VkRenderPassCreateInfo2-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkRenderPassCreateInfo2.size(), + allowed_structs_VkRenderPassCreateInfo2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkRenderPassCreateInfo2-pNext-pNext", "VUID-VkRenderPassCreateInfo2-sType-unique", + true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderPassCreateFlagBits, - AllVkRenderPassCreateFlagBits, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkRenderPassCreateInfo2-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderPassCreateFlagBits, + AllVkRenderPassCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkRenderPassCreateInfo2-flags-parameter"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pCreateInfo_loc.dot(Field::attachmentCount), pCreateInfo_loc.dot(Field::pAttachments), pCreateInfo->attachmentCount, pCreateInfo->pAttachments, VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, false, true, "VUID-VkAttachmentDescription2-sType-sType", "VUID-VkRenderPassCreateInfo2-pAttachments-parameter", kVUIDUndefined); @@ -14493,52 +16516,52 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentDescription2 = { VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT, VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID}; - skip |= ValidateStructPnext(pAttachments_loc, pCreateInfo->pAttachments[attachmentIndex].pNext, - allowed_structs_VkAttachmentDescription2.size(), - allowed_structs_VkAttachmentDescription2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkAttachmentDescription2-pNext-pNext", - "VUID-VkAttachmentDescription2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pAttachments_loc, pCreateInfo->pAttachments[attachmentIndex].pNext, + allowed_structs_VkAttachmentDescription2.size(), + allowed_structs_VkAttachmentDescription2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkAttachmentDescription2-pNext-pNext", + "VUID-VkAttachmentDescription2-sType-unique", true); - skip |= ValidateFlags(pAttachments_loc.dot(Field::flags), vvl::FlagBitmask::VkAttachmentDescriptionFlagBits, - AllVkAttachmentDescriptionFlagBits, pCreateInfo->pAttachments[attachmentIndex].flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkAttachmentDescription2-flags-parameter"); + skip |= state.ValidateFlags(pAttachments_loc.dot(Field::flags), vvl::FlagBitmask::VkAttachmentDescriptionFlagBits, + AllVkAttachmentDescriptionFlagBits, pCreateInfo->pAttachments[attachmentIndex].flags, + kOptionalFlags, "VUID-VkAttachmentDescription2-flags-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::format), vvl::Enum::VkFormat, - pCreateInfo->pAttachments[attachmentIndex].format, - "VUID-VkAttachmentDescription2-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::format), vvl::Enum::VkFormat, + pCreateInfo->pAttachments[attachmentIndex].format, + "VUID-VkAttachmentDescription2-format-parameter"); - skip |= ValidateFlags(pAttachments_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, pCreateInfo->pAttachments[attachmentIndex].samples, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkAttachmentDescription2-samples-parameter", - "VUID-VkAttachmentDescription2-samples-parameter"); + skip |= state.ValidateFlags(pAttachments_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, pCreateInfo->pAttachments[attachmentIndex].samples, + kRequiredSingleBit, "VUID-VkAttachmentDescription2-samples-parameter", + "VUID-VkAttachmentDescription2-samples-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, - pCreateInfo->pAttachments[attachmentIndex].loadOp, - "VUID-VkAttachmentDescription2-loadOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, + pCreateInfo->pAttachments[attachmentIndex].loadOp, + "VUID-VkAttachmentDescription2-loadOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, - pCreateInfo->pAttachments[attachmentIndex].storeOp, - "VUID-VkAttachmentDescription2-storeOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, + pCreateInfo->pAttachments[attachmentIndex].storeOp, + "VUID-VkAttachmentDescription2-storeOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::stencilLoadOp), vvl::Enum::VkAttachmentLoadOp, - pCreateInfo->pAttachments[attachmentIndex].stencilLoadOp, - "VUID-VkAttachmentDescription2-stencilLoadOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::stencilLoadOp), vvl::Enum::VkAttachmentLoadOp, + pCreateInfo->pAttachments[attachmentIndex].stencilLoadOp, + "VUID-VkAttachmentDescription2-stencilLoadOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::stencilStoreOp), vvl::Enum::VkAttachmentStoreOp, - pCreateInfo->pAttachments[attachmentIndex].stencilStoreOp, - "VUID-VkAttachmentDescription2-stencilStoreOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::stencilStoreOp), vvl::Enum::VkAttachmentStoreOp, + pCreateInfo->pAttachments[attachmentIndex].stencilStoreOp, + "VUID-VkAttachmentDescription2-stencilStoreOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, - pCreateInfo->pAttachments[attachmentIndex].initialLayout, - "VUID-VkAttachmentDescription2-initialLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, + pCreateInfo->pAttachments[attachmentIndex].initialLayout, + "VUID-VkAttachmentDescription2-initialLayout-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::finalLayout), vvl::Enum::VkImageLayout, - pCreateInfo->pAttachments[attachmentIndex].finalLayout, - "VUID-VkAttachmentDescription2-finalLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::finalLayout), vvl::Enum::VkImageLayout, + pCreateInfo->pAttachments[attachmentIndex].finalLayout, + "VUID-VkAttachmentDescription2-finalLayout-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pCreateInfo_loc.dot(Field::subpassCount), pCreateInfo_loc.dot(Field::pSubpasses), pCreateInfo->subpassCount, pCreateInfo->pSubpasses, VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, true, true, "VUID-VkSubpassDescription2-sType-sType", "VUID-VkRenderPassCreateInfo2-pSubpasses-parameter", "VUID-VkRenderPassCreateInfo2-subpassCount-arraylength"); @@ -14553,20 +16576,20 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pSubpasses_loc, pCreateInfo->pSubpasses[subpassIndex].pNext, allowed_structs_VkSubpassDescription2.size(), allowed_structs_VkSubpassDescription2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSubpassDescription2-pNext-pNext", "VUID-VkSubpassDescription2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkSubpassDescription2-pNext-pNext", "VUID-VkSubpassDescription2-sType-unique", true); - skip |= ValidateFlags(pSubpasses_loc.dot(Field::flags), vvl::FlagBitmask::VkSubpassDescriptionFlagBits, - AllVkSubpassDescriptionFlagBits, pCreateInfo->pSubpasses[subpassIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkSubpassDescription2-flags-parameter"); + skip |= state.ValidateFlags(pSubpasses_loc.dot(Field::flags), vvl::FlagBitmask::VkSubpassDescriptionFlagBits, + AllVkSubpassDescriptionFlagBits, pCreateInfo->pSubpasses[subpassIndex].flags, + kOptionalFlags, "VUID-VkSubpassDescription2-flags-parameter"); - skip |= ValidateRangedEnum(pSubpasses_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, - pCreateInfo->pSubpasses[subpassIndex].pipelineBindPoint, - "VUID-VkSubpassDescription2-pipelineBindPoint-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pSubpasses_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pCreateInfo->pSubpasses[subpassIndex].pipelineBindPoint, + "VUID-VkSubpassDescription2-pipelineBindPoint-parameter"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pSubpasses_loc.dot(Field::inputAttachmentCount), pSubpasses_loc.dot(Field::pInputAttachments), pCreateInfo->pSubpasses[subpassIndex].inputAttachmentCount, pCreateInfo->pSubpasses[subpassIndex].pInputAttachments, VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, false, true, @@ -14582,21 +16605,21 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentReference2 = { VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pInputAttachments_loc, pCreateInfo->pSubpasses[subpassIndex].pInputAttachments[inputAttachmentIndex].pNext, allowed_structs_VkAttachmentReference2.size(), allowed_structs_VkAttachmentReference2.data(), GeneratedVulkanHeaderVersion, "VUID-VkAttachmentReference2-pNext-pNext", - "VUID-VkAttachmentReference2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkAttachmentReference2-sType-unique", true); - skip |= - ValidateRangedEnum(pInputAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, - pCreateInfo->pSubpasses[subpassIndex].pInputAttachments[inputAttachmentIndex].layout, - "VUID-VkAttachmentReference2-layout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum( + pInputAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pInputAttachments[inputAttachmentIndex].layout, + "VUID-VkAttachmentReference2-layout-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pSubpasses_loc.dot(Field::colorAttachmentCount), pSubpasses_loc.dot(Field::pColorAttachments), pCreateInfo->pSubpasses[subpassIndex].colorAttachmentCount, pCreateInfo->pSubpasses[subpassIndex].pColorAttachments, VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, false, true, @@ -14612,21 +16635,21 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentReference2 = { VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pColorAttachments_loc, pCreateInfo->pSubpasses[subpassIndex].pColorAttachments[colorAttachmentIndex].pNext, allowed_structs_VkAttachmentReference2.size(), allowed_structs_VkAttachmentReference2.data(), GeneratedVulkanHeaderVersion, "VUID-VkAttachmentReference2-pNext-pNext", - "VUID-VkAttachmentReference2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkAttachmentReference2-sType-unique", true); - skip |= - ValidateRangedEnum(pColorAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, - pCreateInfo->pSubpasses[subpassIndex].pColorAttachments[colorAttachmentIndex].layout, - "VUID-VkAttachmentReference2-layout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum( + pColorAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pColorAttachments[colorAttachmentIndex].layout, + "VUID-VkAttachmentReference2-layout-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pSubpasses_loc.dot(Field::colorAttachmentCount), pSubpasses_loc.dot(Field::pResolveAttachments), pCreateInfo->pSubpasses[subpassIndex].colorAttachmentCount, pCreateInfo->pSubpasses[subpassIndex].pResolveAttachments, VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, false, @@ -14641,21 +16664,21 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentReference2 = { VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pResolveAttachments_loc, pCreateInfo->pSubpasses[subpassIndex].pResolveAttachments[colorAttachmentIndex].pNext, allowed_structs_VkAttachmentReference2.size(), allowed_structs_VkAttachmentReference2.data(), GeneratedVulkanHeaderVersion, "VUID-VkAttachmentReference2-pNext-pNext", - "VUID-VkAttachmentReference2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkAttachmentReference2-sType-unique", true); - skip |= ValidateRangedEnum( + skip |= state.ValidateRangedEnum( pResolveAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, pCreateInfo->pSubpasses[subpassIndex].pResolveAttachments[colorAttachmentIndex].layout, - "VUID-VkAttachmentReference2-layout-parameter", VK_NULL_HANDLE); + "VUID-VkAttachmentReference2-layout-parameter"); } } - skip |= ValidateStructType( + skip |= state.ValidateStructType( pSubpasses_loc.dot(Field::pDepthStencilAttachment), pCreateInfo->pSubpasses[subpassIndex].pDepthStencilAttachment, VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, false, "VUID-VkSubpassDescription2-pDepthStencilAttachment-parameter", "VUID-VkAttachmentReference2-sType-sType"); @@ -14666,26 +16689,26 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentReference2 = { VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pDepthStencilAttachment_loc, pCreateInfo->pSubpasses[subpassIndex].pDepthStencilAttachment->pNext, allowed_structs_VkAttachmentReference2.size(), allowed_structs_VkAttachmentReference2.data(), GeneratedVulkanHeaderVersion, "VUID-VkAttachmentReference2-pNext-pNext", - "VUID-VkAttachmentReference2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkAttachmentReference2-sType-unique", true); - skip |= ValidateRangedEnum(pDepthStencilAttachment_loc.dot(Field::layout), vvl::Enum::VkImageLayout, - pCreateInfo->pSubpasses[subpassIndex].pDepthStencilAttachment->layout, - "VUID-VkAttachmentReference2-layout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthStencilAttachment_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pDepthStencilAttachment->layout, + "VUID-VkAttachmentReference2-layout-parameter"); } - skip |= ValidateArray(pSubpasses_loc.dot(Field::preserveAttachmentCount), - pSubpasses_loc.dot(Field::pPreserveAttachments), - pCreateInfo->pSubpasses[subpassIndex].preserveAttachmentCount, - &pCreateInfo->pSubpasses[subpassIndex].pPreserveAttachments, false, true, kVUIDUndefined, - "VUID-VkSubpassDescription2-pPreserveAttachments-parameter"); + skip |= state.ValidateArray(pSubpasses_loc.dot(Field::preserveAttachmentCount), + pSubpasses_loc.dot(Field::pPreserveAttachments), + pCreateInfo->pSubpasses[subpassIndex].preserveAttachmentCount, + &pCreateInfo->pSubpasses[subpassIndex].pPreserveAttachments, false, true, + kVUIDUndefined, "VUID-VkSubpassDescription2-pPreserveAttachments-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pCreateInfo_loc.dot(Field::dependencyCount), pCreateInfo_loc.dot(Field::pDependencies), pCreateInfo->dependencyCount, pCreateInfo->pDependencies, VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, false, true, "VUID-VkSubpassDependency2-sType-sType", "VUID-VkRenderPassCreateInfo2-pDependencies-parameter", kVUIDUndefined); @@ -14695,52 +16718,56 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons [[maybe_unused]] const Location pDependencies_loc = pCreateInfo_loc.dot(Field::pDependencies, dependencyIndex); constexpr std::array allowed_structs_VkSubpassDependency2 = {VK_STRUCTURE_TYPE_MEMORY_BARRIER_2}; - skip |= - ValidateStructPnext(pDependencies_loc, pCreateInfo->pDependencies[dependencyIndex].pNext, - allowed_structs_VkSubpassDependency2.size(), allowed_structs_VkSubpassDependency2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkSubpassDependency2-pNext-pNext", - "VUID-VkSubpassDependency2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDependencies_loc, pCreateInfo->pDependencies[dependencyIndex].pNext, + allowed_structs_VkSubpassDependency2.size(), + allowed_structs_VkSubpassDependency2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSubpassDependency2-pNext-pNext", "VUID-VkSubpassDependency2-sType-unique", + true); if (!vku::FindStructInPNextChain(pCreateInfo->pDependencies[dependencyIndex].pNext)) { - skip |= ValidateFlags(pDependencies_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, - AllVkPipelineStageFlagBits, pCreateInfo->pDependencies[dependencyIndex].srcStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency2-srcStageMask-parameter"); + skip |= + state.ValidateFlags(pDependencies_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, + AllVkPipelineStageFlagBits, pCreateInfo->pDependencies[dependencyIndex].srcStageMask, + kOptionalFlags, "VUID-VkSubpassDependency2-srcStageMask-parameter"); } if (!vku::FindStructInPNextChain(pCreateInfo->pDependencies[dependencyIndex].pNext)) { - skip |= ValidateFlags(pDependencies_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, - AllVkPipelineStageFlagBits, pCreateInfo->pDependencies[dependencyIndex].dstStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency2-dstStageMask-parameter"); + skip |= + state.ValidateFlags(pDependencies_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, + AllVkPipelineStageFlagBits, pCreateInfo->pDependencies[dependencyIndex].dstStageMask, + kOptionalFlags, "VUID-VkSubpassDependency2-dstStageMask-parameter"); } if (!vku::FindStructInPNextChain(pCreateInfo->pDependencies[dependencyIndex].pNext)) { - skip |= ValidateFlags(pDependencies_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits, - AllVkAccessFlagBits, pCreateInfo->pDependencies[dependencyIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency2-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pDependencies_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits, + AllVkAccessFlagBits, pCreateInfo->pDependencies[dependencyIndex].srcAccessMask, + kOptionalFlags, "VUID-VkSubpassDependency2-srcAccessMask-parameter"); } if (!vku::FindStructInPNextChain(pCreateInfo->pDependencies[dependencyIndex].pNext)) { - skip |= ValidateFlags(pDependencies_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits, - AllVkAccessFlagBits, pCreateInfo->pDependencies[dependencyIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency2-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pDependencies_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits, + AllVkAccessFlagBits, pCreateInfo->pDependencies[dependencyIndex].dstAccessMask, + kOptionalFlags, "VUID-VkSubpassDependency2-dstAccessMask-parameter"); } - skip |= ValidateFlags(pDependencies_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, - AllVkDependencyFlagBits, pCreateInfo->pDependencies[dependencyIndex].dependencyFlags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubpassDependency2-dependencyFlags-parameter"); + skip |= state.ValidateFlags(pDependencies_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, + AllVkDependencyFlagBits, pCreateInfo->pDependencies[dependencyIndex].dependencyFlags, + kOptionalFlags, "VUID-VkSubpassDependency2-dependencyFlags-parameter"); } } - skip |= ValidateArray(pCreateInfo_loc.dot(Field::correlatedViewMaskCount), pCreateInfo_loc.dot(Field::pCorrelatedViewMasks), - pCreateInfo->correlatedViewMaskCount, &pCreateInfo->pCorrelatedViewMasks, false, true, kVUIDUndefined, - "VUID-VkRenderPassCreateInfo2-pCorrelatedViewMasks-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::correlatedViewMaskCount), + pCreateInfo_loc.dot(Field::pCorrelatedViewMasks), pCreateInfo->correlatedViewMaskCount, + &pCreateInfo->pCorrelatedViewMasks, false, true, kVUIDUndefined, + "VUID-VkRenderPassCreateInfo2-pCorrelatedViewMasks-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pRenderPass), pRenderPass, "VUID-vkCreateRenderPass2-pRenderPass-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateRenderPass2(device, pCreateInfo, pAllocator, pRenderPass, error_obj); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::pRenderPass), pRenderPass, "VUID-vkCreateRenderPass2-pRenderPass-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateRenderPass2(device, pCreateInfo, pAllocator, pRenderPass, state); return skip; } @@ -14749,9 +16776,11 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderPass2(VkCommandBuffer com const VkSubpassBeginInfo* pSubpassBeginInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pRenderPassBegin), pRenderPassBegin, VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, true, - "VUID-vkCmdBeginRenderPass2-pRenderPassBegin-parameter", "VUID-VkRenderPassBeginInfo-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pRenderPassBegin), pRenderPassBegin, VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, true, + "VUID-vkCmdBeginRenderPass2-pRenderPassBegin-parameter", "VUID-VkRenderPassBeginInfo-sType-sType"); if (pRenderPassBegin != nullptr) { [[maybe_unused]] const Location pRenderPassBegin_loc = loc.dot(Field::pRenderPassBegin); constexpr std::array allowed_structs_VkRenderPassBeginInfo = { @@ -14762,30 +16791,31 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderPass2(VkCommandBuffer com VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM, VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM}; - skip |= ValidateStructPnext(pRenderPassBegin_loc, pRenderPassBegin->pNext, allowed_structs_VkRenderPassBeginInfo.size(), - allowed_structs_VkRenderPassBeginInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkRenderPassBeginInfo-pNext-pNext", "VUID-VkRenderPassBeginInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pRenderPassBegin_loc, pRenderPassBegin->pNext, allowed_structs_VkRenderPassBeginInfo.size(), + allowed_structs_VkRenderPassBeginInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkRenderPassBeginInfo-pNext-pNext", "VUID-VkRenderPassBeginInfo-sType-unique", true); - skip |= ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::renderPass), pRenderPassBegin->renderPass); + skip |= state.ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::renderPass), pRenderPassBegin->renderPass); - skip |= ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::framebuffer), pRenderPassBegin->framebuffer); + skip |= state.ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::framebuffer), pRenderPassBegin->framebuffer); // No xml-driven validation // No xml-driven validation } - skip |= ValidateStructType(loc.dot(Field::pSubpassBeginInfo), pSubpassBeginInfo, VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO, true, - "VUID-vkCmdBeginRenderPass2-pSubpassBeginInfo-parameter", "VUID-VkSubpassBeginInfo-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pSubpassBeginInfo), pSubpassBeginInfo, VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO, true, + "VUID-vkCmdBeginRenderPass2-pSubpassBeginInfo-parameter", "VUID-VkSubpassBeginInfo-sType-sType"); if (pSubpassBeginInfo != nullptr) { [[maybe_unused]] const Location pSubpassBeginInfo_loc = loc.dot(Field::pSubpassBeginInfo); - skip |= ValidateStructPnext(pSubpassBeginInfo_loc, pSubpassBeginInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSubpassBeginInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSubpassBeginInfo_loc, pSubpassBeginInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSubpassBeginInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pSubpassBeginInfo_loc.dot(Field::contents), vvl::Enum::VkSubpassContents, - pSubpassBeginInfo->contents, "VUID-VkSubpassBeginInfo-contents-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pSubpassBeginInfo_loc.dot(Field::contents), vvl::Enum::VkSubpassContents, + pSubpassBeginInfo->contents, "VUID-VkSubpassBeginInfo-contents-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdBeginRenderPass2(commandBuffer, pRenderPassBegin, pSubpassBeginInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdBeginRenderPass2(commandBuffer, pRenderPassBegin, pSubpassBeginInfo, state); return skip; } @@ -14793,28 +16823,29 @@ bool StatelessValidation::PreCallValidateCmdNextSubpass2(VkCommandBuffer command const VkSubpassEndInfo* pSubpassEndInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pSubpassBeginInfo), pSubpassBeginInfo, VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO, true, - "VUID-vkCmdNextSubpass2-pSubpassBeginInfo-parameter", "VUID-VkSubpassBeginInfo-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pSubpassBeginInfo), pSubpassBeginInfo, VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO, true, + "VUID-vkCmdNextSubpass2-pSubpassBeginInfo-parameter", "VUID-VkSubpassBeginInfo-sType-sType"); if (pSubpassBeginInfo != nullptr) { [[maybe_unused]] const Location pSubpassBeginInfo_loc = loc.dot(Field::pSubpassBeginInfo); - skip |= ValidateStructPnext(pSubpassBeginInfo_loc, pSubpassBeginInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSubpassBeginInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSubpassBeginInfo_loc, pSubpassBeginInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSubpassBeginInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pSubpassBeginInfo_loc.dot(Field::contents), vvl::Enum::VkSubpassContents, - pSubpassBeginInfo->contents, "VUID-VkSubpassBeginInfo-contents-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pSubpassBeginInfo_loc.dot(Field::contents), vvl::Enum::VkSubpassContents, + pSubpassBeginInfo->contents, "VUID-VkSubpassBeginInfo-contents-parameter"); } - skip |= ValidateStructType(loc.dot(Field::pSubpassEndInfo), pSubpassEndInfo, VK_STRUCTURE_TYPE_SUBPASS_END_INFO, true, - "VUID-vkCmdNextSubpass2-pSubpassEndInfo-parameter", "VUID-VkSubpassEndInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pSubpassEndInfo), pSubpassEndInfo, VK_STRUCTURE_TYPE_SUBPASS_END_INFO, true, + "VUID-vkCmdNextSubpass2-pSubpassEndInfo-parameter", "VUID-VkSubpassEndInfo-sType-sType"); if (pSubpassEndInfo != nullptr) { [[maybe_unused]] const Location pSubpassEndInfo_loc = loc.dot(Field::pSubpassEndInfo); constexpr std::array allowed_structs_VkSubpassEndInfo = { VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM}; - skip |= - ValidateStructPnext(pSubpassEndInfo_loc, pSubpassEndInfo->pNext, allowed_structs_VkSubpassEndInfo.size(), - allowed_structs_VkSubpassEndInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSubpassEndInfo-pNext-pNext", "VUID-VkSubpassEndInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSubpassEndInfo_loc, pSubpassEndInfo->pNext, allowed_structs_VkSubpassEndInfo.size(), + allowed_structs_VkSubpassEndInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSubpassEndInfo-pNext-pNext", "VUID-VkSubpassEndInfo-sType-unique", true); } return skip; } @@ -14822,18 +16853,18 @@ bool StatelessValidation::PreCallValidateCmdNextSubpass2(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pSubpassEndInfo), pSubpassEndInfo, VK_STRUCTURE_TYPE_SUBPASS_END_INFO, true, - "VUID-vkCmdEndRenderPass2-pSubpassEndInfo-parameter", "VUID-VkSubpassEndInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pSubpassEndInfo), pSubpassEndInfo, VK_STRUCTURE_TYPE_SUBPASS_END_INFO, true, + "VUID-vkCmdEndRenderPass2-pSubpassEndInfo-parameter", "VUID-VkSubpassEndInfo-sType-sType"); if (pSubpassEndInfo != nullptr) { [[maybe_unused]] const Location pSubpassEndInfo_loc = loc.dot(Field::pSubpassEndInfo); constexpr std::array allowed_structs_VkSubpassEndInfo = { VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM}; - skip |= - ValidateStructPnext(pSubpassEndInfo_loc, pSubpassEndInfo->pNext, allowed_structs_VkSubpassEndInfo.size(), - allowed_structs_VkSubpassEndInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSubpassEndInfo-pNext-pNext", "VUID-VkSubpassEndInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSubpassEndInfo_loc, pSubpassEndInfo->pNext, allowed_structs_VkSubpassEndInfo.size(), + allowed_structs_VkSubpassEndInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSubpassEndInfo-pNext-pNext", "VUID-VkSubpassEndInfo-sType-unique", true); } return skip; } @@ -14841,42 +16872,46 @@ bool StatelessValidation::PreCallValidateCmdEndRenderPass2(VkCommandBuffer comma bool StatelessValidation::PreCallValidateResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } bool StatelessValidation::PreCallValidateGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t* pValue, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::semaphore), semaphore); - skip |= ValidateRequiredPointer(loc.dot(Field::pValue), pValue, "VUID-vkGetSemaphoreCounterValue-pValue-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::semaphore), semaphore); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pValue), pValue, "VUID-vkGetSemaphoreCounterValue-pValue-parameter"); return skip; } bool StatelessValidation::PreCallValidateWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pWaitInfo), pWaitInfo, VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, true, - "VUID-vkWaitSemaphores-pWaitInfo-parameter", "VUID-VkSemaphoreWaitInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pWaitInfo), pWaitInfo, VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, true, + "VUID-vkWaitSemaphores-pWaitInfo-parameter", "VUID-VkSemaphoreWaitInfo-sType-sType"); if (pWaitInfo != nullptr) { [[maybe_unused]] const Location pWaitInfo_loc = loc.dot(Field::pWaitInfo); - skip |= ValidateStructPnext(pWaitInfo_loc, pWaitInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSemaphoreWaitInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pWaitInfo_loc, pWaitInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSemaphoreWaitInfo-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateFlags(pWaitInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreWaitFlagBits, AllVkSemaphoreWaitFlagBits, - pWaitInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSemaphoreWaitInfo-flags-parameter"); + skip |= state.ValidateFlags(pWaitInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreWaitFlagBits, + AllVkSemaphoreWaitFlagBits, pWaitInfo->flags, kOptionalFlags, + "VUID-VkSemaphoreWaitInfo-flags-parameter"); - skip |= ValidateHandleArray(pWaitInfo_loc.dot(Field::semaphoreCount), pWaitInfo_loc.dot(Field::pSemaphores), - pWaitInfo->semaphoreCount, pWaitInfo->pSemaphores, true, true, - "VUID-VkSemaphoreWaitInfo-semaphoreCount-arraylength"); + skip |= state.ValidateHandleArray(pWaitInfo_loc.dot(Field::semaphoreCount), pWaitInfo_loc.dot(Field::pSemaphores), + pWaitInfo->semaphoreCount, pWaitInfo->pSemaphores, true, true, + "VUID-VkSemaphoreWaitInfo-semaphoreCount-arraylength"); - skip |= ValidateArray(pWaitInfo_loc.dot(Field::semaphoreCount), pWaitInfo_loc.dot(Field::pValues), - pWaitInfo->semaphoreCount, &pWaitInfo->pValues, true, true, - "VUID-VkSemaphoreWaitInfo-semaphoreCount-arraylength", "VUID-VkSemaphoreWaitInfo-pValues-parameter"); + skip |= state.ValidateArray(pWaitInfo_loc.dot(Field::semaphoreCount), pWaitInfo_loc.dot(Field::pValues), + pWaitInfo->semaphoreCount, &pWaitInfo->pValues, true, true, + "VUID-VkSemaphoreWaitInfo-semaphoreCount-arraylength", + "VUID-VkSemaphoreWaitInfo-pValues-parameter"); } return skip; } @@ -14884,15 +16919,16 @@ bool StatelessValidation::PreCallValidateWaitSemaphores(VkDevice device, const V bool StatelessValidation::PreCallValidateSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pSignalInfo), pSignalInfo, VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO, true, - "VUID-vkSignalSemaphore-pSignalInfo-parameter", "VUID-VkSemaphoreSignalInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pSignalInfo), pSignalInfo, VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO, true, + "VUID-vkSignalSemaphore-pSignalInfo-parameter", "VUID-VkSemaphoreSignalInfo-sType-sType"); if (pSignalInfo != nullptr) { [[maybe_unused]] const Location pSignalInfo_loc = loc.dot(Field::pSignalInfo); - skip |= ValidateStructPnext(pSignalInfo_loc, pSignalInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSemaphoreSignalInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSignalInfo_loc, pSignalInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSemaphoreSignalInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pSignalInfo_loc.dot(Field::semaphore), pSignalInfo->semaphore); + skip |= state.ValidateRequiredHandle(pSignalInfo_loc.dot(Field::semaphore), pSignalInfo->semaphore); } return skip; } @@ -14900,15 +16936,16 @@ bool StatelessValidation::PreCallValidateSignalSemaphore(VkDevice device, const bool StatelessValidation::PreCallValidateGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, true, - "VUID-vkGetBufferDeviceAddress-pInfo-parameter", "VUID-VkBufferDeviceAddressInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, true, + "VUID-vkGetBufferDeviceAddress-pInfo-parameter", "VUID-VkBufferDeviceAddressInfo-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkBufferDeviceAddressInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferDeviceAddressInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); } return skip; } @@ -14916,16 +16953,17 @@ bool StatelessValidation::PreCallValidateGetBufferDeviceAddress(VkDevice device, bool StatelessValidation::PreCallValidateGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= - ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, true, - "VUID-vkGetBufferOpaqueCaptureAddress-pInfo-parameter", "VUID-VkBufferDeviceAddressInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, true, + "VUID-vkGetBufferOpaqueCaptureAddress-pInfo-parameter", + "VUID-VkBufferDeviceAddressInfo-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkBufferDeviceAddressInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferDeviceAddressInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); } return skip; } @@ -14934,17 +16972,17 @@ bool StatelessValidation::PreCallValidateGetDeviceMemoryOpaqueCaptureAddress(VkD const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO, true, - "VUID-vkGetDeviceMemoryOpaqueCaptureAddress-pInfo-parameter", - "VUID-VkDeviceMemoryOpaqueCaptureAddressInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO, + true, "VUID-vkGetDeviceMemoryOpaqueCaptureAddress-pInfo-parameter", + "VUID-VkDeviceMemoryOpaqueCaptureAddressInfo-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= - ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceMemoryOpaqueCaptureAddressInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceMemoryOpaqueCaptureAddressInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::memory), pInfo->memory); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::memory), pInfo->memory); } return skip; } @@ -14953,20 +16991,23 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceToolProperties(VkPhysi VkPhysicalDeviceToolProperties* pToolProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (loc.function == vvl::Func::vkGetPhysicalDeviceToolProperties && CheckPromotedApiAgainstVulkanVersion(physicalDevice, loc, VK_API_VERSION_1_3)) return true; - skip |= ValidateStructTypeArray(loc.dot(Field::pToolCount), loc.dot(Field::pToolProperties), pToolCount, pToolProperties, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES, true, false, false, - "VUID-VkPhysicalDeviceToolProperties-sType-sType", kVUIDUndefined, - "VUID-vkGetPhysicalDeviceToolProperties-pToolCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pToolCount), loc.dot(Field::pToolProperties), pToolCount, pToolProperties, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES, true, false, false, + "VUID-VkPhysicalDeviceToolProperties-sType-sType", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceToolProperties-pToolCount-parameter", kVUIDUndefined); if (pToolProperties != nullptr) { for (uint32_t pToolIndex = 0; pToolIndex < *pToolCount; ++pToolIndex) { [[maybe_unused]] const Location pToolProperties_loc = loc.dot(Field::pToolProperties, pToolIndex); - skip |= ValidateStructPnext(pToolProperties_loc, pToolProperties[pToolIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceToolProperties-pNext-pNext", - kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pToolProperties_loc, pToolProperties[pToolIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceToolProperties-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -14977,24 +17018,25 @@ bool StatelessValidation::PreCallValidateCreatePrivateDataSlot(VkDevice device, VkPrivateDataSlot* pPrivateDataSlot, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= - ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO, true, - "VUID-vkCreatePrivateDataSlot-pCreateInfo-parameter", "VUID-VkPrivateDataSlotCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO, + true, "VUID-vkCreatePrivateDataSlot-pCreateInfo-parameter", + "VUID-VkPrivateDataSlotCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPrivateDataSlotCreateInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPrivateDataSlotCreateInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkPrivateDataSlotCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkPrivateDataSlotCreateInfo-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pPrivateDataSlot), pPrivateDataSlot, - "VUID-vkCreatePrivateDataSlot-pPrivateDataSlot-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pPrivateDataSlot), pPrivateDataSlot, + "VUID-vkCreatePrivateDataSlot-pPrivateDataSlot-parameter"); return skip; } @@ -15002,10 +17044,11 @@ bool StatelessValidation::PreCallValidateDestroyPrivateDataSlot(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -15014,10 +17057,11 @@ bool StatelessValidation::PreCallValidateSetPrivateData(VkDevice device, VkObjec VkPrivateDataSlot privateDataSlot, uint64_t data, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkObjectType, objectType, - "VUID-vkSetPrivateData-objectType-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::privateDataSlot), privateDataSlot); + skip |= state.ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkObjectType, objectType, + "VUID-vkSetPrivateData-objectType-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::privateDataSlot), privateDataSlot); return skip; } @@ -15025,31 +17069,33 @@ bool StatelessValidation::PreCallValidateGetPrivateData(VkDevice device, VkObjec VkPrivateDataSlot privateDataSlot, uint64_t* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkObjectType, objectType, - "VUID-vkGetPrivateData-objectType-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::privateDataSlot), privateDataSlot); - skip |= ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetPrivateData-pData-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkObjectType, objectType, + "VUID-vkGetPrivateData-objectType-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::privateDataSlot), privateDataSlot); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetPrivateData-pData-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetEvent2(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo* pDependencyInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); - skip |= ValidateStructType(loc.dot(Field::pDependencyInfo), pDependencyInfo, VK_STRUCTURE_TYPE_DEPENDENCY_INFO, true, - "VUID-vkCmdSetEvent2-pDependencyInfo-parameter", "VUID-VkDependencyInfo-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= state.ValidateStructType(loc.dot(Field::pDependencyInfo), pDependencyInfo, VK_STRUCTURE_TYPE_DEPENDENCY_INFO, true, + "VUID-vkCmdSetEvent2-pDependencyInfo-parameter", "VUID-VkDependencyInfo-sType-sType"); if (pDependencyInfo != nullptr) { [[maybe_unused]] const Location pDependencyInfo_loc = loc.dot(Field::pDependencyInfo); - skip |= ValidateStructPnext(pDependencyInfo_loc, pDependencyInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDependencyInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDependencyInfo_loc, pDependencyInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDependencyInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pDependencyInfo_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, - AllVkDependencyFlagBits, pDependencyInfo->dependencyFlags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkDependencyInfo-dependencyFlags-parameter"); + skip |= state.ValidateFlags(pDependencyInfo_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, + AllVkDependencyFlagBits, pDependencyInfo->dependencyFlags, kOptionalFlags, + "VUID-VkDependencyInfo-dependencyFlags-parameter"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfo_loc.dot(Field::memoryBarrierCount), pDependencyInfo_loc.dot(Field::pMemoryBarriers), pDependencyInfo->memoryBarrierCount, pDependencyInfo->pMemoryBarriers, VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, false, true, "VUID-VkMemoryBarrier2-sType-sType", "VUID-VkDependencyInfo-pMemoryBarriers-parameter", kVUIDUndefined); @@ -15058,27 +17104,29 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2(VkCommandBuffer commandBuf for (uint32_t memoryBarrierIndex = 0; memoryBarrierIndex < pDependencyInfo->memoryBarrierCount; ++memoryBarrierIndex) { [[maybe_unused]] const Location pMemoryBarriers_loc = pDependencyInfo_loc.dot(Field::pMemoryBarriers, memoryBarrierIndex); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].srcStageMask, kOptionalFlags, + "VUID-VkMemoryBarrier2-srcStageMask-parameter"); + skip |= - ValidateFlags(pMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].srcStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-srcStageMask-parameter"); + state.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstStageMask, kOptionalFlags, + "VUID-VkMemoryBarrier2-dstStageMask-parameter"); skip |= - ValidateFlags(pMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-dstStageMask-parameter"); - - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); + state.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfo_loc.dot(Field::bufferMemoryBarrierCount), pDependencyInfo_loc.dot(Field::pBufferMemoryBarriers), pDependencyInfo->bufferMemoryBarrierCount, pDependencyInfo->pBufferMemoryBarriers, VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, false, true, "VUID-VkBufferMemoryBarrier2-sType-sType", @@ -15092,38 +17140,38 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2(VkCommandBuffer commandBuf constexpr std::array allowed_structs_VkBufferMemoryBarrier2 = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pBufferMemoryBarriers_loc, pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].pNext, allowed_structs_VkBufferMemoryBarrier2.size(), allowed_structs_VkBufferMemoryBarrier2.data(), GeneratedVulkanHeaderVersion, "VUID-VkBufferMemoryBarrier2-pNext-pNext", - "VUID-VkBufferMemoryBarrier2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkBufferMemoryBarrier2-sType-unique", true); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcStageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-srcStageMask-parameter"); + skip |= state.ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkBufferMemoryBarrier2-srcStageMask-parameter"); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkBufferMemoryBarrier2-srcAccessMask-parameter"); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstStageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-dstStageMask-parameter"); + skip |= state.ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkBufferMemoryBarrier2-dstStageMask-parameter"); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkBufferMemoryBarrier2-dstAccessMask-parameter"); - skip |= ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); + skip |= state.ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfo_loc.dot(Field::imageMemoryBarrierCount), pDependencyInfo_loc.dot(Field::pImageMemoryBarriers), pDependencyInfo->imageMemoryBarrierCount, pDependencyInfo->pImageMemoryBarriers, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, false, true, "VUID-VkImageMemoryBarrier2-sType-sType", @@ -15137,48 +17185,48 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2(VkCommandBuffer commandBuf constexpr std::array allowed_structs_VkImageMemoryBarrier2 = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pImageMemoryBarriers_loc, pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].pNext, allowed_structs_VkImageMemoryBarrier2.size(), allowed_structs_VkImageMemoryBarrier2.data(), GeneratedVulkanHeaderVersion, "VUID-VkImageMemoryBarrier2-pNext-pNext", - "VUID-VkImageMemoryBarrier2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkImageMemoryBarrier2-sType-unique", true); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); + skip |= state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); + skip |= state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, - "VUID-VkImageMemoryBarrier2-oldLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, + "VUID-VkImageMemoryBarrier2-oldLayout-parameter"); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, - "VUID-VkImageMemoryBarrier2-newLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, + "VUID-VkImageMemoryBarrier2-newLayout-parameter"); - skip |= ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].image); + skip |= state.ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].image); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceRange-aspectMask-parameter", - "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceRange-aspectMask-parameter", "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } } @@ -15188,10 +17236,11 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2(VkCommandBuffer commandBuf bool StatelessValidation::PreCallValidateCmdResetEvent2(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); - skip |= ValidateFlags(loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - stageMask, kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdResetEvent2-stageMask-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= state.ValidateFlags(loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + stageMask, kOptionalFlags, "VUID-vkCmdResetEvent2-stageMask-parameter"); return skip; } @@ -15199,25 +17248,26 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB const VkDependencyInfo* pDependencyInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateHandleArray(loc.dot(Field::eventCount), loc.dot(Field::pEvents), eventCount, pEvents, true, true, - "VUID-vkCmdWaitEvents2-eventCount-arraylength"); - skip |= - ValidateStructTypeArray(loc.dot(Field::eventCount), loc.dot(Field::pDependencyInfos), eventCount, pDependencyInfos, - VK_STRUCTURE_TYPE_DEPENDENCY_INFO, true, true, "VUID-VkDependencyInfo-sType-sType", - "VUID-vkCmdWaitEvents2-pDependencyInfos-parameter", "VUID-vkCmdWaitEvents2-eventCount-arraylength"); + skip |= state.ValidateHandleArray(loc.dot(Field::eventCount), loc.dot(Field::pEvents), eventCount, pEvents, true, true, + "VUID-vkCmdWaitEvents2-eventCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::eventCount), loc.dot(Field::pDependencyInfos), eventCount, + pDependencyInfos, VK_STRUCTURE_TYPE_DEPENDENCY_INFO, true, true, + "VUID-VkDependencyInfo-sType-sType", "VUID-vkCmdWaitEvents2-pDependencyInfos-parameter", + "VUID-vkCmdWaitEvents2-eventCount-arraylength"); if (pDependencyInfos != nullptr) { for (uint32_t eventIndex = 0; eventIndex < eventCount; ++eventIndex) { [[maybe_unused]] const Location pDependencyInfos_loc = loc.dot(Field::pDependencyInfos, eventIndex); - skip |= ValidateStructPnext(pDependencyInfos_loc, pDependencyInfos[eventIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkDependencyInfo-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pDependencyInfos_loc, pDependencyInfos[eventIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkDependencyInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pDependencyInfos_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, - AllVkDependencyFlagBits, pDependencyInfos[eventIndex].dependencyFlags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkDependencyInfo-dependencyFlags-parameter"); + skip |= state.ValidateFlags(pDependencyInfos_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, + AllVkDependencyFlagBits, pDependencyInfos[eventIndex].dependencyFlags, kOptionalFlags, + "VUID-VkDependencyInfo-dependencyFlags-parameter"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfos_loc.dot(Field::memoryBarrierCount), pDependencyInfos_loc.dot(Field::pMemoryBarriers), pDependencyInfos[eventIndex].memoryBarrierCount, pDependencyInfos[eventIndex].pMemoryBarriers, VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, false, true, "VUID-VkMemoryBarrier2-sType-sType", @@ -15228,29 +17278,29 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB ++memoryBarrierIndex) { [[maybe_unused]] const Location pMemoryBarriers_loc = pDependencyInfos_loc.dot(Field::pMemoryBarriers, memoryBarrierIndex); - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].srcStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-srcStageMask-parameter"); - - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); - - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].dstStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-dstStageMask-parameter"); - - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-srcStageMask-parameter"); + + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); + + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-dstStageMask-parameter"); + + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfos_loc.dot(Field::bufferMemoryBarrierCount), pDependencyInfos_loc.dot(Field::pBufferMemoryBarriers), pDependencyInfos[eventIndex].bufferMemoryBarrierCount, pDependencyInfos[eventIndex].pBufferMemoryBarriers, VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, false, true, "VUID-VkBufferMemoryBarrier2-sType-sType", @@ -15264,42 +17314,44 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB constexpr std::array allowed_structs_VkBufferMemoryBarrier2 = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT}; - skip |= ValidateStructPnext(pBufferMemoryBarriers_loc, - pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].pNext, - allowed_structs_VkBufferMemoryBarrier2.size(), - allowed_structs_VkBufferMemoryBarrier2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkBufferMemoryBarrier2-pNext-pNext", - "VUID-VkBufferMemoryBarrier2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pBufferMemoryBarriers_loc, + pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].pNext, + allowed_structs_VkBufferMemoryBarrier2.size(), allowed_structs_VkBufferMemoryBarrier2.data(), + GeneratedVulkanHeaderVersion, "VUID-VkBufferMemoryBarrier2-pNext-pNext", + "VUID-VkBufferMemoryBarrier2-sType-unique", true); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-srcStageMask-parameter"); + skip |= state.ValidateFlags( + pBufferMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, + AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcStageMask, kOptionalFlags, + "VUID-VkBufferMemoryBarrier2-srcStageMask-parameter"); - skip |= - ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-srcAccessMask-parameter"); + skip |= state.ValidateFlags( + pBufferMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcAccessMask, kOptionalFlags, + "VUID-VkBufferMemoryBarrier2-srcAccessMask-parameter"); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-dstStageMask-parameter"); + skip |= state.ValidateFlags( + pBufferMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, + AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstStageMask, kOptionalFlags, + "VUID-VkBufferMemoryBarrier2-dstStageMask-parameter"); - skip |= - ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-dstAccessMask-parameter"); + skip |= state.ValidateFlags( + pBufferMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstAccessMask, kOptionalFlags, + "VUID-VkBufferMemoryBarrier2-dstAccessMask-parameter"); - skip |= - ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), - pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); + skip |= state.ValidateRequiredHandle( + pBufferMemoryBarriers_loc.dot(Field::buffer), + pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfos_loc.dot(Field::imageMemoryBarrierCount), pDependencyInfos_loc.dot(Field::pImageMemoryBarriers), pDependencyInfos[eventIndex].imageMemoryBarrierCount, pDependencyInfos[eventIndex].pImageMemoryBarriers, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, false, true, "VUID-VkImageMemoryBarrier2-sType-sType", @@ -15313,49 +17365,55 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB constexpr std::array allowed_structs_VkImageMemoryBarrier2 = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pImageMemoryBarriers_loc, pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].pNext, allowed_structs_VkImageMemoryBarrier2.size(), allowed_structs_VkImageMemoryBarrier2.data(), GeneratedVulkanHeaderVersion, "VUID-VkImageMemoryBarrier2-pNext-pNext", - "VUID-VkImageMemoryBarrier2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkImageMemoryBarrier2-sType-unique", true); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); - - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); - - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); - - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); - - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, - "VUID-VkImageMemoryBarrier2-oldLayout-parameter", VK_NULL_HANDLE); + skip |= + state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, - "VUID-VkImageMemoryBarrier2-newLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, kOptionalFlags, + "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); skip |= - ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].image); - - skip |= ValidateFlags( + state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); + + skip |= state.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, kOptionalFlags, + "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); + + skip |= state.ValidateRangedEnum( + pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, + "VUID-VkImageMemoryBarrier2-oldLayout-parameter"); + + skip |= state.ValidateRangedEnum( + pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, + "VUID-VkImageMemoryBarrier2-newLayout-parameter"); + + skip |= state.ValidateRequiredHandle( + pImageMemoryBarriers_loc.dot(Field::image), + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].image); + + skip |= state.ValidateFlags( pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceRange-aspectMask-parameter", + kRequiredFlags, "VUID-VkImageSubresourceRange-aspectMask-parameter", "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } @@ -15367,19 +17425,20 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB bool StatelessValidation::PreCallValidateCmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pDependencyInfo), pDependencyInfo, VK_STRUCTURE_TYPE_DEPENDENCY_INFO, true, - "VUID-vkCmdPipelineBarrier2-pDependencyInfo-parameter", "VUID-VkDependencyInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pDependencyInfo), pDependencyInfo, VK_STRUCTURE_TYPE_DEPENDENCY_INFO, true, + "VUID-vkCmdPipelineBarrier2-pDependencyInfo-parameter", "VUID-VkDependencyInfo-sType-sType"); if (pDependencyInfo != nullptr) { [[maybe_unused]] const Location pDependencyInfo_loc = loc.dot(Field::pDependencyInfo); - skip |= ValidateStructPnext(pDependencyInfo_loc, pDependencyInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDependencyInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDependencyInfo_loc, pDependencyInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDependencyInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pDependencyInfo_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, - AllVkDependencyFlagBits, pDependencyInfo->dependencyFlags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkDependencyInfo-dependencyFlags-parameter"); + skip |= state.ValidateFlags(pDependencyInfo_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, + AllVkDependencyFlagBits, pDependencyInfo->dependencyFlags, kOptionalFlags, + "VUID-VkDependencyInfo-dependencyFlags-parameter"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfo_loc.dot(Field::memoryBarrierCount), pDependencyInfo_loc.dot(Field::pMemoryBarriers), pDependencyInfo->memoryBarrierCount, pDependencyInfo->pMemoryBarriers, VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, false, true, "VUID-VkMemoryBarrier2-sType-sType", "VUID-VkDependencyInfo-pMemoryBarriers-parameter", kVUIDUndefined); @@ -15388,27 +17447,29 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier2(VkCommandBuffer com for (uint32_t memoryBarrierIndex = 0; memoryBarrierIndex < pDependencyInfo->memoryBarrierCount; ++memoryBarrierIndex) { [[maybe_unused]] const Location pMemoryBarriers_loc = pDependencyInfo_loc.dot(Field::pMemoryBarriers, memoryBarrierIndex); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].srcStageMask, kOptionalFlags, + "VUID-VkMemoryBarrier2-srcStageMask-parameter"); + skip |= - ValidateFlags(pMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].srcStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-srcStageMask-parameter"); + state.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstStageMask, kOptionalFlags, + "VUID-VkMemoryBarrier2-dstStageMask-parameter"); skip |= - ValidateFlags(pMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstStageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-dstStageMask-parameter"); - - skip |= ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); + state.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfo_loc.dot(Field::bufferMemoryBarrierCount), pDependencyInfo_loc.dot(Field::pBufferMemoryBarriers), pDependencyInfo->bufferMemoryBarrierCount, pDependencyInfo->pBufferMemoryBarriers, VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, false, true, "VUID-VkBufferMemoryBarrier2-sType-sType", @@ -15422,38 +17483,38 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier2(VkCommandBuffer com constexpr std::array allowed_structs_VkBufferMemoryBarrier2 = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pBufferMemoryBarriers_loc, pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].pNext, allowed_structs_VkBufferMemoryBarrier2.size(), allowed_structs_VkBufferMemoryBarrier2.data(), GeneratedVulkanHeaderVersion, "VUID-VkBufferMemoryBarrier2-pNext-pNext", - "VUID-VkBufferMemoryBarrier2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkBufferMemoryBarrier2-sType-unique", true); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcStageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-srcStageMask-parameter"); + skip |= state.ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkBufferMemoryBarrier2-srcStageMask-parameter"); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::srcAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkBufferMemoryBarrier2-srcAccessMask-parameter"); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstStageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstStageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-dstStageMask-parameter"); + skip |= state.ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkBufferMemoryBarrier2-dstStageMask-parameter"); - skip |= ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstAccessMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkBufferMemoryBarrier2-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pBufferMemoryBarriers_loc.dot(Field::dstAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkBufferMemoryBarrier2-dstAccessMask-parameter"); - skip |= ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), - pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); + skip |= state.ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pDependencyInfo_loc.dot(Field::imageMemoryBarrierCount), pDependencyInfo_loc.dot(Field::pImageMemoryBarriers), pDependencyInfo->imageMemoryBarrierCount, pDependencyInfo->pImageMemoryBarriers, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, false, true, "VUID-VkImageMemoryBarrier2-sType-sType", @@ -15467,48 +17528,48 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier2(VkCommandBuffer com constexpr std::array allowed_structs_VkImageMemoryBarrier2 = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pImageMemoryBarriers_loc, pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].pNext, allowed_structs_VkImageMemoryBarrier2.size(), allowed_structs_VkImageMemoryBarrier2.data(), GeneratedVulkanHeaderVersion, "VUID-VkImageMemoryBarrier2-pNext-pNext", - "VUID-VkImageMemoryBarrier2-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkImageMemoryBarrier2-sType-unique", true); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); + skip |= state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); + skip |= state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); + skip |= state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, - AllVkAccessFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); + skip |= state.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, - "VUID-VkImageMemoryBarrier2-oldLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, + "VUID-VkImageMemoryBarrier2-oldLayout-parameter"); - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, - "VUID-VkImageMemoryBarrier2-newLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, + "VUID-VkImageMemoryBarrier2-newLayout-parameter"); - skip |= ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].image); + skip |= state.ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].image); - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceRange-aspectMask-parameter", - "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceRange-aspectMask-parameter", "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } } @@ -15519,20 +17580,22 @@ bool StatelessValidation::PreCallValidateCmdWriteTimestamp2(VkCommandBuffer comm VkQueryPool queryPool, uint32_t query, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::stage), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, stage, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdWriteTimestamp2-stage-parameter"); - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateFlags(loc.dot(Field::stage), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + stage, kOptionalFlags, "VUID-vkCmdWriteTimestamp2-stage-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } bool StatelessValidation::PreCallValidateQueueSubmit2(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray(loc.dot(Field::submitCount), loc.dot(Field::pSubmits), submitCount, pSubmits, - VK_STRUCTURE_TYPE_SUBMIT_INFO_2, false, true, "VUID-VkSubmitInfo2-sType-sType", - "VUID-vkQueueSubmit2-pSubmits-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::submitCount), loc.dot(Field::pSubmits), submitCount, pSubmits, + VK_STRUCTURE_TYPE_SUBMIT_INFO_2, false, true, "VUID-VkSubmitInfo2-sType-sType", + "VUID-vkQueueSubmit2-pSubmits-parameter", kVUIDUndefined); if (pSubmits != nullptr) { for (uint32_t submitIndex = 0; submitIndex < submitCount; ++submitIndex) { [[maybe_unused]] const Location pSubmits_loc = loc.dot(Field::pSubmits, submitIndex); @@ -15541,15 +17604,14 @@ bool StatelessValidation::PreCallValidateQueueSubmit2(VkQueue queue, uint32_t su VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR, VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR, VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV}; - skip |= ValidateStructPnext(pSubmits_loc, pSubmits[submitIndex].pNext, allowed_structs_VkSubmitInfo2.size(), - allowed_structs_VkSubmitInfo2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSubmitInfo2-pNext-pNext", "VUID-VkSubmitInfo2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSubmits_loc, pSubmits[submitIndex].pNext, allowed_structs_VkSubmitInfo2.size(), + allowed_structs_VkSubmitInfo2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSubmitInfo2-pNext-pNext", "VUID-VkSubmitInfo2-sType-unique", true); - skip |= - ValidateFlags(pSubmits_loc.dot(Field::flags), vvl::FlagBitmask::VkSubmitFlagBits, AllVkSubmitFlagBits, - pSubmits[submitIndex].flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSubmitInfo2-flags-parameter"); + skip |= state.ValidateFlags(pSubmits_loc.dot(Field::flags), vvl::FlagBitmask::VkSubmitFlagBits, AllVkSubmitFlagBits, + pSubmits[submitIndex].flags, kOptionalFlags, "VUID-VkSubmitInfo2-flags-parameter"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pSubmits_loc.dot(Field::waitSemaphoreInfoCount), pSubmits_loc.dot(Field::pWaitSemaphoreInfos), pSubmits[submitIndex].waitSemaphoreInfoCount, pSubmits[submitIndex].pWaitSemaphoreInfos, VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, false, true, "VUID-VkSemaphoreSubmitInfo-sType-sType", @@ -15560,22 +17622,22 @@ bool StatelessValidation::PreCallValidateQueueSubmit2(VkQueue queue, uint32_t su ++waitSemaphoreInfoIndex) { [[maybe_unused]] const Location pWaitSemaphoreInfos_loc = pSubmits_loc.dot(Field::pWaitSemaphoreInfos, waitSemaphoreInfoIndex); - skip |= ValidateStructPnext(pWaitSemaphoreInfos_loc, - pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreSubmitInfo-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); - - skip |= ValidateRequiredHandle(pWaitSemaphoreInfos_loc.dot(Field::semaphore), - pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].semaphore); - - skip |= ValidateFlags(pWaitSemaphoreInfos_loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].stageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSemaphoreSubmitInfo-stageMask-parameter"); + skip |= state.ValidateStructPnext( + pWaitSemaphoreInfos_loc, pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreSubmitInfo-pNext-pNext", kVUIDUndefined, true); + + skip |= + state.ValidateRequiredHandle(pWaitSemaphoreInfos_loc.dot(Field::semaphore), + pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].semaphore); + + skip |= state.ValidateFlags(pWaitSemaphoreInfos_loc.dot(Field::stageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].stageMask, + kOptionalFlags, "VUID-VkSemaphoreSubmitInfo-stageMask-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pSubmits_loc.dot(Field::commandBufferInfoCount), pSubmits_loc.dot(Field::pCommandBufferInfos), pSubmits[submitIndex].commandBufferInfoCount, pSubmits[submitIndex].pCommandBufferInfos, VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, false, true, "VUID-VkCommandBufferSubmitInfo-sType-sType", @@ -15589,18 +17651,19 @@ bool StatelessValidation::PreCallValidateQueueSubmit2(VkQueue queue, uint32_t su constexpr std::array allowed_structs_VkCommandBufferSubmitInfo = { VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pCommandBufferInfos_loc, pSubmits[submitIndex].pCommandBufferInfos[commandBufferInfoIndex].pNext, allowed_structs_VkCommandBufferSubmitInfo.size(), allowed_structs_VkCommandBufferSubmitInfo.data(), GeneratedVulkanHeaderVersion, "VUID-VkCommandBufferSubmitInfo-pNext-pNext", - "VUID-VkCommandBufferSubmitInfo-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkCommandBufferSubmitInfo-sType-unique", true); - skip |= ValidateRequiredHandle(pCommandBufferInfos_loc.dot(Field::commandBuffer), - pSubmits[submitIndex].pCommandBufferInfos[commandBufferInfoIndex].commandBuffer); + skip |= state.ValidateRequiredHandle( + pCommandBufferInfos_loc.dot(Field::commandBuffer), + pSubmits[submitIndex].pCommandBufferInfos[commandBufferInfoIndex].commandBuffer); } } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pSubmits_loc.dot(Field::signalSemaphoreInfoCount), pSubmits_loc.dot(Field::pSignalSemaphoreInfos), pSubmits[submitIndex].signalSemaphoreInfoCount, pSubmits[submitIndex].pSignalSemaphoreInfos, VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, false, true, "VUID-VkSemaphoreSubmitInfo-sType-sType", @@ -15611,18 +17674,18 @@ bool StatelessValidation::PreCallValidateQueueSubmit2(VkQueue queue, uint32_t su signalSemaphoreInfoIndex < pSubmits[submitIndex].signalSemaphoreInfoCount; ++signalSemaphoreInfoIndex) { [[maybe_unused]] const Location pSignalSemaphoreInfos_loc = pSubmits_loc.dot(Field::pSignalSemaphoreInfos, signalSemaphoreInfoIndex); - skip |= ValidateStructPnext(pSignalSemaphoreInfos_loc, - pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].pNext, 0, - nullptr, GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreSubmitInfo-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); - - skip |= ValidateRequiredHandle(pSignalSemaphoreInfos_loc.dot(Field::semaphore), - pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].semaphore); - - skip |= ValidateFlags(pSignalSemaphoreInfos_loc.dot(Field::stageMask), - vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, - pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].stageMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkSemaphoreSubmitInfo-stageMask-parameter"); + skip |= state.ValidateStructPnext( + pSignalSemaphoreInfos_loc, pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreSubmitInfo-pNext-pNext", kVUIDUndefined, true); + + skip |= state.ValidateRequiredHandle( + pSignalSemaphoreInfos_loc.dot(Field::semaphore), + pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].semaphore); + + skip |= state.ValidateFlags(pSignalSemaphoreInfos_loc.dot(Field::stageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].stageMask, + kOptionalFlags, "VUID-VkSemaphoreSubmitInfo-stageMask-parameter"); } } } @@ -15633,82 +17696,84 @@ bool StatelessValidation::PreCallValidateQueueSubmit2(VkQueue queue, uint32_t su bool StatelessValidation::PreCallValidateCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCopyBufferInfo), pCopyBufferInfo, VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2, true, - "VUID-vkCmdCopyBuffer2-pCopyBufferInfo-parameter", "VUID-VkCopyBufferInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCopyBufferInfo), pCopyBufferInfo, VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2, true, + "VUID-vkCmdCopyBuffer2-pCopyBufferInfo-parameter", "VUID-VkCopyBufferInfo2-sType-sType"); if (pCopyBufferInfo != nullptr) { [[maybe_unused]] const Location pCopyBufferInfo_loc = loc.dot(Field::pCopyBufferInfo); - skip |= ValidateStructPnext(pCopyBufferInfo_loc, pCopyBufferInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyBufferInfo2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCopyBufferInfo_loc, pCopyBufferInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyBufferInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCopyBufferInfo_loc.dot(Field::srcBuffer), pCopyBufferInfo->srcBuffer); + skip |= state.ValidateRequiredHandle(pCopyBufferInfo_loc.dot(Field::srcBuffer), pCopyBufferInfo->srcBuffer); - skip |= ValidateRequiredHandle(pCopyBufferInfo_loc.dot(Field::dstBuffer), pCopyBufferInfo->dstBuffer); + skip |= state.ValidateRequiredHandle(pCopyBufferInfo_loc.dot(Field::dstBuffer), pCopyBufferInfo->dstBuffer); - skip |= ValidateStructTypeArray(pCopyBufferInfo_loc.dot(Field::regionCount), pCopyBufferInfo_loc.dot(Field::pRegions), - pCopyBufferInfo->regionCount, pCopyBufferInfo->pRegions, VK_STRUCTURE_TYPE_BUFFER_COPY_2, - true, true, "VUID-VkBufferCopy2-sType-sType", "VUID-VkCopyBufferInfo2-pRegions-parameter", - "VUID-VkCopyBufferInfo2-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray( + pCopyBufferInfo_loc.dot(Field::regionCount), pCopyBufferInfo_loc.dot(Field::pRegions), pCopyBufferInfo->regionCount, + pCopyBufferInfo->pRegions, VK_STRUCTURE_TYPE_BUFFER_COPY_2, true, true, "VUID-VkBufferCopy2-sType-sType", + "VUID-VkCopyBufferInfo2-pRegions-parameter", "VUID-VkCopyBufferInfo2-regionCount-arraylength"); if (pCopyBufferInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pCopyBufferInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pCopyBufferInfo_loc.dot(Field::pRegions, regionIndex); - skip |= ValidateStructPnext(pRegions_loc, pCopyBufferInfo->pRegions[regionIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkBufferCopy2-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pRegions_loc, pCopyBufferInfo->pRegions[regionIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkBufferCopy2-pNext-pNext", kVUIDUndefined, true); } } } - if (!skip) skip |= manual_PreCallValidateCmdCopyBuffer2(commandBuffer, pCopyBufferInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdCopyBuffer2(commandBuffer, pCopyBufferInfo, state); return skip; } bool StatelessValidation::PreCallValidateCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pCopyImageInfo), pCopyImageInfo, VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2, true, - "VUID-vkCmdCopyImage2-pCopyImageInfo-parameter", "VUID-VkCopyImageInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCopyImageInfo), pCopyImageInfo, VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2, true, + "VUID-vkCmdCopyImage2-pCopyImageInfo-parameter", "VUID-VkCopyImageInfo2-sType-sType"); if (pCopyImageInfo != nullptr) { [[maybe_unused]] const Location pCopyImageInfo_loc = loc.dot(Field::pCopyImageInfo); - skip |= ValidateStructPnext(pCopyImageInfo_loc, pCopyImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyImageInfo2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCopyImageInfo_loc, pCopyImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyImageInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCopyImageInfo_loc.dot(Field::srcImage), pCopyImageInfo->srcImage); + skip |= state.ValidateRequiredHandle(pCopyImageInfo_loc.dot(Field::srcImage), pCopyImageInfo->srcImage); - skip |= - ValidateRangedEnum(pCopyImageInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, - pCopyImageInfo->srcImageLayout, "VUID-VkCopyImageInfo2-srcImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCopyImageInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, + pCopyImageInfo->srcImageLayout, "VUID-VkCopyImageInfo2-srcImageLayout-parameter"); - skip |= ValidateRequiredHandle(pCopyImageInfo_loc.dot(Field::dstImage), pCopyImageInfo->dstImage); + skip |= state.ValidateRequiredHandle(pCopyImageInfo_loc.dot(Field::dstImage), pCopyImageInfo->dstImage); - skip |= - ValidateRangedEnum(pCopyImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, - pCopyImageInfo->dstImageLayout, "VUID-VkCopyImageInfo2-dstImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCopyImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, + pCopyImageInfo->dstImageLayout, "VUID-VkCopyImageInfo2-dstImageLayout-parameter"); - skip |= ValidateStructTypeArray(pCopyImageInfo_loc.dot(Field::regionCount), pCopyImageInfo_loc.dot(Field::pRegions), - pCopyImageInfo->regionCount, pCopyImageInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_COPY_2, true, - true, "VUID-VkImageCopy2-sType-sType", "VUID-VkCopyImageInfo2-pRegions-parameter", - "VUID-VkCopyImageInfo2-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray( + pCopyImageInfo_loc.dot(Field::regionCount), pCopyImageInfo_loc.dot(Field::pRegions), pCopyImageInfo->regionCount, + pCopyImageInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_COPY_2, true, true, "VUID-VkImageCopy2-sType-sType", + "VUID-VkCopyImageInfo2-pRegions-parameter", "VUID-VkCopyImageInfo2-regionCount-arraylength"); if (pCopyImageInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pCopyImageInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pCopyImageInfo_loc.dot(Field::pRegions, regionIndex); - skip |= ValidateStructPnext(pRegions_loc, pCopyImageInfo->pRegions[regionIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkImageCopy2-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pRegions_loc, pCopyImageInfo->pRegions[regionIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImageCopy2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pCopyImageInfo->pRegions[regionIndex].srcSubresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= + state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pCopyImageInfo->pRegions[regionIndex].srcSubresource.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pCopyImageInfo->pRegions[regionIndex].dstSubresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= + state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pCopyImageInfo->pRegions[regionIndex].dstSubresource.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -15723,45 +17788,46 @@ bool StatelessValidation::PreCallValidateCmdCopyBufferToImage2(VkCommandBuffer c const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pCopyBufferToImageInfo), pCopyBufferToImageInfo, VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2, true, "VUID-vkCmdCopyBufferToImage2-pCopyBufferToImageInfo-parameter", "VUID-VkCopyBufferToImageInfo2-sType-sType"); if (pCopyBufferToImageInfo != nullptr) { [[maybe_unused]] const Location pCopyBufferToImageInfo_loc = loc.dot(Field::pCopyBufferToImageInfo); - skip |= - ValidateStructPnext(pCopyBufferToImageInfo_loc, pCopyBufferToImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyBufferToImageInfo2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCopyBufferToImageInfo_loc, pCopyBufferToImageInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCopyBufferToImageInfo2-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateRequiredHandle(pCopyBufferToImageInfo_loc.dot(Field::srcBuffer), pCopyBufferToImageInfo->srcBuffer); + skip |= state.ValidateRequiredHandle(pCopyBufferToImageInfo_loc.dot(Field::srcBuffer), pCopyBufferToImageInfo->srcBuffer); - skip |= ValidateRequiredHandle(pCopyBufferToImageInfo_loc.dot(Field::dstImage), pCopyBufferToImageInfo->dstImage); + skip |= state.ValidateRequiredHandle(pCopyBufferToImageInfo_loc.dot(Field::dstImage), pCopyBufferToImageInfo->dstImage); - skip |= ValidateRangedEnum(pCopyBufferToImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, - pCopyBufferToImageInfo->dstImageLayout, "VUID-VkCopyBufferToImageInfo2-dstImageLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCopyBufferToImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, + pCopyBufferToImageInfo->dstImageLayout, + "VUID-VkCopyBufferToImageInfo2-dstImageLayout-parameter"); - skip |= ValidateStructTypeArray(pCopyBufferToImageInfo_loc.dot(Field::regionCount), - pCopyBufferToImageInfo_loc.dot(Field::pRegions), pCopyBufferToImageInfo->regionCount, - pCopyBufferToImageInfo->pRegions, VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, true, true, - "VUID-VkBufferImageCopy2-sType-sType", "VUID-VkCopyBufferToImageInfo2-pRegions-parameter", - "VUID-VkCopyBufferToImageInfo2-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray( + pCopyBufferToImageInfo_loc.dot(Field::regionCount), pCopyBufferToImageInfo_loc.dot(Field::pRegions), + pCopyBufferToImageInfo->regionCount, pCopyBufferToImageInfo->pRegions, VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, true, + true, "VUID-VkBufferImageCopy2-sType-sType", "VUID-VkCopyBufferToImageInfo2-pRegions-parameter", + "VUID-VkCopyBufferToImageInfo2-regionCount-arraylength"); if (pCopyBufferToImageInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pCopyBufferToImageInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pCopyBufferToImageInfo_loc.dot(Field::pRegions, regionIndex); constexpr std::array allowed_structs_VkBufferImageCopy2 = {VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM}; - skip |= ValidateStructPnext(pRegions_loc, pCopyBufferToImageInfo->pRegions[regionIndex].pNext, - allowed_structs_VkBufferImageCopy2.size(), allowed_structs_VkBufferImageCopy2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkBufferImageCopy2-pNext-pNext", - "VUID-VkBufferImageCopy2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pRegions_loc, pCopyBufferToImageInfo->pRegions[regionIndex].pNext, allowed_structs_VkBufferImageCopy2.size(), + allowed_structs_VkBufferImageCopy2.data(), GeneratedVulkanHeaderVersion, "VUID-VkBufferImageCopy2-pNext-pNext", + "VUID-VkBufferImageCopy2-sType-unique", true); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, - pCopyBufferToImageInfo->pRegions[regionIndex].imageSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pCopyBufferToImageInfo->pRegions[regionIndex].imageSubresource.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -15776,45 +17842,46 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer2(VkCommandBuffer c const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pCopyImageToBufferInfo), pCopyImageToBufferInfo, VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2, true, "VUID-vkCmdCopyImageToBuffer2-pCopyImageToBufferInfo-parameter", "VUID-VkCopyImageToBufferInfo2-sType-sType"); if (pCopyImageToBufferInfo != nullptr) { [[maybe_unused]] const Location pCopyImageToBufferInfo_loc = loc.dot(Field::pCopyImageToBufferInfo); - skip |= - ValidateStructPnext(pCopyImageToBufferInfo_loc, pCopyImageToBufferInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyImageToBufferInfo2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCopyImageToBufferInfo_loc, pCopyImageToBufferInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCopyImageToBufferInfo2-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateRequiredHandle(pCopyImageToBufferInfo_loc.dot(Field::srcImage), pCopyImageToBufferInfo->srcImage); + skip |= state.ValidateRequiredHandle(pCopyImageToBufferInfo_loc.dot(Field::srcImage), pCopyImageToBufferInfo->srcImage); - skip |= ValidateRangedEnum(pCopyImageToBufferInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, - pCopyImageToBufferInfo->srcImageLayout, "VUID-VkCopyImageToBufferInfo2-srcImageLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCopyImageToBufferInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, + pCopyImageToBufferInfo->srcImageLayout, + "VUID-VkCopyImageToBufferInfo2-srcImageLayout-parameter"); - skip |= ValidateRequiredHandle(pCopyImageToBufferInfo_loc.dot(Field::dstBuffer), pCopyImageToBufferInfo->dstBuffer); + skip |= state.ValidateRequiredHandle(pCopyImageToBufferInfo_loc.dot(Field::dstBuffer), pCopyImageToBufferInfo->dstBuffer); - skip |= ValidateStructTypeArray(pCopyImageToBufferInfo_loc.dot(Field::regionCount), - pCopyImageToBufferInfo_loc.dot(Field::pRegions), pCopyImageToBufferInfo->regionCount, - pCopyImageToBufferInfo->pRegions, VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, true, true, - "VUID-VkBufferImageCopy2-sType-sType", "VUID-VkCopyImageToBufferInfo2-pRegions-parameter", - "VUID-VkCopyImageToBufferInfo2-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray( + pCopyImageToBufferInfo_loc.dot(Field::regionCount), pCopyImageToBufferInfo_loc.dot(Field::pRegions), + pCopyImageToBufferInfo->regionCount, pCopyImageToBufferInfo->pRegions, VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, true, + true, "VUID-VkBufferImageCopy2-sType-sType", "VUID-VkCopyImageToBufferInfo2-pRegions-parameter", + "VUID-VkCopyImageToBufferInfo2-regionCount-arraylength"); if (pCopyImageToBufferInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pCopyImageToBufferInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pCopyImageToBufferInfo_loc.dot(Field::pRegions, regionIndex); constexpr std::array allowed_structs_VkBufferImageCopy2 = {VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM}; - skip |= ValidateStructPnext(pRegions_loc, pCopyImageToBufferInfo->pRegions[regionIndex].pNext, - allowed_structs_VkBufferImageCopy2.size(), allowed_structs_VkBufferImageCopy2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkBufferImageCopy2-pNext-pNext", - "VUID-VkBufferImageCopy2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pRegions_loc, pCopyImageToBufferInfo->pRegions[regionIndex].pNext, allowed_structs_VkBufferImageCopy2.size(), + allowed_structs_VkBufferImageCopy2.data(), GeneratedVulkanHeaderVersion, "VUID-VkBufferImageCopy2-pNext-pNext", + "VUID-VkBufferImageCopy2-sType-unique", true); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, - pCopyImageToBufferInfo->pRegions[regionIndex].imageSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pCopyImageToBufferInfo->pRegions[regionIndex].imageSubresource.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -15828,59 +17895,59 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer2(VkCommandBuffer c bool StatelessValidation::PreCallValidateCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pBlitImageInfo), pBlitImageInfo, VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2, true, - "VUID-vkCmdBlitImage2-pBlitImageInfo-parameter", "VUID-VkBlitImageInfo2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pBlitImageInfo), pBlitImageInfo, VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2, true, + "VUID-vkCmdBlitImage2-pBlitImageInfo-parameter", "VUID-VkBlitImageInfo2-sType-sType"); if (pBlitImageInfo != nullptr) { [[maybe_unused]] const Location pBlitImageInfo_loc = loc.dot(Field::pBlitImageInfo); constexpr std::array allowed_structs_VkBlitImageInfo2 = {VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM}; - skip |= - ValidateStructPnext(pBlitImageInfo_loc, pBlitImageInfo->pNext, allowed_structs_VkBlitImageInfo2.size(), - allowed_structs_VkBlitImageInfo2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkBlitImageInfo2-pNext-pNext", "VUID-VkBlitImageInfo2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBlitImageInfo_loc, pBlitImageInfo->pNext, allowed_structs_VkBlitImageInfo2.size(), + allowed_structs_VkBlitImageInfo2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBlitImageInfo2-pNext-pNext", "VUID-VkBlitImageInfo2-sType-unique", true); - skip |= ValidateRequiredHandle(pBlitImageInfo_loc.dot(Field::srcImage), pBlitImageInfo->srcImage); + skip |= state.ValidateRequiredHandle(pBlitImageInfo_loc.dot(Field::srcImage), pBlitImageInfo->srcImage); - skip |= - ValidateRangedEnum(pBlitImageInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, - pBlitImageInfo->srcImageLayout, "VUID-VkBlitImageInfo2-srcImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pBlitImageInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, + pBlitImageInfo->srcImageLayout, "VUID-VkBlitImageInfo2-srcImageLayout-parameter"); - skip |= ValidateRequiredHandle(pBlitImageInfo_loc.dot(Field::dstImage), pBlitImageInfo->dstImage); + skip |= state.ValidateRequiredHandle(pBlitImageInfo_loc.dot(Field::dstImage), pBlitImageInfo->dstImage); - skip |= - ValidateRangedEnum(pBlitImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, - pBlitImageInfo->dstImageLayout, "VUID-VkBlitImageInfo2-dstImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pBlitImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, + pBlitImageInfo->dstImageLayout, "VUID-VkBlitImageInfo2-dstImageLayout-parameter"); - skip |= ValidateStructTypeArray(pBlitImageInfo_loc.dot(Field::regionCount), pBlitImageInfo_loc.dot(Field::pRegions), - pBlitImageInfo->regionCount, pBlitImageInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_BLIT_2, true, - true, "VUID-VkImageBlit2-sType-sType", "VUID-VkBlitImageInfo2-pRegions-parameter", - "VUID-VkBlitImageInfo2-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray( + pBlitImageInfo_loc.dot(Field::regionCount), pBlitImageInfo_loc.dot(Field::pRegions), pBlitImageInfo->regionCount, + pBlitImageInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_BLIT_2, true, true, "VUID-VkImageBlit2-sType-sType", + "VUID-VkBlitImageInfo2-pRegions-parameter", "VUID-VkBlitImageInfo2-regionCount-arraylength"); if (pBlitImageInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pBlitImageInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pBlitImageInfo_loc.dot(Field::pRegions, regionIndex); constexpr std::array allowed_structs_VkImageBlit2 = {VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM}; - skip |= ValidateStructPnext(pRegions_loc, pBlitImageInfo->pRegions[regionIndex].pNext, - allowed_structs_VkImageBlit2.size(), allowed_structs_VkImageBlit2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkImageBlit2-pNext-pNext", - "VUID-VkImageBlit2-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pRegions_loc, pBlitImageInfo->pRegions[regionIndex].pNext, + allowed_structs_VkImageBlit2.size(), allowed_structs_VkImageBlit2.data(), + GeneratedVulkanHeaderVersion, "VUID-VkImageBlit2-pNext-pNext", + "VUID-VkImageBlit2-sType-unique", true); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pBlitImageInfo->pRegions[regionIndex].srcSubresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= + state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pBlitImageInfo->pRegions[regionIndex].srcSubresource.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pBlitImageInfo->pRegions[regionIndex].dstSubresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= + state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pBlitImageInfo->pRegions[regionIndex].dstSubresource.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); } } - skip |= ValidateRangedEnum(pBlitImageInfo_loc.dot(Field::filter), vvl::Enum::VkFilter, pBlitImageInfo->filter, - "VUID-VkBlitImageInfo2-filter-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pBlitImageInfo_loc.dot(Field::filter), vvl::Enum::VkFilter, pBlitImageInfo->filter, + "VUID-VkBlitImageInfo2-filter-parameter"); } return skip; } @@ -15889,50 +17956,52 @@ bool StatelessValidation::PreCallValidateCmdResolveImage2(VkCommandBuffer comman const VkResolveImageInfo2* pResolveImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pResolveImageInfo), pResolveImageInfo, VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2, true, - "VUID-vkCmdResolveImage2-pResolveImageInfo-parameter", "VUID-VkResolveImageInfo2-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pResolveImageInfo), pResolveImageInfo, VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2, true, + "VUID-vkCmdResolveImage2-pResolveImageInfo-parameter", "VUID-VkResolveImageInfo2-sType-sType"); if (pResolveImageInfo != nullptr) { [[maybe_unused]] const Location pResolveImageInfo_loc = loc.dot(Field::pResolveImageInfo); - skip |= ValidateStructPnext(pResolveImageInfo_loc, pResolveImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkResolveImageInfo2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pResolveImageInfo_loc, pResolveImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkResolveImageInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pResolveImageInfo_loc.dot(Field::srcImage), pResolveImageInfo->srcImage); + skip |= state.ValidateRequiredHandle(pResolveImageInfo_loc.dot(Field::srcImage), pResolveImageInfo->srcImage); - skip |= ValidateRangedEnum(pResolveImageInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, - pResolveImageInfo->srcImageLayout, "VUID-VkResolveImageInfo2-srcImageLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pResolveImageInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, + pResolveImageInfo->srcImageLayout, "VUID-VkResolveImageInfo2-srcImageLayout-parameter"); - skip |= ValidateRequiredHandle(pResolveImageInfo_loc.dot(Field::dstImage), pResolveImageInfo->dstImage); + skip |= state.ValidateRequiredHandle(pResolveImageInfo_loc.dot(Field::dstImage), pResolveImageInfo->dstImage); - skip |= ValidateRangedEnum(pResolveImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, - pResolveImageInfo->dstImageLayout, "VUID-VkResolveImageInfo2-dstImageLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pResolveImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, + pResolveImageInfo->dstImageLayout, "VUID-VkResolveImageInfo2-dstImageLayout-parameter"); - skip |= - ValidateStructTypeArray(pResolveImageInfo_loc.dot(Field::regionCount), pResolveImageInfo_loc.dot(Field::pRegions), - pResolveImageInfo->regionCount, pResolveImageInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2, - true, true, "VUID-VkImageResolve2-sType-sType", "VUID-VkResolveImageInfo2-pRegions-parameter", - "VUID-VkResolveImageInfo2-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray(pResolveImageInfo_loc.dot(Field::regionCount), + pResolveImageInfo_loc.dot(Field::pRegions), pResolveImageInfo->regionCount, + pResolveImageInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2, true, true, + "VUID-VkImageResolve2-sType-sType", "VUID-VkResolveImageInfo2-pRegions-parameter", + "VUID-VkResolveImageInfo2-regionCount-arraylength"); if (pResolveImageInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pResolveImageInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pResolveImageInfo_loc.dot(Field::pRegions, regionIndex); - skip |= ValidateStructPnext(pRegions_loc, pResolveImageInfo->pRegions[regionIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkImageResolve2-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pRegions_loc, pResolveImageInfo->pRegions[regionIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImageResolve2-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pResolveImageInfo->pRegions[regionIndex].srcSubresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pResolveImageInfo->pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pResolveImageInfo->pRegions[regionIndex].dstSubresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pResolveImageInfo->pRegions[regionIndex].dstSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -15946,9 +18015,10 @@ bool StatelessValidation::PreCallValidateCmdResolveImage2(VkCommandBuffer comman bool StatelessValidation::PreCallValidateCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pRenderingInfo), pRenderingInfo, VK_STRUCTURE_TYPE_RENDERING_INFO, true, - "VUID-vkCmdBeginRendering-pRenderingInfo-parameter", "VUID-VkRenderingInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pRenderingInfo), pRenderingInfo, VK_STRUCTURE_TYPE_RENDERING_INFO, true, + "VUID-vkCmdBeginRendering-pRenderingInfo-parameter", "VUID-VkRenderingInfo-sType-sType"); if (pRenderingInfo != nullptr) { [[maybe_unused]] const Location pRenderingInfo_loc = loc.dot(Field::pRenderingInfo); constexpr std::array allowed_structs_VkRenderingInfo = { @@ -15960,129 +18030,133 @@ bool StatelessValidation::PreCallValidateCmdBeginRendering(VkCommandBuffer comma VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT, VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR}; - skip |= ValidateStructPnext(pRenderingInfo_loc, pRenderingInfo->pNext, allowed_structs_VkRenderingInfo.size(), - allowed_structs_VkRenderingInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkRenderingInfo-pNext-pNext", "VUID-VkRenderingInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pRenderingInfo_loc, pRenderingInfo->pNext, allowed_structs_VkRenderingInfo.size(), + allowed_structs_VkRenderingInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkRenderingInfo-pNext-pNext", "VUID-VkRenderingInfo-sType-unique", true); - skip |= ValidateFlags(pRenderingInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderingFlagBits, AllVkRenderingFlagBits, - pRenderingInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkRenderingInfo-flags-parameter"); + skip |= + state.ValidateFlags(pRenderingInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderingFlagBits, AllVkRenderingFlagBits, + pRenderingInfo->flags, kOptionalFlags, "VUID-VkRenderingInfo-flags-parameter"); // No xml-driven validation // No xml-driven validation - skip |= ValidateStructTypeArray(pRenderingInfo_loc.dot(Field::colorAttachmentCount), - pRenderingInfo_loc.dot(Field::pColorAttachments), pRenderingInfo->colorAttachmentCount, - pRenderingInfo->pColorAttachments, VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, true, - "VUID-VkRenderingAttachmentInfo-sType-sType", - "VUID-VkRenderingInfo-pColorAttachments-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + pRenderingInfo_loc.dot(Field::colorAttachmentCount), pRenderingInfo_loc.dot(Field::pColorAttachments), + pRenderingInfo->colorAttachmentCount, pRenderingInfo->pColorAttachments, VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, + false, true, "VUID-VkRenderingAttachmentInfo-sType-sType", "VUID-VkRenderingInfo-pColorAttachments-parameter", + kVUIDUndefined); if (pRenderingInfo->pColorAttachments != nullptr) { for (uint32_t colorAttachmentIndex = 0; colorAttachmentIndex < pRenderingInfo->colorAttachmentCount; ++colorAttachmentIndex) { [[maybe_unused]] const Location pColorAttachments_loc = pRenderingInfo_loc.dot(Field::pColorAttachments, colorAttachmentIndex); - skip |= ValidateStructPnext(pColorAttachments_loc, pRenderingInfo->pColorAttachments[colorAttachmentIndex].pNext, 0, - nullptr, GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pColorAttachments_loc, pRenderingInfo->pColorAttachments[colorAttachmentIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pColorAttachments_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pColorAttachments[colorAttachmentIndex].imageLayout, - "VUID-VkRenderingAttachmentInfo-imageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorAttachments_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].imageLayout, + "VUID-VkRenderingAttachmentInfo-imageLayout-parameter"); - skip |= ValidateFlags(pColorAttachments_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, - AllVkResolveModeFlagBits, pRenderingInfo->pColorAttachments[colorAttachmentIndex].resolveMode, - kOptionalSingleBit, VK_NULL_HANDLE, "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); + skip |= state.ValidateFlags(pColorAttachments_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, + AllVkResolveModeFlagBits, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].resolveMode, kOptionalSingleBit, + "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); - skip |= ValidateRangedEnum(pColorAttachments_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pColorAttachments[colorAttachmentIndex].resolveImageLayout, - "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorAttachments_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].resolveImageLayout, + "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter"); - skip |= ValidateRangedEnum(pColorAttachments_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, - pRenderingInfo->pColorAttachments[colorAttachmentIndex].loadOp, - "VUID-VkRenderingAttachmentInfo-loadOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorAttachments_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].loadOp, + "VUID-VkRenderingAttachmentInfo-loadOp-parameter"); - skip |= ValidateRangedEnum(pColorAttachments_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, - pRenderingInfo->pColorAttachments[colorAttachmentIndex].storeOp, - "VUID-VkRenderingAttachmentInfo-storeOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorAttachments_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].storeOp, + "VUID-VkRenderingAttachmentInfo-storeOp-parameter"); // No xml-driven validation } } - skip |= ValidateStructType(pRenderingInfo_loc.dot(Field::pDepthAttachment), pRenderingInfo->pDepthAttachment, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, - "VUID-VkRenderingInfo-pDepthAttachment-parameter", "VUID-VkRenderingAttachmentInfo-sType-sType"); + skip |= state.ValidateStructType(pRenderingInfo_loc.dot(Field::pDepthAttachment), pRenderingInfo->pDepthAttachment, + VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, + "VUID-VkRenderingInfo-pDepthAttachment-parameter", + "VUID-VkRenderingAttachmentInfo-sType-sType"); if (pRenderingInfo->pDepthAttachment != nullptr) { [[maybe_unused]] const Location pDepthAttachment_loc = pRenderingInfo_loc.dot(Field::pDepthAttachment); - skip |= ValidateStructPnext(pDepthAttachment_loc, pRenderingInfo->pDepthAttachment->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDepthAttachment_loc, pRenderingInfo->pDepthAttachment->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pDepthAttachment_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pDepthAttachment->imageLayout, - "VUID-VkRenderingAttachmentInfo-imageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthAttachment_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pDepthAttachment->imageLayout, + "VUID-VkRenderingAttachmentInfo-imageLayout-parameter"); - skip |= ValidateFlags(pDepthAttachment_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, - AllVkResolveModeFlagBits, pRenderingInfo->pDepthAttachment->resolveMode, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); + skip |= state.ValidateFlags(pDepthAttachment_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, + AllVkResolveModeFlagBits, pRenderingInfo->pDepthAttachment->resolveMode, kOptionalSingleBit, + "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); - skip |= ValidateRangedEnum(pDepthAttachment_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pDepthAttachment->resolveImageLayout, - "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthAttachment_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pDepthAttachment->resolveImageLayout, + "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter"); - skip |= ValidateRangedEnum(pDepthAttachment_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, - pRenderingInfo->pDepthAttachment->loadOp, "VUID-VkRenderingAttachmentInfo-loadOp-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthAttachment_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, + pRenderingInfo->pDepthAttachment->loadOp, + "VUID-VkRenderingAttachmentInfo-loadOp-parameter"); - skip |= ValidateRangedEnum(pDepthAttachment_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, - pRenderingInfo->pDepthAttachment->storeOp, - "VUID-VkRenderingAttachmentInfo-storeOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthAttachment_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, + pRenderingInfo->pDepthAttachment->storeOp, + "VUID-VkRenderingAttachmentInfo-storeOp-parameter"); // No xml-driven validation } - skip |= - ValidateStructType(pRenderingInfo_loc.dot(Field::pStencilAttachment), pRenderingInfo->pStencilAttachment, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, - "VUID-VkRenderingInfo-pStencilAttachment-parameter", "VUID-VkRenderingAttachmentInfo-sType-sType"); + skip |= state.ValidateStructType(pRenderingInfo_loc.dot(Field::pStencilAttachment), pRenderingInfo->pStencilAttachment, + VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, + "VUID-VkRenderingInfo-pStencilAttachment-parameter", + "VUID-VkRenderingAttachmentInfo-sType-sType"); if (pRenderingInfo->pStencilAttachment != nullptr) { [[maybe_unused]] const Location pStencilAttachment_loc = pRenderingInfo_loc.dot(Field::pStencilAttachment); - skip |= ValidateStructPnext(pStencilAttachment_loc, pRenderingInfo->pStencilAttachment->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pStencilAttachment_loc, pRenderingInfo->pStencilAttachment->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pStencilAttachment_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pStencilAttachment->imageLayout, - "VUID-VkRenderingAttachmentInfo-imageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pStencilAttachment_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pStencilAttachment->imageLayout, + "VUID-VkRenderingAttachmentInfo-imageLayout-parameter"); - skip |= ValidateFlags(pStencilAttachment_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, - AllVkResolveModeFlagBits, pRenderingInfo->pStencilAttachment->resolveMode, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); + skip |= state.ValidateFlags(pStencilAttachment_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, + AllVkResolveModeFlagBits, pRenderingInfo->pStencilAttachment->resolveMode, + kOptionalSingleBit, "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); - skip |= ValidateRangedEnum(pStencilAttachment_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pStencilAttachment->resolveImageLayout, - "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pStencilAttachment_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pStencilAttachment->resolveImageLayout, + "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter"); - skip |= ValidateRangedEnum(pStencilAttachment_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, - pRenderingInfo->pStencilAttachment->loadOp, - "VUID-VkRenderingAttachmentInfo-loadOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pStencilAttachment_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, + pRenderingInfo->pStencilAttachment->loadOp, + "VUID-VkRenderingAttachmentInfo-loadOp-parameter"); - skip |= ValidateRangedEnum(pStencilAttachment_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, - pRenderingInfo->pStencilAttachment->storeOp, - "VUID-VkRenderingAttachmentInfo-storeOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pStencilAttachment_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, + pRenderingInfo->pStencilAttachment->storeOp, + "VUID-VkRenderingAttachmentInfo-storeOp-parameter"); // No xml-driven validation } } - if (!skip) skip |= manual_PreCallValidateCmdBeginRendering(commandBuffer, pRenderingInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdBeginRendering(commandBuffer, pRenderingInfo, state); return skip; } bool StatelessValidation::PreCallValidateCmdEndRendering(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -16091,18 +18165,20 @@ bool StatelessValidation::PreCallValidateCmdEndRendering(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::cullMode), vvl::FlagBitmask::VkCullModeFlagBits, AllVkCullModeFlagBits, cullMode, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdSetCullMode-cullMode-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::cullMode), vvl::FlagBitmask::VkCullModeFlagBits, AllVkCullModeFlagBits, cullMode, + kOptionalFlags, "VUID-vkCmdSetCullMode-cullMode-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetFrontFace(VkCommandBuffer commandBuffer, VkFrontFace frontFace, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::frontFace), vvl::Enum::VkFrontFace, frontFace, - "VUID-vkCmdSetFrontFace-frontFace-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::frontFace), vvl::Enum::VkFrontFace, frontFace, + "VUID-vkCmdSetFrontFace-frontFace-parameter"); return skip; } @@ -16110,37 +18186,40 @@ bool StatelessValidation::PreCallValidateCmdSetPrimitiveTopology(VkCommandBuffer VkPrimitiveTopology primitiveTopology, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::primitiveTopology), vvl::Enum::VkPrimitiveTopology, primitiveTopology, - "VUID-vkCmdSetPrimitiveTopology-primitiveTopology-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::primitiveTopology), vvl::Enum::VkPrimitiveTopology, primitiveTopology, + "VUID-vkCmdSetPrimitiveTopology-primitiveTopology-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pViewports), viewportCount, &pViewports, true, true, - "VUID-vkCmdSetViewportWithCount-viewportCount-arraylength", - "VUID-vkCmdSetViewportWithCount-pViewports-parameter"); + skip |= state.ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pViewports), viewportCount, &pViewports, true, true, + "VUID-vkCmdSetViewportWithCount-viewportCount-arraylength", + "VUID-vkCmdSetViewportWithCount-pViewports-parameter"); if (pViewports != nullptr) { for (uint32_t viewportIndex = 0; viewportIndex < viewportCount; ++viewportIndex) { [[maybe_unused]] const Location pViewports_loc = loc.dot(Field::pViewports, viewportIndex); // No xml-driven validation } } - if (!skip) skip |= manual_PreCallValidateCmdSetViewportWithCount(commandBuffer, viewportCount, pViewports, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdSetViewportWithCount(commandBuffer, viewportCount, pViewports, state); return skip; } bool StatelessValidation::PreCallValidateCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateArray(loc.dot(Field::scissorCount), loc.dot(Field::pScissors), scissorCount, &pScissors, true, true, - "VUID-vkCmdSetScissorWithCount-scissorCount-arraylength", - "VUID-vkCmdSetScissorWithCount-pScissors-parameter"); - if (!skip) skip |= manual_PreCallValidateCmdSetScissorWithCount(commandBuffer, scissorCount, pScissors, error_obj); + skip |= state.ValidateArray(loc.dot(Field::scissorCount), loc.dot(Field::pScissors), scissorCount, &pScissors, true, true, + "VUID-vkCmdSetScissorWithCount-scissorCount-arraylength", + "VUID-vkCmdSetScissorWithCount-pScissors-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdSetScissorWithCount(commandBuffer, scissorCount, pScissors, state); return skip; } @@ -16149,52 +18228,58 @@ bool StatelessValidation::PreCallValidateCmdBindVertexBuffers2(VkCommandBuffer c const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation if (!skip) skip |= manual_PreCallValidateCmdBindVertexBuffers2(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes, - pStrides, error_obj); + pStrides, state); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::depthTestEnable), depthTestEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthTestEnable), depthTestEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::depthWriteEnable), depthWriteEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthWriteEnable), depthWriteEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::depthCompareOp), vvl::Enum::VkCompareOp, depthCompareOp, - "VUID-vkCmdSetDepthCompareOp-depthCompareOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::depthCompareOp), vvl::Enum::VkCompareOp, depthCompareOp, + "VUID-vkCmdSetDepthCompareOp-depthCompareOp-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthBoundsTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::depthBoundsTestEnable), depthBoundsTestEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthBoundsTestEnable), depthBoundsTestEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::stencilTestEnable), stencilTestEnable); + skip |= state.ValidateBool32(loc.dot(Field::stencilTestEnable), stencilTestEnable); return skip; } @@ -16202,18 +18287,19 @@ bool StatelessValidation::PreCallValidateCmdSetStencilOp(VkCommandBuffer command VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, faceMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-vkCmdSetStencilOp-faceMask-parameter", - "VUID-vkCmdSetStencilOp-faceMask-requiredbitmask"); - skip |= ValidateRangedEnum(loc.dot(Field::failOp), vvl::Enum::VkStencilOp, failOp, "VUID-vkCmdSetStencilOp-failOp-parameter", - VK_NULL_HANDLE); - skip |= ValidateRangedEnum(loc.dot(Field::passOp), vvl::Enum::VkStencilOp, passOp, "VUID-vkCmdSetStencilOp-passOp-parameter", - VK_NULL_HANDLE); - skip |= ValidateRangedEnum(loc.dot(Field::depthFailOp), vvl::Enum::VkStencilOp, depthFailOp, - "VUID-vkCmdSetStencilOp-depthFailOp-parameter", VK_NULL_HANDLE); - skip |= ValidateRangedEnum(loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, compareOp, - "VUID-vkCmdSetStencilOp-compareOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, + faceMask, kRequiredFlags, "VUID-vkCmdSetStencilOp-faceMask-parameter", + "VUID-vkCmdSetStencilOp-faceMask-requiredbitmask"); + skip |= + state.ValidateRangedEnum(loc.dot(Field::failOp), vvl::Enum::VkStencilOp, failOp, "VUID-vkCmdSetStencilOp-failOp-parameter"); + skip |= + state.ValidateRangedEnum(loc.dot(Field::passOp), vvl::Enum::VkStencilOp, passOp, "VUID-vkCmdSetStencilOp-passOp-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::depthFailOp), vvl::Enum::VkStencilOp, depthFailOp, + "VUID-vkCmdSetStencilOp-depthFailOp-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, compareOp, + "VUID-vkCmdSetStencilOp-compareOp-parameter"); return skip; } @@ -16221,16 +18307,18 @@ bool StatelessValidation::PreCallValidateCmdSetRasterizerDiscardEnable(VkCommand VkBool32 rasterizerDiscardEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::rasterizerDiscardEnable), rasterizerDiscardEnable); + skip |= state.ValidateBool32(loc.dot(Field::rasterizerDiscardEnable), rasterizerDiscardEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthBiasEnable(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::depthBiasEnable), depthBiasEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthBiasEnable), depthBiasEnable); return skip; } @@ -16238,8 +18326,9 @@ bool StatelessValidation::PreCallValidateCmdSetPrimitiveRestartEnable(VkCommandB VkBool32 primitiveRestartEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::primitiveRestartEnable), primitiveRestartEnable); + skip |= state.ValidateBool32(loc.dot(Field::primitiveRestartEnable), primitiveRestartEnable); return skip; } @@ -16248,18 +18337,19 @@ bool StatelessValidation::PreCallValidateGetDeviceBufferMemoryRequirements(VkDev VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS, true, - "VUID-vkGetDeviceBufferMemoryRequirements-pInfo-parameter", - "VUID-VkDeviceBufferMemoryRequirements-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS, true, + "VUID-vkGetDeviceBufferMemoryRequirements-pInfo-parameter", + "VUID-VkDeviceBufferMemoryRequirements-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceBufferMemoryRequirements-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceBufferMemoryRequirements-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateStructType(pInfo_loc.dot(Field::pCreateInfo), pInfo->pCreateInfo, VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, - true, "VUID-VkDeviceBufferMemoryRequirements-pCreateInfo-parameter", - "VUID-VkBufferCreateInfo-sType-sType"); + skip |= state.ValidateStructType( + pInfo_loc.dot(Field::pCreateInfo), pInfo->pCreateInfo, VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, true, + "VUID-VkDeviceBufferMemoryRequirements-pCreateInfo-parameter", "VUID-VkBufferCreateInfo-sType-sType"); if (pInfo->pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = pInfo_loc.dot(Field::pCreateInfo); @@ -16273,31 +18363,29 @@ bool StatelessValidation::PreCallValidateGetDeviceBufferMemoryRequirements(VkDev VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pCreateInfo_loc, pInfo->pCreateInfo->pNext, allowed_structs_VkBufferCreateInfo.size(), - allowed_structs_VkBufferCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkBufferCreateInfo-pNext-pNext", "VUID-VkBufferCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pInfo->pCreateInfo->pNext, allowed_structs_VkBufferCreateInfo.size(), + allowed_structs_VkBufferCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBufferCreateInfo-pNext-pNext", "VUID-VkBufferCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, - AllVkBufferCreateFlagBits, pInfo->pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkBufferCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, + AllVkBufferCreateFlagBits, pInfo->pCreateInfo->flags, kOptionalFlags, + "VUID-VkBufferCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, - pInfo->pCreateInfo->sharingMode, "VUID-VkBufferCreateInfo-sharingMode-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, + pInfo->pCreateInfo->sharingMode, "VUID-VkBufferCreateInfo-sharingMode-parameter"); } } - skip |= ValidateStructType(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - true, "VUID-vkGetDeviceBufferMemoryRequirements-pMemoryRequirements-parameter", - "VUID-VkMemoryRequirements2-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, true, + "VUID-vkGetDeviceBufferMemoryRequirements-pMemoryRequirements-parameter", "VUID-VkMemoryRequirements2-sType-sType"); if (pMemoryRequirements != nullptr) { [[maybe_unused]] const Location pMemoryRequirements_loc = loc.dot(Field::pMemoryRequirements); constexpr std::array allowed_structs_VkMemoryRequirements2 = {VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS}; - skip |= ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements->pNext, - allowed_structs_VkMemoryRequirements2.size(), allowed_structs_VkMemoryRequirements2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", - "VUID-VkMemoryRequirements2-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pMemoryRequirements_loc, pMemoryRequirements->pNext, allowed_structs_VkMemoryRequirements2.size(), + allowed_structs_VkMemoryRequirements2.data(), GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", + "VUID-VkMemoryRequirements2-sType-unique", false); } return skip; } @@ -16307,18 +18395,19 @@ bool StatelessValidation::PreCallValidateGetDeviceImageMemoryRequirements(VkDevi VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, true, - "VUID-vkGetDeviceImageMemoryRequirements-pInfo-parameter", - "VUID-VkDeviceImageMemoryRequirements-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, true, + "VUID-vkGetDeviceImageMemoryRequirements-pInfo-parameter", + "VUID-VkDeviceImageMemoryRequirements-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceImageMemoryRequirements-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceImageMemoryRequirements-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateStructType(pInfo_loc.dot(Field::pCreateInfo), pInfo->pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, true, - "VUID-VkDeviceImageMemoryRequirements-pCreateInfo-parameter", "VUID-VkImageCreateInfo-sType-sType"); + skip |= state.ValidateStructType(pInfo_loc.dot(Field::pCreateInfo), pInfo->pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, + true, "VUID-VkDeviceImageMemoryRequirements-pCreateInfo-parameter", + "VUID-VkImageCreateInfo-sType-sType"); if (pInfo->pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = pInfo_loc.dot(Field::pCreateInfo); @@ -16343,60 +18432,57 @@ bool StatelessValidation::PreCallValidateGetDeviceImageMemoryRequirements(VkDevi VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pCreateInfo_loc, pInfo->pCreateInfo->pNext, allowed_structs_VkImageCreateInfo.size(), - allowed_structs_VkImageCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pInfo->pCreateInfo->pNext, allowed_structs_VkImageCreateInfo.size(), + allowed_structs_VkImageCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", true); - skip |= - ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, - pInfo->pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, + AllVkImageCreateFlagBits, pInfo->pCreateInfo->flags, kOptionalFlags, + "VUID-VkImageCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, pInfo->pCreateInfo->imageType, - "VUID-VkImageCreateInfo-imageType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, + pInfo->pCreateInfo->imageType, "VUID-VkImageCreateInfo-imageType-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pInfo->pCreateInfo->format, - "VUID-VkImageCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pInfo->pCreateInfo->format, + "VUID-VkImageCreateInfo-format-parameter"); // No xml-driven validation - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, pInfo->pCreateInfo->samples, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, pInfo->pCreateInfo->samples, kRequiredSingleBit, + "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pInfo->pCreateInfo->tiling, - "VUID-VkImageCreateInfo-tiling-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, + pInfo->pCreateInfo->tiling, "VUID-VkImageCreateInfo-tiling-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, - AllVkImageUsageFlagBits, pInfo->pCreateInfo->usage, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pInfo->pCreateInfo->usage, kRequiredFlags, + "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); - skip |= - ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, - pInfo->pCreateInfo->sharingMode, "VUID-VkImageCreateInfo-sharingMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, + pInfo->pCreateInfo->sharingMode, "VUID-VkImageCreateInfo-sharingMode-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, - pInfo->pCreateInfo->initialLayout, "VUID-VkImageCreateInfo-initialLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, + pInfo->pCreateInfo->initialLayout, "VUID-VkImageCreateInfo-initialLayout-parameter"); } - skip |= ValidateFlags(pInfo_loc.dot(Field::planeAspect), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, - pInfo->planeAspect, kOptionalSingleBit, VK_NULL_HANDLE, - "VUID-VkDeviceImageMemoryRequirements-planeAspect-parameter"); + skip |= state.ValidateFlags(pInfo_loc.dot(Field::planeAspect), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pInfo->planeAspect, kOptionalSingleBit, + "VUID-VkDeviceImageMemoryRequirements-planeAspect-parameter"); } - skip |= ValidateStructType(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - true, "VUID-vkGetDeviceImageMemoryRequirements-pMemoryRequirements-parameter", - "VUID-VkMemoryRequirements2-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, true, + "VUID-vkGetDeviceImageMemoryRequirements-pMemoryRequirements-parameter", "VUID-VkMemoryRequirements2-sType-sType"); if (pMemoryRequirements != nullptr) { [[maybe_unused]] const Location pMemoryRequirements_loc = loc.dot(Field::pMemoryRequirements); constexpr std::array allowed_structs_VkMemoryRequirements2 = {VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS}; - skip |= ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements->pNext, - allowed_structs_VkMemoryRequirements2.size(), allowed_structs_VkMemoryRequirements2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", - "VUID-VkMemoryRequirements2-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pMemoryRequirements_loc, pMemoryRequirements->pNext, allowed_structs_VkMemoryRequirements2.size(), + allowed_structs_VkMemoryRequirements2.data(), GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", + "VUID-VkMemoryRequirements2-sType-unique", false); } - if (!skip) skip |= manual_PreCallValidateGetDeviceImageMemoryRequirements(device, pInfo, pMemoryRequirements, error_obj); + if (!skip) skip |= manual_PreCallValidateGetDeviceImageMemoryRequirements(device, pInfo, pMemoryRequirements, state); return skip; } @@ -16404,18 +18490,19 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSparseMemoryRequirements( VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, true, - "VUID-vkGetDeviceImageSparseMemoryRequirements-pInfo-parameter", - "VUID-VkDeviceImageMemoryRequirements-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, true, + "VUID-vkGetDeviceImageSparseMemoryRequirements-pInfo-parameter", + "VUID-VkDeviceImageMemoryRequirements-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceImageMemoryRequirements-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceImageMemoryRequirements-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateStructType(pInfo_loc.dot(Field::pCreateInfo), pInfo->pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, true, - "VUID-VkDeviceImageMemoryRequirements-pCreateInfo-parameter", "VUID-VkImageCreateInfo-sType-sType"); + skip |= state.ValidateStructType(pInfo_loc.dot(Field::pCreateInfo), pInfo->pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, + true, "VUID-VkDeviceImageMemoryRequirements-pCreateInfo-parameter", + "VUID-VkImageCreateInfo-sType-sType"); if (pInfo->pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = pInfo_loc.dot(Field::pCreateInfo); @@ -16440,48 +18527,45 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSparseMemoryRequirements( VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pCreateInfo_loc, pInfo->pCreateInfo->pNext, allowed_structs_VkImageCreateInfo.size(), - allowed_structs_VkImageCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pInfo->pCreateInfo->pNext, allowed_structs_VkImageCreateInfo.size(), + allowed_structs_VkImageCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", true); - skip |= - ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, - pInfo->pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, + AllVkImageCreateFlagBits, pInfo->pCreateInfo->flags, kOptionalFlags, + "VUID-VkImageCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, pInfo->pCreateInfo->imageType, - "VUID-VkImageCreateInfo-imageType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, + pInfo->pCreateInfo->imageType, "VUID-VkImageCreateInfo-imageType-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pInfo->pCreateInfo->format, - "VUID-VkImageCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pInfo->pCreateInfo->format, + "VUID-VkImageCreateInfo-format-parameter"); // No xml-driven validation - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, pInfo->pCreateInfo->samples, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, pInfo->pCreateInfo->samples, kRequiredSingleBit, + "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pInfo->pCreateInfo->tiling, - "VUID-VkImageCreateInfo-tiling-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, + pInfo->pCreateInfo->tiling, "VUID-VkImageCreateInfo-tiling-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, - AllVkImageUsageFlagBits, pInfo->pCreateInfo->usage, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pInfo->pCreateInfo->usage, kRequiredFlags, + "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); - skip |= - ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, - pInfo->pCreateInfo->sharingMode, "VUID-VkImageCreateInfo-sharingMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, + pInfo->pCreateInfo->sharingMode, "VUID-VkImageCreateInfo-sharingMode-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, - pInfo->pCreateInfo->initialLayout, "VUID-VkImageCreateInfo-initialLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, + pInfo->pCreateInfo->initialLayout, "VUID-VkImageCreateInfo-initialLayout-parameter"); } - skip |= ValidateFlags(pInfo_loc.dot(Field::planeAspect), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, - pInfo->planeAspect, kOptionalSingleBit, VK_NULL_HANDLE, - "VUID-VkDeviceImageMemoryRequirements-planeAspect-parameter"); + skip |= state.ValidateFlags(pInfo_loc.dot(Field::planeAspect), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pInfo->planeAspect, kOptionalSingleBit, + "VUID-VkDeviceImageMemoryRequirements-planeAspect-parameter"); } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pSparseMemoryRequirementCount), loc.dot(Field::pSparseMemoryRequirements), pSparseMemoryRequirementCount, pSparseMemoryRequirements, VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, true, false, false, "VUID-VkSparseImageMemoryRequirements2-sType-sType", kVUIDUndefined, @@ -16491,66 +18575,69 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSparseMemoryRequirements( ++pSparseMemoryRequirementIndex) { [[maybe_unused]] const Location pSparseMemoryRequirements_loc = loc.dot(Field::pSparseMemoryRequirements, pSparseMemoryRequirementIndex); - skip |= - ValidateStructPnext(pSparseMemoryRequirements_loc, pSparseMemoryRequirements[pSparseMemoryRequirementIndex].pNext, - 0, nullptr, GeneratedVulkanHeaderVersion, "VUID-VkSparseImageMemoryRequirements2-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pSparseMemoryRequirements_loc, pSparseMemoryRequirements[pSparseMemoryRequirementIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSparseImageMemoryRequirements2-pNext-pNext", kVUIDUndefined, false); } } if (!skip) skip |= manual_PreCallValidateGetDeviceImageSparseMemoryRequirements(device, pInfo, pSparseMemoryRequirementCount, - pSparseMemoryRequirements, error_obj); + pSparseMemoryRequirements, state); return skip; } bool StatelessValidation::PreCallValidateCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation - if (!skip) skip |= manual_PreCallValidateCmdSetLineStipple(commandBuffer, lineStippleFactor, lineStipplePattern, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdSetLineStipple(commandBuffer, lineStippleFactor, lineStipplePattern, state); return skip; } bool StatelessValidation::PreCallValidateMapMemory2(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pMemoryMapInfo), pMemoryMapInfo, VK_STRUCTURE_TYPE_MEMORY_MAP_INFO, true, - "VUID-vkMapMemory2-pMemoryMapInfo-parameter", "VUID-VkMemoryMapInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pMemoryMapInfo), pMemoryMapInfo, VK_STRUCTURE_TYPE_MEMORY_MAP_INFO, true, + "VUID-vkMapMemory2-pMemoryMapInfo-parameter", "VUID-VkMemoryMapInfo-sType-sType"); if (pMemoryMapInfo != nullptr) { [[maybe_unused]] const Location pMemoryMapInfo_loc = loc.dot(Field::pMemoryMapInfo); constexpr std::array allowed_structs_VkMemoryMapInfo = {VK_STRUCTURE_TYPE_MEMORY_MAP_PLACED_INFO_EXT}; - skip |= ValidateStructPnext(pMemoryMapInfo_loc, pMemoryMapInfo->pNext, allowed_structs_VkMemoryMapInfo.size(), - allowed_structs_VkMemoryMapInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkMemoryMapInfo-pNext-pNext", "VUID-VkMemoryMapInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMemoryMapInfo_loc, pMemoryMapInfo->pNext, allowed_structs_VkMemoryMapInfo.size(), + allowed_structs_VkMemoryMapInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkMemoryMapInfo-pNext-pNext", "VUID-VkMemoryMapInfo-sType-unique", true); - skip |= ValidateFlags(pMemoryMapInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkMemoryMapFlagBits, AllVkMemoryMapFlagBits, - pMemoryMapInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryMapInfo-flags-parameter"); + skip |= + state.ValidateFlags(pMemoryMapInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkMemoryMapFlagBits, AllVkMemoryMapFlagBits, + pMemoryMapInfo->flags, kOptionalFlags, "VUID-VkMemoryMapInfo-flags-parameter"); - skip |= ValidateRequiredHandle(pMemoryMapInfo_loc.dot(Field::memory), pMemoryMapInfo->memory); + skip |= state.ValidateRequiredHandle(pMemoryMapInfo_loc.dot(Field::memory), pMemoryMapInfo->memory); } - skip |= ValidateRequiredPointer(loc.dot(Field::ppData), ppData, "VUID-vkMapMemory2-ppData-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::ppData), ppData, "VUID-vkMapMemory2-ppData-parameter"); return skip; } bool StatelessValidation::PreCallValidateUnmapMemory2(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pMemoryUnmapInfo), pMemoryUnmapInfo, VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO, true, - "VUID-vkUnmapMemory2-pMemoryUnmapInfo-parameter", "VUID-VkMemoryUnmapInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pMemoryUnmapInfo), pMemoryUnmapInfo, VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO, true, + "VUID-vkUnmapMemory2-pMemoryUnmapInfo-parameter", "VUID-VkMemoryUnmapInfo-sType-sType"); if (pMemoryUnmapInfo != nullptr) { [[maybe_unused]] const Location pMemoryUnmapInfo_loc = loc.dot(Field::pMemoryUnmapInfo); - skip |= ValidateStructPnext(pMemoryUnmapInfo_loc, pMemoryUnmapInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMemoryUnmapInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMemoryUnmapInfo_loc, pMemoryUnmapInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMemoryUnmapInfo-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateFlags(pMemoryUnmapInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkMemoryUnmapFlagBits, AllVkMemoryUnmapFlagBits, - pMemoryUnmapInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkMemoryUnmapInfo-flags-parameter"); + skip |= state.ValidateFlags(pMemoryUnmapInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkMemoryUnmapFlagBits, + AllVkMemoryUnmapFlagBits, pMemoryUnmapInfo->flags, kOptionalFlags, + "VUID-VkMemoryUnmapInfo-flags-parameter"); - skip |= ValidateRequiredHandle(pMemoryUnmapInfo_loc.dot(Field::memory), pMemoryUnmapInfo->memory); + skip |= state.ValidateRequiredHandle(pMemoryUnmapInfo_loc.dot(Field::memory), pMemoryUnmapInfo->memory); } return skip; } @@ -16559,27 +18646,30 @@ bool StatelessValidation::PreCallValidateCmdBindIndexBuffer2(VkCommandBuffer com VkDeviceSize size, VkIndexType indexType, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::indexType), vvl::Enum::VkIndexType, indexType, - "VUID-vkCmdBindIndexBuffer2-indexType-parameter", VK_NULL_HANDLE); - if (!skip) skip |= manual_PreCallValidateCmdBindIndexBuffer2(commandBuffer, buffer, offset, size, indexType, error_obj); + skip |= state.ValidateRangedEnum(loc.dot(Field::indexType), vvl::Enum::VkIndexType, indexType, + "VUID-vkCmdBindIndexBuffer2-indexType-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdBindIndexBuffer2(commandBuffer, buffer, offset, size, indexType, state); return skip; } bool StatelessValidation::PreCallValidateGetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pRenderingAreaInfo), pRenderingAreaInfo, VK_STRUCTURE_TYPE_RENDERING_AREA_INFO, true, - "VUID-vkGetRenderingAreaGranularity-pRenderingAreaInfo-parameter", - "VUID-VkRenderingAreaInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pRenderingAreaInfo), pRenderingAreaInfo, VK_STRUCTURE_TYPE_RENDERING_AREA_INFO, + true, "VUID-vkGetRenderingAreaGranularity-pRenderingAreaInfo-parameter", + "VUID-VkRenderingAreaInfo-sType-sType"); if (pRenderingAreaInfo != nullptr) { [[maybe_unused]] const Location pRenderingAreaInfo_loc = loc.dot(Field::pRenderingAreaInfo); - skip |= ValidateStructPnext(pRenderingAreaInfo_loc, pRenderingAreaInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkRenderingAreaInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pRenderingAreaInfo_loc, pRenderingAreaInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkRenderingAreaInfo-pNext-pNext", kVUIDUndefined, true); } - skip |= ValidateRequiredPointer(loc.dot(Field::pGranularity), pGranularity, - "VUID-vkGetRenderingAreaGranularity-pGranularity-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pGranularity), pGranularity, + "VUID-vkGetRenderingAreaGranularity-pGranularity-parameter"); return skip; } @@ -16587,17 +18677,19 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSubresourceLayout(VkDevic VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO, true, - "VUID-vkGetDeviceImageSubresourceLayout-pInfo-parameter", - "VUID-VkDeviceImageSubresourceInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO, true, + "VUID-vkGetDeviceImageSubresourceLayout-pInfo-parameter", + "VUID-VkDeviceImageSubresourceInfo-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceImageSubresourceInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceImageSubresourceInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateStructType(pInfo_loc.dot(Field::pCreateInfo), pInfo->pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, true, - "VUID-VkDeviceImageSubresourceInfo-pCreateInfo-parameter", "VUID-VkImageCreateInfo-sType-sType"); + skip |= state.ValidateStructType(pInfo_loc.dot(Field::pCreateInfo), pInfo->pCreateInfo, VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, + true, "VUID-VkDeviceImageSubresourceInfo-pCreateInfo-parameter", + "VUID-VkImageCreateInfo-sType-sType"); if (pInfo->pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = pInfo_loc.dot(Field::pCreateInfo); @@ -16622,71 +18714,69 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSubresourceLayout(VkDevic VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pCreateInfo_loc, pInfo->pCreateInfo->pNext, allowed_structs_VkImageCreateInfo.size(), - allowed_structs_VkImageCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pInfo->pCreateInfo->pNext, allowed_structs_VkImageCreateInfo.size(), + allowed_structs_VkImageCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", true); - skip |= - ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, - pInfo->pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, + AllVkImageCreateFlagBits, pInfo->pCreateInfo->flags, kOptionalFlags, + "VUID-VkImageCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, pInfo->pCreateInfo->imageType, - "VUID-VkImageCreateInfo-imageType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, + pInfo->pCreateInfo->imageType, "VUID-VkImageCreateInfo-imageType-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pInfo->pCreateInfo->format, - "VUID-VkImageCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pInfo->pCreateInfo->format, + "VUID-VkImageCreateInfo-format-parameter"); // No xml-driven validation - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, - AllVkSampleCountFlagBits, pInfo->pCreateInfo->samples, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, pInfo->pCreateInfo->samples, kRequiredSingleBit, + "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pInfo->pCreateInfo->tiling, - "VUID-VkImageCreateInfo-tiling-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, + pInfo->pCreateInfo->tiling, "VUID-VkImageCreateInfo-tiling-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, - AllVkImageUsageFlagBits, pInfo->pCreateInfo->usage, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pInfo->pCreateInfo->usage, kRequiredFlags, + "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); - skip |= - ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, - pInfo->pCreateInfo->sharingMode, "VUID-VkImageCreateInfo-sharingMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, + pInfo->pCreateInfo->sharingMode, "VUID-VkImageCreateInfo-sharingMode-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, - pInfo->pCreateInfo->initialLayout, "VUID-VkImageCreateInfo-initialLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, + pInfo->pCreateInfo->initialLayout, "VUID-VkImageCreateInfo-initialLayout-parameter"); } - skip |= - ValidateStructType(pInfo_loc.dot(Field::pSubresource), pInfo->pSubresource, VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2, true, - "VUID-VkDeviceImageSubresourceInfo-pSubresource-parameter", "VUID-VkImageSubresource2-sType-sType"); + skip |= state.ValidateStructType( + pInfo_loc.dot(Field::pSubresource), pInfo->pSubresource, VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2, true, + "VUID-VkDeviceImageSubresourceInfo-pSubresource-parameter", "VUID-VkImageSubresource2-sType-sType"); if (pInfo->pSubresource != nullptr) { [[maybe_unused]] const Location pSubresource_loc = pInfo_loc.dot(Field::pSubresource); - skip |= ValidateStructPnext(pSubresource_loc, pInfo->pSubresource->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageSubresource2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pSubresource_loc, pInfo->pSubresource->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageSubresource2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pSubresource_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pInfo->pSubresource->imageSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresource-aspectMask-parameter", - "VUID-VkImageSubresource-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pSubresource_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pInfo->pSubresource->imageSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresource-aspectMask-parameter", + "VUID-VkImageSubresource-aspectMask-requiredbitmask"); } } - skip |= ValidateStructType(loc.dot(Field::pLayout), pLayout, VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2, true, - "VUID-vkGetDeviceImageSubresourceLayout-pLayout-parameter", "VUID-VkSubresourceLayout2-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pLayout), pLayout, VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2, true, + "VUID-vkGetDeviceImageSubresourceLayout-pLayout-parameter", + "VUID-VkSubresourceLayout2-sType-sType"); if (pLayout != nullptr) { [[maybe_unused]] const Location pLayout_loc = loc.dot(Field::pLayout); constexpr std::array allowed_structs_VkSubresourceLayout2 = {VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT, VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE}; - skip |= ValidateStructPnext(pLayout_loc, pLayout->pNext, allowed_structs_VkSubresourceLayout2.size(), - allowed_structs_VkSubresourceLayout2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSubresourceLayout2-pNext-pNext", "VUID-VkSubresourceLayout2-sType-unique", - VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pLayout_loc, pLayout->pNext, allowed_structs_VkSubresourceLayout2.size(), + allowed_structs_VkSubresourceLayout2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSubresourceLayout2-pNext-pNext", "VUID-VkSubresourceLayout2-sType-unique", false); } - if (!skip) skip |= manual_PreCallValidateGetDeviceImageSubresourceLayout(device, pInfo, pLayout, error_obj); + if (!skip) skip |= manual_PreCallValidateGetDeviceImageSubresourceLayout(device, pInfo, pLayout, state); return skip; } @@ -16695,30 +18785,33 @@ bool StatelessValidation::PreCallValidateGetImageSubresourceLayout2(VkDevice dev VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidateStructType(loc.dot(Field::pSubresource), pSubresource, VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2, true, - "VUID-vkGetImageSubresourceLayout2-pSubresource-parameter", "VUID-VkImageSubresource2-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= state.ValidateStructType(loc.dot(Field::pSubresource), pSubresource, VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2, true, + "VUID-vkGetImageSubresourceLayout2-pSubresource-parameter", + "VUID-VkImageSubresource2-sType-sType"); if (pSubresource != nullptr) { [[maybe_unused]] const Location pSubresource_loc = loc.dot(Field::pSubresource); - skip |= ValidateStructPnext(pSubresource_loc, pSubresource->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageSubresource2-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSubresource_loc, pSubresource->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageSubresource2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pSubresource_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pSubresource->imageSubresource.aspectMask, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageSubresource-aspectMask-parameter", "VUID-VkImageSubresource-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pSubresource_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pSubresource->imageSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresource-aspectMask-parameter", + "VUID-VkImageSubresource-aspectMask-requiredbitmask"); } - skip |= ValidateStructType(loc.dot(Field::pLayout), pLayout, VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2, true, - "VUID-vkGetImageSubresourceLayout2-pLayout-parameter", "VUID-VkSubresourceLayout2-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pLayout), pLayout, VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2, true, + "VUID-vkGetImageSubresourceLayout2-pLayout-parameter", "VUID-VkSubresourceLayout2-sType-sType"); if (pLayout != nullptr) { [[maybe_unused]] const Location pLayout_loc = loc.dot(Field::pLayout); constexpr std::array allowed_structs_VkSubresourceLayout2 = {VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT, VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE}; - skip |= ValidateStructPnext(pLayout_loc, pLayout->pNext, allowed_structs_VkSubresourceLayout2.size(), - allowed_structs_VkSubresourceLayout2.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSubresourceLayout2-pNext-pNext", "VUID-VkSubresourceLayout2-sType-unique", - VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pLayout_loc, pLayout->pNext, allowed_structs_VkSubresourceLayout2.size(), + allowed_structs_VkSubresourceLayout2.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSubresourceLayout2-pNext-pNext", "VUID-VkSubresourceLayout2-sType-unique", false); } return skip; } @@ -16728,11 +18821,12 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSet(VkCommandBuffer co const VkWriteDescriptorSet* pDescriptorWrites, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, - "VUID-vkCmdPushDescriptorSet-pipelineBindPoint-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); - skip |= ValidateStructTypeArray( + skip |= state.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdPushDescriptorSet-pipelineBindPoint-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= state.ValidateStructTypeArray( loc.dot(Field::descriptorWriteCount), loc.dot(Field::pDescriptorWrites), descriptorWriteCount, pDescriptorWrites, VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, true, true, "VUID-VkWriteDescriptorSet-sType-sType", "VUID-vkCmdPushDescriptorSet-pDescriptorWrites-parameter", "VUID-vkCmdPushDescriptorSet-descriptorWriteCount-arraylength"); @@ -16744,24 +18838,24 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSet(VkCommandBuffer co VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV, VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK}; - skip |= ValidateStructPnext(pDescriptorWrites_loc, pDescriptorWrites[descriptorWriteIndex].pNext, - allowed_structs_VkWriteDescriptorSet.size(), allowed_structs_VkWriteDescriptorSet.data(), - GeneratedVulkanHeaderVersion, "VUID-VkWriteDescriptorSet-pNext-pNext", - "VUID-VkWriteDescriptorSet-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pDescriptorWrites_loc, pDescriptorWrites[descriptorWriteIndex].pNext, allowed_structs_VkWriteDescriptorSet.size(), + allowed_structs_VkWriteDescriptorSet.data(), GeneratedVulkanHeaderVersion, "VUID-VkWriteDescriptorSet-pNext-pNext", + "VUID-VkWriteDescriptorSet-sType-unique", true); - skip |= ValidateRangedEnum(pDescriptorWrites_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, - pDescriptorWrites[descriptorWriteIndex].descriptorType, - "VUID-VkWriteDescriptorSet-descriptorType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDescriptorWrites_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, + pDescriptorWrites[descriptorWriteIndex].descriptorType, + "VUID-VkWriteDescriptorSet-descriptorType-parameter"); - skip |= ValidateArray(pDescriptorWrites_loc.dot(Field::descriptorCount), loc, - pDescriptorWrites[descriptorWriteIndex].descriptorCount, - &pDescriptorWrites[descriptorWriteIndex].pImageInfo, true, false, - "VUID-VkWriteDescriptorSet-descriptorCount-arraylength", kVUIDUndefined); + skip |= state.ValidateArray(pDescriptorWrites_loc.dot(Field::descriptorCount), loc, + pDescriptorWrites[descriptorWriteIndex].descriptorCount, + &pDescriptorWrites[descriptorWriteIndex].pImageInfo, true, false, + "VUID-VkWriteDescriptorSet-descriptorCount-arraylength", kVUIDUndefined); } } if (!skip) skip |= manual_PreCallValidateCmdPushDescriptorSet(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, - pDescriptorWrites, error_obj); + pDescriptorWrites, state); return skip; } @@ -16770,9 +18864,10 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetWithTemplate(VkComm VkPipelineLayout layout, uint32_t set, const void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorUpdateTemplate), descriptorUpdateTemplate); - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= state.ValidateRequiredHandle(loc.dot(Field::descriptorUpdateTemplate), descriptorUpdateTemplate); + skip |= state.ValidateRequiredHandle(loc.dot(Field::layout), layout); return skip; } @@ -16780,10 +18875,11 @@ bool StatelessValidation::PreCallValidateCmdSetRenderingAttachmentLocations(VkCo const VkRenderingAttachmentLocationInfo* pLocationInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pLocationInfo), pLocationInfo, VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO, - true, "VUID-vkCmdSetRenderingAttachmentLocations-pLocationInfo-parameter", - "VUID-VkRenderingAttachmentLocationInfo-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pLocationInfo), pLocationInfo, VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO, true, + "VUID-vkCmdSetRenderingAttachmentLocations-pLocationInfo-parameter", "VUID-VkRenderingAttachmentLocationInfo-sType-sType"); return skip; } @@ -16791,11 +18887,12 @@ bool StatelessValidation::PreCallValidateCmdSetRenderingInputAttachmentIndices( VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pInputAttachmentIndexInfo), pInputAttachmentIndexInfo, - VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO, true, - "VUID-vkCmdSetRenderingInputAttachmentIndices-pInputAttachmentIndexInfo-parameter", - "VUID-VkRenderingInputAttachmentIndexInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInputAttachmentIndexInfo), pInputAttachmentIndexInfo, + VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO, true, + "VUID-vkCmdSetRenderingInputAttachmentIndices-pInputAttachmentIndexInfo-parameter", + "VUID-VkRenderingInputAttachmentIndexInfo-sType-sType"); return skip; } @@ -16803,30 +18900,31 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorSets2(VkCommandBuffer const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pBindDescriptorSetsInfo), pBindDescriptorSetsInfo, VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO, true, "VUID-vkCmdBindDescriptorSets2-pBindDescriptorSetsInfo-parameter", "VUID-VkBindDescriptorSetsInfo-sType-sType"); if (pBindDescriptorSetsInfo != nullptr) { [[maybe_unused]] const Location pBindDescriptorSetsInfo_loc = loc.dot(Field::pBindDescriptorSetsInfo); constexpr std::array allowed_structs_VkBindDescriptorSetsInfo = {VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pBindDescriptorSetsInfo_loc, pBindDescriptorSetsInfo->pNext, allowed_structs_VkBindDescriptorSetsInfo.size(), allowed_structs_VkBindDescriptorSetsInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkBindDescriptorSetsInfo-pNext-pNext", "VUID-VkBindDescriptorSetsInfo-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkBindDescriptorSetsInfo-pNext-pNext", "VUID-VkBindDescriptorSetsInfo-sType-unique", true); - skip |= ValidateFlags(pBindDescriptorSetsInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pBindDescriptorSetsInfo->stageFlags, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkBindDescriptorSetsInfo-stageFlags-parameter", - "VUID-VkBindDescriptorSetsInfo-stageFlags-requiredbitmask"); + skip |= state.ValidateFlags(pBindDescriptorSetsInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pBindDescriptorSetsInfo->stageFlags, kRequiredFlags, + "VUID-VkBindDescriptorSetsInfo-stageFlags-parameter", + "VUID-VkBindDescriptorSetsInfo-stageFlags-requiredbitmask"); - skip |= ValidateHandleArray(pBindDescriptorSetsInfo_loc.dot(Field::descriptorSetCount), - pBindDescriptorSetsInfo_loc.dot(Field::pDescriptorSets), - pBindDescriptorSetsInfo->descriptorSetCount, pBindDescriptorSetsInfo->pDescriptorSets, true, - true, "VUID-VkBindDescriptorSetsInfo-descriptorSetCount-arraylength"); + skip |= state.ValidateHandleArray(pBindDescriptorSetsInfo_loc.dot(Field::descriptorSetCount), + pBindDescriptorSetsInfo_loc.dot(Field::pDescriptorSets), + pBindDescriptorSetsInfo->descriptorSetCount, pBindDescriptorSetsInfo->pDescriptorSets, + true, true, "VUID-VkBindDescriptorSetsInfo-descriptorSetCount-arraylength"); } - if (!skip) skip |= manual_PreCallValidateCmdBindDescriptorSets2(commandBuffer, pBindDescriptorSetsInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdBindDescriptorSets2(commandBuffer, pBindDescriptorSetsInfo, state); return skip; } @@ -16834,28 +18932,30 @@ bool StatelessValidation::PreCallValidateCmdPushConstants2(VkCommandBuffer comma const VkPushConstantsInfo* pPushConstantsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pPushConstantsInfo), pPushConstantsInfo, VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO, true, - "VUID-vkCmdPushConstants2-pPushConstantsInfo-parameter", "VUID-VkPushConstantsInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pPushConstantsInfo), pPushConstantsInfo, VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO, + true, "VUID-vkCmdPushConstants2-pPushConstantsInfo-parameter", + "VUID-VkPushConstantsInfo-sType-sType"); if (pPushConstantsInfo != nullptr) { [[maybe_unused]] const Location pPushConstantsInfo_loc = loc.dot(Field::pPushConstantsInfo); constexpr std::array allowed_structs_VkPushConstantsInfo = {VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; - skip |= ValidateStructPnext(pPushConstantsInfo_loc, pPushConstantsInfo->pNext, allowed_structs_VkPushConstantsInfo.size(), - allowed_structs_VkPushConstantsInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPushConstantsInfo-pNext-pNext", "VUID-VkPushConstantsInfo-sType-unique", VK_NULL_HANDLE, - true); - skip |= - ValidateFlags(pPushConstantsInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pPushConstantsInfo->stageFlags, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkPushConstantsInfo-stageFlags-parameter", "VUID-VkPushConstantsInfo-stageFlags-requiredbitmask"); + state.ValidateStructPnext(pPushConstantsInfo_loc, pPushConstantsInfo->pNext, allowed_structs_VkPushConstantsInfo.size(), + allowed_structs_VkPushConstantsInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPushConstantsInfo-pNext-pNext", "VUID-VkPushConstantsInfo-sType-unique", true); - skip |= ValidateArray(pPushConstantsInfo_loc.dot(Field::size), pPushConstantsInfo_loc.dot(Field::pValues), - pPushConstantsInfo->size, &pPushConstantsInfo->pValues, true, true, - "VUID-VkPushConstantsInfo-size-arraylength", "VUID-VkPushConstantsInfo-pValues-parameter"); + skip |= state.ValidateFlags(pPushConstantsInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pPushConstantsInfo->stageFlags, kRequiredFlags, + "VUID-VkPushConstantsInfo-stageFlags-parameter", + "VUID-VkPushConstantsInfo-stageFlags-requiredbitmask"); + + skip |= state.ValidateArray(pPushConstantsInfo_loc.dot(Field::size), pPushConstantsInfo_loc.dot(Field::pValues), + pPushConstantsInfo->size, &pPushConstantsInfo->pValues, true, true, + "VUID-VkPushConstantsInfo-size-arraylength", "VUID-VkPushConstantsInfo-pValues-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdPushConstants2(commandBuffer, pPushConstantsInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdPushConstants2(commandBuffer, pPushConstantsInfo, state); return skip; } @@ -16863,30 +18963,31 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSet2(VkCommandBuffer c const VkPushDescriptorSetInfo* pPushDescriptorSetInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pPushDescriptorSetInfo), pPushDescriptorSetInfo, VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO, true, "VUID-vkCmdPushDescriptorSet2-pPushDescriptorSetInfo-parameter", "VUID-VkPushDescriptorSetInfo-sType-sType"); if (pPushDescriptorSetInfo != nullptr) { [[maybe_unused]] const Location pPushDescriptorSetInfo_loc = loc.dot(Field::pPushDescriptorSetInfo); constexpr std::array allowed_structs_VkPushDescriptorSetInfo = {VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; - skip |= ValidateStructPnext(pPushDescriptorSetInfo_loc, pPushDescriptorSetInfo->pNext, - allowed_structs_VkPushDescriptorSetInfo.size(), allowed_structs_VkPushDescriptorSetInfo.data(), - GeneratedVulkanHeaderVersion, "VUID-VkPushDescriptorSetInfo-pNext-pNext", - "VUID-VkPushDescriptorSetInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pPushDescriptorSetInfo_loc, pPushDescriptorSetInfo->pNext, allowed_structs_VkPushDescriptorSetInfo.size(), + allowed_structs_VkPushDescriptorSetInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPushDescriptorSetInfo-pNext-pNext", "VUID-VkPushDescriptorSetInfo-sType-unique", true); - skip |= ValidateFlags(pPushDescriptorSetInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pPushDescriptorSetInfo->stageFlags, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkPushDescriptorSetInfo-stageFlags-parameter", - "VUID-VkPushDescriptorSetInfo-stageFlags-requiredbitmask"); + skip |= state.ValidateFlags(pPushDescriptorSetInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pPushDescriptorSetInfo->stageFlags, kRequiredFlags, + "VUID-VkPushDescriptorSetInfo-stageFlags-parameter", + "VUID-VkPushDescriptorSetInfo-stageFlags-requiredbitmask"); - skip |= ValidateStructTypeArray(pPushDescriptorSetInfo_loc.dot(Field::descriptorWriteCount), - pPushDescriptorSetInfo_loc.dot(Field::pDescriptorWrites), - pPushDescriptorSetInfo->descriptorWriteCount, pPushDescriptorSetInfo->pDescriptorWrites, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, true, true, "VUID-VkWriteDescriptorSet-sType-sType", - "VUID-VkPushDescriptorSetInfo-pDescriptorWrites-parameter", - "VUID-VkPushDescriptorSetInfo-descriptorWriteCount-arraylength"); + skip |= state.ValidateStructTypeArray( + pPushDescriptorSetInfo_loc.dot(Field::descriptorWriteCount), pPushDescriptorSetInfo_loc.dot(Field::pDescriptorWrites), + pPushDescriptorSetInfo->descriptorWriteCount, pPushDescriptorSetInfo->pDescriptorWrites, + VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, true, true, "VUID-VkWriteDescriptorSet-sType-sType", + "VUID-VkPushDescriptorSetInfo-pDescriptorWrites-parameter", + "VUID-VkPushDescriptorSetInfo-descriptorWriteCount-arraylength"); if (pPushDescriptorSetInfo->pDescriptorWrites != nullptr) { for (uint32_t descriptorWriteIndex = 0; descriptorWriteIndex < pPushDescriptorSetInfo->descriptorWriteCount; @@ -16898,24 +18999,24 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSet2(VkCommandBuffer c VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV, VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pDescriptorWrites_loc, pPushDescriptorSetInfo->pDescriptorWrites[descriptorWriteIndex].pNext, allowed_structs_VkWriteDescriptorSet.size(), allowed_structs_VkWriteDescriptorSet.data(), GeneratedVulkanHeaderVersion, "VUID-VkWriteDescriptorSet-pNext-pNext", "VUID-VkWriteDescriptorSet-sType-unique", - VK_NULL_HANDLE, true); + true); - skip |= ValidateRangedEnum(pDescriptorWrites_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, - pPushDescriptorSetInfo->pDescriptorWrites[descriptorWriteIndex].descriptorType, - "VUID-VkWriteDescriptorSet-descriptorType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDescriptorWrites_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, + pPushDescriptorSetInfo->pDescriptorWrites[descriptorWriteIndex].descriptorType, + "VUID-VkWriteDescriptorSet-descriptorType-parameter"); - skip |= ValidateArray(pDescriptorWrites_loc.dot(Field::descriptorCount), loc, - pPushDescriptorSetInfo->pDescriptorWrites[descriptorWriteIndex].descriptorCount, - &pPushDescriptorSetInfo->pDescriptorWrites[descriptorWriteIndex].pImageInfo, true, false, - "VUID-VkWriteDescriptorSet-descriptorCount-arraylength", kVUIDUndefined); + skip |= state.ValidateArray(pDescriptorWrites_loc.dot(Field::descriptorCount), loc, + pPushDescriptorSetInfo->pDescriptorWrites[descriptorWriteIndex].descriptorCount, + &pPushDescriptorSetInfo->pDescriptorWrites[descriptorWriteIndex].pImageInfo, true, + false, "VUID-VkWriteDescriptorSet-descriptorCount-arraylength", kVUIDUndefined); } } } - if (!skip) skip |= manual_PreCallValidateCmdPushDescriptorSet2(commandBuffer, pPushDescriptorSetInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdPushDescriptorSet2(commandBuffer, pPushDescriptorSetInfo, state); return skip; } @@ -16923,79 +19024,80 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetWithTemplate2( VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pPushDescriptorSetWithTemplateInfo), pPushDescriptorSetWithTemplateInfo, - VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO, true, - "VUID-vkCmdPushDescriptorSetWithTemplate2-pPushDescriptorSetWithTemplateInfo-parameter", - "VUID-VkPushDescriptorSetWithTemplateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pPushDescriptorSetWithTemplateInfo), pPushDescriptorSetWithTemplateInfo, + VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO, true, + "VUID-vkCmdPushDescriptorSetWithTemplate2-pPushDescriptorSetWithTemplateInfo-parameter", + "VUID-VkPushDescriptorSetWithTemplateInfo-sType-sType"); if (pPushDescriptorSetWithTemplateInfo != nullptr) { [[maybe_unused]] const Location pPushDescriptorSetWithTemplateInfo_loc = loc.dot(Field::pPushDescriptorSetWithTemplateInfo); constexpr std::array allowed_structs_VkPushDescriptorSetWithTemplateInfo = {VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; - skip |= ValidateStructPnext(pPushDescriptorSetWithTemplateInfo_loc, pPushDescriptorSetWithTemplateInfo->pNext, - allowed_structs_VkPushDescriptorSetWithTemplateInfo.size(), - allowed_structs_VkPushDescriptorSetWithTemplateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPushDescriptorSetWithTemplateInfo-pNext-pNext", - "VUID-VkPushDescriptorSetWithTemplateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pPushDescriptorSetWithTemplateInfo_loc, pPushDescriptorSetWithTemplateInfo->pNext, + allowed_structs_VkPushDescriptorSetWithTemplateInfo.size(), + allowed_structs_VkPushDescriptorSetWithTemplateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPushDescriptorSetWithTemplateInfo-pNext-pNext", + "VUID-VkPushDescriptorSetWithTemplateInfo-sType-unique", true); - skip |= ValidateRequiredHandle(pPushDescriptorSetWithTemplateInfo_loc.dot(Field::descriptorUpdateTemplate), - pPushDescriptorSetWithTemplateInfo->descriptorUpdateTemplate); + skip |= state.ValidateRequiredHandle(pPushDescriptorSetWithTemplateInfo_loc.dot(Field::descriptorUpdateTemplate), + pPushDescriptorSetWithTemplateInfo->descriptorUpdateTemplate); - skip |= ValidateRequiredPointer(pPushDescriptorSetWithTemplateInfo_loc.dot(Field::pData), - pPushDescriptorSetWithTemplateInfo->pData, - "VUID-VkPushDescriptorSetWithTemplateInfo-pData-parameter"); + skip |= state.ValidateRequiredPointer(pPushDescriptorSetWithTemplateInfo_loc.dot(Field::pData), + pPushDescriptorSetWithTemplateInfo->pData, + "VUID-VkPushDescriptorSetWithTemplateInfo-pData-parameter"); } if (!skip) - skip |= - manual_PreCallValidateCmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo, error_obj); + skip |= manual_PreCallValidateCmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo, state); return skip; } bool StatelessValidation::PreCallValidateCopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pCopyMemoryToImageInfo), pCopyMemoryToImageInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO, true, "VUID-vkCopyMemoryToImage-pCopyMemoryToImageInfo-parameter", "VUID-VkCopyMemoryToImageInfo-sType-sType"); if (pCopyMemoryToImageInfo != nullptr) { [[maybe_unused]] const Location pCopyMemoryToImageInfo_loc = loc.dot(Field::pCopyMemoryToImageInfo); - skip |= - ValidateStructPnext(pCopyMemoryToImageInfo_loc, pCopyMemoryToImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMemoryToImageInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCopyMemoryToImageInfo_loc, pCopyMemoryToImageInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCopyMemoryToImageInfo-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateFlags(pCopyMemoryToImageInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkHostImageCopyFlagBits, - AllVkHostImageCopyFlagBits, pCopyMemoryToImageInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkCopyMemoryToImageInfo-flags-parameter"); + skip |= state.ValidateFlags(pCopyMemoryToImageInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkHostImageCopyFlagBits, + AllVkHostImageCopyFlagBits, pCopyMemoryToImageInfo->flags, kOptionalFlags, + "VUID-VkCopyMemoryToImageInfo-flags-parameter"); - skip |= ValidateRequiredHandle(pCopyMemoryToImageInfo_loc.dot(Field::dstImage), pCopyMemoryToImageInfo->dstImage); + skip |= state.ValidateRequiredHandle(pCopyMemoryToImageInfo_loc.dot(Field::dstImage), pCopyMemoryToImageInfo->dstImage); - skip |= ValidateRangedEnum(pCopyMemoryToImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, - pCopyMemoryToImageInfo->dstImageLayout, "VUID-VkCopyMemoryToImageInfo-dstImageLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCopyMemoryToImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, + pCopyMemoryToImageInfo->dstImageLayout, + "VUID-VkCopyMemoryToImageInfo-dstImageLayout-parameter"); - skip |= ValidateStructTypeArray(pCopyMemoryToImageInfo_loc.dot(Field::regionCount), - pCopyMemoryToImageInfo_loc.dot(Field::pRegions), pCopyMemoryToImageInfo->regionCount, - pCopyMemoryToImageInfo->pRegions, VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY, true, true, - "VUID-VkMemoryToImageCopy-sType-sType", "VUID-VkCopyMemoryToImageInfo-pRegions-parameter", - "VUID-VkCopyMemoryToImageInfo-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray( + pCopyMemoryToImageInfo_loc.dot(Field::regionCount), pCopyMemoryToImageInfo_loc.dot(Field::pRegions), + pCopyMemoryToImageInfo->regionCount, pCopyMemoryToImageInfo->pRegions, VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY, true, + true, "VUID-VkMemoryToImageCopy-sType-sType", "VUID-VkCopyMemoryToImageInfo-pRegions-parameter", + "VUID-VkCopyMemoryToImageInfo-regionCount-arraylength"); if (pCopyMemoryToImageInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pCopyMemoryToImageInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pCopyMemoryToImageInfo_loc.dot(Field::pRegions, regionIndex); - skip |= ValidateStructPnext(pRegions_loc, pCopyMemoryToImageInfo->pRegions[regionIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMemoryToImageCopy-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pRegions_loc, pCopyMemoryToImageInfo->pRegions[regionIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryToImageCopy-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pRegions_loc.dot(Field::pHostPointer), - pCopyMemoryToImageInfo->pRegions[regionIndex].pHostPointer, - "VUID-VkMemoryToImageCopy-pHostPointer-parameter"); + skip |= state.ValidateRequiredPointer(pRegions_loc.dot(Field::pHostPointer), + pCopyMemoryToImageInfo->pRegions[regionIndex].pHostPointer, + "VUID-VkMemoryToImageCopy-pHostPointer-parameter"); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, - pCopyMemoryToImageInfo->pRegions[regionIndex].imageSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pCopyMemoryToImageInfo->pRegions[regionIndex].imageSubresource.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -17009,48 +19111,49 @@ bool StatelessValidation::PreCallValidateCopyMemoryToImage(VkDevice device, cons bool StatelessValidation::PreCallValidateCopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pCopyImageToMemoryInfo), pCopyImageToMemoryInfo, VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO, true, "VUID-vkCopyImageToMemory-pCopyImageToMemoryInfo-parameter", "VUID-VkCopyImageToMemoryInfo-sType-sType"); if (pCopyImageToMemoryInfo != nullptr) { [[maybe_unused]] const Location pCopyImageToMemoryInfo_loc = loc.dot(Field::pCopyImageToMemoryInfo); - skip |= - ValidateStructPnext(pCopyImageToMemoryInfo_loc, pCopyImageToMemoryInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyImageToMemoryInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCopyImageToMemoryInfo_loc, pCopyImageToMemoryInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCopyImageToMemoryInfo-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateFlags(pCopyImageToMemoryInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkHostImageCopyFlagBits, - AllVkHostImageCopyFlagBits, pCopyImageToMemoryInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkCopyImageToMemoryInfo-flags-parameter"); + skip |= state.ValidateFlags(pCopyImageToMemoryInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkHostImageCopyFlagBits, + AllVkHostImageCopyFlagBits, pCopyImageToMemoryInfo->flags, kOptionalFlags, + "VUID-VkCopyImageToMemoryInfo-flags-parameter"); - skip |= ValidateRequiredHandle(pCopyImageToMemoryInfo_loc.dot(Field::srcImage), pCopyImageToMemoryInfo->srcImage); + skip |= state.ValidateRequiredHandle(pCopyImageToMemoryInfo_loc.dot(Field::srcImage), pCopyImageToMemoryInfo->srcImage); - skip |= ValidateRangedEnum(pCopyImageToMemoryInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, - pCopyImageToMemoryInfo->srcImageLayout, "VUID-VkCopyImageToMemoryInfo-srcImageLayout-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCopyImageToMemoryInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, + pCopyImageToMemoryInfo->srcImageLayout, + "VUID-VkCopyImageToMemoryInfo-srcImageLayout-parameter"); - skip |= ValidateStructTypeArray(pCopyImageToMemoryInfo_loc.dot(Field::regionCount), - pCopyImageToMemoryInfo_loc.dot(Field::pRegions), pCopyImageToMemoryInfo->regionCount, - pCopyImageToMemoryInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY, true, true, - "VUID-VkImageToMemoryCopy-sType-sType", "VUID-VkCopyImageToMemoryInfo-pRegions-parameter", - "VUID-VkCopyImageToMemoryInfo-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray( + pCopyImageToMemoryInfo_loc.dot(Field::regionCount), pCopyImageToMemoryInfo_loc.dot(Field::pRegions), + pCopyImageToMemoryInfo->regionCount, pCopyImageToMemoryInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY, true, + true, "VUID-VkImageToMemoryCopy-sType-sType", "VUID-VkCopyImageToMemoryInfo-pRegions-parameter", + "VUID-VkCopyImageToMemoryInfo-regionCount-arraylength"); if (pCopyImageToMemoryInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pCopyImageToMemoryInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pCopyImageToMemoryInfo_loc.dot(Field::pRegions, regionIndex); - skip |= ValidateStructPnext(pRegions_loc, pCopyImageToMemoryInfo->pRegions[regionIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkImageToMemoryCopy-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pRegions_loc, pCopyImageToMemoryInfo->pRegions[regionIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImageToMemoryCopy-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pRegions_loc.dot(Field::pHostPointer), - pCopyImageToMemoryInfo->pRegions[regionIndex].pHostPointer, - "VUID-VkImageToMemoryCopy-pHostPointer-parameter"); + skip |= state.ValidateRequiredPointer(pRegions_loc.dot(Field::pHostPointer), + pCopyImageToMemoryInfo->pRegions[regionIndex].pHostPointer, + "VUID-VkImageToMemoryCopy-pHostPointer-parameter"); - skip |= ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, - pCopyImageToMemoryInfo->pRegions[regionIndex].imageSubresource.aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pCopyImageToMemoryInfo->pRegions[regionIndex].imageSubresource.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -17064,58 +19167,59 @@ bool StatelessValidation::PreCallValidateCopyImageToMemory(VkDevice device, cons bool StatelessValidation::PreCallValidateCopyImageToImage(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pCopyImageToImageInfo), pCopyImageToImageInfo, VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO, true, "VUID-vkCopyImageToImage-pCopyImageToImageInfo-parameter", "VUID-VkCopyImageToImageInfo-sType-sType"); if (pCopyImageToImageInfo != nullptr) { [[maybe_unused]] const Location pCopyImageToImageInfo_loc = loc.dot(Field::pCopyImageToImageInfo); - skip |= - ValidateStructPnext(pCopyImageToImageInfo_loc, pCopyImageToImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyImageToImageInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCopyImageToImageInfo_loc, pCopyImageToImageInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCopyImageToImageInfo-pNext-pNext", kVUIDUndefined, + true); - skip |= ValidateFlags(pCopyImageToImageInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkHostImageCopyFlagBits, - AllVkHostImageCopyFlagBits, pCopyImageToImageInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkCopyImageToImageInfo-flags-parameter"); + skip |= state.ValidateFlags(pCopyImageToImageInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkHostImageCopyFlagBits, + AllVkHostImageCopyFlagBits, pCopyImageToImageInfo->flags, kOptionalFlags, + "VUID-VkCopyImageToImageInfo-flags-parameter"); - skip |= ValidateRequiredHandle(pCopyImageToImageInfo_loc.dot(Field::srcImage), pCopyImageToImageInfo->srcImage); + skip |= state.ValidateRequiredHandle(pCopyImageToImageInfo_loc.dot(Field::srcImage), pCopyImageToImageInfo->srcImage); - skip |= ValidateRangedEnum(pCopyImageToImageInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, - pCopyImageToImageInfo->srcImageLayout, "VUID-VkCopyImageToImageInfo-srcImageLayout-parameter", - VK_NULL_HANDLE); + skip |= + state.ValidateRangedEnum(pCopyImageToImageInfo_loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, + pCopyImageToImageInfo->srcImageLayout, "VUID-VkCopyImageToImageInfo-srcImageLayout-parameter"); - skip |= ValidateRequiredHandle(pCopyImageToImageInfo_loc.dot(Field::dstImage), pCopyImageToImageInfo->dstImage); + skip |= state.ValidateRequiredHandle(pCopyImageToImageInfo_loc.dot(Field::dstImage), pCopyImageToImageInfo->dstImage); - skip |= ValidateRangedEnum(pCopyImageToImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, - pCopyImageToImageInfo->dstImageLayout, "VUID-VkCopyImageToImageInfo-dstImageLayout-parameter", - VK_NULL_HANDLE); + skip |= + state.ValidateRangedEnum(pCopyImageToImageInfo_loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, + pCopyImageToImageInfo->dstImageLayout, "VUID-VkCopyImageToImageInfo-dstImageLayout-parameter"); - skip |= ValidateStructTypeArray(pCopyImageToImageInfo_loc.dot(Field::regionCount), - pCopyImageToImageInfo_loc.dot(Field::pRegions), pCopyImageToImageInfo->regionCount, - pCopyImageToImageInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_COPY_2, true, true, - "VUID-VkImageCopy2-sType-sType", "VUID-VkCopyImageToImageInfo-pRegions-parameter", - "VUID-VkCopyImageToImageInfo-regionCount-arraylength"); + skip |= state.ValidateStructTypeArray(pCopyImageToImageInfo_loc.dot(Field::regionCount), + pCopyImageToImageInfo_loc.dot(Field::pRegions), pCopyImageToImageInfo->regionCount, + pCopyImageToImageInfo->pRegions, VK_STRUCTURE_TYPE_IMAGE_COPY_2, true, true, + "VUID-VkImageCopy2-sType-sType", "VUID-VkCopyImageToImageInfo-pRegions-parameter", + "VUID-VkCopyImageToImageInfo-regionCount-arraylength"); if (pCopyImageToImageInfo->pRegions != nullptr) { for (uint32_t regionIndex = 0; regionIndex < pCopyImageToImageInfo->regionCount; ++regionIndex) { [[maybe_unused]] const Location pRegions_loc = pCopyImageToImageInfo_loc.dot(Field::pRegions, regionIndex); - skip |= ValidateStructPnext(pRegions_loc, pCopyImageToImageInfo->pRegions[regionIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkImageCopy2-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); - skip |= - ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pCopyImageToImageInfo->pRegions[regionIndex].srcSubresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + state.ValidateStructPnext(pRegions_loc, pCopyImageToImageInfo->pRegions[regionIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImageCopy2-pNext-pNext", kVUIDUndefined, true); + + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pCopyImageToImageInfo->pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation - skip |= - ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pCopyImageToImageInfo->pRegions[regionIndex].dstSubresource.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pCopyImageToImageInfo->pRegions[regionIndex].dstSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); // No xml-driven validation @@ -17130,32 +19234,33 @@ bool StatelessValidation::PreCallValidateTransitionImageLayout(VkDevice device, const VkHostImageLayoutTransitionInfo* pTransitions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::transitionCount), loc.dot(Field::pTransitions), transitionCount, pTransitions, VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO, true, true, "VUID-VkHostImageLayoutTransitionInfo-sType-sType", "VUID-vkTransitionImageLayout-pTransitions-parameter", "VUID-vkTransitionImageLayout-transitionCount-arraylength"); if (pTransitions != nullptr) { for (uint32_t transitionIndex = 0; transitionIndex < transitionCount; ++transitionIndex) { [[maybe_unused]] const Location pTransitions_loc = loc.dot(Field::pTransitions, transitionIndex); - skip |= - ValidateStructPnext(pTransitions_loc, pTransitions[transitionIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkHostImageLayoutTransitionInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pTransitions_loc, pTransitions[transitionIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkHostImageLayoutTransitionInfo-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pTransitions_loc.dot(Field::image), pTransitions[transitionIndex].image); + skip |= state.ValidateRequiredHandle(pTransitions_loc.dot(Field::image), pTransitions[transitionIndex].image); - skip |= ValidateRangedEnum(pTransitions_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, - pTransitions[transitionIndex].oldLayout, - "VUID-VkHostImageLayoutTransitionInfo-oldLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pTransitions_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pTransitions[transitionIndex].oldLayout, + "VUID-VkHostImageLayoutTransitionInfo-oldLayout-parameter"); - skip |= ValidateRangedEnum(pTransitions_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pTransitions[transitionIndex].newLayout, - "VUID-VkHostImageLayoutTransitionInfo-newLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pTransitions_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pTransitions[transitionIndex].newLayout, + "VUID-VkHostImageLayoutTransitionInfo-newLayout-parameter"); - skip |= ValidateFlags(pTransitions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pTransitions[transitionIndex].subresourceRange.aspectMask, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkImageSubresourceRange-aspectMask-parameter", - "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pTransitions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pTransitions[transitionIndex].subresourceRange.aspectMask, + kRequiredFlags, "VUID-VkImageSubresourceRange-aspectMask-parameter", + "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } return skip; @@ -17165,11 +19270,12 @@ bool StatelessValidation::PreCallValidateDestroySurfaceKHR(VkInstance instance, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -17179,11 +19285,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceSupportKHR(VkPh VkBool32* pSupported, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); - skip |= ValidateRequiredHandle(loc.dot(Field::surface), surface); - skip |= ValidateRequiredPointer(loc.dot(Field::pSupported), pSupported, - "VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSupported), pSupported, + "VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter"); return skip; } @@ -17192,11 +19301,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceCapabilitiesKHR VkSurfaceCapabilitiesKHR* pSurfaceCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); - skip |= ValidateRequiredHandle(loc.dot(Field::surface), surface); - skip |= ValidateRequiredPointer(loc.dot(Field::pSurfaceCapabilities), pSurfaceCapabilities, - "VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurfaceCapabilities), pSurfaceCapabilities, + "VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter"); return skip; } @@ -17205,12 +19317,15 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPh VkSurfaceFormatKHR* pSurfaceFormats, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); - skip |= ValidatePointerArray(loc.dot(Field::pSurfaceFormatCount), loc.dot(Field::pSurfaceFormats), pSurfaceFormatCount, - &pSurfaceFormats, true, false, false, - "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter", kVUIDUndefined, - "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pSurfaceFormatCount), loc.dot(Field::pSurfaceFormats), pSurfaceFormatCount, + &pSurfaceFormats, true, false, false, + "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormatCount-parameter", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-pSurfaceFormats-parameter"); if (pSurfaceFormats != nullptr) { for (uint32_t pSurfaceFormatIndex = 0; pSurfaceFormatIndex < *pSurfaceFormatCount; ++pSurfaceFormatIndex) { [[maybe_unused]] const Location pSurfaceFormats_loc = loc.dot(Field::pSurfaceFormats, pSurfaceFormatIndex); @@ -17219,7 +19334,7 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPh } if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, - pSurfaceFormats, error_obj); + pSurfaceFormats, state); return skip; } @@ -17228,15 +19343,18 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR VkPresentModeKHR* pPresentModes, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); - skip |= - ValidatePointerArray(loc.dot(Field::pPresentModeCount), loc.dot(Field::pPresentModes), pPresentModeCount, &pPresentModes, - true, false, false, "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter", - kVUIDUndefined, "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pPresentModeCount), loc.dot(Field::pPresentModes), pPresentModeCount, + &pPresentModes, true, false, false, + "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModeCount-parameter", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-pPresentModes-parameter"); if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR(physicalDevice, surface, pPresentModeCount, - pPresentModes, error_obj); + pPresentModes, state); return skip; } @@ -17244,10 +19362,12 @@ bool StatelessValidation::PreCallValidateCreateSwapchainKHR(VkDevice device, con const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, true, - "VUID-vkCreateSwapchainKHR-pCreateInfo-parameter", "VUID-VkSwapchainCreateInfoKHR-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, true, + "VUID-vkCreateSwapchainKHR-pCreateInfo-parameter", "VUID-VkSwapchainCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkSwapchainCreateInfoKHR = { @@ -17263,56 +19383,54 @@ bool StatelessValidation::PreCallValidateCreateSwapchainKHR(VkDevice device, con VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkSwapchainCreateInfoKHR.size(), - allowed_structs_VkSwapchainCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSwapchainCreateInfoKHR-pNext-pNext", "VUID-VkSwapchainCreateInfoKHR-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkSwapchainCreateInfoKHR.size(), + allowed_structs_VkSwapchainCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSwapchainCreateInfoKHR-pNext-pNext", "VUID-VkSwapchainCreateInfoKHR-sType-unique", + true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSwapchainCreateFlagBitsKHR, - AllVkSwapchainCreateFlagBitsKHR, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkSwapchainCreateInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSwapchainCreateFlagBitsKHR, + AllVkSwapchainCreateFlagBitsKHR, pCreateInfo->flags, kOptionalFlags, + "VUID-VkSwapchainCreateInfoKHR-flags-parameter"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::surface), pCreateInfo->surface); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::surface), pCreateInfo->surface); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageFormat), vvl::Enum::VkFormat, pCreateInfo->imageFormat, - "VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageFormat), vvl::Enum::VkFormat, pCreateInfo->imageFormat, + "VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageColorSpace), vvl::Enum::VkColorSpaceKHR, - pCreateInfo->imageColorSpace, "VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageColorSpace), vvl::Enum::VkColorSpaceKHR, + pCreateInfo->imageColorSpace, "VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter"); // No xml-driven validation - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::imageUsage), vvl::FlagBitmask::VkImageUsageFlagBits, - AllVkImageUsageFlagBits, pCreateInfo->imageUsage, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter", - "VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::imageUsage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pCreateInfo->imageUsage, kRequiredFlags, + "VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter", + "VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageSharingMode), vvl::Enum::VkSharingMode, - pCreateInfo->imageSharingMode, "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageSharingMode), vvl::Enum::VkSharingMode, + pCreateInfo->imageSharingMode, "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::preTransform), vvl::FlagBitmask::VkSurfaceTransformFlagBitsKHR, - AllVkSurfaceTransformFlagBitsKHR, pCreateInfo->preTransform, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter", - "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::preTransform), vvl::FlagBitmask::VkSurfaceTransformFlagBitsKHR, + AllVkSurfaceTransformFlagBitsKHR, pCreateInfo->preTransform, kRequiredSingleBit, + "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter", + "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::compositeAlpha), vvl::FlagBitmask::VkCompositeAlphaFlagBitsKHR, - AllVkCompositeAlphaFlagBitsKHR, pCreateInfo->compositeAlpha, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter", - "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::compositeAlpha), vvl::FlagBitmask::VkCompositeAlphaFlagBitsKHR, + AllVkCompositeAlphaFlagBitsKHR, pCreateInfo->compositeAlpha, kRequiredSingleBit, + "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter", + "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::presentMode), vvl::Enum::VkPresentModeKHR, pCreateInfo->presentMode, - "VUID-VkSwapchainCreateInfoKHR-presentMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::presentMode), vvl::Enum::VkPresentModeKHR, + pCreateInfo->presentMode, "VUID-VkSwapchainCreateInfoKHR-presentMode-parameter"); - skip |= ValidateBool32(pCreateInfo_loc.dot(Field::clipped), pCreateInfo->clipped); + skip |= state.ValidateBool32(pCreateInfo_loc.dot(Field::clipped), pCreateInfo->clipped); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSwapchain), pSwapchain, "VUID-vkCreateSwapchainKHR-pSwapchain-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSwapchain), pSwapchain, "VUID-vkCreateSwapchainKHR-pSwapchain-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain, state); return skip; } @@ -17320,11 +19438,12 @@ bool StatelessValidation::PreCallValidateDestroySwapchainKHR(VkDevice device, Vk const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -17333,13 +19452,14 @@ bool StatelessValidation::PreCallValidateGetSwapchainImagesKHR(VkDevice device, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= - ValidatePointerArray(loc.dot(Field::pSwapchainImageCount), loc.dot(Field::pSwapchainImages), pSwapchainImageCount, - &pSwapchainImages, true, false, false, "VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter", - kVUIDUndefined, "VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidatePointerArray(loc.dot(Field::pSwapchainImageCount), loc.dot(Field::pSwapchainImages), pSwapchainImageCount, + &pSwapchainImages, true, false, false, + "VUID-vkGetSwapchainImagesKHR-pSwapchainImageCount-parameter", kVUIDUndefined, + "VUID-vkGetSwapchainImagesKHR-pSwapchainImages-parameter"); return skip; } @@ -17347,22 +19467,24 @@ bool StatelessValidation::PreCallValidateAcquireNextImageKHR(VkDevice device, Vk VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= ValidateRequiredPointer(loc.dot(Field::pImageIndex), pImageIndex, "VUID-vkAcquireNextImageKHR-pImageIndex-parameter"); - if (!skip) - skip |= manual_PreCallValidateAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::pImageIndex), pImageIndex, "VUID-vkAcquireNextImageKHR-pImageIndex-parameter"); + if (!skip) skip |= manual_PreCallValidateAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex, state); return skip; } bool StatelessValidation::PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); - skip |= ValidateStructType(loc.dot(Field::pPresentInfo), pPresentInfo, VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, true, - "VUID-vkQueuePresentKHR-pPresentInfo-parameter", "VUID-VkPresentInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pPresentInfo), pPresentInfo, VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, true, + "VUID-vkQueuePresentKHR-pPresentInfo-parameter", "VUID-VkPresentInfoKHR-sType-sType"); if (pPresentInfo != nullptr) { [[maybe_unused]] const Location pPresentInfo_loc = loc.dot(Field::pPresentInfo); constexpr std::array allowed_structs_VkPresentInfoKHR = {VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR, @@ -17375,46 +19497,47 @@ bool StatelessValidation::PreCallValidateQueuePresentKHR(VkQueue queue, const Vk VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT, VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT}; - skip |= - ValidateStructPnext(pPresentInfo_loc, pPresentInfo->pNext, allowed_structs_VkPresentInfoKHR.size(), - allowed_structs_VkPresentInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPresentInfoKHR-pNext-pNext", "VUID-VkPresentInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pPresentInfo_loc, pPresentInfo->pNext, allowed_structs_VkPresentInfoKHR.size(), + allowed_structs_VkPresentInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPresentInfoKHR-pNext-pNext", "VUID-VkPresentInfoKHR-sType-unique", true); - skip |= ValidateArray(pPresentInfo_loc.dot(Field::waitSemaphoreCount), pPresentInfo_loc.dot(Field::pWaitSemaphores), - pPresentInfo->waitSemaphoreCount, &pPresentInfo->pWaitSemaphores, false, true, kVUIDUndefined, - "VUID-VkPresentInfoKHR-pWaitSemaphores-parameter"); + skip |= state.ValidateArray(pPresentInfo_loc.dot(Field::waitSemaphoreCount), pPresentInfo_loc.dot(Field::pWaitSemaphores), + pPresentInfo->waitSemaphoreCount, &pPresentInfo->pWaitSemaphores, false, true, kVUIDUndefined, + "VUID-VkPresentInfoKHR-pWaitSemaphores-parameter"); - skip |= ValidateHandleArray(pPresentInfo_loc.dot(Field::swapchainCount), pPresentInfo_loc.dot(Field::pSwapchains), - pPresentInfo->swapchainCount, pPresentInfo->pSwapchains, true, true, - "VUID-VkPresentInfoKHR-swapchainCount-arraylength"); + skip |= state.ValidateHandleArray(pPresentInfo_loc.dot(Field::swapchainCount), pPresentInfo_loc.dot(Field::pSwapchains), + pPresentInfo->swapchainCount, pPresentInfo->pSwapchains, true, true, + "VUID-VkPresentInfoKHR-swapchainCount-arraylength"); - skip |= ValidateArray(pPresentInfo_loc.dot(Field::swapchainCount), pPresentInfo_loc.dot(Field::pImageIndices), - pPresentInfo->swapchainCount, &pPresentInfo->pImageIndices, true, true, - "VUID-VkPresentInfoKHR-swapchainCount-arraylength", "VUID-VkPresentInfoKHR-pImageIndices-parameter"); + skip |= state.ValidateArray(pPresentInfo_loc.dot(Field::swapchainCount), pPresentInfo_loc.dot(Field::pImageIndices), + pPresentInfo->swapchainCount, &pPresentInfo->pImageIndices, true, true, + "VUID-VkPresentInfoKHR-swapchainCount-arraylength", + "VUID-VkPresentInfoKHR-pImageIndices-parameter"); - skip |= ValidateArray(pPresentInfo_loc.dot(Field::swapchainCount), pPresentInfo_loc.dot(Field::pResults), - pPresentInfo->swapchainCount, &pPresentInfo->pResults, true, false, - "VUID-VkPresentInfoKHR-swapchainCount-arraylength", "VUID-VkPresentInfoKHR-pResults-parameter"); + skip |= state.ValidateArray(pPresentInfo_loc.dot(Field::swapchainCount), pPresentInfo_loc.dot(Field::pResults), + pPresentInfo->swapchainCount, &pPresentInfo->pResults, true, false, + "VUID-VkPresentInfoKHR-swapchainCount-arraylength", "VUID-VkPresentInfoKHR-pResults-parameter"); } - if (!skip) skip |= manual_PreCallValidateQueuePresentKHR(queue, pPresentInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateQueuePresentKHR(queue, pPresentInfo, state); return skip; } bool StatelessValidation::PreCallValidateGetDeviceGroupPresentCapabilitiesKHR( VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_khr_swapchain) || IsExtEnabled(device_extensions.vk_khr_device_group))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain, vvl::Extension::_VK_KHR_device_group}); - skip |= ValidateStructType(loc.dot(Field::pDeviceGroupPresentCapabilities), pDeviceGroupPresentCapabilities, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR, true, - "VUID-vkGetDeviceGroupPresentCapabilitiesKHR-pDeviceGroupPresentCapabilities-parameter", - "VUID-VkDeviceGroupPresentCapabilitiesKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pDeviceGroupPresentCapabilities), pDeviceGroupPresentCapabilities, + VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR, true, + "VUID-vkGetDeviceGroupPresentCapabilitiesKHR-pDeviceGroupPresentCapabilities-parameter", + "VUID-VkDeviceGroupPresentCapabilitiesKHR-sType-sType"); if (pDeviceGroupPresentCapabilities != nullptr) { [[maybe_unused]] const Location pDeviceGroupPresentCapabilities_loc = loc.dot(Field::pDeviceGroupPresentCapabilities); - skip |= ValidateStructPnext(pDeviceGroupPresentCapabilities_loc, pDeviceGroupPresentCapabilities->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkDeviceGroupPresentCapabilitiesKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pDeviceGroupPresentCapabilities_loc, pDeviceGroupPresentCapabilities->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkDeviceGroupPresentCapabilitiesKHR-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -17423,11 +19546,13 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupSurfacePresentModesKHR(Vk VkDeviceGroupPresentModeFlagsKHR* pModes, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_khr_swapchain) || IsExtEnabled(device_extensions.vk_khr_device_group))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain, vvl::Extension::_VK_KHR_device_group}); - skip |= ValidateRequiredHandle(loc.dot(Field::surface), surface); - skip |= ValidateRequiredPointer(loc.dot(Field::pModes), pModes, "VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pModes), pModes, + "VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter"); return skip; } @@ -17436,31 +19561,37 @@ bool StatelessValidation::PreCallValidateGetPhysicalDevicePresentRectanglesKHR(V VkRect2D* pRects, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::surface), surface); - skip |= ValidatePointerArray(loc.dot(Field::pRectCount), loc.dot(Field::pRects), pRectCount, &pRects, true, false, false, - "VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRectCount-parameter", kVUIDUndefined, - "VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRects-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= state.ValidatePointerArray(loc.dot(Field::pRectCount), loc.dot(Field::pRects), pRectCount, &pRects, true, false, false, + "VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRectCount-parameter", kVUIDUndefined, + "VUID-vkGetPhysicalDevicePresentRectanglesKHR-pRects-parameter"); return skip; } bool StatelessValidation::PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_khr_swapchain) || IsExtEnabled(device_extensions.vk_khr_device_group))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain, vvl::Extension::_VK_KHR_device_group}); - skip |= ValidateStructType(loc.dot(Field::pAcquireInfo), pAcquireInfo, VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR, true, - "VUID-vkAcquireNextImage2KHR-pAcquireInfo-parameter", "VUID-VkAcquireNextImageInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pAcquireInfo), pAcquireInfo, VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR, + true, "VUID-vkAcquireNextImage2KHR-pAcquireInfo-parameter", + "VUID-VkAcquireNextImageInfoKHR-sType-sType"); if (pAcquireInfo != nullptr) { [[maybe_unused]] const Location pAcquireInfo_loc = loc.dot(Field::pAcquireInfo); - skip |= ValidateStructPnext(pAcquireInfo_loc, pAcquireInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAcquireNextImageInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pAcquireInfo_loc, pAcquireInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAcquireNextImageInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pAcquireInfo_loc.dot(Field::swapchain), pAcquireInfo->swapchain); + skip |= state.ValidateRequiredHandle(pAcquireInfo_loc.dot(Field::swapchain), pAcquireInfo->swapchain); } - skip |= ValidateRequiredPointer(loc.dot(Field::pImageIndex), pImageIndex, "VUID-vkAcquireNextImage2KHR-pImageIndex-parameter"); - if (!skip) skip |= manual_PreCallValidateAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pImageIndex), pImageIndex, + "VUID-vkAcquireNextImage2KHR-pImageIndex-parameter"); + if (!skip) skip |= manual_PreCallValidateAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex, state); return skip; } @@ -17469,11 +19600,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDisplayPropertiesKHR(V VkDisplayPropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); - skip |= ValidatePointerArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, &pProperties, true, - false, false, "VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter", - kVUIDUndefined, "VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, &pProperties, + true, false, false, "VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pPropertyCount-parameter", + kVUIDUndefined, "VUID-vkGetPhysicalDeviceDisplayPropertiesKHR-pProperties-parameter"); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); @@ -17488,11 +19622,15 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDisplayPlaneProperties VkDisplayPlanePropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); - skip |= ValidatePointerArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, &pProperties, true, - false, false, "VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter", - kVUIDUndefined, "VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter"); + skip |= + state.ValidatePointerArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, &pProperties, true, + false, false, "VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pPropertyCount-parameter", + kVUIDUndefined, "VUID-vkGetPhysicalDeviceDisplayPlanePropertiesKHR-pProperties-parameter"); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); @@ -17506,11 +19644,14 @@ bool StatelessValidation::PreCallValidateGetDisplayPlaneSupportedDisplaysKHR(VkP uint32_t* pDisplayCount, VkDisplayKHR* pDisplays, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); - skip |= ValidatePointerArray(loc.dot(Field::pDisplayCount), loc.dot(Field::pDisplays), pDisplayCount, &pDisplays, true, false, - false, "VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter", kVUIDUndefined, - "VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pDisplayCount), loc.dot(Field::pDisplays), pDisplayCount, &pDisplays, true, + false, false, "VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplayCount-parameter", + kVUIDUndefined, "VUID-vkGetDisplayPlaneSupportedDisplaysKHR-pDisplays-parameter"); return skip; } @@ -17519,12 +19660,15 @@ bool StatelessValidation::PreCallValidateGetDisplayModePropertiesKHR(VkPhysicalD VkDisplayModePropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); - skip |= ValidatePointerArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, &pProperties, true, - false, false, "VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter", kVUIDUndefined, - "VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidatePointerArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, &pProperties, + true, false, false, "VUID-vkGetDisplayModePropertiesKHR-pPropertyCount-parameter", + kVUIDUndefined, "VUID-vkGetDisplayModePropertiesKHR-pProperties-parameter"); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); @@ -17539,28 +19683,31 @@ bool StatelessValidation::PreCallValidateCreateDisplayModeKHR(VkPhysicalDevice p const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR, true, - "VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter", "VUID-VkDisplayModeCreateInfoKHR-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR, true, + "VUID-vkCreateDisplayModeKHR-pCreateInfo-parameter", + "VUID-VkDisplayModeCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDisplayModeCreateInfoKHR-pNext-pNext", kVUIDUndefined, physicalDevice, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDisplayModeCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkDisplayModeCreateInfoKHR-flags-zerobitmask"); // No xml-driven validation } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pMode), pMode, "VUID-vkCreateDisplayModeKHR-pMode-parameter"); - if (!skip) - skip |= manual_PreCallValidateCreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMode), pMode, "VUID-vkCreateDisplayModeKHR-pMode-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode, state); return skip; } @@ -17569,11 +19716,14 @@ bool StatelessValidation::PreCallValidateGetDisplayPlaneCapabilitiesKHR(VkPhysic VkDisplayPlaneCapabilitiesKHR* pCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); - skip |= ValidateRequiredHandle(loc.dot(Field::mode), mode); - skip |= ValidateRequiredPointer(loc.dot(Field::pCapabilities), pCapabilities, - "VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::mode), mode); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCapabilities), pCapabilities, + "VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter"); return skip; } @@ -17582,43 +19732,45 @@ bool StatelessValidation::PreCallValidateCreateDisplayPlaneSurfaceKHR(VkInstance const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR, true, - "VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter", - "VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR, + true, "VUID-vkCreateDisplayPlaneSurfaceKHR-pCreateInfo-parameter", + "VUID-VkDisplaySurfaceCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkDisplaySurfaceCreateInfoKHR = { VK_STRUCTURE_TYPE_DISPLAY_SURFACE_STEREO_CREATE_INFO_NV}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDisplaySurfaceCreateInfoKHR.size(), - allowed_structs_VkDisplaySurfaceCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext", - "VUID-VkDisplaySurfaceCreateInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkDisplaySurfaceCreateInfoKHR.size(), + allowed_structs_VkDisplaySurfaceCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDisplaySurfaceCreateInfoKHR-pNext-pNext", + "VUID-VkDisplaySurfaceCreateInfoKHR-sType-unique", true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::displayMode), pCreateInfo->displayMode); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::displayMode), pCreateInfo->displayMode); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::transform), vvl::FlagBitmask::VkSurfaceTransformFlagBitsKHR, - AllVkSurfaceTransformFlagBitsKHR, pCreateInfo->transform, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter", - "VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::transform), vvl::FlagBitmask::VkSurfaceTransformFlagBitsKHR, + AllVkSurfaceTransformFlagBitsKHR, pCreateInfo->transform, kRequiredSingleBit, + "VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter", + "VUID-VkDisplaySurfaceCreateInfoKHR-transform-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::alphaMode), vvl::FlagBitmask::VkDisplayPlaneAlphaFlagBitsKHR, - AllVkDisplayPlaneAlphaFlagBitsKHR, pCreateInfo->alphaMode, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter", - "VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::alphaMode), vvl::FlagBitmask::VkDisplayPlaneAlphaFlagBitsKHR, + AllVkDisplayPlaneAlphaFlagBitsKHR, pCreateInfo->alphaMode, kRequiredSingleBit, + "VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter", + "VUID-VkDisplaySurfaceCreateInfoKHR-alphaMode-parameter"); // No xml-driven validation } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter"); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter"); return skip; } @@ -17628,10 +19780,11 @@ bool StatelessValidation::PreCallValidateCreateSharedSwapchainsKHR(VkDevice devi VkSwapchainKHR* pSwapchains, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_display_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display_swapchain}); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::swapchainCount), loc.dot(Field::pCreateInfos), swapchainCount, pCreateInfos, VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, true, true, "VUID-VkSwapchainCreateInfoKHR-sType-sType", "VUID-vkCreateSharedSwapchainsKHR-pCreateInfos-parameter", "VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength"); @@ -17651,63 +19804,63 @@ bool StatelessValidation::PreCallValidateCreateSharedSwapchainsKHR(VkDevice devi VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pCreateInfos_loc, pCreateInfos[swapchainIndex].pNext, allowed_structs_VkSwapchainCreateInfoKHR.size(), allowed_structs_VkSwapchainCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSwapchainCreateInfoKHR-pNext-pNext", "VUID-VkSwapchainCreateInfoKHR-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkSwapchainCreateInfoKHR-pNext-pNext", "VUID-VkSwapchainCreateInfoKHR-sType-unique", true); - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkSwapchainCreateFlagBitsKHR, - AllVkSwapchainCreateFlagBitsKHR, pCreateInfos[swapchainIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkSwapchainCreateInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkSwapchainCreateFlagBitsKHR, + AllVkSwapchainCreateFlagBitsKHR, pCreateInfos[swapchainIndex].flags, kOptionalFlags, + "VUID-VkSwapchainCreateInfoKHR-flags-parameter"); - skip |= ValidateRequiredHandle(pCreateInfos_loc.dot(Field::surface), pCreateInfos[swapchainIndex].surface); + skip |= state.ValidateRequiredHandle(pCreateInfos_loc.dot(Field::surface), pCreateInfos[swapchainIndex].surface); - skip |= ValidateRangedEnum(pCreateInfos_loc.dot(Field::imageFormat), vvl::Enum::VkFormat, - pCreateInfos[swapchainIndex].imageFormat, - "VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfos_loc.dot(Field::imageFormat), vvl::Enum::VkFormat, + pCreateInfos[swapchainIndex].imageFormat, + "VUID-VkSwapchainCreateInfoKHR-imageFormat-parameter"); - skip |= ValidateRangedEnum(pCreateInfos_loc.dot(Field::imageColorSpace), vvl::Enum::VkColorSpaceKHR, - pCreateInfos[swapchainIndex].imageColorSpace, - "VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfos_loc.dot(Field::imageColorSpace), vvl::Enum::VkColorSpaceKHR, + pCreateInfos[swapchainIndex].imageColorSpace, + "VUID-VkSwapchainCreateInfoKHR-imageColorSpace-parameter"); // No xml-driven validation - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::imageUsage), vvl::FlagBitmask::VkImageUsageFlagBits, - AllVkImageUsageFlagBits, pCreateInfos[swapchainIndex].imageUsage, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter", - "VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::imageUsage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pCreateInfos[swapchainIndex].imageUsage, kRequiredFlags, + "VUID-VkSwapchainCreateInfoKHR-imageUsage-parameter", + "VUID-VkSwapchainCreateInfoKHR-imageUsage-requiredbitmask"); - skip |= ValidateRangedEnum(pCreateInfos_loc.dot(Field::imageSharingMode), vvl::Enum::VkSharingMode, - pCreateInfos[swapchainIndex].imageSharingMode, - "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfos_loc.dot(Field::imageSharingMode), vvl::Enum::VkSharingMode, + pCreateInfos[swapchainIndex].imageSharingMode, + "VUID-VkSwapchainCreateInfoKHR-imageSharingMode-parameter"); - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::preTransform), vvl::FlagBitmask::VkSurfaceTransformFlagBitsKHR, - AllVkSurfaceTransformFlagBitsKHR, pCreateInfos[swapchainIndex].preTransform, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter", - "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::preTransform), vvl::FlagBitmask::VkSurfaceTransformFlagBitsKHR, + AllVkSurfaceTransformFlagBitsKHR, pCreateInfos[swapchainIndex].preTransform, + kRequiredSingleBit, "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter", + "VUID-VkSwapchainCreateInfoKHR-preTransform-parameter"); - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::compositeAlpha), vvl::FlagBitmask::VkCompositeAlphaFlagBitsKHR, - AllVkCompositeAlphaFlagBitsKHR, pCreateInfos[swapchainIndex].compositeAlpha, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter", - "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::compositeAlpha), vvl::FlagBitmask::VkCompositeAlphaFlagBitsKHR, + AllVkCompositeAlphaFlagBitsKHR, pCreateInfos[swapchainIndex].compositeAlpha, + kRequiredSingleBit, "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter", + "VUID-VkSwapchainCreateInfoKHR-compositeAlpha-parameter"); - skip |= ValidateRangedEnum(pCreateInfos_loc.dot(Field::presentMode), vvl::Enum::VkPresentModeKHR, - pCreateInfos[swapchainIndex].presentMode, - "VUID-VkSwapchainCreateInfoKHR-presentMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfos_loc.dot(Field::presentMode), vvl::Enum::VkPresentModeKHR, + pCreateInfos[swapchainIndex].presentMode, + "VUID-VkSwapchainCreateInfoKHR-presentMode-parameter"); - skip |= ValidateBool32(pCreateInfos_loc.dot(Field::clipped), pCreateInfos[swapchainIndex].clipped); + skip |= state.ValidateBool32(pCreateInfos_loc.dot(Field::clipped), pCreateInfos[swapchainIndex].clipped); } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateArray(loc.dot(Field::swapchainCount), loc.dot(Field::pSwapchains), swapchainCount, &pSwapchains, true, true, - "VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength", - "VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter"); + skip |= state.ValidateArray(loc.dot(Field::swapchainCount), loc.dot(Field::pSwapchains), swapchainCount, &pSwapchains, true, + true, "VUID-vkCreateSharedSwapchainsKHR-swapchainCount-arraylength", + "VUID-vkCreateSharedSwapchainsKHR-pSwapchains-parameter"); if (!skip) - skip |= manual_PreCallValidateCreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains, - error_obj); + skip |= + manual_PreCallValidateCreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator, pSwapchains, state); return skip; } @@ -17716,25 +19869,27 @@ bool StatelessValidation::PreCallValidateCreateXlibSurfaceKHR(VkInstance instanc const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_xlib_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_xlib_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR, true, - "VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter", "VUID-VkXlibSurfaceCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR, true, + "VUID-vkCreateXlibSurfaceKHR-pCreateInfo-parameter", + "VUID-VkXlibSurfaceCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkXlibSurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkXlibSurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkXlibSurfaceCreateInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkXlibSurfaceCreateInfoKHR-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateXlibSurfaceKHR-pSurface-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateXlibSurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, state); return skip; } @@ -17743,10 +19898,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceXlibPresentationSuppor VisualID visualID, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_xlib_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_xlib_surface}); - skip |= ValidateRequiredPointer(loc.dot(Field::dpy), dpy, "VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter"); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::dpy), dpy, "VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter"); return skip; } #endif // VK_USE_PLATFORM_XLIB_KHR @@ -17756,25 +19915,27 @@ bool StatelessValidation::PreCallValidateCreateXcbSurfaceKHR(VkInstance instance const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_xcb_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_xcb_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR, true, - "VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter", "VUID-VkXcbSurfaceCreateInfoKHR-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR, true, + "VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter", "VUID-VkXcbSurfaceCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkXcbSurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkXcbSurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkXcbSurfaceCreateInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkXcbSurfaceCreateInfoKHR-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateXcbSurfaceKHR-pSurface-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateXcbSurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, state); return skip; } @@ -17784,11 +19945,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceXcbPresentationSupport xcb_visualid_t visual_id, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_xcb_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_xcb_surface}); - skip |= ValidateRequiredPointer(loc.dot(Field::connection), connection, - "VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::connection), connection, + "VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter"); return skip; } #endif // VK_USE_PLATFORM_XCB_KHR @@ -17799,26 +19963,27 @@ bool StatelessValidation::PreCallValidateCreateWaylandSurfaceKHR(VkInstance inst const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_wayland_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_wayland_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, true, - "VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter", - "VUID-VkWaylandSurfaceCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, + true, "VUID-vkCreateWaylandSurfaceKHR-pCreateInfo-parameter", + "VUID-VkWaylandSurfaceCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkWaylandSurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkWaylandSurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkWaylandSurfaceCreateInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkWaylandSurfaceCreateInfoKHR-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, state); return skip; } @@ -17827,11 +19992,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceWaylandPresentationSup struct wl_display* display, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_wayland_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_wayland_surface}); - skip |= ValidateRequiredPointer(loc.dot(Field::display), display, - "VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::display), display, + "VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter"); return skip; } #endif // VK_USE_PLATFORM_WAYLAND_KHR @@ -17842,26 +20010,27 @@ bool StatelessValidation::PreCallValidateCreateAndroidSurfaceKHR(VkInstance inst const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_android_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_android_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR, true, - "VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter", - "VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR, + true, "VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter", + "VUID-VkAndroidSurfaceCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAndroidSurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, state); return skip; } #endif // VK_USE_PLATFORM_ANDROID_KHR @@ -17871,26 +20040,27 @@ bool StatelessValidation::PreCallValidateCreateWin32SurfaceKHR(VkInstance instan const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_win32_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_win32_surface}); - skip |= - ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR, true, - "VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter", "VUID-VkWin32SurfaceCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR, + true, "VUID-vkCreateWin32SurfaceKHR-pCreateInfo-parameter", + "VUID-VkWin32SurfaceCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkWin32SurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkWin32SurfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkWin32SurfaceCreateInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkWin32SurfaceCreateInfoKHR-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateWin32SurfaceKHR-pSurface-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateWin32SurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, state); return skip; } @@ -17898,6 +20068,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceWin32PresentationSuppo uint32_t queueFamilyIndex, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_win32_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_win32_surface}); @@ -17911,35 +20084,39 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceVideoCapabilitiesKHR(V VkVideoCapabilitiesKHR* pCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pVideoProfile), pVideoProfile, VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, true, - "VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pVideoProfile-parameter", - "VUID-VkVideoProfileInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pVideoProfile), pVideoProfile, VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, true, + "VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pVideoProfile-parameter", + "VUID-VkVideoProfileInfoKHR-sType-sType"); if (pVideoProfile != nullptr) { [[maybe_unused]] const Location pVideoProfile_loc = loc.dot(Field::pVideoProfile); - skip |= ValidateFlags(pVideoProfile_loc.dot(Field::videoCodecOperation), vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, - AllVkVideoCodecOperationFlagBitsKHR, pVideoProfile->videoCodecOperation, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", - "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); + skip |= state.ValidateFlags( + pVideoProfile_loc.dot(Field::videoCodecOperation), vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, + AllVkVideoCodecOperationFlagBitsKHR, pVideoProfile->videoCodecOperation, kRequiredSingleBit, + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); + + skip |= state.ValidateFlags(pVideoProfile_loc.dot(Field::chromaSubsampling), + vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, AllVkVideoChromaSubsamplingFlagBitsKHR, + pVideoProfile->chromaSubsampling, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); + + skip |= state.ValidateFlags( + pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pVideoProfile->lumaBitDepth, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); skip |= - ValidateFlags(pVideoProfile_loc.dot(Field::chromaSubsampling), vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, - AllVkVideoChromaSubsamplingFlagBitsKHR, pVideoProfile->chromaSubsampling, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", - "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); - - skip |= ValidateFlags(pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, - AllVkVideoComponentBitDepthFlagBitsKHR, pVideoProfile->lumaBitDepth, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", - "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); - - skip |= ValidateFlags(pVideoProfile_loc.dot(Field::chromaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, - AllVkVideoComponentBitDepthFlagBitsKHR, pVideoProfile->chromaBitDepth, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); - } - skip |= ValidateStructType(loc.dot(Field::pCapabilities), pCapabilities, VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR, true, - "VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pCapabilities-parameter", - "VUID-VkVideoCapabilitiesKHR-sType-sType"); + state.ValidateFlags(pVideoProfile_loc.dot(Field::chromaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pVideoProfile->chromaBitDepth, kOptionalFlags, + "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); + } + skip |= state.ValidateStructType(loc.dot(Field::pCapabilities), pCapabilities, VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR, true, + "VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pCapabilities-parameter", + "VUID-VkVideoCapabilitiesKHR-sType-sType"); if (pCapabilities != nullptr) { [[maybe_unused]] const Location pCapabilities_loc = loc.dot(Field::pCapabilities); constexpr std::array allowed_structs_VkVideoCapabilitiesKHR = { @@ -17956,10 +20133,10 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceVideoCapabilitiesKHR(V VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUANTIZATION_MAP_CAPABILITIES_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_CAPABILITIES_KHR}; - skip |= ValidateStructPnext(pCapabilities_loc, pCapabilities->pNext, allowed_structs_VkVideoCapabilitiesKHR.size(), - allowed_structs_VkVideoCapabilitiesKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoCapabilitiesKHR-pNext-pNext", "VUID-VkVideoCapabilitiesKHR-sType-unique", - physicalDevice, false); + skip |= + state.ValidateStructPnext(pCapabilities_loc, pCapabilities->pNext, allowed_structs_VkVideoCapabilitiesKHR.size(), + allowed_structs_VkVideoCapabilitiesKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoCapabilitiesKHR-pNext-pNext", "VUID-VkVideoCapabilitiesKHR-sType-unique", false); } return skip; } @@ -17968,27 +20145,29 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceVideoFormatPropertiesK VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pVideoFormatInfo), pVideoFormatInfo, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR, true, - "VUID-vkGetPhysicalDeviceVideoFormatPropertiesKHR-pVideoFormatInfo-parameter", - "VUID-VkPhysicalDeviceVideoFormatInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pVideoFormatInfo), pVideoFormatInfo, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR, true, + "VUID-vkGetPhysicalDeviceVideoFormatPropertiesKHR-pVideoFormatInfo-parameter", + "VUID-VkPhysicalDeviceVideoFormatInfoKHR-sType-sType"); if (pVideoFormatInfo != nullptr) { [[maybe_unused]] const Location pVideoFormatInfo_loc = loc.dot(Field::pVideoFormatInfo); constexpr std::array allowed_structs_VkPhysicalDeviceVideoFormatInfoKHR = {VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pVideoFormatInfo_loc, pVideoFormatInfo->pNext, - allowed_structs_VkPhysicalDeviceVideoFormatInfoKHR.size(), - allowed_structs_VkPhysicalDeviceVideoFormatInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceVideoFormatInfoKHR-pNext-pNext", - "VUID-VkPhysicalDeviceVideoFormatInfoKHR-sType-unique", physicalDevice, true); + skip |= state.ValidateStructPnext( + pVideoFormatInfo_loc, pVideoFormatInfo->pNext, allowed_structs_VkPhysicalDeviceVideoFormatInfoKHR.size(), + allowed_structs_VkPhysicalDeviceVideoFormatInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceVideoFormatInfoKHR-pNext-pNext", "VUID-VkPhysicalDeviceVideoFormatInfoKHR-sType-unique", true); - skip |= ValidateFlags(pVideoFormatInfo_loc.dot(Field::imageUsage), vvl::FlagBitmask::VkImageUsageFlagBits, - AllVkImageUsageFlagBits, pVideoFormatInfo->imageUsage, kRequiredFlags, physicalDevice, - "VUID-VkPhysicalDeviceVideoFormatInfoKHR-imageUsage-parameter", - "VUID-VkPhysicalDeviceVideoFormatInfoKHR-imageUsage-requiredbitmask"); + skip |= state.ValidateFlags(pVideoFormatInfo_loc.dot(Field::imageUsage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pVideoFormatInfo->imageUsage, kRequiredFlags, + "VUID-VkPhysicalDeviceVideoFormatInfoKHR-imageUsage-parameter", + "VUID-VkPhysicalDeviceVideoFormatInfoKHR-imageUsage-requiredbitmask"); } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pVideoFormatPropertyCount), loc.dot(Field::pVideoFormatProperties), pVideoFormatPropertyCount, pVideoFormatProperties, VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR, true, false, false, "VUID-VkVideoFormatPropertiesKHR-sType-sType", kVUIDUndefined, @@ -18003,11 +20182,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceVideoFormatPropertiesK VK_STRUCTURE_TYPE_VIDEO_FORMAT_H265_QUANTIZATION_MAP_PROPERTIES_KHR, VK_STRUCTURE_TYPE_VIDEO_FORMAT_QUANTIZATION_MAP_PROPERTIES_KHR}; - skip |= ValidateStructPnext(pVideoFormatProperties_loc, pVideoFormatProperties[pVideoFormatPropertyIndex].pNext, - allowed_structs_VkVideoFormatPropertiesKHR.size(), - allowed_structs_VkVideoFormatPropertiesKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoFormatPropertiesKHR-pNext-pNext", - "VUID-VkVideoFormatPropertiesKHR-sType-unique", physicalDevice, false); + skip |= state.ValidateStructPnext(pVideoFormatProperties_loc, pVideoFormatProperties[pVideoFormatPropertyIndex].pNext, + allowed_structs_VkVideoFormatPropertiesKHR.size(), + allowed_structs_VkVideoFormatPropertiesKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoFormatPropertiesKHR-pNext-pNext", + "VUID-VkVideoFormatPropertiesKHR-sType-unique", false); } } return skip; @@ -18018,74 +20197,75 @@ bool StatelessValidation::PreCallValidateCreateVideoSessionKHR(VkDevice device, VkVideoSessionKHR* pVideoSession, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); - skip |= - ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR, true, - "VUID-vkCreateVideoSessionKHR-pCreateInfo-parameter", "VUID-VkVideoSessionCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR, + true, "VUID-vkCreateVideoSessionKHR-pCreateInfo-parameter", + "VUID-VkVideoSessionCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkVideoSessionCreateInfoKHR = { VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_SESSION_CREATE_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_KHR}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkVideoSessionCreateInfoKHR.size(), - allowed_structs_VkVideoSessionCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoSessionCreateInfoKHR-pNext-pNext", "VUID-VkVideoSessionCreateInfoKHR-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkVideoSessionCreateInfoKHR.size(), + allowed_structs_VkVideoSessionCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoSessionCreateInfoKHR-pNext-pNext", + "VUID-VkVideoSessionCreateInfoKHR-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoSessionCreateFlagBitsKHR, - AllVkVideoSessionCreateFlagBitsKHR, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkVideoSessionCreateInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoSessionCreateFlagBitsKHR, + AllVkVideoSessionCreateFlagBitsKHR, pCreateInfo->flags, kOptionalFlags, + "VUID-VkVideoSessionCreateInfoKHR-flags-parameter"); - skip |= ValidateStructType( + skip |= state.ValidateStructType( pCreateInfo_loc.dot(Field::pVideoProfile), pCreateInfo->pVideoProfile, VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, true, "VUID-VkVideoSessionCreateInfoKHR-pVideoProfile-parameter", "VUID-VkVideoProfileInfoKHR-sType-sType"); if (pCreateInfo->pVideoProfile != nullptr) { [[maybe_unused]] const Location pVideoProfile_loc = pCreateInfo_loc.dot(Field::pVideoProfile); - skip |= - ValidateFlags(pVideoProfile_loc.dot(Field::videoCodecOperation), vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, - AllVkVideoCodecOperationFlagBitsKHR, pCreateInfo->pVideoProfile->videoCodecOperation, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", - "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); - - skip |= ValidateFlags(pVideoProfile_loc.dot(Field::chromaSubsampling), - vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, AllVkVideoChromaSubsamplingFlagBitsKHR, - pCreateInfo->pVideoProfile->chromaSubsampling, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", - "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); - - skip |= ValidateFlags(pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, - AllVkVideoComponentBitDepthFlagBitsKHR, pCreateInfo->pVideoProfile->lumaBitDepth, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", - "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); - - skip |= - ValidateFlags(pVideoProfile_loc.dot(Field::chromaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, - AllVkVideoComponentBitDepthFlagBitsKHR, pCreateInfo->pVideoProfile->chromaBitDepth, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); + skip |= state.ValidateFlags(pVideoProfile_loc.dot(Field::videoCodecOperation), + vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, AllVkVideoCodecOperationFlagBitsKHR, + pCreateInfo->pVideoProfile->videoCodecOperation, kRequiredSingleBit, + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); + + skip |= state.ValidateFlags(pVideoProfile_loc.dot(Field::chromaSubsampling), + vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, + AllVkVideoChromaSubsamplingFlagBitsKHR, pCreateInfo->pVideoProfile->chromaSubsampling, + kRequiredFlags, "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); + + skip |= state.ValidateFlags( + pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pCreateInfo->pVideoProfile->lumaBitDepth, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); + + skip |= state.ValidateFlags(pVideoProfile_loc.dot(Field::chromaBitDepth), + vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pCreateInfo->pVideoProfile->chromaBitDepth, + kOptionalFlags, "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); } - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::pictureFormat), vvl::Enum::VkFormat, pCreateInfo->pictureFormat, - "VUID-VkVideoSessionCreateInfoKHR-pictureFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::pictureFormat), vvl::Enum::VkFormat, pCreateInfo->pictureFormat, + "VUID-VkVideoSessionCreateInfoKHR-pictureFormat-parameter"); // No xml-driven validation - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::referencePictureFormat), vvl::Enum::VkFormat, - pCreateInfo->referencePictureFormat, - "VUID-VkVideoSessionCreateInfoKHR-referencePictureFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::referencePictureFormat), vvl::Enum::VkFormat, + pCreateInfo->referencePictureFormat, + "VUID-VkVideoSessionCreateInfoKHR-referencePictureFormat-parameter"); - skip |= ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pStdHeaderVersion), pCreateInfo->pStdHeaderVersion, - "VUID-VkVideoSessionCreateInfoKHR-pStdHeaderVersion-parameter"); + skip |= state.ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pStdHeaderVersion), pCreateInfo->pStdHeaderVersion, + "VUID-VkVideoSessionCreateInfoKHR-pStdHeaderVersion-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pVideoSession), pVideoSession, - "VUID-vkCreateVideoSessionKHR-pVideoSession-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pVideoSession), pVideoSession, + "VUID-vkCreateVideoSessionKHR-pVideoSession-parameter"); return skip; } @@ -18093,12 +20273,13 @@ bool StatelessValidation::PreCallValidateDestroyVideoSessionKHR(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -18107,11 +20288,12 @@ bool StatelessValidation::PreCallValidateGetVideoSessionMemoryRequirementsKHR( VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); - skip |= ValidateRequiredHandle(loc.dot(Field::videoSession), videoSession); - skip |= ValidateStructTypeArray( + skip |= state.ValidateRequiredHandle(loc.dot(Field::videoSession), videoSession); + skip |= state.ValidateStructTypeArray( loc.dot(Field::pMemoryRequirementsCount), loc.dot(Field::pMemoryRequirements), pMemoryRequirementsCount, pMemoryRequirements, VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR, true, false, false, "VUID-VkVideoSessionMemoryRequirementsKHR-sType-sType", kVUIDUndefined, @@ -18120,9 +20302,9 @@ bool StatelessValidation::PreCallValidateGetVideoSessionMemoryRequirementsKHR( for (uint32_t pMemoryRequirementsIndex = 0; pMemoryRequirementsIndex < *pMemoryRequirementsCount; ++pMemoryRequirementsIndex) { [[maybe_unused]] const Location pMemoryRequirements_loc = loc.dot(Field::pMemoryRequirements, pMemoryRequirementsIndex); - skip |= ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements[pMemoryRequirementsIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkVideoSessionMemoryRequirementsKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements[pMemoryRequirementsIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkVideoSessionMemoryRequirementsKHR-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -18133,11 +20315,12 @@ bool StatelessValidation::PreCallValidateBindVideoSessionMemoryKHR(VkDevice devi const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); - skip |= ValidateRequiredHandle(loc.dot(Field::videoSession), videoSession); - skip |= ValidateStructTypeArray( + skip |= state.ValidateRequiredHandle(loc.dot(Field::videoSession), videoSession); + skip |= state.ValidateStructTypeArray( loc.dot(Field::bindSessionMemoryInfoCount), loc.dot(Field::pBindSessionMemoryInfos), bindSessionMemoryInfoCount, pBindSessionMemoryInfos, VK_STRUCTURE_TYPE_BIND_VIDEO_SESSION_MEMORY_INFO_KHR, true, true, "VUID-VkBindVideoSessionMemoryInfoKHR-sType-sType", "VUID-vkBindVideoSessionMemoryKHR-pBindSessionMemoryInfos-parameter", @@ -18147,12 +20330,12 @@ bool StatelessValidation::PreCallValidateBindVideoSessionMemoryKHR(VkDevice devi ++bindSessionMemoryInfoIndex) { [[maybe_unused]] const Location pBindSessionMemoryInfos_loc = loc.dot(Field::pBindSessionMemoryInfos, bindSessionMemoryInfoIndex); - skip |= ValidateStructPnext(pBindSessionMemoryInfos_loc, pBindSessionMemoryInfos[bindSessionMemoryInfoIndex].pNext, 0, - nullptr, GeneratedVulkanHeaderVersion, "VUID-VkBindVideoSessionMemoryInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pBindSessionMemoryInfos_loc, pBindSessionMemoryInfos[bindSessionMemoryInfoIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkBindVideoSessionMemoryInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pBindSessionMemoryInfos_loc.dot(Field::memory), - pBindSessionMemoryInfos[bindSessionMemoryInfoIndex].memory); + skip |= state.ValidateRequiredHandle(pBindSessionMemoryInfos_loc.dot(Field::memory), + pBindSessionMemoryInfos[bindSessionMemoryInfoIndex].memory); } } return skip; @@ -18164,12 +20347,13 @@ bool StatelessValidation::PreCallValidateCreateVideoSessionParametersKHR(VkDevic VkVideoSessionParametersKHR* pVideoSessionParameters, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR, - true, "VUID-vkCreateVideoSessionParametersKHR-pCreateInfo-parameter", - "VUID-VkVideoSessionParametersCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR, true, + "VUID-vkCreateVideoSessionParametersKHR-pCreateInfo-parameter", "VUID-VkVideoSessionParametersCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkVideoSessionParametersCreateInfoKHR = { @@ -18182,24 +20366,24 @@ bool StatelessValidation::PreCallValidateCreateVideoSessionParametersKHR(VkDevic VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_SESSION_PARAMETERS_CREATE_INFO_KHR}; - skip |= - ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkVideoSessionParametersCreateInfoKHR.size(), - allowed_structs_VkVideoSessionParametersCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoSessionParametersCreateInfoKHR-pNext-pNext", - "VUID-VkVideoSessionParametersCreateInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, + allowed_structs_VkVideoSessionParametersCreateInfoKHR.size(), + allowed_structs_VkVideoSessionParametersCreateInfoKHR.data(), + GeneratedVulkanHeaderVersion, "VUID-VkVideoSessionParametersCreateInfoKHR-pNext-pNext", + "VUID-VkVideoSessionParametersCreateInfoKHR-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoSessionParametersCreateFlagBitsKHR, - AllVkVideoSessionParametersCreateFlagBitsKHR, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkVideoSessionParametersCreateInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoSessionParametersCreateFlagBitsKHR, + AllVkVideoSessionParametersCreateFlagBitsKHR, pCreateInfo->flags, kOptionalFlags, + "VUID-VkVideoSessionParametersCreateInfoKHR-flags-parameter"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::videoSession), pCreateInfo->videoSession); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::videoSession), pCreateInfo->videoSession); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pVideoSessionParameters), pVideoSessionParameters, - "VUID-vkCreateVideoSessionParametersKHR-pVideoSessionParameters-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pVideoSessionParameters), pVideoSessionParameters, + "VUID-vkCreateVideoSessionParametersKHR-pVideoSessionParameters-parameter"); return skip; } @@ -18208,13 +20392,14 @@ bool StatelessValidation::PreCallValidateUpdateVideoSessionParametersKHR(VkDevic const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); - skip |= ValidateRequiredHandle(loc.dot(Field::videoSessionParameters), videoSessionParameters); - skip |= ValidateStructType(loc.dot(Field::pUpdateInfo), pUpdateInfo, VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR, - true, "VUID-vkUpdateVideoSessionParametersKHR-pUpdateInfo-parameter", - "VUID-VkVideoSessionParametersUpdateInfoKHR-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::videoSessionParameters), videoSessionParameters); + skip |= state.ValidateStructType( + loc.dot(Field::pUpdateInfo), pUpdateInfo, VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR, true, + "VUID-vkUpdateVideoSessionParametersKHR-pUpdateInfo-parameter", "VUID-VkVideoSessionParametersUpdateInfoKHR-sType-sType"); if (pUpdateInfo != nullptr) { [[maybe_unused]] const Location pUpdateInfo_loc = loc.dot(Field::pUpdateInfo); constexpr std::array allowed_structs_VkVideoSessionParametersUpdateInfoKHR = { @@ -18223,11 +20408,11 @@ bool StatelessValidation::PreCallValidateUpdateVideoSessionParametersKHR(VkDevic VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR}; - skip |= - ValidateStructPnext(pUpdateInfo_loc, pUpdateInfo->pNext, allowed_structs_VkVideoSessionParametersUpdateInfoKHR.size(), - allowed_structs_VkVideoSessionParametersUpdateInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoSessionParametersUpdateInfoKHR-pNext-pNext", - "VUID-VkVideoSessionParametersUpdateInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pUpdateInfo_loc, pUpdateInfo->pNext, + allowed_structs_VkVideoSessionParametersUpdateInfoKHR.size(), + allowed_structs_VkVideoSessionParametersUpdateInfoKHR.data(), + GeneratedVulkanHeaderVersion, "VUID-VkVideoSessionParametersUpdateInfoKHR-pNext-pNext", + "VUID-VkVideoSessionParametersUpdateInfoKHR-sType-unique", true); } return skip; } @@ -18237,12 +20422,13 @@ bool StatelessValidation::PreCallValidateDestroyVideoSessionParametersKHR(VkDevi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -18251,11 +20437,13 @@ bool StatelessValidation::PreCallValidateCmdBeginVideoCodingKHR(VkCommandBuffer const VkVideoBeginCodingInfoKHR* pBeginInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); - skip |= ValidateStructType(loc.dot(Field::pBeginInfo), pBeginInfo, VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR, true, - "VUID-vkCmdBeginVideoCodingKHR-pBeginInfo-parameter", "VUID-VkVideoBeginCodingInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pBeginInfo), pBeginInfo, VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR, true, + "VUID-vkCmdBeginVideoCodingKHR-pBeginInfo-parameter", + "VUID-VkVideoBeginCodingInfoKHR-sType-sType"); if (pBeginInfo != nullptr) { [[maybe_unused]] const Location pBeginInfo_loc = loc.dot(Field::pBeginInfo); constexpr std::array allowed_structs_VkVideoBeginCodingInfoKHR = { @@ -18267,21 +20455,21 @@ bool StatelessValidation::PreCallValidateCmdBeginVideoCodingKHR(VkCommandBuffer VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR}; - skip |= ValidateStructPnext(pBeginInfo_loc, pBeginInfo->pNext, allowed_structs_VkVideoBeginCodingInfoKHR.size(), - allowed_structs_VkVideoBeginCodingInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoBeginCodingInfoKHR-pNext-pNext", "VUID-VkVideoBeginCodingInfoKHR-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBeginInfo_loc, pBeginInfo->pNext, allowed_structs_VkVideoBeginCodingInfoKHR.size(), + allowed_structs_VkVideoBeginCodingInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoBeginCodingInfoKHR-pNext-pNext", + "VUID-VkVideoBeginCodingInfoKHR-sType-unique", true); - skip |= ValidateReservedFlags(pBeginInfo_loc.dot(Field::flags), pBeginInfo->flags, - "VUID-VkVideoBeginCodingInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pBeginInfo_loc.dot(Field::flags), pBeginInfo->flags, + "VUID-VkVideoBeginCodingInfoKHR-flags-zerobitmask"); - skip |= ValidateRequiredHandle(pBeginInfo_loc.dot(Field::videoSession), pBeginInfo->videoSession); + skip |= state.ValidateRequiredHandle(pBeginInfo_loc.dot(Field::videoSession), pBeginInfo->videoSession); - skip |= ValidateStructTypeArray(pBeginInfo_loc.dot(Field::referenceSlotCount), pBeginInfo_loc.dot(Field::pReferenceSlots), - pBeginInfo->referenceSlotCount, pBeginInfo->pReferenceSlots, - VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, true, - "VUID-VkVideoReferenceSlotInfoKHR-sType-sType", - "VUID-VkVideoBeginCodingInfoKHR-pReferenceSlots-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pBeginInfo_loc.dot(Field::referenceSlotCount), + pBeginInfo_loc.dot(Field::pReferenceSlots), pBeginInfo->referenceSlotCount, + pBeginInfo->pReferenceSlots, VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, + true, "VUID-VkVideoReferenceSlotInfoKHR-sType-sType", + "VUID-VkVideoBeginCodingInfoKHR-pReferenceSlots-parameter", kVUIDUndefined); if (pBeginInfo->pReferenceSlots != nullptr) { for (uint32_t referenceSlotIndex = 0; referenceSlotIndex < pBeginInfo->referenceSlotCount; ++referenceSlotIndex) { @@ -18292,32 +20480,31 @@ bool StatelessValidation::PreCallValidateCmdBeginVideoCodingKHR(VkCommandBuffer VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR}; - skip |= ValidateStructPnext(pReferenceSlots_loc, pBeginInfo->pReferenceSlots[referenceSlotIndex].pNext, - allowed_structs_VkVideoReferenceSlotInfoKHR.size(), - allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", - "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pReferenceSlots_loc, pBeginInfo->pReferenceSlots[referenceSlotIndex].pNext, + allowed_structs_VkVideoReferenceSlotInfoKHR.size(), + allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", + "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", true); - skip |= ValidateStructType(pReferenceSlots_loc.dot(Field::pPictureResource), - pBeginInfo->pReferenceSlots[referenceSlotIndex].pPictureResource, - VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, - "VUID-VkVideoReferenceSlotInfoKHR-pPictureResource-parameter", - "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pReferenceSlots_loc.dot(Field::pPictureResource), + pBeginInfo->pReferenceSlots[referenceSlotIndex].pPictureResource, + VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, + "VUID-VkVideoReferenceSlotInfoKHR-pPictureResource-parameter", + "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); if (pBeginInfo->pReferenceSlots[referenceSlotIndex].pPictureResource != nullptr) { [[maybe_unused]] const Location pPictureResource_loc = pReferenceSlots_loc.dot(Field::pPictureResource); - skip |= ValidateStructPnext(pPictureResource_loc, - pBeginInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pPictureResource_loc, pBeginInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, true); // No xml-driven validation // No xml-driven validation - skip |= - ValidateRequiredHandle(pPictureResource_loc.dot(Field::imageViewBinding), - pBeginInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); + skip |= state.ValidateRequiredHandle( + pPictureResource_loc.dot(Field::imageViewBinding), + pBeginInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); } } } @@ -18329,18 +20516,20 @@ bool StatelessValidation::PreCallValidateCmdEndVideoCodingKHR(VkCommandBuffer co const VkVideoEndCodingInfoKHR* pEndCodingInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); - skip |= ValidateStructType(loc.dot(Field::pEndCodingInfo), pEndCodingInfo, VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR, true, - "VUID-vkCmdEndVideoCodingKHR-pEndCodingInfo-parameter", "VUID-VkVideoEndCodingInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pEndCodingInfo), pEndCodingInfo, VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR, + true, "VUID-vkCmdEndVideoCodingKHR-pEndCodingInfo-parameter", + "VUID-VkVideoEndCodingInfoKHR-sType-sType"); if (pEndCodingInfo != nullptr) { [[maybe_unused]] const Location pEndCodingInfo_loc = loc.dot(Field::pEndCodingInfo); - skip |= ValidateStructPnext(pEndCodingInfo_loc, pEndCodingInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkVideoEndCodingInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pEndCodingInfo_loc, pEndCodingInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkVideoEndCodingInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pEndCodingInfo_loc.dot(Field::flags), pEndCodingInfo->flags, - "VUID-VkVideoEndCodingInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pEndCodingInfo_loc.dot(Field::flags), pEndCodingInfo->flags, + "VUID-VkVideoEndCodingInfoKHR-flags-zerobitmask"); } return skip; } @@ -18349,10 +20538,11 @@ bool StatelessValidation::PreCallValidateCmdControlVideoCodingKHR(VkCommandBuffe const VkVideoCodingControlInfoKHR* pCodingControlInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pCodingControlInfo), pCodingControlInfo, VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR, true, "VUID-vkCmdControlVideoCodingKHR-pCodingControlInfo-parameter", "VUID-VkVideoCodingControlInfoKHR-sType-sType"); if (pCodingControlInfo != nullptr) { @@ -18362,15 +20552,15 @@ bool StatelessValidation::PreCallValidateCmdControlVideoCodingKHR(VkCommandBuffe VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pCodingControlInfo_loc, pCodingControlInfo->pNext, allowed_structs_VkVideoCodingControlInfoKHR.size(), allowed_structs_VkVideoCodingControlInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoCodingControlInfoKHR-pNext-pNext", "VUID-VkVideoCodingControlInfoKHR-sType-unique", VK_NULL_HANDLE, true); + "VUID-VkVideoCodingControlInfoKHR-pNext-pNext", "VUID-VkVideoCodingControlInfoKHR-sType-unique", true); - skip |= ValidateFlags(pCodingControlInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoCodingControlFlagBitsKHR, - AllVkVideoCodingControlFlagBitsKHR, pCodingControlInfo->flags, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkVideoCodingControlInfoKHR-flags-parameter", - "VUID-VkVideoCodingControlInfoKHR-flags-requiredbitmask"); + skip |= state.ValidateFlags(pCodingControlInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoCodingControlFlagBitsKHR, + AllVkVideoCodingControlFlagBitsKHR, pCodingControlInfo->flags, kRequiredFlags, + "VUID-VkVideoCodingControlInfoKHR-flags-parameter", + "VUID-VkVideoCodingControlInfoKHR-flags-requiredbitmask"); } return skip; } @@ -18378,46 +20568,46 @@ bool StatelessValidation::PreCallValidateCmdControlVideoCodingKHR(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdDecodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR* pDecodeInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_decode_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_decode_queue}); - skip |= ValidateStructType(loc.dot(Field::pDecodeInfo), pDecodeInfo, VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR, true, - "VUID-vkCmdDecodeVideoKHR-pDecodeInfo-parameter", "VUID-VkVideoDecodeInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pDecodeInfo), pDecodeInfo, VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR, true, + "VUID-vkCmdDecodeVideoKHR-pDecodeInfo-parameter", "VUID-VkVideoDecodeInfoKHR-sType-sType"); if (pDecodeInfo != nullptr) { [[maybe_unused]] const Location pDecodeInfo_loc = loc.dot(Field::pDecodeInfo); constexpr std::array allowed_structs_VkVideoDecodeInfoKHR = { VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR}; - skip |= ValidateStructPnext(pDecodeInfo_loc, pDecodeInfo->pNext, allowed_structs_VkVideoDecodeInfoKHR.size(), - allowed_structs_VkVideoDecodeInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoDecodeInfoKHR-pNext-pNext", "VUID-VkVideoDecodeInfoKHR-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDecodeInfo_loc, pDecodeInfo->pNext, allowed_structs_VkVideoDecodeInfoKHR.size(), + allowed_structs_VkVideoDecodeInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoDecodeInfoKHR-pNext-pNext", "VUID-VkVideoDecodeInfoKHR-sType-unique", true); - skip |= ValidateReservedFlags(pDecodeInfo_loc.dot(Field::flags), pDecodeInfo->flags, - "VUID-VkVideoDecodeInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pDecodeInfo_loc.dot(Field::flags), pDecodeInfo->flags, + "VUID-VkVideoDecodeInfoKHR-flags-zerobitmask"); - skip |= ValidateRequiredHandle(pDecodeInfo_loc.dot(Field::srcBuffer), pDecodeInfo->srcBuffer); + skip |= state.ValidateRequiredHandle(pDecodeInfo_loc.dot(Field::srcBuffer), pDecodeInfo->srcBuffer); - skip |= ValidateStructType(pDecodeInfo_loc.dot(Field::dstPictureResource), &(pDecodeInfo->dstPictureResource), - VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, kVUIDUndefined, - "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pDecodeInfo_loc.dot(Field::dstPictureResource), &(pDecodeInfo->dstPictureResource), + VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, kVUIDUndefined, + "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); - skip |= - ValidateStructPnext(pDecodeInfo_loc, pDecodeInfo->dstPictureResource.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDecodeInfo_loc, pDecodeInfo->dstPictureResource.pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", + kVUIDUndefined, true); // No xml-driven validation // No xml-driven validation - skip |= - ValidateRequiredHandle(pDecodeInfo_loc.dot(Field::imageViewBinding), pDecodeInfo->dstPictureResource.imageViewBinding); + skip |= state.ValidateRequiredHandle(pDecodeInfo_loc.dot(Field::imageViewBinding), + pDecodeInfo->dstPictureResource.imageViewBinding); - skip |= ValidateStructType(pDecodeInfo_loc.dot(Field::pSetupReferenceSlot), pDecodeInfo->pSetupReferenceSlot, - VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, - "VUID-VkVideoDecodeInfoKHR-pSetupReferenceSlot-parameter", - "VUID-VkVideoReferenceSlotInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pDecodeInfo_loc.dot(Field::pSetupReferenceSlot), pDecodeInfo->pSetupReferenceSlot, + VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, + "VUID-VkVideoDecodeInfoKHR-pSetupReferenceSlot-parameter", + "VUID-VkVideoReferenceSlotInfoKHR-sType-sType"); if (pDecodeInfo->pSetupReferenceSlot != nullptr) { [[maybe_unused]] const Location pSetupReferenceSlot_loc = pDecodeInfo_loc.dot(Field::pSetupReferenceSlot); @@ -18426,37 +20616,37 @@ bool StatelessValidation::PreCallValidateCmdDecodeVideoKHR(VkCommandBuffer comma VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR}; - skip |= ValidateStructPnext(pSetupReferenceSlot_loc, pDecodeInfo->pSetupReferenceSlot->pNext, - allowed_structs_VkVideoReferenceSlotInfoKHR.size(), - allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", - "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSetupReferenceSlot_loc, pDecodeInfo->pSetupReferenceSlot->pNext, + allowed_structs_VkVideoReferenceSlotInfoKHR.size(), + allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", + "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", true); - skip |= ValidateStructType( + skip |= state.ValidateStructType( pSetupReferenceSlot_loc.dot(Field::pPictureResource), pDecodeInfo->pSetupReferenceSlot->pPictureResource, VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, "VUID-VkVideoReferenceSlotInfoKHR-pPictureResource-parameter", "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); if (pDecodeInfo->pSetupReferenceSlot->pPictureResource != nullptr) { [[maybe_unused]] const Location pPictureResource_loc = pSetupReferenceSlot_loc.dot(Field::pPictureResource); - skip |= ValidateStructPnext(pPictureResource_loc, pDecodeInfo->pSetupReferenceSlot->pPictureResource->pNext, 0, - nullptr, GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pPictureResource_loc, pDecodeInfo->pSetupReferenceSlot->pPictureResource->pNext, + 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, true); // No xml-driven validation // No xml-driven validation - skip |= ValidateRequiredHandle(pPictureResource_loc.dot(Field::imageViewBinding), - pDecodeInfo->pSetupReferenceSlot->pPictureResource->imageViewBinding); + skip |= state.ValidateRequiredHandle(pPictureResource_loc.dot(Field::imageViewBinding), + pDecodeInfo->pSetupReferenceSlot->pPictureResource->imageViewBinding); } } - skip |= ValidateStructTypeArray(pDecodeInfo_loc.dot(Field::referenceSlotCount), pDecodeInfo_loc.dot(Field::pReferenceSlots), - pDecodeInfo->referenceSlotCount, pDecodeInfo->pReferenceSlots, - VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, true, - "VUID-VkVideoReferenceSlotInfoKHR-sType-sType", - "VUID-VkVideoDecodeInfoKHR-pReferenceSlots-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pDecodeInfo_loc.dot(Field::referenceSlotCount), + pDecodeInfo_loc.dot(Field::pReferenceSlots), pDecodeInfo->referenceSlotCount, + pDecodeInfo->pReferenceSlots, VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, + true, "VUID-VkVideoReferenceSlotInfoKHR-sType-sType", + "VUID-VkVideoDecodeInfoKHR-pReferenceSlots-parameter", kVUIDUndefined); if (pDecodeInfo->pReferenceSlots != nullptr) { for (uint32_t referenceSlotIndex = 0; referenceSlotIndex < pDecodeInfo->referenceSlotCount; ++referenceSlotIndex) { @@ -18467,32 +20657,31 @@ bool StatelessValidation::PreCallValidateCmdDecodeVideoKHR(VkCommandBuffer comma VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR}; - skip |= ValidateStructPnext(pReferenceSlots_loc, pDecodeInfo->pReferenceSlots[referenceSlotIndex].pNext, - allowed_structs_VkVideoReferenceSlotInfoKHR.size(), - allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", - "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pReferenceSlots_loc, pDecodeInfo->pReferenceSlots[referenceSlotIndex].pNext, + allowed_structs_VkVideoReferenceSlotInfoKHR.size(), + allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", + "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", true); - skip |= ValidateStructType(pReferenceSlots_loc.dot(Field::pPictureResource), - pDecodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource, - VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, - "VUID-VkVideoReferenceSlotInfoKHR-pPictureResource-parameter", - "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pReferenceSlots_loc.dot(Field::pPictureResource), + pDecodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource, + VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, + "VUID-VkVideoReferenceSlotInfoKHR-pPictureResource-parameter", + "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); if (pDecodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource != nullptr) { [[maybe_unused]] const Location pPictureResource_loc = pReferenceSlots_loc.dot(Field::pPictureResource); - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pPictureResource_loc, pDecodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, true); // No xml-driven validation // No xml-driven validation - skip |= - ValidateRequiredHandle(pPictureResource_loc.dot(Field::imageViewBinding), - pDecodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); + skip |= state.ValidateRequiredHandle( + pPictureResource_loc.dot(Field::imageViewBinding), + pDecodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); } } } @@ -18503,6 +20692,7 @@ bool StatelessValidation::PreCallValidateCmdDecodeVideoKHR(VkCommandBuffer comma bool StatelessValidation::PreCallValidateCmdBeginRenderingKHR(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_dynamic_rendering}); @@ -18512,6 +20702,7 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderingKHR(VkCommandBuffer co bool StatelessValidation::PreCallValidateCmdEndRenderingKHR(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_dynamic_rendering}); @@ -18523,6 +20714,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFeatures2KHR(VkPhysica VkPhysicalDeviceFeatures2* pFeatures, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); @@ -18534,6 +20728,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceProperties2KHR(VkPhysi VkPhysicalDeviceProperties2* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); @@ -18545,6 +20742,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFormatProperties2KHR(V VkFormatProperties2* pFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); @@ -18556,6 +20756,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceImageFormatProperties2 VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); @@ -18568,6 +20771,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceQueueFamilyProperties2 VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); @@ -18580,6 +20786,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceMemoryProperties2KHR(V VkPhysicalDeviceMemoryProperties2* pMemoryProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); @@ -18591,6 +20800,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSparseImageFormatPrope VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); @@ -18604,6 +20816,7 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupPeerMemoryFeaturesKHR(VkD VkPeerMemoryFeatureFlags* pPeerMemoryFeatures, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_device_group)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_device_group}); @@ -18615,6 +20828,7 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupPeerMemoryFeaturesKHR(VkD bool StatelessValidation::PreCallValidateCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_device_group)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_device_group}); @@ -18626,6 +20840,7 @@ bool StatelessValidation::PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer comm uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_device_group)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_device_group}); @@ -18637,6 +20852,7 @@ bool StatelessValidation::PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer comm bool StatelessValidation::PreCallValidateTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance1)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance1}); @@ -18648,6 +20864,7 @@ bool StatelessValidation::PreCallValidateEnumeratePhysicalDeviceGroupsKHR( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_device_group_creation)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_device_group_creation}); @@ -18660,6 +20877,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalBufferProperti VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_external_memory_capabilities)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_memory_capabilities}); @@ -18673,26 +20893,28 @@ bool StatelessValidation::PreCallValidateGetMemoryWin32HandleKHR(VkDevice device const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_memory_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_memory_win32}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pGetWin32HandleInfo), pGetWin32HandleInfo, VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR, true, "VUID-vkGetMemoryWin32HandleKHR-pGetWin32HandleInfo-parameter", "VUID-VkMemoryGetWin32HandleInfoKHR-sType-sType"); if (pGetWin32HandleInfo != nullptr) { [[maybe_unused]] const Location pGetWin32HandleInfo_loc = loc.dot(Field::pGetWin32HandleInfo); - skip |= ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::memory), pGetWin32HandleInfo->memory); + skip |= state.ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::memory), pGetWin32HandleInfo->memory); - skip |= ValidateFlags(pGetWin32HandleInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, pGetWin32HandleInfo->handleType, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter", - "VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter"); + skip |= state.ValidateFlags( + pGetWin32HandleInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, pGetWin32HandleInfo->handleType, kRequiredSingleBit, + "VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter", "VUID-VkMemoryGetWin32HandleInfoKHR-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter"); - if (!skip) skip |= manual_PreCallValidateGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter"); + if (!skip) skip |= manual_PreCallValidateGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, state); return skip; } @@ -18700,26 +20922,27 @@ bool StatelessValidation::PreCallValidateGetMemoryWin32HandlePropertiesKHR( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_memory_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_memory_win32}); - skip |= ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter", - "VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter"); - skip |= ValidateStructType(loc.dot(Field::pMemoryWin32HandleProperties), pMemoryWin32HandleProperties, - VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR, true, - "VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter", - "VUID-VkMemoryWin32HandlePropertiesKHR-sType-sType"); + skip |= state.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, + "VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter", + "VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter"); + skip |= state.ValidateStructType(loc.dot(Field::pMemoryWin32HandleProperties), pMemoryWin32HandleProperties, + VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR, true, + "VUID-vkGetMemoryWin32HandlePropertiesKHR-pMemoryWin32HandleProperties-parameter", + "VUID-VkMemoryWin32HandlePropertiesKHR-sType-sType"); if (pMemoryWin32HandleProperties != nullptr) { [[maybe_unused]] const Location pMemoryWin32HandleProperties_loc = loc.dot(Field::pMemoryWin32HandleProperties); - skip |= ValidateStructPnext(pMemoryWin32HandleProperties_loc, pMemoryWin32HandleProperties->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMemoryWin32HandlePropertiesKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pMemoryWin32HandleProperties_loc, pMemoryWin32HandleProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryWin32HandlePropertiesKHR-pNext-pNext", + kVUIDUndefined, false); } if (!skip) skip |= manual_PreCallValidateGetMemoryWin32HandlePropertiesKHR(device, handleType, handle, pMemoryWin32HandleProperties, - error_obj); + state); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -18727,24 +20950,26 @@ bool StatelessValidation::PreCallValidateGetMemoryWin32HandlePropertiesKHR( bool StatelessValidation::PreCallValidateGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_memory_fd)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_memory_fd}); - skip |= ValidateStructType(loc.dot(Field::pGetFdInfo), pGetFdInfo, VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR, true, - "VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter", "VUID-VkMemoryGetFdInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pGetFdInfo), pGetFdInfo, VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR, true, + "VUID-vkGetMemoryFdKHR-pGetFdInfo-parameter", "VUID-VkMemoryGetFdInfoKHR-sType-sType"); if (pGetFdInfo != nullptr) { [[maybe_unused]] const Location pGetFdInfo_loc = loc.dot(Field::pGetFdInfo); - skip |= ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMemoryGetFdInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMemoryGetFdInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::memory), pGetFdInfo->memory); + skip |= state.ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::memory), pGetFdInfo->memory); - skip |= ValidateFlags(pGetFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, pGetFdInfo->handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkMemoryGetFdInfoKHR-handleType-parameter", "VUID-VkMemoryGetFdInfoKHR-handleType-parameter"); + skip |= + state.ValidateFlags(pGetFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, pGetFdInfo->handleType, kRequiredSingleBit, + "VUID-VkMemoryGetFdInfoKHR-handleType-parameter", "VUID-VkMemoryGetFdInfoKHR-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetMemoryFdKHR-pFd-parameter"); - if (!skip) skip |= manual_PreCallValidateGetMemoryFdKHR(device, pGetFdInfo, pFd, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetMemoryFdKHR-pFd-parameter"); + if (!skip) skip |= manual_PreCallValidateGetMemoryFdKHR(device, pGetFdInfo, pFd, state); return skip; } @@ -18752,22 +20977,24 @@ bool StatelessValidation::PreCallValidateGetMemoryFdPropertiesKHR(VkDevice devic int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_memory_fd)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_memory_fd}); - skip |= ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter", - "VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter"); - skip |= ValidateStructType(loc.dot(Field::pMemoryFdProperties), pMemoryFdProperties, VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR, - true, "VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter", - "VUID-VkMemoryFdPropertiesKHR-sType-sType"); + skip |= state.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, + "VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter", + "VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter"); + skip |= state.ValidateStructType( + loc.dot(Field::pMemoryFdProperties), pMemoryFdProperties, VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR, true, + "VUID-vkGetMemoryFdPropertiesKHR-pMemoryFdProperties-parameter", "VUID-VkMemoryFdPropertiesKHR-sType-sType"); if (pMemoryFdProperties != nullptr) { [[maybe_unused]] const Location pMemoryFdProperties_loc = loc.dot(Field::pMemoryFdProperties); - skip |= ValidateStructPnext(pMemoryFdProperties_loc, pMemoryFdProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMemoryFdPropertiesKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= + state.ValidateStructPnext(pMemoryFdProperties_loc, pMemoryFdProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMemoryFdPropertiesKHR-pNext-pNext", kVUIDUndefined, false); } - if (!skip) skip |= manual_PreCallValidateGetMemoryFdPropertiesKHR(device, handleType, fd, pMemoryFdProperties, error_obj); + if (!skip) skip |= manual_PreCallValidateGetMemoryFdPropertiesKHR(device, handleType, fd, pMemoryFdProperties, state); return skip; } @@ -18775,6 +21002,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalSemaphorePrope VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_external_semaphore_capabilities)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_semaphore_capabilities}); @@ -18788,27 +21018,29 @@ bool StatelessValidation::PreCallValidateImportSemaphoreWin32HandleKHR( VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_semaphore_win32}); - skip |= ValidateStructType(loc.dot(Field::pImportSemaphoreWin32HandleInfo), pImportSemaphoreWin32HandleInfo, - VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR, true, - "VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter", - "VUID-VkImportSemaphoreWin32HandleInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pImportSemaphoreWin32HandleInfo), pImportSemaphoreWin32HandleInfo, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR, true, + "VUID-vkImportSemaphoreWin32HandleKHR-pImportSemaphoreWin32HandleInfo-parameter", + "VUID-VkImportSemaphoreWin32HandleInfoKHR-sType-sType"); if (pImportSemaphoreWin32HandleInfo != nullptr) { [[maybe_unused]] const Location pImportSemaphoreWin32HandleInfo_loc = loc.dot(Field::pImportSemaphoreWin32HandleInfo); - skip |= ValidateStructPnext(pImportSemaphoreWin32HandleInfo_loc, pImportSemaphoreWin32HandleInfo->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkImportSemaphoreWin32HandleInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pImportSemaphoreWin32HandleInfo_loc, pImportSemaphoreWin32HandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImportSemaphoreWin32HandleInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportSemaphoreWin32HandleInfo_loc.dot(Field::semaphore), - pImportSemaphoreWin32HandleInfo->semaphore); + skip |= state.ValidateRequiredHandle(pImportSemaphoreWin32HandleInfo_loc.dot(Field::semaphore), + pImportSemaphoreWin32HandleInfo->semaphore); - skip |= ValidateFlags(pImportSemaphoreWin32HandleInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreImportFlagBits, - AllVkSemaphoreImportFlagBits, pImportSemaphoreWin32HandleInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkImportSemaphoreWin32HandleInfoKHR-flags-parameter"); + skip |= + state.ValidateFlags(pImportSemaphoreWin32HandleInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreImportFlagBits, + AllVkSemaphoreImportFlagBits, pImportSemaphoreWin32HandleInfo->flags, kOptionalFlags, + "VUID-VkImportSemaphoreWin32HandleInfoKHR-flags-parameter"); } - if (!skip) skip |= manual_PreCallValidateImportSemaphoreWin32HandleKHR(device, pImportSemaphoreWin32HandleInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateImportSemaphoreWin32HandleKHR(device, pImportSemaphoreWin32HandleInfo, state); return skip; } @@ -18816,27 +21048,29 @@ bool StatelessValidation::PreCallValidateGetSemaphoreWin32HandleKHR(VkDevice dev const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_semaphore_win32}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pGetWin32HandleInfo), pGetWin32HandleInfo, VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR, true, "VUID-vkGetSemaphoreWin32HandleKHR-pGetWin32HandleInfo-parameter", "VUID-VkSemaphoreGetWin32HandleInfoKHR-sType-sType"); if (pGetWin32HandleInfo != nullptr) { [[maybe_unused]] const Location pGetWin32HandleInfo_loc = loc.dot(Field::pGetWin32HandleInfo); - skip |= ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::semaphore), pGetWin32HandleInfo->semaphore); + skip |= state.ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::semaphore), pGetWin32HandleInfo->semaphore); - skip |= - ValidateFlags(pGetWin32HandleInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, - AllVkExternalSemaphoreHandleTypeFlagBits, pGetWin32HandleInfo->handleType, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter", - "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter"); + skip |= state.ValidateFlags(pGetWin32HandleInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, + AllVkExternalSemaphoreHandleTypeFlagBits, pGetWin32HandleInfo->handleType, kRequiredSingleBit, + "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter", + "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter"); - if (!skip) skip |= manual_PreCallValidateGetSemaphoreWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter"); + if (!skip) skip |= manual_PreCallValidateGetSemaphoreWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, state); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -18845,55 +21079,57 @@ bool StatelessValidation::PreCallValidateImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore_fd)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_semaphore_fd}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pImportSemaphoreFdInfo), pImportSemaphoreFdInfo, VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR, true, "VUID-vkImportSemaphoreFdKHR-pImportSemaphoreFdInfo-parameter", "VUID-VkImportSemaphoreFdInfoKHR-sType-sType"); if (pImportSemaphoreFdInfo != nullptr) { [[maybe_unused]] const Location pImportSemaphoreFdInfo_loc = loc.dot(Field::pImportSemaphoreFdInfo); - skip |= - ValidateStructPnext(pImportSemaphoreFdInfo_loc, pImportSemaphoreFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImportSemaphoreFdInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pImportSemaphoreFdInfo_loc, pImportSemaphoreFdInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImportSemaphoreFdInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportSemaphoreFdInfo_loc.dot(Field::semaphore), pImportSemaphoreFdInfo->semaphore); + skip |= state.ValidateRequiredHandle(pImportSemaphoreFdInfo_loc.dot(Field::semaphore), pImportSemaphoreFdInfo->semaphore); - skip |= ValidateFlags(pImportSemaphoreFdInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreImportFlagBits, - AllVkSemaphoreImportFlagBits, pImportSemaphoreFdInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkImportSemaphoreFdInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pImportSemaphoreFdInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreImportFlagBits, + AllVkSemaphoreImportFlagBits, pImportSemaphoreFdInfo->flags, kOptionalFlags, + "VUID-VkImportSemaphoreFdInfoKHR-flags-parameter"); - skip |= ValidateFlags( + skip |= state.ValidateFlags( pImportSemaphoreFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, - AllVkExternalSemaphoreHandleTypeFlagBits, pImportSemaphoreFdInfo->handleType, kRequiredSingleBit, VK_NULL_HANDLE, + AllVkExternalSemaphoreHandleTypeFlagBits, pImportSemaphoreFdInfo->handleType, kRequiredSingleBit, "VUID-VkImportSemaphoreFdInfoKHR-handleType-parameter", "VUID-VkImportSemaphoreFdInfoKHR-handleType-parameter"); } - if (!skip) skip |= manual_PreCallValidateImportSemaphoreFdKHR(device, pImportSemaphoreFdInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateImportSemaphoreFdKHR(device, pImportSemaphoreFdInfo, state); return skip; } bool StatelessValidation::PreCallValidateGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore_fd)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_semaphore_fd}); - skip |= ValidateStructType(loc.dot(Field::pGetFdInfo), pGetFdInfo, VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR, true, - "VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter", "VUID-VkSemaphoreGetFdInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pGetFdInfo), pGetFdInfo, VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR, true, + "VUID-vkGetSemaphoreFdKHR-pGetFdInfo-parameter", "VUID-VkSemaphoreGetFdInfoKHR-sType-sType"); if (pGetFdInfo != nullptr) { [[maybe_unused]] const Location pGetFdInfo_loc = loc.dot(Field::pGetFdInfo); - skip |= ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::semaphore), pGetFdInfo->semaphore); + skip |= state.ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::semaphore), pGetFdInfo->semaphore); - skip |= - ValidateFlags(pGetFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, - AllVkExternalSemaphoreHandleTypeFlagBits, pGetFdInfo->handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter", "VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter"); + skip |= state.ValidateFlags(pGetFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, + AllVkExternalSemaphoreHandleTypeFlagBits, pGetFdInfo->handleType, kRequiredSingleBit, + "VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter", + "VUID-VkSemaphoreGetFdInfoKHR-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetSemaphoreFdKHR-pFd-parameter"); - if (!skip) skip |= manual_PreCallValidateGetSemaphoreFdKHR(device, pGetFdInfo, pFd, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetSemaphoreFdKHR-pFd-parameter"); + if (!skip) skip |= manual_PreCallValidateGetSemaphoreFdKHR(device, pGetFdInfo, pFd, state); return skip; } @@ -18903,6 +21139,7 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetKHR(VkCommandBuffer const VkWriteDescriptorSet* pDescriptorWrites, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_push_descriptor)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_push_descriptor}); @@ -18917,6 +21154,7 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetWithTemplateKHR(VkC const void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_khr_push_descriptor) || IsExtEnabled(device_extensions.vk_khr_descriptor_update_template))) @@ -18932,6 +21170,7 @@ bool StatelessValidation::PreCallValidateCreateDescriptorUpdateTemplateKHR(VkDev VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_descriptor_update_template)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_descriptor_update_template}); @@ -18944,6 +21183,7 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorUpdateTemplateKHR(VkDe const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_descriptor_update_template)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_descriptor_update_template}); @@ -18955,6 +21195,7 @@ bool StatelessValidation::PreCallValidateUpdateDescriptorSetWithTemplateKHR(VkDe VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_descriptor_update_template)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_descriptor_update_template}); @@ -18966,6 +21207,7 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2KHR(VkDevice device, c const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_create_renderpass2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_create_renderpass2}); @@ -18978,6 +21220,7 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderPass2KHR(VkCommandBuffer const VkSubpassBeginInfo* pSubpassBeginInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_create_renderpass2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_create_renderpass2}); @@ -18990,6 +21233,7 @@ bool StatelessValidation::PreCallValidateCmdNextSubpass2KHR(VkCommandBuffer comm const VkSubpassEndInfo* pSubpassEndInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_create_renderpass2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_create_renderpass2}); @@ -19001,6 +21245,7 @@ bool StatelessValidation::PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer co const VkSubpassEndInfo* pSubpassEndInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_create_renderpass2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_create_renderpass2}); @@ -19011,10 +21256,11 @@ bool StatelessValidation::PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer co bool StatelessValidation::PreCallValidateGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_shared_presentable_image)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_shared_presentable_image}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); return skip; } @@ -19022,6 +21268,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalFencePropertie VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_external_fence_capabilities)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_fence_capabilities}); @@ -19034,26 +21283,27 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalFencePropertie bool StatelessValidation::PreCallValidateImportFenceWin32HandleKHR( VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_fence_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_fence_win32}); - skip |= ValidateStructType(loc.dot(Field::pImportFenceWin32HandleInfo), pImportFenceWin32HandleInfo, - VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR, true, - "VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter", - "VUID-VkImportFenceWin32HandleInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pImportFenceWin32HandleInfo), pImportFenceWin32HandleInfo, + VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR, true, + "VUID-vkImportFenceWin32HandleKHR-pImportFenceWin32HandleInfo-parameter", + "VUID-VkImportFenceWin32HandleInfoKHR-sType-sType"); if (pImportFenceWin32HandleInfo != nullptr) { [[maybe_unused]] const Location pImportFenceWin32HandleInfo_loc = loc.dot(Field::pImportFenceWin32HandleInfo); - skip |= ValidateStructPnext(pImportFenceWin32HandleInfo_loc, pImportFenceWin32HandleInfo->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pImportFenceWin32HandleInfo_loc, pImportFenceWin32HandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportFenceWin32HandleInfo_loc.dot(Field::fence), pImportFenceWin32HandleInfo->fence); + skip |= state.ValidateRequiredHandle(pImportFenceWin32HandleInfo_loc.dot(Field::fence), pImportFenceWin32HandleInfo->fence); - skip |= ValidateFlags(pImportFenceWin32HandleInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkFenceImportFlagBits, - AllVkFenceImportFlagBits, pImportFenceWin32HandleInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pImportFenceWin32HandleInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkFenceImportFlagBits, + AllVkFenceImportFlagBits, pImportFenceWin32HandleInfo->flags, kOptionalFlags, + "VUID-VkImportFenceWin32HandleInfoKHR-flags-parameter"); } - if (!skip) skip |= manual_PreCallValidateImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateImportFenceWin32HandleKHR(device, pImportFenceWin32HandleInfo, state); return skip; } @@ -19061,26 +21311,28 @@ bool StatelessValidation::PreCallValidateGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_fence_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_fence_win32}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pGetWin32HandleInfo), pGetWin32HandleInfo, VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR, true, "VUID-vkGetFenceWin32HandleKHR-pGetWin32HandleInfo-parameter", "VUID-VkFenceGetWin32HandleInfoKHR-sType-sType"); if (pGetWin32HandleInfo != nullptr) { [[maybe_unused]] const Location pGetWin32HandleInfo_loc = loc.dot(Field::pGetWin32HandleInfo); - skip |= ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::fence), pGetWin32HandleInfo->fence); + skip |= state.ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::fence), pGetWin32HandleInfo->fence); - skip |= ValidateFlags(pGetWin32HandleInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, - AllVkExternalFenceHandleTypeFlagBits, pGetWin32HandleInfo->handleType, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter", - "VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter"); + skip |= state.ValidateFlags( + pGetWin32HandleInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, + AllVkExternalFenceHandleTypeFlagBits, pGetWin32HandleInfo->handleType, kRequiredSingleBit, + "VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter", "VUID-VkFenceGetWin32HandleInfoKHR-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetFenceWin32HandleKHR-pHandle-parameter"); - if (!skip) skip |= manual_PreCallValidateGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetFenceWin32HandleKHR-pHandle-parameter"); + if (!skip) skip |= manual_PreCallValidateGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, state); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -19088,53 +21340,57 @@ bool StatelessValidation::PreCallValidateGetFenceWin32HandleKHR(VkDevice device, bool StatelessValidation::PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_fence_fd)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_fence_fd}); - skip |= - ValidateStructType(loc.dot(Field::pImportFenceFdInfo), pImportFenceFdInfo, VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR, true, - "VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter", "VUID-VkImportFenceFdInfoKHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pImportFenceFdInfo), pImportFenceFdInfo, VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR, true, + "VUID-vkImportFenceFdKHR-pImportFenceFdInfo-parameter", "VUID-VkImportFenceFdInfoKHR-sType-sType"); if (pImportFenceFdInfo != nullptr) { [[maybe_unused]] const Location pImportFenceFdInfo_loc = loc.dot(Field::pImportFenceFdInfo); - skip |= ValidateStructPnext(pImportFenceFdInfo_loc, pImportFenceFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImportFenceFdInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pImportFenceFdInfo_loc, pImportFenceFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImportFenceFdInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportFenceFdInfo_loc.dot(Field::fence), pImportFenceFdInfo->fence); + skip |= state.ValidateRequiredHandle(pImportFenceFdInfo_loc.dot(Field::fence), pImportFenceFdInfo->fence); - skip |= ValidateFlags(pImportFenceFdInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkFenceImportFlagBits, - AllVkFenceImportFlagBits, pImportFenceFdInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkImportFenceFdInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pImportFenceFdInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkFenceImportFlagBits, + AllVkFenceImportFlagBits, pImportFenceFdInfo->flags, kOptionalFlags, + "VUID-VkImportFenceFdInfoKHR-flags-parameter"); - skip |= - ValidateFlags(pImportFenceFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, - AllVkExternalFenceHandleTypeFlagBits, pImportFenceFdInfo->handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkImportFenceFdInfoKHR-handleType-parameter", "VUID-VkImportFenceFdInfoKHR-handleType-parameter"); + skip |= state.ValidateFlags( + pImportFenceFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, + AllVkExternalFenceHandleTypeFlagBits, pImportFenceFdInfo->handleType, kRequiredSingleBit, + "VUID-VkImportFenceFdInfoKHR-handleType-parameter", "VUID-VkImportFenceFdInfoKHR-handleType-parameter"); } - if (!skip) skip |= manual_PreCallValidateImportFenceFdKHR(device, pImportFenceFdInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateImportFenceFdKHR(device, pImportFenceFdInfo, state); return skip; } bool StatelessValidation::PreCallValidateGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_external_fence_fd)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_fence_fd}); - skip |= ValidateStructType(loc.dot(Field::pGetFdInfo), pGetFdInfo, VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR, true, - "VUID-vkGetFenceFdKHR-pGetFdInfo-parameter", "VUID-VkFenceGetFdInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pGetFdInfo), pGetFdInfo, VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR, true, + "VUID-vkGetFenceFdKHR-pGetFdInfo-parameter", "VUID-VkFenceGetFdInfoKHR-sType-sType"); if (pGetFdInfo != nullptr) { [[maybe_unused]] const Location pGetFdInfo_loc = loc.dot(Field::pGetFdInfo); - skip |= ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkFenceGetFdInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkFenceGetFdInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::fence), pGetFdInfo->fence); + skip |= state.ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::fence), pGetFdInfo->fence); - skip |= ValidateFlags(pGetFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, - AllVkExternalFenceHandleTypeFlagBits, pGetFdInfo->handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkFenceGetFdInfoKHR-handleType-parameter", "VUID-VkFenceGetFdInfoKHR-handleType-parameter"); + skip |= + state.ValidateFlags(pGetFdInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, + AllVkExternalFenceHandleTypeFlagBits, pGetFdInfo->handleType, kRequiredSingleBit, + "VUID-VkFenceGetFdInfoKHR-handleType-parameter", "VUID-VkFenceGetFdInfoKHR-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetFenceFdKHR-pFd-parameter"); - if (!skip) skip |= manual_PreCallValidateGetFenceFdKHR(device, pGetFdInfo, pFd, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetFenceFdKHR-pFd-parameter"); + if (!skip) skip |= manual_PreCallValidateGetFenceFdKHR(device, pGetFdInfo, pFd, state); return skip; } @@ -19142,29 +21398,33 @@ bool StatelessValidation::PreCallValidateEnumeratePhysicalDeviceQueueFamilyPerfo VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pCounterCount), loc.dot(Field::pCounters), pCounterCount, pCounters, VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR, true, false, false, "VUID-VkPerformanceCounterKHR-sType-sType", kVUIDUndefined, "VUID-vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR-pCounterCount-parameter", kVUIDUndefined); if (pCounters != nullptr) { for (uint32_t pIndexerIndex = 0; pIndexerIndex < *pCounterCount; ++pIndexerIndex) { [[maybe_unused]] const Location pCounters_loc = loc.dot(Field::pCounters, pIndexerIndex); - skip |= ValidateStructPnext(pCounters_loc, pCounters[pIndexerIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPerformanceCounterKHR-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= + state.ValidateStructPnext(pCounters_loc, pCounters[pIndexerIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPerformanceCounterKHR-pNext-pNext", kVUIDUndefined, false); } } - skip |= ValidateStructTypeArray(loc.dot(Field::pCounterCount), loc.dot(Field::pCounterDescriptions), pCounterCount, - pCounterDescriptions, VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR, true, false, false, - "VUID-VkPerformanceCounterDescriptionKHR-sType-sType", kVUIDUndefined, - "VUID-vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR-pCounterCount-parameter", - kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + loc.dot(Field::pCounterCount), loc.dot(Field::pCounterDescriptions), pCounterCount, pCounterDescriptions, + VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR, true, false, false, + "VUID-VkPerformanceCounterDescriptionKHR-sType-sType", kVUIDUndefined, + "VUID-vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR-pCounterCount-parameter", kVUIDUndefined); if (pCounterDescriptions != nullptr) { for (uint32_t pIndexerIndex = 0; pIndexerIndex < *pCounterCount; ++pIndexerIndex) { [[maybe_unused]] const Location pCounterDescriptions_loc = loc.dot(Field::pCounterDescriptions, pIndexerIndex); - skip |= ValidateStructPnext(pCounterDescriptions_loc, pCounterDescriptions[pIndexerIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkPerformanceCounterDescriptionKHR-pNext-pNext", - kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pCounterDescriptions_loc, pCounterDescriptions[pIndexerIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPerformanceCounterDescriptionKHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19174,45 +21434,52 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceQueueFamilyPerformance VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pPerformanceQueryCreateInfo), pPerformanceQueryCreateInfo, - VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR, true, - "VUID-vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR-pPerformanceQueryCreateInfo-parameter", - "VUID-VkQueryPoolPerformanceCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pPerformanceQueryCreateInfo), pPerformanceQueryCreateInfo, + VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR, true, + "VUID-vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR-pPerformanceQueryCreateInfo-parameter", + "VUID-VkQueryPoolPerformanceCreateInfoKHR-sType-sType"); if (pPerformanceQueryCreateInfo != nullptr) { [[maybe_unused]] const Location pPerformanceQueryCreateInfo_loc = loc.dot(Field::pPerformanceQueryCreateInfo); - skip |= ValidateArray(pPerformanceQueryCreateInfo_loc.dot(Field::counterIndexCount), - pPerformanceQueryCreateInfo_loc.dot(Field::pCounterIndices), - pPerformanceQueryCreateInfo->counterIndexCount, &pPerformanceQueryCreateInfo->pCounterIndices, true, - true, "VUID-VkQueryPoolPerformanceCreateInfoKHR-counterIndexCount-arraylength", - "VUID-VkQueryPoolPerformanceCreateInfoKHR-pCounterIndices-parameter"); + skip |= state.ValidateArray(pPerformanceQueryCreateInfo_loc.dot(Field::counterIndexCount), + pPerformanceQueryCreateInfo_loc.dot(Field::pCounterIndices), + pPerformanceQueryCreateInfo->counterIndexCount, &pPerformanceQueryCreateInfo->pCounterIndices, + true, true, "VUID-VkQueryPoolPerformanceCreateInfoKHR-counterIndexCount-arraylength", + "VUID-VkQueryPoolPerformanceCreateInfoKHR-pCounterIndices-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pNumPasses), pNumPasses, - "VUID-vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR-pNumPasses-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pNumPasses), pNumPasses, + "VUID-vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR-pNumPasses-parameter"); return skip; } bool StatelessValidation::PreCallValidateAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_performance_query}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR, true, - "VUID-vkAcquireProfilingLockKHR-pInfo-parameter", "VUID-VkAcquireProfilingLockInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR, true, + "VUID-vkAcquireProfilingLockKHR-pInfo-parameter", + "VUID-VkAcquireProfilingLockInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAcquireProfilingLockInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAcquireProfilingLockInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pInfo_loc.dot(Field::flags), pInfo->flags, - "VUID-VkAcquireProfilingLockInfoKHR-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pInfo_loc.dot(Field::flags), pInfo->flags, + "VUID-VkAcquireProfilingLockInfoKHR-flags-zerobitmask"); } return skip; } bool StatelessValidation::PreCallValidateReleaseProfilingLockKHR(VkDevice device, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_performance_query}); @@ -19224,27 +21491,31 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KH VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_surface_capabilities2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_surface_capabilities2}); - skip |= ValidateStructType(loc.dot(Field::pSurfaceInfo), pSurfaceInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, - true, "VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter", - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pSurfaceInfo), pSurfaceInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, + true, "VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-parameter", + "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType"); if (pSurfaceInfo != nullptr) { [[maybe_unused]] const Location pSurfaceInfo_loc = loc.dot(Field::pSurfaceInfo); constexpr std::array allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR = { VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT, VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT}; - skip |= ValidateStructPnext(pSurfaceInfo_loc, pSurfaceInfo->pNext, allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.size(), - allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-unique", physicalDevice, true); + skip |= state.ValidateStructPnext( + pSurfaceInfo_loc, pSurfaceInfo->pNext, allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.size(), + allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-unique", true); } - skip |= - ValidateStructType(loc.dot(Field::pSurfaceCapabilities), pSurfaceCapabilities, VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR, - true, "VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter", - "VUID-VkSurfaceCapabilities2KHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pSurfaceCapabilities), pSurfaceCapabilities, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR, true, + "VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceCapabilities-parameter", + "VUID-VkSurfaceCapabilities2KHR-sType-sType"); if (pSurfaceCapabilities != nullptr) { [[maybe_unused]] const Location pSurfaceCapabilities_loc = loc.dot(Field::pSurfaceCapabilities); constexpr std::array allowed_structs_VkSurfaceCapabilities2KHR = { @@ -19257,14 +21528,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KH VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT, VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pSurfaceCapabilities_loc, pSurfaceCapabilities->pNext, allowed_structs_VkSurfaceCapabilities2KHR.size(), allowed_structs_VkSurfaceCapabilities2KHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSurfaceCapabilities2KHR-pNext-pNext", "VUID-VkSurfaceCapabilities2KHR-sType-unique", physicalDevice, false); + "VUID-VkSurfaceCapabilities2KHR-pNext-pNext", "VUID-VkSurfaceCapabilities2KHR-sType-unique", false); } if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo, pSurfaceCapabilities, - error_obj); + state); return skip; } @@ -19274,41 +21545,44 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(VkP VkSurfaceFormat2KHR* pSurfaceFormats, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_surface_capabilities2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_surface_capabilities2}); - skip |= ValidateStructType(loc.dot(Field::pSurfaceInfo), pSurfaceInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, - true, "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter", - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pSurfaceInfo), pSurfaceInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, true, + "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-parameter", "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType"); if (pSurfaceInfo != nullptr) { [[maybe_unused]] const Location pSurfaceInfo_loc = loc.dot(Field::pSurfaceInfo); constexpr std::array allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR = { VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT, VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT}; - skip |= ValidateStructPnext(pSurfaceInfo_loc, pSurfaceInfo->pNext, allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.size(), - allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-unique", physicalDevice, true); + skip |= state.ValidateStructPnext( + pSurfaceInfo_loc, pSurfaceInfo->pNext, allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.size(), + allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-unique", true); } - skip |= ValidateStructTypeArray(loc.dot(Field::pSurfaceFormatCount), loc.dot(Field::pSurfaceFormats), pSurfaceFormatCount, - pSurfaceFormats, VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR, true, false, false, - "VUID-VkSurfaceFormat2KHR-sType-sType", kVUIDUndefined, - "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + loc.dot(Field::pSurfaceFormatCount), loc.dot(Field::pSurfaceFormats), pSurfaceFormatCount, pSurfaceFormats, + VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR, true, false, false, "VUID-VkSurfaceFormat2KHR-sType-sType", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceFormatCount-parameter", kVUIDUndefined); if (pSurfaceFormats != nullptr) { for (uint32_t pSurfaceFormatIndex = 0; pSurfaceFormatIndex < *pSurfaceFormatCount; ++pSurfaceFormatIndex) { [[maybe_unused]] const Location pSurfaceFormats_loc = loc.dot(Field::pSurfaceFormats, pSurfaceFormatIndex); constexpr std::array allowed_structs_VkSurfaceFormat2KHR = {VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT}; - skip |= ValidateStructPnext(pSurfaceFormats_loc, pSurfaceFormats[pSurfaceFormatIndex].pNext, - allowed_structs_VkSurfaceFormat2KHR.size(), allowed_structs_VkSurfaceFormat2KHR.data(), - GeneratedVulkanHeaderVersion, "VUID-VkSurfaceFormat2KHR-pNext-pNext", - "VUID-VkSurfaceFormat2KHR-sType-unique", physicalDevice, false); + skip |= state.ValidateStructPnext( + pSurfaceFormats_loc, pSurfaceFormats[pSurfaceFormatIndex].pNext, allowed_structs_VkSurfaceFormat2KHR.size(), + allowed_structs_VkSurfaceFormat2KHR.data(), GeneratedVulkanHeaderVersion, "VUID-VkSurfaceFormat2KHR-pNext-pNext", + "VUID-VkSurfaceFormat2KHR-sType-unique", false); } } if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(physicalDevice, pSurfaceInfo, pSurfaceFormatCount, - pSurfaceFormats, error_obj); + pSurfaceFormats, state); return skip; } @@ -19317,19 +21591,22 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDisplayProperties2KHR( VkDisplayProperties2KHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_display_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_display_properties2}); - skip |= ValidateStructTypeArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, - VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR, true, false, false, - "VUID-VkDisplayProperties2KHR-sType-sType", kVUIDUndefined, - "VUID-vkGetPhysicalDeviceDisplayProperties2KHR-pPropertyCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, + VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR, true, false, false, + "VUID-VkDisplayProperties2KHR-sType-sType", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceDisplayProperties2KHR-pPropertyCount-parameter", kVUIDUndefined); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); - skip |= - ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDisplayProperties2KHR-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkDisplayProperties2KHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19340,19 +21617,22 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDisplayPlaneProperties VkDisplayPlaneProperties2KHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_display_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_display_properties2}); - skip |= ValidateStructTypeArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, - VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR, true, false, false, - "VUID-VkDisplayPlaneProperties2KHR-sType-sType", kVUIDUndefined, - "VUID-vkGetPhysicalDeviceDisplayPlaneProperties2KHR-pPropertyCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, + VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR, true, false, false, "VUID-VkDisplayPlaneProperties2KHR-sType-sType", + kVUIDUndefined, "VUID-vkGetPhysicalDeviceDisplayPlaneProperties2KHR-pPropertyCount-parameter", kVUIDUndefined); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); - skip |= - ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDisplayPlaneProperties2KHR-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkDisplayPlaneProperties2KHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19363,25 +21643,27 @@ bool StatelessValidation::PreCallValidateGetDisplayModeProperties2KHR(VkPhysical VkDisplayModeProperties2KHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_display_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_display_properties2}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); - skip |= ValidateStructTypeArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, - VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR, true, false, false, - "VUID-VkDisplayModeProperties2KHR-sType-sType", kVUIDUndefined, - "VUID-vkGetDisplayModeProperties2KHR-pPropertyCount-parameter", kVUIDUndefined); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, + VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR, true, false, false, + "VUID-VkDisplayModeProperties2KHR-sType-sType", kVUIDUndefined, + "VUID-vkGetDisplayModeProperties2KHR-pPropertyCount-parameter", kVUIDUndefined); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); constexpr std::array allowed_structs_VkDisplayModeProperties2KHR = { VK_STRUCTURE_TYPE_DISPLAY_MODE_STEREO_PROPERTIES_NV}; - skip |= ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, - allowed_structs_VkDisplayModeProperties2KHR.size(), - allowed_structs_VkDisplayModeProperties2KHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDisplayModeProperties2KHR-pNext-pNext", - "VUID-VkDisplayModeProperties2KHR-sType-unique", physicalDevice, false); + skip |= state.ValidateStructPnext( + pProperties_loc, pProperties[pPropertyIndex].pNext, allowed_structs_VkDisplayModeProperties2KHR.size(), + allowed_structs_VkDisplayModeProperties2KHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDisplayModeProperties2KHR-pNext-pNext", "VUID-VkDisplayModeProperties2KHR-sType-unique", false); } } return skip; @@ -19392,26 +21674,29 @@ bool StatelessValidation::PreCallValidateGetDisplayPlaneCapabilities2KHR(VkPhysi VkDisplayPlaneCapabilities2KHR* pCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_khr_get_display_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_display_properties2}); - skip |= ValidateStructType(loc.dot(Field::pDisplayPlaneInfo), pDisplayPlaneInfo, VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR, - true, "VUID-vkGetDisplayPlaneCapabilities2KHR-pDisplayPlaneInfo-parameter", - "VUID-VkDisplayPlaneInfo2KHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pDisplayPlaneInfo), pDisplayPlaneInfo, VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR, true, + "VUID-vkGetDisplayPlaneCapabilities2KHR-pDisplayPlaneInfo-parameter", "VUID-VkDisplayPlaneInfo2KHR-sType-sType"); if (pDisplayPlaneInfo != nullptr) { [[maybe_unused]] const Location pDisplayPlaneInfo_loc = loc.dot(Field::pDisplayPlaneInfo); - skip |= ValidateStructPnext(pDisplayPlaneInfo_loc, pDisplayPlaneInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDisplayPlaneInfo2KHR-pNext-pNext", kVUIDUndefined, physicalDevice, true); + skip |= state.ValidateStructPnext(pDisplayPlaneInfo_loc, pDisplayPlaneInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDisplayPlaneInfo2KHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pDisplayPlaneInfo_loc.dot(Field::mode), pDisplayPlaneInfo->mode); + skip |= state.ValidateRequiredHandle(pDisplayPlaneInfo_loc.dot(Field::mode), pDisplayPlaneInfo->mode); } - skip |= ValidateStructType(loc.dot(Field::pCapabilities), pCapabilities, VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR, - true, "VUID-vkGetDisplayPlaneCapabilities2KHR-pCapabilities-parameter", - "VUID-VkDisplayPlaneCapabilities2KHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCapabilities), pCapabilities, VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR, true, + "VUID-vkGetDisplayPlaneCapabilities2KHR-pCapabilities-parameter", "VUID-VkDisplayPlaneCapabilities2KHR-sType-sType"); if (pCapabilities != nullptr) { [[maybe_unused]] const Location pCapabilities_loc = loc.dot(Field::pCapabilities); - skip |= ValidateStructPnext(pCapabilities_loc, pCapabilities->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDisplayPlaneCapabilities2KHR-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pCapabilities_loc, pCapabilities->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDisplayPlaneCapabilities2KHR-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -19421,6 +21706,7 @@ bool StatelessValidation::PreCallValidateGetImageMemoryRequirements2KHR(VkDevice VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_get_memory_requirements2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_memory_requirements2}); @@ -19433,6 +21719,7 @@ bool StatelessValidation::PreCallValidateGetBufferMemoryRequirements2KHR(VkDevic VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_get_memory_requirements2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_memory_requirements2}); @@ -19444,6 +21731,7 @@ bool StatelessValidation::PreCallValidateGetImageSparseMemoryRequirements2KHR( VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_get_memory_requirements2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_memory_requirements2}); @@ -19458,6 +21746,7 @@ bool StatelessValidation::PreCallValidateCreateSamplerYcbcrConversionKHR(VkDevic VkSamplerYcbcrConversion* pYcbcrConversion, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}); @@ -19469,6 +21758,7 @@ bool StatelessValidation::PreCallValidateDestroySamplerYcbcrConversionKHR(VkDevi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}); @@ -19480,6 +21770,7 @@ bool StatelessValidation::PreCallValidateBindBufferMemory2KHR(VkDevice device, u const VkBindBufferMemoryInfo* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_bind_memory2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_bind_memory2}); @@ -19491,6 +21782,7 @@ bool StatelessValidation::PreCallValidateBindImageMemory2KHR(VkDevice device, ui const VkBindImageMemoryInfo* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_bind_memory2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_bind_memory2}); @@ -19503,6 +21795,7 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutSupportKHR(VkDevi VkDescriptorSetLayoutSupport* pSupport, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance3)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance3}); @@ -19515,6 +21808,7 @@ bool StatelessValidation::PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_draw_indirect_count)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_draw_indirect_count}); @@ -19528,6 +21822,7 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirectCountKHR(VkComman VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_draw_indirect_count)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_draw_indirect_count}); @@ -19539,6 +21834,7 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirectCountKHR(VkComman bool StatelessValidation::PreCallValidateGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_timeline_semaphore)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_timeline_semaphore}); @@ -19549,6 +21845,7 @@ bool StatelessValidation::PreCallValidateGetSemaphoreCounterValueKHR(VkDevice de bool StatelessValidation::PreCallValidateWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_timeline_semaphore)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_timeline_semaphore}); @@ -19559,6 +21856,7 @@ bool StatelessValidation::PreCallValidateWaitSemaphoresKHR(VkDevice device, cons bool StatelessValidation::PreCallValidateSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_timeline_semaphore)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_timeline_semaphore}); @@ -19570,8 +21868,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFragmentShadingRatesKH VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pFragmentShadingRateCount), loc.dot(Field::pFragmentShadingRates), pFragmentShadingRateCount, pFragmentShadingRates, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR, true, false, false, "VUID-VkPhysicalDeviceFragmentShadingRateKHR-sType-sType", kVUIDUndefined, @@ -19581,10 +21882,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFragmentShadingRatesKH ++pFragmentShadingRateIndex) { [[maybe_unused]] const Location pFragmentShadingRates_loc = loc.dot(Field::pFragmentShadingRates, pFragmentShadingRateIndex); - skip |= - ValidateStructPnext(pFragmentShadingRates_loc, pFragmentShadingRates[pFragmentShadingRateIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceFragmentShadingRateKHR-pNext-pNext", - kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pFragmentShadingRates_loc, pFragmentShadingRates[pFragmentShadingRateIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceFragmentShadingRateKHR-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -19595,19 +21895,22 @@ bool StatelessValidation::PreCallValidateCmdSetFragmentShadingRateKHR(VkCommandB const VkFragmentShadingRateCombinerOpKHR combinerOps[2], const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_fragment_shading_rate}); - skip |= ValidateRequiredPointer(loc.dot(Field::pFragmentSize), pFragmentSize, - "VUID-vkCmdSetFragmentShadingRateKHR-pFragmentSize-parameter"); - skip |= ValidateRangedEnumArray(loc, loc.dot(Field::combinerOps), vvl::Enum::VkFragmentShadingRateCombinerOpKHR, 2, combinerOps, - false, true, kVUIDUndefined, "VUID-vkCmdSetFragmentShadingRateKHR-combinerOps-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFragmentSize), pFragmentSize, + "VUID-vkCmdSetFragmentShadingRateKHR-pFragmentSize-parameter"); + skip |= state.ValidateRangedEnumArray(loc, loc.dot(Field::combinerOps), vvl::Enum::VkFragmentShadingRateCombinerOpKHR, 2, + combinerOps, false, true, kVUIDUndefined, + "VUID-vkCmdSetFragmentShadingRateKHR-combinerOps-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetRenderingAttachmentLocationsKHR( VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo* pLocationInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_dynamic_rendering_local_read}); @@ -19619,6 +21922,7 @@ bool StatelessValidation::PreCallValidateCmdSetRenderingInputAttachmentIndicesKH VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_dynamic_rendering_local_read}); @@ -19629,16 +21933,18 @@ bool StatelessValidation::PreCallValidateCmdSetRenderingInputAttachmentIndicesKH bool StatelessValidation::PreCallValidateWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, uint64_t timeout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_present_wait)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_present_wait}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); return skip; } bool StatelessValidation::PreCallValidateGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_buffer_device_address}); @@ -19649,6 +21955,7 @@ bool StatelessValidation::PreCallValidateGetBufferDeviceAddressKHR(VkDevice devi bool StatelessValidation::PreCallValidateGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_buffer_device_address}); @@ -19660,6 +21967,7 @@ bool StatelessValidation::PreCallValidateGetDeviceMemoryOpaqueCaptureAddressKHR( const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_buffer_device_address}); @@ -19671,15 +21979,16 @@ bool StatelessValidation::PreCallValidateCreateDeferredOperationKHR(VkDevice dev VkDeferredOperationKHR* pDeferredOperation, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_deferred_host_operations}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pDeferredOperation), pDeferredOperation, - "VUID-vkCreateDeferredOperationKHR-pDeferredOperation-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pDeferredOperation), pDeferredOperation, + "VUID-vkCreateDeferredOperationKHR-pDeferredOperation-parameter"); return skip; } @@ -19687,12 +21996,13 @@ bool StatelessValidation::PreCallValidateDestroyDeferredOperationKHR(VkDevice de const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_deferred_host_operations}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -19700,30 +22010,33 @@ bool StatelessValidation::PreCallValidateDestroyDeferredOperationKHR(VkDevice de bool StatelessValidation::PreCallValidateGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_deferred_host_operations}); - skip |= ValidateRequiredHandle(loc.dot(Field::operation), operation); + skip |= state.ValidateRequiredHandle(loc.dot(Field::operation), operation); return skip; } bool StatelessValidation::PreCallValidateGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_deferred_host_operations}); - skip |= ValidateRequiredHandle(loc.dot(Field::operation), operation); + skip |= state.ValidateRequiredHandle(loc.dot(Field::operation), operation); return skip; } bool StatelessValidation::PreCallValidateDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_deferred_host_operations}); - skip |= ValidateRequiredHandle(loc.dot(Field::operation), operation); + skip |= state.ValidateRequiredHandle(loc.dot(Field::operation), operation); return skip; } @@ -19732,29 +22045,30 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutablePropertiesKHR(VkDe VkPipelineExecutablePropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_pipeline_executable_properties)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_pipeline_executable_properties}); - skip |= ValidateStructType(loc.dot(Field::pPipelineInfo), pPipelineInfo, VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, true, - "VUID-vkGetPipelineExecutablePropertiesKHR-pPipelineInfo-parameter", - "VUID-VkPipelineInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pPipelineInfo), pPipelineInfo, VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, true, + "VUID-vkGetPipelineExecutablePropertiesKHR-pPipelineInfo-parameter", + "VUID-VkPipelineInfoKHR-sType-sType"); if (pPipelineInfo != nullptr) { [[maybe_unused]] const Location pPipelineInfo_loc = loc.dot(Field::pPipelineInfo); - skip |= ValidateStructPnext(pPipelineInfo_loc, pPipelineInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pPipelineInfo_loc, pPipelineInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pPipelineInfo_loc.dot(Field::pipeline), pPipelineInfo->pipeline); + skip |= state.ValidateRequiredHandle(pPipelineInfo_loc.dot(Field::pipeline), pPipelineInfo->pipeline); } - skip |= ValidateStructTypeArray(loc.dot(Field::pExecutableCount), loc.dot(Field::pProperties), pExecutableCount, pProperties, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR, true, false, false, - "VUID-VkPipelineExecutablePropertiesKHR-sType-sType", kVUIDUndefined, - "VUID-vkGetPipelineExecutablePropertiesKHR-pExecutableCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pExecutableCount), loc.dot(Field::pProperties), pExecutableCount, + pProperties, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR, true, false, false, + "VUID-VkPipelineExecutablePropertiesKHR-sType-sType", kVUIDUndefined, + "VUID-vkGetPipelineExecutablePropertiesKHR-pExecutableCount-parameter", kVUIDUndefined); if (pProperties != nullptr) { for (uint32_t pExecutableIndex = 0; pExecutableIndex < *pExecutableCount; ++pExecutableIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pExecutableIndex); - skip |= - ValidateStructPnext(pProperties_loc, pProperties[pExecutableIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineExecutablePropertiesKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties[pExecutableIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineExecutablePropertiesKHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19766,29 +22080,30 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutableStatisticsKHR(VkDe VkPipelineExecutableStatisticKHR* pStatistics, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_pipeline_executable_properties)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_pipeline_executable_properties}); - skip |= ValidateStructType(loc.dot(Field::pExecutableInfo), pExecutableInfo, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR, - true, "VUID-vkGetPipelineExecutableStatisticsKHR-pExecutableInfo-parameter", - "VUID-VkPipelineExecutableInfoKHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pExecutableInfo), pExecutableInfo, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR, true, + "VUID-vkGetPipelineExecutableStatisticsKHR-pExecutableInfo-parameter", "VUID-VkPipelineExecutableInfoKHR-sType-sType"); if (pExecutableInfo != nullptr) { [[maybe_unused]] const Location pExecutableInfo_loc = loc.dot(Field::pExecutableInfo); - skip |= ValidateStructPnext(pExecutableInfo_loc, pExecutableInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineExecutableInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pExecutableInfo_loc, pExecutableInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineExecutableInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pExecutableInfo_loc.dot(Field::pipeline), pExecutableInfo->pipeline); + skip |= state.ValidateRequiredHandle(pExecutableInfo_loc.dot(Field::pipeline), pExecutableInfo->pipeline); } - skip |= ValidateStructTypeArray(loc.dot(Field::pStatisticCount), loc.dot(Field::pStatistics), pStatisticCount, pStatistics, - VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR, true, false, false, - "VUID-VkPipelineExecutableStatisticKHR-sType-sType", kVUIDUndefined, - "VUID-vkGetPipelineExecutableStatisticsKHR-pStatisticCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pStatisticCount), loc.dot(Field::pStatistics), pStatisticCount, + pStatistics, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR, true, false, false, + "VUID-VkPipelineExecutableStatisticKHR-sType-sType", kVUIDUndefined, + "VUID-vkGetPipelineExecutableStatisticsKHR-pStatisticCount-parameter", kVUIDUndefined); if (pStatistics != nullptr) { for (uint32_t pStatisticIndex = 0; pStatisticIndex < *pStatisticCount; ++pStatisticIndex) { [[maybe_unused]] const Location pStatistics_loc = loc.dot(Field::pStatistics, pStatisticIndex); - skip |= - ValidateStructPnext(pStatistics_loc, pStatistics[pStatisticIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineExecutableStatisticKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pStatistics_loc, pStatistics[pStatisticIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineExecutableStatisticKHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19798,20 +22113,22 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutableInternalRepresenta VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_pipeline_executable_properties)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_pipeline_executable_properties}); - skip |= ValidateStructType(loc.dot(Field::pExecutableInfo), pExecutableInfo, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR, - true, "VUID-vkGetPipelineExecutableInternalRepresentationsKHR-pExecutableInfo-parameter", - "VUID-VkPipelineExecutableInfoKHR-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pExecutableInfo), pExecutableInfo, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR, + true, "VUID-vkGetPipelineExecutableInternalRepresentationsKHR-pExecutableInfo-parameter", + "VUID-VkPipelineExecutableInfoKHR-sType-sType"); if (pExecutableInfo != nullptr) { [[maybe_unused]] const Location pExecutableInfo_loc = loc.dot(Field::pExecutableInfo); - skip |= ValidateStructPnext(pExecutableInfo_loc, pExecutableInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineExecutableInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pExecutableInfo_loc, pExecutableInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineExecutableInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pExecutableInfo_loc.dot(Field::pipeline), pExecutableInfo->pipeline); + skip |= state.ValidateRequiredHandle(pExecutableInfo_loc.dot(Field::pipeline), pExecutableInfo->pipeline); } - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pInternalRepresentationCount), loc.dot(Field::pInternalRepresentations), pInternalRepresentationCount, pInternalRepresentations, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR, true, false, false, "VUID-VkPipelineExecutableInternalRepresentationKHR-sType-sType", kVUIDUndefined, @@ -19821,10 +22138,10 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutableInternalRepresenta ++pInternalRepresentationIndex) { [[maybe_unused]] const Location pInternalRepresentations_loc = loc.dot(Field::pInternalRepresentations, pInternalRepresentationIndex); - skip |= ValidateStructPnext(pInternalRepresentations_loc, pInternalRepresentations[pInternalRepresentationIndex].pNext, - 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineExecutableInternalRepresentationKHR-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pInternalRepresentations_loc, pInternalRepresentations[pInternalRepresentationIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineExecutableInternalRepresentationKHR-pNext-pNext", kVUIDUndefined, + false); } } return skip; @@ -19833,6 +22150,7 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutableInternalRepresenta bool StatelessValidation::PreCallValidateMapMemory2KHR(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_map_memory2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_map_memory2}); @@ -19843,6 +22161,7 @@ bool StatelessValidation::PreCallValidateMapMemory2KHR(VkDevice device, const Vk bool StatelessValidation::PreCallValidateUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_map_memory2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_map_memory2}); @@ -19854,51 +22173,54 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceVideoEncodeQualityLeve VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo, VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pQualityLevelInfo), pQualityLevelInfo, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR, true, - "VUID-vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR-pQualityLevelInfo-parameter", - "VUID-VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pQualityLevelInfo), pQualityLevelInfo, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR, true, + "VUID-vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR-pQualityLevelInfo-parameter", + "VUID-VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR-sType-sType"); if (pQualityLevelInfo != nullptr) { [[maybe_unused]] const Location pQualityLevelInfo_loc = loc.dot(Field::pQualityLevelInfo); - skip |= ValidateStructPnext(pQualityLevelInfo_loc, pQualityLevelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR-pNext-pNext", kVUIDUndefined, - physicalDevice, true); + skip |= state.ValidateStructPnext(pQualityLevelInfo_loc, pQualityLevelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateStructType(pQualityLevelInfo_loc.dot(Field::pVideoProfile), pQualityLevelInfo->pVideoProfile, - VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, true, - "VUID-VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR-pVideoProfile-parameter", - "VUID-VkVideoProfileInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pQualityLevelInfo_loc.dot(Field::pVideoProfile), pQualityLevelInfo->pVideoProfile, + VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, true, + "VUID-VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR-pVideoProfile-parameter", + "VUID-VkVideoProfileInfoKHR-sType-sType"); if (pQualityLevelInfo->pVideoProfile != nullptr) { [[maybe_unused]] const Location pVideoProfile_loc = pQualityLevelInfo_loc.dot(Field::pVideoProfile); - skip |= - ValidateFlags(pVideoProfile_loc.dot(Field::videoCodecOperation), vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, - AllVkVideoCodecOperationFlagBitsKHR, pQualityLevelInfo->pVideoProfile->videoCodecOperation, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", - "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); - - skip |= ValidateFlags(pVideoProfile_loc.dot(Field::chromaSubsampling), - vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, AllVkVideoChromaSubsamplingFlagBitsKHR, - pQualityLevelInfo->pVideoProfile->chromaSubsampling, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", - "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); - - skip |= ValidateFlags(pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, - AllVkVideoComponentBitDepthFlagBitsKHR, pQualityLevelInfo->pVideoProfile->lumaBitDepth, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", - "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); - - skip |= - ValidateFlags(pVideoProfile_loc.dot(Field::chromaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, - AllVkVideoComponentBitDepthFlagBitsKHR, pQualityLevelInfo->pVideoProfile->chromaBitDepth, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); + skip |= state.ValidateFlags(pVideoProfile_loc.dot(Field::videoCodecOperation), + vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, AllVkVideoCodecOperationFlagBitsKHR, + pQualityLevelInfo->pVideoProfile->videoCodecOperation, kRequiredSingleBit, + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); + + skip |= state.ValidateFlags(pVideoProfile_loc.dot(Field::chromaSubsampling), + vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, + AllVkVideoChromaSubsamplingFlagBitsKHR, pQualityLevelInfo->pVideoProfile->chromaSubsampling, + kRequiredFlags, "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); + + skip |= state.ValidateFlags( + pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pQualityLevelInfo->pVideoProfile->lumaBitDepth, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); + + skip |= state.ValidateFlags(pVideoProfile_loc.dot(Field::chromaBitDepth), + vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pQualityLevelInfo->pVideoProfile->chromaBitDepth, + kOptionalFlags, "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); } } - skip |= ValidateStructType(loc.dot(Field::pQualityLevelProperties), pQualityLevelProperties, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_PROPERTIES_KHR, true, - "VUID-vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR-pQualityLevelProperties-parameter", - "VUID-VkVideoEncodeQualityLevelPropertiesKHR-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pQualityLevelProperties), pQualityLevelProperties, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_PROPERTIES_KHR, true, + "VUID-vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR-pQualityLevelProperties-parameter", + "VUID-VkVideoEncodeQualityLevelPropertiesKHR-sType-sType"); if (pQualityLevelProperties != nullptr) { [[maybe_unused]] const Location pQualityLevelProperties_loc = loc.dot(Field::pQualityLevelProperties); constexpr std::array allowed_structs_VkVideoEncodeQualityLevelPropertiesKHR = { @@ -19906,11 +22228,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceVideoEncodeQualityLeve VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR}; - skip |= ValidateStructPnext(pQualityLevelProperties_loc, pQualityLevelProperties->pNext, - allowed_structs_VkVideoEncodeQualityLevelPropertiesKHR.size(), - allowed_structs_VkVideoEncodeQualityLevelPropertiesKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoEncodeQualityLevelPropertiesKHR-pNext-pNext", - "VUID-VkVideoEncodeQualityLevelPropertiesKHR-sType-unique", physicalDevice, false); + skip |= state.ValidateStructPnext(pQualityLevelProperties_loc, pQualityLevelProperties->pNext, + allowed_structs_VkVideoEncodeQualityLevelPropertiesKHR.size(), + allowed_structs_VkVideoEncodeQualityLevelPropertiesKHR.data(), + GeneratedVulkanHeaderVersion, "VUID-VkVideoEncodeQualityLevelPropertiesKHR-pNext-pNext", + "VUID-VkVideoEncodeQualityLevelPropertiesKHR-sType-unique", false); } return skip; } @@ -19920,58 +22242,60 @@ bool StatelessValidation::PreCallValidateGetEncodedVideoSessionParametersKHR( VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo, size_t* pDataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_encode_queue}); - skip |= ValidateStructType(loc.dot(Field::pVideoSessionParametersInfo), pVideoSessionParametersInfo, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_GET_INFO_KHR, true, - "VUID-vkGetEncodedVideoSessionParametersKHR-pVideoSessionParametersInfo-parameter", - "VUID-VkVideoEncodeSessionParametersGetInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pVideoSessionParametersInfo), pVideoSessionParametersInfo, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_GET_INFO_KHR, true, + "VUID-vkGetEncodedVideoSessionParametersKHR-pVideoSessionParametersInfo-parameter", + "VUID-VkVideoEncodeSessionParametersGetInfoKHR-sType-sType"); if (pVideoSessionParametersInfo != nullptr) { [[maybe_unused]] const Location pVideoSessionParametersInfo_loc = loc.dot(Field::pVideoSessionParametersInfo); constexpr std::array allowed_structs_VkVideoEncodeSessionParametersGetInfoKHR = { VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_KHR}; - skip |= ValidateStructPnext(pVideoSessionParametersInfo_loc, pVideoSessionParametersInfo->pNext, - allowed_structs_VkVideoEncodeSessionParametersGetInfoKHR.size(), - allowed_structs_VkVideoEncodeSessionParametersGetInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoEncodeSessionParametersGetInfoKHR-pNext-pNext", - "VUID-VkVideoEncodeSessionParametersGetInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pVideoSessionParametersInfo_loc, pVideoSessionParametersInfo->pNext, + allowed_structs_VkVideoEncodeSessionParametersGetInfoKHR.size(), + allowed_structs_VkVideoEncodeSessionParametersGetInfoKHR.data(), + GeneratedVulkanHeaderVersion, "VUID-VkVideoEncodeSessionParametersGetInfoKHR-pNext-pNext", + "VUID-VkVideoEncodeSessionParametersGetInfoKHR-sType-unique", true); - skip |= ValidateRequiredHandle(pVideoSessionParametersInfo_loc.dot(Field::videoSessionParameters), - pVideoSessionParametersInfo->videoSessionParameters); + skip |= state.ValidateRequiredHandle(pVideoSessionParametersInfo_loc.dot(Field::videoSessionParameters), + pVideoSessionParametersInfo->videoSessionParameters); } - skip |= ValidateStructType(loc.dot(Field::pFeedbackInfo), pFeedbackInfo, - VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR, false, - "VUID-vkGetEncodedVideoSessionParametersKHR-pFeedbackInfo-parameter", - "VUID-VkVideoEncodeSessionParametersFeedbackInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pFeedbackInfo), pFeedbackInfo, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR, false, + "VUID-vkGetEncodedVideoSessionParametersKHR-pFeedbackInfo-parameter", + "VUID-VkVideoEncodeSessionParametersFeedbackInfoKHR-sType-sType"); if (pFeedbackInfo != nullptr) { [[maybe_unused]] const Location pFeedbackInfo_loc = loc.dot(Field::pFeedbackInfo); constexpr std::array allowed_structs_VkVideoEncodeSessionParametersFeedbackInfoKHR = { VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR}; - skip |= ValidateStructPnext(pFeedbackInfo_loc, pFeedbackInfo->pNext, - allowed_structs_VkVideoEncodeSessionParametersFeedbackInfoKHR.size(), - allowed_structs_VkVideoEncodeSessionParametersFeedbackInfoKHR.data(), - GeneratedVulkanHeaderVersion, "VUID-VkVideoEncodeSessionParametersFeedbackInfoKHR-pNext-pNext", - "VUID-VkVideoEncodeSessionParametersFeedbackInfoKHR-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pFeedbackInfo_loc, pFeedbackInfo->pNext, allowed_structs_VkVideoEncodeSessionParametersFeedbackInfoKHR.size(), + allowed_structs_VkVideoEncodeSessionParametersFeedbackInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoEncodeSessionParametersFeedbackInfoKHR-pNext-pNext", + "VUID-VkVideoEncodeSessionParametersFeedbackInfoKHR-sType-unique", false); } - skip |= ValidatePointerArray(loc.dot(Field::pDataSize), loc.dot(Field::pData), pDataSize, &pData, true, false, false, - "VUID-vkGetEncodedVideoSessionParametersKHR-pDataSize-parameter", kVUIDUndefined, - "VUID-vkGetEncodedVideoSessionParametersKHR-pData-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pDataSize), loc.dot(Field::pData), pDataSize, &pData, true, false, false, + "VUID-vkGetEncodedVideoSessionParametersKHR-pDataSize-parameter", kVUIDUndefined, + "VUID-vkGetEncodedVideoSessionParametersKHR-pData-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdEncodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_encode_queue}); - skip |= ValidateStructType(loc.dot(Field::pEncodeInfo), pEncodeInfo, VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR, true, - "VUID-vkCmdEncodeVideoKHR-pEncodeInfo-parameter", "VUID-VkVideoEncodeInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pEncodeInfo), pEncodeInfo, VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR, true, + "VUID-vkCmdEncodeVideoKHR-pEncodeInfo-parameter", "VUID-VkVideoEncodeInfoKHR-sType-sType"); if (pEncodeInfo != nullptr) { [[maybe_unused]] const Location pEncodeInfo_loc = loc.dot(Field::pEncodeInfo); constexpr std::array allowed_structs_VkVideoEncodeInfoKHR = { @@ -19979,36 +22303,35 @@ bool StatelessValidation::PreCallValidateCmdEncodeVideoKHR(VkCommandBuffer comma VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUANTIZATION_MAP_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR}; - skip |= ValidateStructPnext(pEncodeInfo_loc, pEncodeInfo->pNext, allowed_structs_VkVideoEncodeInfoKHR.size(), - allowed_structs_VkVideoEncodeInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoEncodeInfoKHR-pNext-pNext", "VUID-VkVideoEncodeInfoKHR-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pEncodeInfo_loc, pEncodeInfo->pNext, allowed_structs_VkVideoEncodeInfoKHR.size(), + allowed_structs_VkVideoEncodeInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoEncodeInfoKHR-pNext-pNext", "VUID-VkVideoEncodeInfoKHR-sType-unique", true); - skip |= ValidateFlags(pEncodeInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoEncodeFlagBitsKHR, - AllVkVideoEncodeFlagBitsKHR, pEncodeInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkVideoEncodeInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pEncodeInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoEncodeFlagBitsKHR, + AllVkVideoEncodeFlagBitsKHR, pEncodeInfo->flags, kOptionalFlags, + "VUID-VkVideoEncodeInfoKHR-flags-parameter"); - skip |= ValidateRequiredHandle(pEncodeInfo_loc.dot(Field::dstBuffer), pEncodeInfo->dstBuffer); + skip |= state.ValidateRequiredHandle(pEncodeInfo_loc.dot(Field::dstBuffer), pEncodeInfo->dstBuffer); - skip |= ValidateStructType(pEncodeInfo_loc.dot(Field::srcPictureResource), &(pEncodeInfo->srcPictureResource), - VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, kVUIDUndefined, - "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pEncodeInfo_loc.dot(Field::srcPictureResource), &(pEncodeInfo->srcPictureResource), + VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, kVUIDUndefined, + "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); - skip |= - ValidateStructPnext(pEncodeInfo_loc, pEncodeInfo->srcPictureResource.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pEncodeInfo_loc, pEncodeInfo->srcPictureResource.pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", + kVUIDUndefined, true); // No xml-driven validation // No xml-driven validation - skip |= - ValidateRequiredHandle(pEncodeInfo_loc.dot(Field::imageViewBinding), pEncodeInfo->srcPictureResource.imageViewBinding); + skip |= state.ValidateRequiredHandle(pEncodeInfo_loc.dot(Field::imageViewBinding), + pEncodeInfo->srcPictureResource.imageViewBinding); - skip |= ValidateStructType(pEncodeInfo_loc.dot(Field::pSetupReferenceSlot), pEncodeInfo->pSetupReferenceSlot, - VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, - "VUID-VkVideoEncodeInfoKHR-pSetupReferenceSlot-parameter", - "VUID-VkVideoReferenceSlotInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pEncodeInfo_loc.dot(Field::pSetupReferenceSlot), pEncodeInfo->pSetupReferenceSlot, + VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, + "VUID-VkVideoEncodeInfoKHR-pSetupReferenceSlot-parameter", + "VUID-VkVideoReferenceSlotInfoKHR-sType-sType"); if (pEncodeInfo->pSetupReferenceSlot != nullptr) { [[maybe_unused]] const Location pSetupReferenceSlot_loc = pEncodeInfo_loc.dot(Field::pSetupReferenceSlot); @@ -20017,37 +22340,37 @@ bool StatelessValidation::PreCallValidateCmdEncodeVideoKHR(VkCommandBuffer comma VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR}; - skip |= ValidateStructPnext(pSetupReferenceSlot_loc, pEncodeInfo->pSetupReferenceSlot->pNext, - allowed_structs_VkVideoReferenceSlotInfoKHR.size(), - allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", - "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pSetupReferenceSlot_loc, pEncodeInfo->pSetupReferenceSlot->pNext, + allowed_structs_VkVideoReferenceSlotInfoKHR.size(), + allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", + "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", true); - skip |= ValidateStructType( + skip |= state.ValidateStructType( pSetupReferenceSlot_loc.dot(Field::pPictureResource), pEncodeInfo->pSetupReferenceSlot->pPictureResource, VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, "VUID-VkVideoReferenceSlotInfoKHR-pPictureResource-parameter", "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); if (pEncodeInfo->pSetupReferenceSlot->pPictureResource != nullptr) { [[maybe_unused]] const Location pPictureResource_loc = pSetupReferenceSlot_loc.dot(Field::pPictureResource); - skip |= ValidateStructPnext(pPictureResource_loc, pEncodeInfo->pSetupReferenceSlot->pPictureResource->pNext, 0, - nullptr, GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pPictureResource_loc, pEncodeInfo->pSetupReferenceSlot->pPictureResource->pNext, + 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, true); // No xml-driven validation // No xml-driven validation - skip |= ValidateRequiredHandle(pPictureResource_loc.dot(Field::imageViewBinding), - pEncodeInfo->pSetupReferenceSlot->pPictureResource->imageViewBinding); + skip |= state.ValidateRequiredHandle(pPictureResource_loc.dot(Field::imageViewBinding), + pEncodeInfo->pSetupReferenceSlot->pPictureResource->imageViewBinding); } } - skip |= ValidateStructTypeArray(pEncodeInfo_loc.dot(Field::referenceSlotCount), pEncodeInfo_loc.dot(Field::pReferenceSlots), - pEncodeInfo->referenceSlotCount, pEncodeInfo->pReferenceSlots, - VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, true, - "VUID-VkVideoReferenceSlotInfoKHR-sType-sType", - "VUID-VkVideoEncodeInfoKHR-pReferenceSlots-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pEncodeInfo_loc.dot(Field::referenceSlotCount), + pEncodeInfo_loc.dot(Field::pReferenceSlots), pEncodeInfo->referenceSlotCount, + pEncodeInfo->pReferenceSlots, VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, false, + true, "VUID-VkVideoReferenceSlotInfoKHR-sType-sType", + "VUID-VkVideoEncodeInfoKHR-pReferenceSlots-parameter", kVUIDUndefined); if (pEncodeInfo->pReferenceSlots != nullptr) { for (uint32_t referenceSlotIndex = 0; referenceSlotIndex < pEncodeInfo->referenceSlotCount; ++referenceSlotIndex) { @@ -20058,32 +22381,31 @@ bool StatelessValidation::PreCallValidateCmdEncodeVideoKHR(VkCommandBuffer comma VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR, VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR}; - skip |= ValidateStructPnext(pReferenceSlots_loc, pEncodeInfo->pReferenceSlots[referenceSlotIndex].pNext, - allowed_structs_VkVideoReferenceSlotInfoKHR.size(), - allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", - "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pReferenceSlots_loc, pEncodeInfo->pReferenceSlots[referenceSlotIndex].pNext, + allowed_structs_VkVideoReferenceSlotInfoKHR.size(), + allowed_structs_VkVideoReferenceSlotInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkVideoReferenceSlotInfoKHR-pNext-pNext", + "VUID-VkVideoReferenceSlotInfoKHR-sType-unique", true); - skip |= ValidateStructType(pReferenceSlots_loc.dot(Field::pPictureResource), - pEncodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource, - VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, - "VUID-VkVideoReferenceSlotInfoKHR-pPictureResource-parameter", - "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pReferenceSlots_loc.dot(Field::pPictureResource), + pEncodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource, + VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, false, + "VUID-VkVideoReferenceSlotInfoKHR-pPictureResource-parameter", + "VUID-VkVideoPictureResourceInfoKHR-sType-sType"); if (pEncodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource != nullptr) { [[maybe_unused]] const Location pPictureResource_loc = pReferenceSlots_loc.dot(Field::pPictureResource); - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pPictureResource_loc, pEncodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + GeneratedVulkanHeaderVersion, "VUID-VkVideoPictureResourceInfoKHR-pNext-pNext", kVUIDUndefined, true); // No xml-driven validation // No xml-driven validation - skip |= - ValidateRequiredHandle(pPictureResource_loc.dot(Field::imageViewBinding), - pEncodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); + skip |= state.ValidateRequiredHandle( + pPictureResource_loc.dot(Field::imageViewBinding), + pEncodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); } } } @@ -20095,6 +22417,7 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2KHR(VkCommandBuffer command const VkDependencyInfo* pDependencyInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); @@ -20105,6 +22428,7 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2KHR(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); @@ -20116,6 +22440,7 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2KHR(VkCommandBuffer comma const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); @@ -20127,6 +22452,7 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier2KHR(VkCommandBuffer const VkDependencyInfo* pDependencyInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); @@ -20138,6 +22464,7 @@ bool StatelessValidation::PreCallValidateCmdWriteTimestamp2KHR(VkCommandBuffer c VkQueryPool queryPool, uint32_t query, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); @@ -20148,6 +22475,7 @@ bool StatelessValidation::PreCallValidateCmdWriteTimestamp2KHR(VkCommandBuffer c bool StatelessValidation::PreCallValidateQueueSubmit2KHR(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); @@ -20158,6 +22486,7 @@ bool StatelessValidation::PreCallValidateQueueSubmit2KHR(VkQueue queue, uint32_t bool StatelessValidation::PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); @@ -20168,6 +22497,7 @@ bool StatelessValidation::PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer comma bool StatelessValidation::PreCallValidateCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); @@ -20179,6 +22509,7 @@ bool StatelessValidation::PreCallValidateCmdCopyBufferToImage2KHR(VkCommandBuffe const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); @@ -20190,6 +22521,7 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer2KHR(VkCommandBuffe const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); @@ -20200,6 +22532,7 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer2KHR(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); @@ -20211,6 +22544,7 @@ bool StatelessValidation::PreCallValidateCmdResolveImage2KHR(VkCommandBuffer com const VkResolveImageInfo2* pResolveImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); @@ -20222,11 +22556,12 @@ bool StatelessValidation::PreCallValidateCmdTraceRaysIndirect2KHR(VkCommandBuffe VkDeviceAddress indirectDeviceAddress, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_maintenance1)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_maintenance1}); // No xml-driven validation - if (!skip) skip |= manual_PreCallValidateCmdTraceRaysIndirect2KHR(commandBuffer, indirectDeviceAddress, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdTraceRaysIndirect2KHR(commandBuffer, indirectDeviceAddress, state); return skip; } @@ -20235,6 +22570,7 @@ bool StatelessValidation::PreCallValidateGetDeviceBufferMemoryRequirementsKHR(Vk VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); @@ -20247,6 +22583,7 @@ bool StatelessValidation::PreCallValidateGetDeviceImageMemoryRequirementsKHR(VkD VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); @@ -20258,6 +22595,7 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSparseMemoryRequirementsK VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); @@ -20270,6 +22608,7 @@ bool StatelessValidation::PreCallValidateCmdBindIndexBuffer2KHR(VkCommandBuffer VkDeviceSize size, VkIndexType indexType, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); @@ -20282,6 +22621,7 @@ bool StatelessValidation::PreCallValidateGetRenderingAreaGranularityKHR(VkDevice VkExtent2D* pGranularity, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); @@ -20294,6 +22634,7 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSubresourceLayoutKHR(VkDe VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); @@ -20306,6 +22647,7 @@ bool StatelessValidation::PreCallValidateGetImageSubresourceLayout2KHR(VkDevice VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); @@ -20319,20 +22661,21 @@ bool StatelessValidation::PreCallValidateCreatePipelineBinariesKHR(VkDevice devi VkPipelineBinaryHandlesInfoKHR* pBinaries, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_pipeline_binary}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR, true, - "VUID-vkCreatePipelineBinariesKHR-pCreateInfo-parameter", - "VUID-VkPipelineBinaryCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_BINARY_CREATE_INFO_KHR, + true, "VUID-vkCreatePipelineBinariesKHR-pCreateInfo-parameter", + "VUID-VkPipelineBinaryCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineBinaryCreateInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineBinaryCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); if (pCreateInfo->pKeysAndDataInfo != nullptr) { [[maybe_unused]] const Location pKeysAndDataInfo_loc = pCreateInfo_loc.dot(Field::pKeysAndDataInfo); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pKeysAndDataInfo_loc.dot(Field::binaryCount), pKeysAndDataInfo_loc.dot(Field::pPipelineBinaryKeys), pCreateInfo->pKeysAndDataInfo->binaryCount, pCreateInfo->pKeysAndDataInfo->pPipelineBinaryKeys, VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR, true, true, "VUID-VkPipelineBinaryKeyKHR-sType-sType", @@ -20343,48 +22686,47 @@ bool StatelessValidation::PreCallValidateCreatePipelineBinariesKHR(VkDevice devi for (uint32_t binaryIndex = 0; binaryIndex < pCreateInfo->pKeysAndDataInfo->binaryCount; ++binaryIndex) { [[maybe_unused]] const Location pPipelineBinaryKeys_loc = pKeysAndDataInfo_loc.dot(Field::pPipelineBinaryKeys, binaryIndex); - skip |= ValidateStructPnext(pPipelineBinaryKeys_loc, - pCreateInfo->pKeysAndDataInfo->pPipelineBinaryKeys[binaryIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkPipelineBinaryKeyKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pPipelineBinaryKeys_loc, pCreateInfo->pKeysAndDataInfo->pPipelineBinaryKeys[binaryIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineBinaryKeyKHR-pNext-pNext", kVUIDUndefined, true); } } - skip |= - ValidateArray(pKeysAndDataInfo_loc.dot(Field::binaryCount), pKeysAndDataInfo_loc.dot(Field::pPipelineBinaryData), - pCreateInfo->pKeysAndDataInfo->binaryCount, &pCreateInfo->pKeysAndDataInfo->pPipelineBinaryData, true, - true, "VUID-VkPipelineBinaryKeysAndDataKHR-binaryCount-arraylength", - "VUID-VkPipelineBinaryKeysAndDataKHR-pPipelineBinaryData-parameter"); + skip |= state.ValidateArray( + pKeysAndDataInfo_loc.dot(Field::binaryCount), pKeysAndDataInfo_loc.dot(Field::pPipelineBinaryData), + pCreateInfo->pKeysAndDataInfo->binaryCount, &pCreateInfo->pKeysAndDataInfo->pPipelineBinaryData, true, true, + "VUID-VkPipelineBinaryKeysAndDataKHR-binaryCount-arraylength", + "VUID-VkPipelineBinaryKeysAndDataKHR-pPipelineBinaryData-parameter"); if (pCreateInfo->pKeysAndDataInfo->pPipelineBinaryData != nullptr) { for (uint32_t binaryIndex = 0; binaryIndex < pCreateInfo->pKeysAndDataInfo->binaryCount; ++binaryIndex) { [[maybe_unused]] const Location pPipelineBinaryData_loc = pKeysAndDataInfo_loc.dot(Field::pPipelineBinaryData, binaryIndex); - skip |= ValidateArray(pPipelineBinaryData_loc.dot(Field::dataSize), pPipelineBinaryData_loc.dot(Field::pData), - pCreateInfo->pKeysAndDataInfo->pPipelineBinaryData[binaryIndex].dataSize, - &pCreateInfo->pKeysAndDataInfo->pPipelineBinaryData[binaryIndex].pData, true, true, - "VUID-VkPipelineBinaryDataKHR-dataSize-arraylength", - "VUID-VkPipelineBinaryDataKHR-pData-parameter"); + skip |= state.ValidateArray( + pPipelineBinaryData_loc.dot(Field::dataSize), pPipelineBinaryData_loc.dot(Field::pData), + pCreateInfo->pKeysAndDataInfo->pPipelineBinaryData[binaryIndex].dataSize, + &pCreateInfo->pKeysAndDataInfo->pPipelineBinaryData[binaryIndex].pData, true, true, + "VUID-VkPipelineBinaryDataKHR-dataSize-arraylength", "VUID-VkPipelineBinaryDataKHR-pData-parameter"); } } } - skip |= ValidateStructType(pCreateInfo_loc.dot(Field::pPipelineCreateInfo), pCreateInfo->pPipelineCreateInfo, - VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR, false, - "VUID-VkPipelineBinaryCreateInfoKHR-pPipelineCreateInfo-parameter", - "VUID-VkPipelineCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pCreateInfo_loc.dot(Field::pPipelineCreateInfo), pCreateInfo->pPipelineCreateInfo, + VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR, false, + "VUID-VkPipelineBinaryCreateInfoKHR-pPipelineCreateInfo-parameter", + "VUID-VkPipelineCreateInfoKHR-sType-sType"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateStructType(loc.dot(Field::pBinaries), pBinaries, VK_STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR, true, - "VUID-vkCreatePipelineBinariesKHR-pBinaries-parameter", - "VUID-VkPipelineBinaryHandlesInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pBinaries), pBinaries, VK_STRUCTURE_TYPE_PIPELINE_BINARY_HANDLES_INFO_KHR, true, + "VUID-vkCreatePipelineBinariesKHR-pBinaries-parameter", + "VUID-VkPipelineBinaryHandlesInfoKHR-sType-sType"); if (pBinaries != nullptr) { [[maybe_unused]] const Location pBinaries_loc = loc.dot(Field::pBinaries); - skip |= ValidateStructPnext(pBinaries_loc, pBinaries->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineBinaryHandlesInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pBinaries_loc, pBinaries->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineBinaryHandlesInfoKHR-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -20393,12 +22735,13 @@ bool StatelessValidation::PreCallValidateDestroyPipelineBinaryKHR(VkDevice devic const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_pipeline_binary}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -20407,18 +22750,19 @@ bool StatelessValidation::PreCallValidateGetPipelineKeyKHR(VkDevice device, cons VkPipelineBinaryKeyKHR* pPipelineKey, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_pipeline_binary}); - skip |= ValidateStructType(loc.dot(Field::pPipelineCreateInfo), pPipelineCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR, - false, "VUID-vkGetPipelineKeyKHR-pPipelineCreateInfo-parameter", - "VUID-VkPipelineCreateInfoKHR-sType-sType"); - skip |= ValidateStructType(loc.dot(Field::pPipelineKey), pPipelineKey, VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR, true, - "VUID-vkGetPipelineKeyKHR-pPipelineKey-parameter", "VUID-VkPipelineBinaryKeyKHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pPipelineCreateInfo), pPipelineCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR, false, + "VUID-vkGetPipelineKeyKHR-pPipelineCreateInfo-parameter", "VUID-VkPipelineCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pPipelineKey), pPipelineKey, VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR, true, + "VUID-vkGetPipelineKeyKHR-pPipelineKey-parameter", "VUID-VkPipelineBinaryKeyKHR-sType-sType"); if (pPipelineKey != nullptr) { [[maybe_unused]] const Location pPipelineKey_loc = loc.dot(Field::pPipelineKey); - skip |= ValidateStructPnext(pPipelineKey_loc, pPipelineKey->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineBinaryKeyKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pPipelineKey_loc, pPipelineKey->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineBinaryKeyKHR-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -20428,30 +22772,33 @@ bool StatelessValidation::PreCallValidateGetPipelineBinaryDataKHR(VkDevice devic size_t* pPipelineBinaryDataSize, void* pPipelineBinaryData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_pipeline_binary}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR, true, - "VUID-vkGetPipelineBinaryDataKHR-pInfo-parameter", "VUID-VkPipelineBinaryDataInfoKHR-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_PIPELINE_BINARY_DATA_INFO_KHR, true, + "VUID-vkGetPipelineBinaryDataKHR-pInfo-parameter", "VUID-VkPipelineBinaryDataInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineBinaryDataInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineBinaryDataInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::pipelineBinary), pInfo->pipelineBinary); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::pipelineBinary), pInfo->pipelineBinary); } - skip |= ValidateStructType(loc.dot(Field::pPipelineBinaryKey), pPipelineBinaryKey, VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR, - true, "VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryKey-parameter", - "VUID-VkPipelineBinaryKeyKHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pPipelineBinaryKey), pPipelineBinaryKey, VK_STRUCTURE_TYPE_PIPELINE_BINARY_KEY_KHR, true, + "VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryKey-parameter", "VUID-VkPipelineBinaryKeyKHR-sType-sType"); if (pPipelineBinaryKey != nullptr) { [[maybe_unused]] const Location pPipelineBinaryKey_loc = loc.dot(Field::pPipelineBinaryKey); - skip |= ValidateStructPnext(pPipelineBinaryKey_loc, pPipelineBinaryKey->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineBinaryKeyKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= + state.ValidateStructPnext(pPipelineBinaryKey_loc, pPipelineBinaryKey->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineBinaryKeyKHR-pNext-pNext", kVUIDUndefined, false); } - skip |= ValidatePointerArray(loc.dot(Field::pPipelineBinaryDataSize), loc.dot(Field::pPipelineBinaryData), - pPipelineBinaryDataSize, &pPipelineBinaryData, true, false, false, - "VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryDataSize-parameter", kVUIDUndefined, - "VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryData-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pPipelineBinaryDataSize), loc.dot(Field::pPipelineBinaryData), + pPipelineBinaryDataSize, &pPipelineBinaryData, true, false, false, + "VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryDataSize-parameter", kVUIDUndefined, + "VUID-vkGetPipelineBinaryDataKHR-pPipelineBinaryData-parameter"); return skip; } @@ -20460,22 +22807,23 @@ bool StatelessValidation::PreCallValidateReleaseCapturedPipelineDataKHR(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_pipeline_binary}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR, true, - "VUID-vkReleaseCapturedPipelineDataKHR-pInfo-parameter", - "VUID-VkReleaseCapturedPipelineDataInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_RELEASE_CAPTURED_PIPELINE_DATA_INFO_KHR, true, + "VUID-vkReleaseCapturedPipelineDataKHR-pInfo-parameter", + "VUID-VkReleaseCapturedPipelineDataInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkReleaseCapturedPipelineDataInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkReleaseCapturedPipelineDataInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::pipeline), pInfo->pipeline); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::pipeline), pInfo->pipeline); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -20484,18 +22832,21 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCooperativeMatrixPrope VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= - ValidateStructTypeArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, - VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR, true, false, false, - "VUID-VkCooperativeMatrixPropertiesKHR-sType-sType", kVUIDUndefined, - "VUID-vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR-pPropertyCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, + VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR, true, false, false, + "VUID-VkCooperativeMatrixPropertiesKHR-sType-sType", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR-pPropertyCount-parameter", + kVUIDUndefined); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); - skip |= - ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCooperativeMatrixPropertiesKHR-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCooperativeMatrixPropertiesKHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -20504,6 +22855,7 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCooperativeMatrixPrope bool StatelessValidation::PreCallValidateCmdSetLineStippleKHR(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_line_rasterization)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_line_rasterization}); @@ -20516,11 +22868,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCalibrateableTimeDomai VkTimeDomainKHR* pTimeDomains, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= - ValidatePointerArray(loc.dot(Field::pTimeDomainCount), loc.dot(Field::pTimeDomains), pTimeDomainCount, &pTimeDomains, true, - false, false, "VUID-vkGetPhysicalDeviceCalibrateableTimeDomainsKHR-pTimeDomainCount-parameter", - kVUIDUndefined, "VUID-vkGetPhysicalDeviceCalibrateableTimeDomainsKHR-pTimeDomains-parameter"); + skip |= state.ValidatePointerArray( + loc.dot(Field::pTimeDomainCount), loc.dot(Field::pTimeDomains), pTimeDomainCount, &pTimeDomains, true, false, false, + "VUID-vkGetPhysicalDeviceCalibrateableTimeDomainsKHR-pTimeDomainCount-parameter", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceCalibrateableTimeDomainsKHR-pTimeDomains-parameter"); return skip; } @@ -20529,31 +22884,32 @@ bool StatelessValidation::PreCallValidateGetCalibratedTimestampsKHR(VkDevice dev uint64_t* pTimestamps, uint64_t* pMaxDeviation, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_calibrated_timestamps) && loc.function == vvl::Func::vkGetCalibratedTimestampsKHR) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_calibrated_timestamps}); - skip |= ValidateStructTypeArray(loc.dot(Field::timestampCount), loc.dot(Field::pTimestampInfos), timestampCount, - pTimestampInfos, VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR, true, true, - "VUID-VkCalibratedTimestampInfoKHR-sType-sType", - "VUID-vkGetCalibratedTimestampsKHR-pTimestampInfos-parameter", - "VUID-vkGetCalibratedTimestampsKHR-timestampCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::timestampCount), loc.dot(Field::pTimestampInfos), timestampCount, + pTimestampInfos, VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR, true, true, + "VUID-VkCalibratedTimestampInfoKHR-sType-sType", + "VUID-vkGetCalibratedTimestampsKHR-pTimestampInfos-parameter", + "VUID-vkGetCalibratedTimestampsKHR-timestampCount-arraylength"); if (pTimestampInfos != nullptr) { for (uint32_t timestampIndex = 0; timestampIndex < timestampCount; ++timestampIndex) { [[maybe_unused]] const Location pTimestampInfos_loc = loc.dot(Field::pTimestampInfos, timestampIndex); - skip |= ValidateStructPnext(pTimestampInfos_loc, pTimestampInfos[timestampIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkCalibratedTimestampInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pTimestampInfos_loc, pTimestampInfos[timestampIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCalibratedTimestampInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pTimestampInfos_loc.dot(Field::timeDomain), vvl::Enum::VkTimeDomainKHR, - pTimestampInfos[timestampIndex].timeDomain, - "VUID-VkCalibratedTimestampInfoKHR-timeDomain-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pTimestampInfos_loc.dot(Field::timeDomain), vvl::Enum::VkTimeDomainKHR, + pTimestampInfos[timestampIndex].timeDomain, + "VUID-VkCalibratedTimestampInfoKHR-timeDomain-parameter"); } } - skip |= ValidateArray(loc.dot(Field::timestampCount), loc.dot(Field::pTimestamps), timestampCount, &pTimestamps, true, true, - "VUID-vkGetCalibratedTimestampsKHR-timestampCount-arraylength", - "VUID-vkGetCalibratedTimestampsKHR-pTimestamps-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pMaxDeviation), pMaxDeviation, - "VUID-vkGetCalibratedTimestampsKHR-pMaxDeviation-parameter"); + skip |= state.ValidateArray(loc.dot(Field::timestampCount), loc.dot(Field::pTimestamps), timestampCount, &pTimestamps, true, + true, "VUID-vkGetCalibratedTimestampsKHR-timestampCount-arraylength", + "VUID-vkGetCalibratedTimestampsKHR-pTimestamps-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMaxDeviation), pMaxDeviation, + "VUID-vkGetCalibratedTimestampsKHR-pMaxDeviation-parameter"); return skip; } @@ -20561,6 +22917,7 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorSets2KHR(VkCommandBuff const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); @@ -20572,6 +22929,7 @@ bool StatelessValidation::PreCallValidateCmdPushConstants2KHR(VkCommandBuffer co const VkPushConstantsInfo* pPushConstantsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); @@ -20583,6 +22941,7 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSet2KHR(VkCommandBuffe const VkPushDescriptorSetInfo* pPushDescriptorSetInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); @@ -20594,6 +22953,7 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetWithTemplate2KHR( VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); @@ -20605,42 +22965,44 @@ bool StatelessValidation::PreCallValidateCmdSetDescriptorBufferOffsets2EXT( VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); - skip |= ValidateStructType(loc.dot(Field::pSetDescriptorBufferOffsetsInfo), pSetDescriptorBufferOffsetsInfo, - VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT, true, - "VUID-vkCmdSetDescriptorBufferOffsets2EXT-pSetDescriptorBufferOffsetsInfo-parameter", - "VUID-VkSetDescriptorBufferOffsetsInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pSetDescriptorBufferOffsetsInfo), pSetDescriptorBufferOffsetsInfo, + VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT, true, + "VUID-vkCmdSetDescriptorBufferOffsets2EXT-pSetDescriptorBufferOffsetsInfo-parameter", + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-sType-sType"); if (pSetDescriptorBufferOffsetsInfo != nullptr) { [[maybe_unused]] const Location pSetDescriptorBufferOffsetsInfo_loc = loc.dot(Field::pSetDescriptorBufferOffsetsInfo); constexpr std::array allowed_structs_VkSetDescriptorBufferOffsetsInfoEXT = {VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; - skip |= ValidateStructPnext(pSetDescriptorBufferOffsetsInfo_loc, pSetDescriptorBufferOffsetsInfo->pNext, - allowed_structs_VkSetDescriptorBufferOffsetsInfoEXT.size(), - allowed_structs_VkSetDescriptorBufferOffsetsInfoEXT.data(), GeneratedVulkanHeaderVersion, - "VUID-VkSetDescriptorBufferOffsetsInfoEXT-pNext-pNext", - "VUID-VkSetDescriptorBufferOffsetsInfoEXT-sType-unique", VK_NULL_HANDLE, true); - - skip |= ValidateFlags(pSetDescriptorBufferOffsetsInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pSetDescriptorBufferOffsetsInfo->stageFlags, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkSetDescriptorBufferOffsetsInfoEXT-stageFlags-parameter", - "VUID-VkSetDescriptorBufferOffsetsInfoEXT-stageFlags-requiredbitmask"); - - skip |= ValidateArray(pSetDescriptorBufferOffsetsInfo_loc.dot(Field::setCount), - pSetDescriptorBufferOffsetsInfo_loc.dot(Field::pBufferIndices), - pSetDescriptorBufferOffsetsInfo->setCount, &pSetDescriptorBufferOffsetsInfo->pBufferIndices, true, - true, "VUID-VkSetDescriptorBufferOffsetsInfoEXT-setCount-arraylength", - "VUID-VkSetDescriptorBufferOffsetsInfoEXT-pBufferIndices-parameter"); - - skip |= ValidateArray(pSetDescriptorBufferOffsetsInfo_loc.dot(Field::setCount), - pSetDescriptorBufferOffsetsInfo_loc.dot(Field::pOffsets), pSetDescriptorBufferOffsetsInfo->setCount, - &pSetDescriptorBufferOffsetsInfo->pOffsets, true, true, - "VUID-VkSetDescriptorBufferOffsetsInfoEXT-setCount-arraylength", - "VUID-VkSetDescriptorBufferOffsetsInfoEXT-pOffsets-parameter"); + skip |= state.ValidateStructPnext(pSetDescriptorBufferOffsetsInfo_loc, pSetDescriptorBufferOffsetsInfo->pNext, + allowed_structs_VkSetDescriptorBufferOffsetsInfoEXT.size(), + allowed_structs_VkSetDescriptorBufferOffsetsInfoEXT.data(), GeneratedVulkanHeaderVersion, + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-pNext-pNext", + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-sType-unique", true); + + skip |= + state.ValidateFlags(pSetDescriptorBufferOffsetsInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pSetDescriptorBufferOffsetsInfo->stageFlags, kRequiredFlags, + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-stageFlags-parameter", + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-stageFlags-requiredbitmask"); + + skip |= state.ValidateArray(pSetDescriptorBufferOffsetsInfo_loc.dot(Field::setCount), + pSetDescriptorBufferOffsetsInfo_loc.dot(Field::pBufferIndices), + pSetDescriptorBufferOffsetsInfo->setCount, &pSetDescriptorBufferOffsetsInfo->pBufferIndices, + true, true, "VUID-VkSetDescriptorBufferOffsetsInfoEXT-setCount-arraylength", + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-pBufferIndices-parameter"); + + skip |= state.ValidateArray(pSetDescriptorBufferOffsetsInfo_loc.dot(Field::setCount), + pSetDescriptorBufferOffsetsInfo_loc.dot(Field::pOffsets), + pSetDescriptorBufferOffsetsInfo->setCount, &pSetDescriptorBufferOffsetsInfo->pOffsets, true, + true, "VUID-VkSetDescriptorBufferOffsetsInfoEXT-setCount-arraylength", + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-pOffsets-parameter"); } if (!skip) - skip |= manual_PreCallValidateCmdSetDescriptorBufferOffsets2EXT(commandBuffer, pSetDescriptorBufferOffsetsInfo, error_obj); + skip |= manual_PreCallValidateCmdSetDescriptorBufferOffsets2EXT(commandBuffer, pSetDescriptorBufferOffsetsInfo, state); return skip; } @@ -20648,35 +23010,37 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); - skip |= - ValidateStructType(loc.dot(Field::pBindDescriptorBufferEmbeddedSamplersInfo), pBindDescriptorBufferEmbeddedSamplersInfo, - VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT, true, - "VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-pBindDescriptorBufferEmbeddedSamplersInfo-parameter", - "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pBindDescriptorBufferEmbeddedSamplersInfo), pBindDescriptorBufferEmbeddedSamplersInfo, + VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT, true, + "VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-pBindDescriptorBufferEmbeddedSamplersInfo-parameter", + "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-sType-sType"); if (pBindDescriptorBufferEmbeddedSamplersInfo != nullptr) { [[maybe_unused]] const Location pBindDescriptorBufferEmbeddedSamplersInfo_loc = loc.dot(Field::pBindDescriptorBufferEmbeddedSamplersInfo); constexpr std::array allowed_structs_VkBindDescriptorBufferEmbeddedSamplersInfoEXT = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; - skip |= ValidateStructPnext(pBindDescriptorBufferEmbeddedSamplersInfo_loc, pBindDescriptorBufferEmbeddedSamplersInfo->pNext, - allowed_structs_VkBindDescriptorBufferEmbeddedSamplersInfoEXT.size(), - allowed_structs_VkBindDescriptorBufferEmbeddedSamplersInfoEXT.data(), - GeneratedVulkanHeaderVersion, "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-pNext-pNext", - "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pBindDescriptorBufferEmbeddedSamplersInfo_loc, pBindDescriptorBufferEmbeddedSamplersInfo->pNext, + allowed_structs_VkBindDescriptorBufferEmbeddedSamplersInfoEXT.size(), + allowed_structs_VkBindDescriptorBufferEmbeddedSamplersInfoEXT.data(), GeneratedVulkanHeaderVersion, + "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-pNext-pNext", + "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-sType-unique", true); - skip |= ValidateFlags(pBindDescriptorBufferEmbeddedSamplersInfo_loc.dot(Field::stageFlags), - vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, - pBindDescriptorBufferEmbeddedSamplersInfo->stageFlags, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-stageFlags-parameter", - "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-stageFlags-requiredbitmask"); + skip |= state.ValidateFlags(pBindDescriptorBufferEmbeddedSamplersInfo_loc.dot(Field::stageFlags), + vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, + pBindDescriptorBufferEmbeddedSamplersInfo->stageFlags, kRequiredFlags, + "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-stageFlags-parameter", + "VUID-VkBindDescriptorBufferEmbeddedSamplersInfoEXT-stageFlags-requiredbitmask"); } if (!skip) - skip |= manual_PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers2EXT( - commandBuffer, pBindDescriptorBufferEmbeddedSamplersInfo, error_obj); + skip |= manual_PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers2EXT(commandBuffer, + pBindDescriptorBufferEmbeddedSamplersInfo, state); return skip; } @@ -20686,28 +23050,29 @@ bool StatelessValidation::PreCallValidateCreateDebugReportCallbackEXT(VkInstance VkDebugReportCallbackEXT* pCallback, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_report)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_report}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, - true, "VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter", - "VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, true, + "VUID-vkCreateDebugReportCallbackEXT-pCreateInfo-parameter", "VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDebugReportFlagBitsEXT, - AllVkDebugReportFlagBitsEXT, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkDebugReportFlagBitsEXT, + AllVkDebugReportFlagBitsEXT, pCreateInfo->flags, kOptionalFlags, + "VUID-VkDebugReportCallbackCreateInfoEXT-flags-parameter"); - skip |= ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pfnCallback), - reinterpret_cast(pCreateInfo->pfnCallback), - "VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-parameter"); + skip |= state.ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pfnCallback), + reinterpret_cast(pCreateInfo->pfnCallback), + "VUID-VkDebugReportCallbackCreateInfoEXT-pfnCallback-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pCallback), pCallback, "VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCallback), pCallback, + "VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter"); return skip; } @@ -20715,12 +23080,13 @@ bool StatelessValidation::PreCallValidateDestroyDebugReportCallbackEXT(VkInstanc const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_report)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_report}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -20730,40 +23096,42 @@ bool StatelessValidation::PreCallValidateDebugReportMessageEXT(VkInstance instan size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_report)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_report}); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkDebugReportFlagBitsEXT, AllVkDebugReportFlagBitsEXT, flags, - kRequiredFlags, VK_NULL_HANDLE, "VUID-vkDebugReportMessageEXT-flags-parameter", - "VUID-vkDebugReportMessageEXT-flags-requiredbitmask"); - skip |= ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkDebugReportObjectTypeEXT, objectType, - "VUID-vkDebugReportMessageEXT-objectType-parameter", VK_NULL_HANDLE); - skip |= - ValidateRequiredPointer(loc.dot(Field::pLayerPrefix), pLayerPrefix, "VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pMessage), pMessage, "VUID-vkDebugReportMessageEXT-pMessage-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkDebugReportFlagBitsEXT, AllVkDebugReportFlagBitsEXT, + flags, kRequiredFlags, "VUID-vkDebugReportMessageEXT-flags-parameter", + "VUID-vkDebugReportMessageEXT-flags-requiredbitmask"); + skip |= state.ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkDebugReportObjectTypeEXT, objectType, + "VUID-vkDebugReportMessageEXT-objectType-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pLayerPrefix), pLayerPrefix, + "VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMessage), pMessage, "VUID-vkDebugReportMessageEXT-pMessage-parameter"); return skip; } bool StatelessValidation::PreCallValidateDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); - skip |= ValidateStructType(loc.dot(Field::pTagInfo), pTagInfo, VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT, true, - "VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter", - "VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pTagInfo), pTagInfo, VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT, true, + "VUID-vkDebugMarkerSetObjectTagEXT-pTagInfo-parameter", + "VUID-VkDebugMarkerObjectTagInfoEXT-sType-sType"); if (pTagInfo != nullptr) { [[maybe_unused]] const Location pTagInfo_loc = loc.dot(Field::pTagInfo); - skip |= ValidateStructPnext(pTagInfo_loc, pTagInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pTagInfo_loc, pTagInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugMarkerObjectTagInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pTagInfo_loc.dot(Field::objectType), vvl::Enum::VkDebugReportObjectTypeEXT, pTagInfo->objectType, - "VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pTagInfo_loc.dot(Field::objectType), vvl::Enum::VkDebugReportObjectTypeEXT, + pTagInfo->objectType, "VUID-VkDebugMarkerObjectTagInfoEXT-objectType-parameter"); - skip |= ValidateArray(pTagInfo_loc.dot(Field::tagSize), pTagInfo_loc.dot(Field::pTag), pTagInfo->tagSize, &pTagInfo->pTag, - true, true, "VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength", - "VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter"); + skip |= state.ValidateArray(pTagInfo_loc.dot(Field::tagSize), pTagInfo_loc.dot(Field::pTag), pTagInfo->tagSize, + &pTagInfo->pTag, true, true, "VUID-VkDebugMarkerObjectTagInfoEXT-tagSize-arraylength", + "VUID-VkDebugMarkerObjectTagInfoEXT-pTag-parameter"); } return skip; } @@ -20772,23 +23140,23 @@ bool StatelessValidation::PreCallValidateDebugMarkerSetObjectNameEXT(VkDevice de const VkDebugMarkerObjectNameInfoEXT* pNameInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); - skip |= ValidateStructType(loc.dot(Field::pNameInfo), pNameInfo, VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT, true, - "VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter", - "VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pNameInfo), pNameInfo, VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT, + true, "VUID-vkDebugMarkerSetObjectNameEXT-pNameInfo-parameter", + "VUID-VkDebugMarkerObjectNameInfoEXT-sType-sType"); if (pNameInfo != nullptr) { [[maybe_unused]] const Location pNameInfo_loc = loc.dot(Field::pNameInfo); - skip |= ValidateStructPnext(pNameInfo_loc, pNameInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pNameInfo_loc, pNameInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugMarkerObjectNameInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateRangedEnum(pNameInfo_loc.dot(Field::objectType), vvl::Enum::VkDebugReportObjectTypeEXT, pNameInfo->objectType, - "VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pNameInfo_loc.dot(Field::objectType), vvl::Enum::VkDebugReportObjectTypeEXT, + pNameInfo->objectType, "VUID-VkDebugMarkerObjectNameInfoEXT-objectType-parameter"); - skip |= ValidateRequiredPointer(pNameInfo_loc.dot(Field::pObjectName), pNameInfo->pObjectName, - "VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter"); + skip |= state.ValidateRequiredPointer(pNameInfo_loc.dot(Field::pObjectName), pNameInfo->pObjectName, + "VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter"); } return skip; } @@ -20797,25 +23165,27 @@ bool StatelessValidation::PreCallValidateCmdDebugMarkerBeginEXT(VkCommandBuffer const VkDebugMarkerMarkerInfoEXT* pMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); - skip |= - ValidateStructType(loc.dot(Field::pMarkerInfo), pMarkerInfo, VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT, true, - "VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter", "VUID-VkDebugMarkerMarkerInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pMarkerInfo), pMarkerInfo, VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT, true, + "VUID-vkCmdDebugMarkerBeginEXT-pMarkerInfo-parameter", + "VUID-VkDebugMarkerMarkerInfoEXT-sType-sType"); if (pMarkerInfo != nullptr) { [[maybe_unused]] const Location pMarkerInfo_loc = loc.dot(Field::pMarkerInfo); - skip |= ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pMarkerInfo_loc.dot(Field::pMarkerName), pMarkerInfo->pMarkerName, - "VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter"); + skip |= state.ValidateRequiredPointer(pMarkerInfo_loc.dot(Field::pMarkerName), pMarkerInfo->pMarkerName, + "VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter"); } return skip; } bool StatelessValidation::PreCallValidateCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); @@ -20827,19 +23197,20 @@ bool StatelessValidation::PreCallValidateCmdDebugMarkerInsertEXT(VkCommandBuffer const VkDebugMarkerMarkerInfoEXT* pMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); - skip |= - ValidateStructType(loc.dot(Field::pMarkerInfo), pMarkerInfo, VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT, true, - "VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter", "VUID-VkDebugMarkerMarkerInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pMarkerInfo), pMarkerInfo, VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT, true, + "VUID-vkCmdDebugMarkerInsertEXT-pMarkerInfo-parameter", + "VUID-VkDebugMarkerMarkerInfoEXT-sType-sType"); if (pMarkerInfo != nullptr) { [[maybe_unused]] const Location pMarkerInfo_loc = loc.dot(Field::pMarkerInfo); - skip |= ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugMarkerMarkerInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pMarkerInfo_loc.dot(Field::pMarkerName), pMarkerInfo->pMarkerName, - "VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter"); + skip |= state.ValidateRequiredPointer(pMarkerInfo_loc.dot(Field::pMarkerName), pMarkerInfo->pMarkerName, + "VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter"); } return skip; } @@ -20850,19 +23221,20 @@ bool StatelessValidation::PreCallValidateCmdBindTransformFeedbackBuffersEXT(VkCo const VkDeviceSize* pSizes, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_transform_feedback}); - skip |= ValidateHandleArray(loc.dot(Field::bindingCount), loc.dot(Field::pBuffers), bindingCount, pBuffers, true, true, - "VUID-vkCmdBindTransformFeedbackBuffersEXT-bindingCount-arraylength"); - skip |= ValidateArray(loc.dot(Field::bindingCount), loc.dot(Field::pOffsets), bindingCount, &pOffsets, true, true, - "VUID-vkCmdBindTransformFeedbackBuffersEXT-bindingCount-arraylength", - "VUID-vkCmdBindTransformFeedbackBuffersEXT-pOffsets-parameter"); - skip |= ValidateArray(loc.dot(Field::bindingCount), loc, bindingCount, &pSizes, true, false, - "VUID-vkCmdBindTransformFeedbackBuffersEXT-bindingCount-arraylength", kVUIDUndefined); + skip |= state.ValidateHandleArray(loc.dot(Field::bindingCount), loc.dot(Field::pBuffers), bindingCount, pBuffers, true, true, + "VUID-vkCmdBindTransformFeedbackBuffersEXT-bindingCount-arraylength"); + skip |= state.ValidateArray(loc.dot(Field::bindingCount), loc.dot(Field::pOffsets), bindingCount, &pOffsets, true, true, + "VUID-vkCmdBindTransformFeedbackBuffersEXT-bindingCount-arraylength", + "VUID-vkCmdBindTransformFeedbackBuffersEXT-pOffsets-parameter"); + skip |= state.ValidateArray(loc.dot(Field::bindingCount), loc, bindingCount, &pSizes, true, false, + "VUID-vkCmdBindTransformFeedbackBuffersEXT-bindingCount-arraylength", kVUIDUndefined); if (!skip) skip |= manual_PreCallValidateCmdBindTransformFeedbackBuffersEXT(commandBuffer, firstBinding, bindingCount, pBuffers, - pOffsets, pSizes, error_obj); + pOffsets, pSizes, state); return skip; } @@ -20871,13 +23243,14 @@ bool StatelessValidation::PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandB const VkDeviceSize* pCounterBufferOffsets, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_transform_feedback}); // No xml-driven validation if (!skip) skip |= manual_PreCallValidateCmdBeginTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, - pCounterBuffers, pCounterBufferOffsets, error_obj); + pCounterBuffers, pCounterBufferOffsets, state); return skip; } @@ -20886,13 +23259,14 @@ bool StatelessValidation::PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuf const VkDeviceSize* pCounterBufferOffsets, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_transform_feedback}); // No xml-driven validation if (!skip) skip |= manual_PreCallValidateCmdEndTransformFeedbackEXT(commandBuffer, firstCounterBuffer, counterBufferCount, - pCounterBuffers, pCounterBufferOffsets, error_obj); + pCounterBuffers, pCounterBufferOffsets, state); return skip; } @@ -20900,22 +23274,24 @@ bool StatelessValidation::PreCallValidateCmdBeginQueryIndexedEXT(VkCommandBuffer uint32_t query, VkQueryControlFlags flags, uint32_t index, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_transform_feedback}); - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryControlFlagBits, AllVkQueryControlFlagBits, flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdBeginQueryIndexedEXT-flags-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryControlFlagBits, AllVkQueryControlFlagBits, flags, + kOptionalFlags, "VUID-vkCmdBeginQueryIndexedEXT-flags-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_transform_feedback}); - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } @@ -20924,10 +23300,11 @@ bool StatelessValidation::PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBu VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_transform_feedback}); - skip |= ValidateRequiredHandle(loc.dot(Field::counterBuffer), counterBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::counterBuffer), counterBuffer); return skip; } @@ -20935,28 +23312,30 @@ bool StatelessValidation::PreCallValidateCreateCuModuleNVX(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkCuModuleNVX* pModule, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX, true, - "VUID-vkCreateCuModuleNVX-pCreateInfo-parameter", "VUID-VkCuModuleCreateInfoNVX-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX, true, + "VUID-vkCreateCuModuleNVX-pCreateInfo-parameter", "VUID-VkCuModuleCreateInfoNVX-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkCuModuleCreateInfoNVX = {VK_STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkCuModuleCreateInfoNVX.size(), - allowed_structs_VkCuModuleCreateInfoNVX.data(), GeneratedVulkanHeaderVersion, - "VUID-VkCuModuleCreateInfoNVX-pNext-pNext", "VUID-VkCuModuleCreateInfoNVX-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkCuModuleCreateInfoNVX.size(), + allowed_structs_VkCuModuleCreateInfoNVX.data(), GeneratedVulkanHeaderVersion, + "VUID-VkCuModuleCreateInfoNVX-pNext-pNext", "VUID-VkCuModuleCreateInfoNVX-sType-unique", + true); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::dataSize), pCreateInfo_loc.dot(Field::pData), pCreateInfo->dataSize, - &pCreateInfo->pData, false, true, kVUIDUndefined, "VUID-VkCuModuleCreateInfoNVX-pData-parameter"); + skip |= + state.ValidateArray(pCreateInfo_loc.dot(Field::dataSize), pCreateInfo_loc.dot(Field::pData), pCreateInfo->dataSize, + &pCreateInfo->pData, false, true, kVUIDUndefined, "VUID-VkCuModuleCreateInfoNVX-pData-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pModule), pModule, "VUID-vkCreateCuModuleNVX-pModule-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pModule), pModule, "VUID-vkCreateCuModuleNVX-pModule-parameter"); return skip; } @@ -20964,26 +23343,28 @@ bool StatelessValidation::PreCallValidateCreateCuFunctionNVX(VkDevice device, co const VkAllocationCallbacks* pAllocator, VkCuFunctionNVX* pFunction, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX, true, - "VUID-vkCreateCuFunctionNVX-pCreateInfo-parameter", "VUID-VkCuFunctionCreateInfoNVX-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX, true, + "VUID-vkCreateCuFunctionNVX-pCreateInfo-parameter", "VUID-VkCuFunctionCreateInfoNVX-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCuFunctionCreateInfoNVX-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCuFunctionCreateInfoNVX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::module), pCreateInfo->module); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::module), pCreateInfo->module); - skip |= ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pName), pCreateInfo->pName, - "VUID-VkCuFunctionCreateInfoNVX-pName-parameter"); + skip |= state.ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pName), pCreateInfo->pName, + "VUID-VkCuFunctionCreateInfoNVX-pName-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFunction), pFunction, "VUID-vkCreateCuFunctionNVX-pFunction-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFunction), pFunction, "VUID-vkCreateCuFunctionNVX-pFunction-parameter"); return skip; } @@ -20991,13 +23372,14 @@ bool StatelessValidation::PreCallValidateDestroyCuModuleNVX(VkDevice device, VkC const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); - skip |= ValidateRequiredHandle(loc.dot(Field::module), module); + skip |= state.ValidateRequiredHandle(loc.dot(Field::module), module); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -21006,13 +23388,14 @@ bool StatelessValidation::PreCallValidateDestroyCuFunctionNVX(VkDevice device, V const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); - skip |= ValidateRequiredHandle(loc.dot(Field::function), function); + skip |= state.ValidateRequiredHandle(loc.dot(Field::function), function); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -21020,23 +23403,26 @@ bool StatelessValidation::PreCallValidateDestroyCuFunctionNVX(VkDevice device, V bool StatelessValidation::PreCallValidateCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer, const VkCuLaunchInfoNVX* pLaunchInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); - skip |= ValidateStructType(loc.dot(Field::pLaunchInfo), pLaunchInfo, VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX, true, - "VUID-vkCmdCuLaunchKernelNVX-pLaunchInfo-parameter", "VUID-VkCuLaunchInfoNVX-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pLaunchInfo), pLaunchInfo, VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX, true, + "VUID-vkCmdCuLaunchKernelNVX-pLaunchInfo-parameter", "VUID-VkCuLaunchInfoNVX-sType-sType"); if (pLaunchInfo != nullptr) { [[maybe_unused]] const Location pLaunchInfo_loc = loc.dot(Field::pLaunchInfo); - skip |= ValidateStructPnext(pLaunchInfo_loc, pLaunchInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCuLaunchInfoNVX-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pLaunchInfo_loc, pLaunchInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCuLaunchInfoNVX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pLaunchInfo_loc.dot(Field::function), pLaunchInfo->function); + skip |= state.ValidateRequiredHandle(pLaunchInfo_loc.dot(Field::function), pLaunchInfo->function); - skip |= ValidateArray(pLaunchInfo_loc.dot(Field::paramCount), pLaunchInfo_loc.dot(Field::pParams), pLaunchInfo->paramCount, - &pLaunchInfo->pParams, false, true, kVUIDUndefined, "VUID-VkCuLaunchInfoNVX-pParams-parameter"); + skip |= state.ValidateArray(pLaunchInfo_loc.dot(Field::paramCount), pLaunchInfo_loc.dot(Field::pParams), + pLaunchInfo->paramCount, &pLaunchInfo->pParams, false, true, kVUIDUndefined, + "VUID-VkCuLaunchInfoNVX-pParams-parameter"); - skip |= ValidateArray(pLaunchInfo_loc.dot(Field::extraCount), pLaunchInfo_loc.dot(Field::pExtras), pLaunchInfo->extraCount, - &pLaunchInfo->pExtras, false, true, kVUIDUndefined, "VUID-VkCuLaunchInfoNVX-pExtras-parameter"); + skip |= state.ValidateArray(pLaunchInfo_loc.dot(Field::extraCount), pLaunchInfo_loc.dot(Field::pExtras), + pLaunchInfo->extraCount, &pLaunchInfo->pExtras, false, true, kVUIDUndefined, + "VUID-VkCuLaunchInfoNVX-pExtras-parameter"); } return skip; } @@ -21044,20 +23430,21 @@ bool StatelessValidation::PreCallValidateCmdCuLaunchKernelNVX(VkCommandBuffer co bool StatelessValidation::PreCallValidateGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nvx_image_view_handle)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_image_view_handle}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX, true, - "VUID-vkGetImageViewHandleNVX-pInfo-parameter", "VUID-VkImageViewHandleInfoNVX-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX, true, + "VUID-vkGetImageViewHandleNVX-pInfo-parameter", "VUID-VkImageViewHandleInfoNVX-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageViewHandleInfoNVX-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageViewHandleInfoNVX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, pInfo->descriptorType, - "VUID-VkImageViewHandleInfoNVX-descriptorType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, pInfo->descriptorType, + "VUID-VkImageViewHandleInfoNVX-descriptorType-parameter"); } return skip; } @@ -21065,20 +23452,21 @@ bool StatelessValidation::PreCallValidateGetImageViewHandleNVX(VkDevice device, bool StatelessValidation::PreCallValidateGetImageViewHandle64NVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nvx_image_view_handle)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_image_view_handle}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX, true, - "VUID-vkGetImageViewHandle64NVX-pInfo-parameter", "VUID-VkImageViewHandleInfoNVX-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX, true, + "VUID-vkGetImageViewHandle64NVX-pInfo-parameter", "VUID-VkImageViewHandleInfoNVX-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageViewHandleInfoNVX-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageViewHandleInfoNVX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, pInfo->descriptorType, - "VUID-VkImageViewHandleInfoNVX-descriptorType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, pInfo->descriptorType, + "VUID-VkImageViewHandleInfoNVX-descriptorType-parameter"); } return skip; } @@ -21087,17 +23475,18 @@ bool StatelessValidation::PreCallValidateGetImageViewAddressNVX(VkDevice device, VkImageViewAddressPropertiesNVX* pProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nvx_image_view_handle)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_image_view_handle}); - skip |= ValidateRequiredHandle(loc.dot(Field::imageView), imageView); - skip |= ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX, true, - "VUID-vkGetImageViewAddressNVX-pProperties-parameter", - "VUID-VkImageViewAddressPropertiesNVX-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::imageView), imageView); + skip |= state.ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX, + true, "VUID-vkGetImageViewAddressNVX-pProperties-parameter", + "VUID-VkImageViewAddressPropertiesNVX-sType-sType"); if (pProperties != nullptr) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties); - skip |= ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageViewAddressPropertiesNVX-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageViewAddressPropertiesNVX-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -21107,6 +23496,7 @@ bool StatelessValidation::PreCallValidateCmdDrawIndirectCountAMD(VkCommandBuffer VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amd_draw_indirect_count)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_draw_indirect_count}); @@ -21120,6 +23510,7 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirectCountAMD(VkComman VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amd_draw_indirect_count)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_draw_indirect_count}); @@ -21132,18 +23523,19 @@ bool StatelessValidation::PreCallValidateGetShaderInfoAMD(VkDevice device, VkPip VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amd_shader_info)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_shader_info}); - skip |= ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); - skip |= ValidateFlags(loc.dot(Field::shaderStage), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, - shaderStage, kRequiredSingleBit, VK_NULL_HANDLE, "VUID-vkGetShaderInfoAMD-shaderStage-parameter", - "VUID-vkGetShaderInfoAMD-shaderStage-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::infoType), vvl::Enum::VkShaderInfoTypeAMD, infoType, - "VUID-vkGetShaderInfoAMD-infoType-parameter", VK_NULL_HANDLE); - skip |= ValidatePointerArray(loc.dot(Field::pInfoSize), loc.dot(Field::pInfo), pInfoSize, &pInfo, true, false, false, - "VUID-vkGetShaderInfoAMD-pInfoSize-parameter", kVUIDUndefined, - "VUID-vkGetShaderInfoAMD-pInfo-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= state.ValidateFlags(loc.dot(Field::shaderStage), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, + shaderStage, kRequiredSingleBit, "VUID-vkGetShaderInfoAMD-shaderStage-parameter", + "VUID-vkGetShaderInfoAMD-shaderStage-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::infoType), vvl::Enum::VkShaderInfoTypeAMD, infoType, + "VUID-vkGetShaderInfoAMD-infoType-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pInfoSize), loc.dot(Field::pInfo), pInfoSize, &pInfo, true, false, false, + "VUID-vkGetShaderInfoAMD-pInfoSize-parameter", kVUIDUndefined, + "VUID-vkGetShaderInfoAMD-pInfo-parameter"); return skip; } @@ -21154,27 +23546,27 @@ bool StatelessValidation::PreCallValidateCreateStreamDescriptorSurfaceGGP(VkInst VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ggp_stream_descriptor_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_GGP_stream_descriptor_surface}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP, true, "VUID-vkCreateStreamDescriptorSurfaceGGP-pCreateInfo-parameter", "VUID-VkStreamDescriptorSurfaceCreateInfoGGP-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= - ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkStreamDescriptorSurfaceCreateInfoGGP-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkStreamDescriptorSurfaceCreateInfoGGP-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkStreamDescriptorSurfaceCreateInfoGGP-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkStreamDescriptorSurfaceCreateInfoGGP-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateStreamDescriptorSurfaceGGP-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, + "VUID-vkCreateStreamDescriptorSurfaceGGP-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_GGP @@ -21184,27 +23576,29 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalImageFormatPro VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_nv_external_memory_capabilities)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_external_memory_capabilities}); - skip |= ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, - "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter", physicalDevice); - skip |= ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, - "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter", physicalDevice); - skip |= ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, - "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter", physicalDevice); - skip |= ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, - kRequiredFlags, physicalDevice, "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter", - "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask"); - skip |= - ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, flags, - kOptionalFlags, physicalDevice, "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter"); - skip |= ValidateFlags(loc.dot(Field::externalHandleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, - AllVkExternalMemoryHandleTypeFlagBitsNV, externalHandleType, kOptionalFlags, physicalDevice, - "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter"); - skip |= - ValidateRequiredPointer(loc.dot(Field::pExternalImageFormatProperties), pExternalImageFormatProperties, - "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, + kRequiredFlags, "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter", + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask"); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, flags, + kOptionalFlags, "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::externalHandleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, + AllVkExternalMemoryHandleTypeFlagBitsNV, externalHandleType, kOptionalFlags, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter"); + skip |= state.ValidateRequiredPointer( + loc.dot(Field::pExternalImageFormatProperties), pExternalImageFormatProperties, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter"); return skip; } @@ -21213,15 +23607,16 @@ bool StatelessValidation::PreCallValidateGetMemoryWin32HandleNV(VkDevice device, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_external_memory_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_external_memory_win32}); - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); - skip |= ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, - AllVkExternalMemoryHandleTypeFlagBitsNV, handleType, kRequiredFlags, VK_NULL_HANDLE, - "VUID-vkGetMemoryWin32HandleNV-handleType-parameter", - "VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask"); - skip |= ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetMemoryWin32HandleNV-pHandle-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= state.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, + AllVkExternalMemoryHandleTypeFlagBitsNV, handleType, kRequiredFlags, + "VUID-vkGetMemoryWin32HandleNV-handleType-parameter", + "VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetMemoryWin32HandleNV-pHandle-parameter"); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -21231,23 +23626,24 @@ bool StatelessValidation::PreCallValidateCreateViSurfaceNN(VkInstance instance, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_nn_vi_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NN_vi_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN, true, - "VUID-vkCreateViSurfaceNN-pCreateInfo-parameter", "VUID-VkViSurfaceCreateInfoNN-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN, true, + "VUID-vkCreateViSurfaceNN-pCreateInfo-parameter", "VUID-VkViSurfaceCreateInfoNN-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkViSurfaceCreateInfoNN-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkViSurfaceCreateInfoNN-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkViSurfaceCreateInfoNN-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkViSurfaceCreateInfoNN-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateViSurfaceNN-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateViSurfaceNN-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_VI_NN @@ -21256,32 +23652,35 @@ bool StatelessValidation::PreCallValidateCmdBeginConditionalRenderingEXT( VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_conditional_rendering}); - skip |= ValidateStructType(loc.dot(Field::pConditionalRenderingBegin), pConditionalRenderingBegin, - VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT, true, - "VUID-vkCmdBeginConditionalRenderingEXT-pConditionalRenderingBegin-parameter", - "VUID-VkConditionalRenderingBeginInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pConditionalRenderingBegin), pConditionalRenderingBegin, + VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT, true, + "VUID-vkCmdBeginConditionalRenderingEXT-pConditionalRenderingBegin-parameter", + "VUID-VkConditionalRenderingBeginInfoEXT-sType-sType"); if (pConditionalRenderingBegin != nullptr) { [[maybe_unused]] const Location pConditionalRenderingBegin_loc = loc.dot(Field::pConditionalRenderingBegin); - skip |= ValidateStructPnext(pConditionalRenderingBegin_loc, pConditionalRenderingBegin->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkConditionalRenderingBeginInfoEXT-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pConditionalRenderingBegin_loc, pConditionalRenderingBegin->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkConditionalRenderingBeginInfoEXT-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pConditionalRenderingBegin_loc.dot(Field::buffer), pConditionalRenderingBegin->buffer); + skip |= state.ValidateRequiredHandle(pConditionalRenderingBegin_loc.dot(Field::buffer), pConditionalRenderingBegin->buffer); - skip |= ValidateFlags(pConditionalRenderingBegin_loc.dot(Field::flags), vvl::FlagBitmask::VkConditionalRenderingFlagBitsEXT, - AllVkConditionalRenderingFlagBitsEXT, pConditionalRenderingBegin->flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkConditionalRenderingBeginInfoEXT-flags-parameter"); + skip |= state.ValidateFlags(pConditionalRenderingBegin_loc.dot(Field::flags), + vvl::FlagBitmask::VkConditionalRenderingFlagBitsEXT, AllVkConditionalRenderingFlagBitsEXT, + pConditionalRenderingBegin->flags, kOptionalFlags, + "VUID-VkConditionalRenderingBeginInfoEXT-flags-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdBeginConditionalRenderingEXT(commandBuffer, pConditionalRenderingBegin, state); return skip; } bool StatelessValidation::PreCallValidateCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_conditional_rendering}); @@ -21294,12 +23693,13 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffe const VkViewportWScalingNV* pViewportWScalings, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_clip_space_w_scaling)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_clip_space_w_scaling}); - skip |= ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pViewportWScalings), viewportCount, &pViewportWScalings, - true, true, "VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength", - "VUID-vkCmdSetViewportWScalingNV-pViewportWScalings-parameter"); + skip |= state.ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pViewportWScalings), viewportCount, + &pViewportWScalings, true, true, "VUID-vkCmdSetViewportWScalingNV-viewportCount-arraylength", + "VUID-vkCmdSetViewportWScalingNV-pViewportWScalings-parameter"); if (pViewportWScalings != nullptr) { for (uint32_t viewportIndex = 0; viewportIndex < viewportCount; ++viewportIndex) { [[maybe_unused]] const Location pViewportWScalings_loc = loc.dot(Field::pViewportWScalings, viewportIndex); @@ -21307,18 +23707,21 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffe } } if (!skip) - skip |= manual_PreCallValidateCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings, - error_obj); + skip |= + manual_PreCallValidateCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings, state); return skip; } bool StatelessValidation::PreCallValidateReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_direct_mode_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_direct_mode_display}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); return skip; } @@ -21326,22 +23729,28 @@ bool StatelessValidation::PreCallValidateReleaseDisplayEXT(VkPhysicalDevice phys bool StatelessValidation::PreCallValidateAcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_acquire_xlib_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_acquire_xlib_display}); - skip |= ValidateRequiredPointer(loc.dot(Field::dpy), dpy, "VUID-vkAcquireXlibDisplayEXT-dpy-parameter"); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidateRequiredPointer(loc.dot(Field::dpy), dpy, "VUID-vkAcquireXlibDisplayEXT-dpy-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); return skip; } bool StatelessValidation::PreCallValidateGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_acquire_xlib_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_acquire_xlib_display}); - skip |= ValidateRequiredPointer(loc.dot(Field::dpy), dpy, "VUID-vkGetRandROutputDisplayEXT-dpy-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pDisplay), pDisplay, "VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::dpy), dpy, "VUID-vkGetRandROutputDisplayEXT-dpy-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pDisplay), pDisplay, "VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter"); return skip; } #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT @@ -21351,18 +23760,22 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceCapabilities2EX VkSurfaceCapabilities2EXT* pSurfaceCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_display_surface_counter)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_display_surface_counter}); - skip |= ValidateRequiredHandle(loc.dot(Field::surface), surface); - skip |= - ValidateStructType(loc.dot(Field::pSurfaceCapabilities), pSurfaceCapabilities, VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT, - true, "VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter", - "VUID-VkSurfaceCapabilities2EXT-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= state.ValidateStructType(loc.dot(Field::pSurfaceCapabilities), pSurfaceCapabilities, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT, true, + "VUID-vkGetPhysicalDeviceSurfaceCapabilities2EXT-pSurfaceCapabilities-parameter", + "VUID-VkSurfaceCapabilities2EXT-sType-sType"); if (pSurfaceCapabilities != nullptr) { [[maybe_unused]] const Location pSurfaceCapabilities_loc = loc.dot(Field::pSurfaceCapabilities); - skip |= ValidateStructPnext(pSurfaceCapabilities_loc, pSurfaceCapabilities->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSurfaceCapabilities2EXT-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pSurfaceCapabilities_loc, pSurfaceCapabilities->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSurfaceCapabilities2EXT-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -21371,21 +23784,21 @@ bool StatelessValidation::PreCallValidateDisplayPowerControlEXT(VkDevice device, const VkDisplayPowerInfoEXT* pDisplayPowerInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_display_control)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_display_control}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); - skip |= - ValidateStructType(loc.dot(Field::pDisplayPowerInfo), pDisplayPowerInfo, VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT, true, - "VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter", "VUID-VkDisplayPowerInfoEXT-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidateStructType(loc.dot(Field::pDisplayPowerInfo), pDisplayPowerInfo, VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT, + true, "VUID-vkDisplayPowerControlEXT-pDisplayPowerInfo-parameter", + "VUID-VkDisplayPowerInfoEXT-sType-sType"); if (pDisplayPowerInfo != nullptr) { [[maybe_unused]] const Location pDisplayPowerInfo_loc = loc.dot(Field::pDisplayPowerInfo); - skip |= ValidateStructPnext(pDisplayPowerInfo_loc, pDisplayPowerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDisplayPowerInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDisplayPowerInfo_loc, pDisplayPowerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDisplayPowerInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateRangedEnum(pDisplayPowerInfo_loc.dot(Field::powerState), vvl::Enum::VkDisplayPowerStateEXT, - pDisplayPowerInfo->powerState, "VUID-VkDisplayPowerInfoEXT-powerState-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDisplayPowerInfo_loc.dot(Field::powerState), vvl::Enum::VkDisplayPowerStateEXT, + pDisplayPowerInfo->powerState, "VUID-VkDisplayPowerInfoEXT-powerState-parameter"); } return skip; } @@ -21394,25 +23807,26 @@ bool StatelessValidation::PreCallValidateRegisterDeviceEventEXT(VkDevice device, const VkAllocationCallbacks* pAllocator, VkFence* pFence, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_display_control)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_display_control}); - skip |= ValidateStructType(loc.dot(Field::pDeviceEventInfo), pDeviceEventInfo, VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT, true, - "VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter", "VUID-VkDeviceEventInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pDeviceEventInfo), pDeviceEventInfo, VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT, + true, "VUID-vkRegisterDeviceEventEXT-pDeviceEventInfo-parameter", + "VUID-VkDeviceEventInfoEXT-sType-sType"); if (pDeviceEventInfo != nullptr) { [[maybe_unused]] const Location pDeviceEventInfo_loc = loc.dot(Field::pDeviceEventInfo); - skip |= ValidateStructPnext(pDeviceEventInfo_loc, pDeviceEventInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceEventInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDeviceEventInfo_loc, pDeviceEventInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceEventInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateRangedEnum(pDeviceEventInfo_loc.dot(Field::deviceEvent), vvl::Enum::VkDeviceEventTypeEXT, - pDeviceEventInfo->deviceEvent, "VUID-VkDeviceEventInfoEXT-deviceEvent-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDeviceEventInfo_loc.dot(Field::deviceEvent), vvl::Enum::VkDeviceEventTypeEXT, + pDeviceEventInfo->deviceEvent, "VUID-VkDeviceEventInfoEXT-deviceEvent-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkRegisterDeviceEventEXT-pFence-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkRegisterDeviceEventEXT-pFence-parameter"); return skip; } @@ -21421,27 +23835,27 @@ bool StatelessValidation::PreCallValidateRegisterDisplayEventEXT(VkDevice device const VkAllocationCallbacks* pAllocator, VkFence* pFence, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_display_control)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_display_control}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); - skip |= - ValidateStructType(loc.dot(Field::pDisplayEventInfo), pDisplayEventInfo, VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT, true, - "VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter", "VUID-VkDisplayEventInfoEXT-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidateStructType(loc.dot(Field::pDisplayEventInfo), pDisplayEventInfo, VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT, + true, "VUID-vkRegisterDisplayEventEXT-pDisplayEventInfo-parameter", + "VUID-VkDisplayEventInfoEXT-sType-sType"); if (pDisplayEventInfo != nullptr) { [[maybe_unused]] const Location pDisplayEventInfo_loc = loc.dot(Field::pDisplayEventInfo); - skip |= ValidateStructPnext(pDisplayEventInfo_loc, pDisplayEventInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDisplayEventInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDisplayEventInfo_loc, pDisplayEventInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDisplayEventInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pDisplayEventInfo_loc.dot(Field::displayEvent), vvl::Enum::VkDisplayEventTypeEXT, - pDisplayEventInfo->displayEvent, "VUID-VkDisplayEventInfoEXT-displayEvent-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDisplayEventInfo_loc.dot(Field::displayEvent), vvl::Enum::VkDisplayEventTypeEXT, + pDisplayEventInfo->displayEvent, "VUID-VkDisplayEventInfoEXT-displayEvent-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkRegisterDisplayEventEXT-pFence-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkRegisterDisplayEventEXT-pFence-parameter"); return skip; } @@ -21449,15 +23863,16 @@ bool StatelessValidation::PreCallValidateGetSwapchainCounterEXT(VkDevice device, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_display_control)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_display_control}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= ValidateFlags(loc.dot(Field::counter), vvl::FlagBitmask::VkSurfaceCounterFlagBitsEXT, AllVkSurfaceCounterFlagBitsEXT, - counter, kRequiredSingleBit, VK_NULL_HANDLE, "VUID-vkGetSwapchainCounterEXT-counter-parameter", - "VUID-vkGetSwapchainCounterEXT-counter-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pCounterValue), pCounterValue, - "VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateFlags( + loc.dot(Field::counter), vvl::FlagBitmask::VkSurfaceCounterFlagBitsEXT, AllVkSurfaceCounterFlagBitsEXT, counter, + kRequiredSingleBit, "VUID-vkGetSwapchainCounterEXT-counter-parameter", "VUID-vkGetSwapchainCounterEXT-counter-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCounterValue), pCounterValue, + "VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter"); return skip; } @@ -21465,12 +23880,13 @@ bool StatelessValidation::PreCallValidateGetRefreshCycleDurationGOOGLE(VkDevice VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_google_display_timing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_GOOGLE_display_timing}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= ValidateRequiredPointer(loc.dot(Field::pDisplayTimingProperties), pDisplayTimingProperties, - "VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pDisplayTimingProperties), pDisplayTimingProperties, + "VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter"); return skip; } @@ -21479,14 +23895,15 @@ bool StatelessValidation::PreCallValidateGetPastPresentationTimingGOOGLE(VkDevic VkPastPresentationTimingGOOGLE* pPresentationTimings, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_google_display_timing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_GOOGLE_display_timing}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= ValidatePointerArray(loc.dot(Field::pPresentationTimingCount), loc.dot(Field::pPresentationTimings), - pPresentationTimingCount, &pPresentationTimings, true, false, false, - "VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter", kVUIDUndefined, - "VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidatePointerArray(loc.dot(Field::pPresentationTimingCount), loc.dot(Field::pPresentationTimings), + pPresentationTimingCount, &pPresentationTimings, true, false, false, + "VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimingCount-parameter", kVUIDUndefined, + "VUID-vkGetPastPresentationTimingGOOGLE-pPresentationTimings-parameter"); if (pPresentationTimings != nullptr) { for (uint32_t pPresentationTimingIndex = 0; pPresentationTimingIndex < *pPresentationTimingCount; ++pPresentationTimingIndex) { @@ -21503,15 +23920,17 @@ bool StatelessValidation::PreCallValidateCmdSetDiscardRectangleEXT(VkCommandBuff const VkRect2D* pDiscardRectangles, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_discard_rectangles)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_discard_rectangles}); - skip |= ValidateArray(loc.dot(Field::discardRectangleCount), loc.dot(Field::pDiscardRectangles), discardRectangleCount, - &pDiscardRectangles, true, true, "VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength", - "VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter"); + skip |= + state.ValidateArray(loc.dot(Field::discardRectangleCount), loc.dot(Field::pDiscardRectangles), discardRectangleCount, + &pDiscardRectangles, true, true, "VUID-vkCmdSetDiscardRectangleEXT-discardRectangleCount-arraylength", + "VUID-vkCmdSetDiscardRectangleEXT-pDiscardRectangles-parameter"); if (!skip) skip |= manual_PreCallValidateCmdSetDiscardRectangleEXT(commandBuffer, firstDiscardRectangle, discardRectangleCount, - pDiscardRectangles, error_obj); + pDiscardRectangles, state); return skip; } @@ -21519,11 +23938,12 @@ bool StatelessValidation::PreCallValidateCmdSetDiscardRectangleEnableEXT(VkComma VkBool32 discardRectangleEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_discard_rectangles)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_discard_rectangles}); - skip |= ValidateBool32(loc.dot(Field::discardRectangleEnable), discardRectangleEnable); - if (!skip) skip |= manual_PreCallValidateCmdSetDiscardRectangleEnableEXT(commandBuffer, discardRectangleEnable, error_obj); + skip |= state.ValidateBool32(loc.dot(Field::discardRectangleEnable), discardRectangleEnable); + if (!skip) skip |= manual_PreCallValidateCmdSetDiscardRectangleEnableEXT(commandBuffer, discardRectangleEnable, state); return skip; } @@ -21531,12 +23951,13 @@ bool StatelessValidation::PreCallValidateCmdSetDiscardRectangleModeEXT(VkCommand VkDiscardRectangleModeEXT discardRectangleMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_discard_rectangles)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_discard_rectangles}); - skip |= ValidateRangedEnum(loc.dot(Field::discardRectangleMode), vvl::Enum::VkDiscardRectangleModeEXT, discardRectangleMode, - "VUID-vkCmdSetDiscardRectangleModeEXT-discardRectangleMode-parameter", VK_NULL_HANDLE); - if (!skip) skip |= manual_PreCallValidateCmdSetDiscardRectangleModeEXT(commandBuffer, discardRectangleMode, error_obj); + skip |= state.ValidateRangedEnum(loc.dot(Field::discardRectangleMode), vvl::Enum::VkDiscardRectangleModeEXT, + discardRectangleMode, "VUID-vkCmdSetDiscardRectangleModeEXT-discardRectangleMode-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdSetDiscardRectangleModeEXT(commandBuffer, discardRectangleMode, state); return skip; } @@ -21544,24 +23965,25 @@ bool StatelessValidation::PreCallValidateSetHdrMetadataEXT(VkDevice device, uint const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_hdr_metadata)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_hdr_metadata}); - skip |= ValidateHandleArray(loc.dot(Field::swapchainCount), loc.dot(Field::pSwapchains), swapchainCount, pSwapchains, true, - true, "VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength"); - skip |= ValidateStructTypeArray(loc.dot(Field::swapchainCount), loc.dot(Field::pMetadata), swapchainCount, pMetadata, - VK_STRUCTURE_TYPE_HDR_METADATA_EXT, true, true, "VUID-VkHdrMetadataEXT-sType-sType", - "VUID-vkSetHdrMetadataEXT-pMetadata-parameter", - "VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength"); + skip |= state.ValidateHandleArray(loc.dot(Field::swapchainCount), loc.dot(Field::pSwapchains), swapchainCount, pSwapchains, + true, true, "VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::swapchainCount), loc.dot(Field::pMetadata), swapchainCount, pMetadata, + VK_STRUCTURE_TYPE_HDR_METADATA_EXT, true, true, "VUID-VkHdrMetadataEXT-sType-sType", + "VUID-vkSetHdrMetadataEXT-pMetadata-parameter", + "VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength"); if (pMetadata != nullptr) { for (uint32_t swapchainIndex = 0; swapchainIndex < swapchainCount; ++swapchainIndex) { [[maybe_unused]] const Location pMetadata_loc = loc.dot(Field::pMetadata, swapchainIndex); constexpr std::array allowed_structs_VkHdrMetadataEXT = {VK_STRUCTURE_TYPE_HDR_VIVID_DYNAMIC_METADATA_HUAWEI}; - skip |= ValidateStructPnext(pMetadata_loc, pMetadata[swapchainIndex].pNext, allowed_structs_VkHdrMetadataEXT.size(), - allowed_structs_VkHdrMetadataEXT.data(), GeneratedVulkanHeaderVersion, - "VUID-VkHdrMetadataEXT-pNext-pNext", "VUID-VkHdrMetadataEXT-sType-unique", VK_NULL_HANDLE, - true); + skip |= + state.ValidateStructPnext(pMetadata_loc, pMetadata[swapchainIndex].pNext, allowed_structs_VkHdrMetadataEXT.size(), + allowed_structs_VkHdrMetadataEXT.data(), GeneratedVulkanHeaderVersion, + "VUID-VkHdrMetadataEXT-pNext-pNext", "VUID-VkHdrMetadataEXT-sType-unique", true); } } return skip; @@ -21572,24 +23994,26 @@ bool StatelessValidation::PreCallValidateCreateIOSSurfaceMVK(VkInstance instance const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_mvk_ios_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_MVK_ios_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK, true, - "VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter", "VUID-VkIOSSurfaceCreateInfoMVK-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK, true, + "VUID-vkCreateIOSSurfaceMVK-pCreateInfo-parameter", "VUID-VkIOSSurfaceCreateInfoMVK-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkIOSSurfaceCreateInfoMVK-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkIOSSurfaceCreateInfoMVK-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkIOSSurfaceCreateInfoMVK-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkIOSSurfaceCreateInfoMVK-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateIOSSurfaceMVK-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateIOSSurfaceMVK-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_IOS_MVK @@ -21599,25 +24023,26 @@ bool StatelessValidation::PreCallValidateCreateMacOSSurfaceMVK(VkInstance instan const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_mvk_macos_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_MVK_macos_surface}); - skip |= - ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK, true, - "VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter", "VUID-VkMacOSSurfaceCreateInfoMVK-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK, + true, "VUID-vkCreateMacOSSurfaceMVK-pCreateInfo-parameter", + "VUID-VkMacOSSurfaceCreateInfoMVK-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMacOSSurfaceCreateInfoMVK-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMacOSSurfaceCreateInfoMVK-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkMacOSSurfaceCreateInfoMVK-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkMacOSSurfaceCreateInfoMVK-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_MACOS_MVK @@ -21625,67 +24050,72 @@ bool StatelessValidation::PreCallValidateCreateMacOSSurfaceMVK(VkInstance instan bool StatelessValidation::PreCallValidateSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); - skip |= ValidateStructType(loc.dot(Field::pNameInfo), pNameInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, true, - "VUID-vkSetDebugUtilsObjectNameEXT-pNameInfo-parameter", - "VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pNameInfo), pNameInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, true, + "VUID-vkSetDebugUtilsObjectNameEXT-pNameInfo-parameter", + "VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType"); if (pNameInfo != nullptr) { [[maybe_unused]] const Location pNameInfo_loc = loc.dot(Field::pNameInfo); - skip |= ValidateRangedEnum(pNameInfo_loc.dot(Field::objectType), vvl::Enum::VkObjectType, pNameInfo->objectType, - "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pNameInfo_loc.dot(Field::objectType), vvl::Enum::VkObjectType, pNameInfo->objectType, + "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter"); } - if (!skip) skip |= manual_PreCallValidateSetDebugUtilsObjectNameEXT(device, pNameInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateSetDebugUtilsObjectNameEXT(device, pNameInfo, state); return skip; } bool StatelessValidation::PreCallValidateSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); - skip |= - ValidateStructType(loc.dot(Field::pTagInfo), pTagInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT, true, - "VUID-vkSetDebugUtilsObjectTagEXT-pTagInfo-parameter", "VUID-VkDebugUtilsObjectTagInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pTagInfo), pTagInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT, true, + "VUID-vkSetDebugUtilsObjectTagEXT-pTagInfo-parameter", + "VUID-VkDebugUtilsObjectTagInfoEXT-sType-sType"); if (pTagInfo != nullptr) { [[maybe_unused]] const Location pTagInfo_loc = loc.dot(Field::pTagInfo); - skip |= ValidateStructPnext(pTagInfo_loc, pTagInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugUtilsObjectTagInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pTagInfo_loc, pTagInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugUtilsObjectTagInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pTagInfo_loc.dot(Field::objectType), vvl::Enum::VkObjectType, pTagInfo->objectType, - "VUID-VkDebugUtilsObjectTagInfoEXT-objectType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pTagInfo_loc.dot(Field::objectType), vvl::Enum::VkObjectType, pTagInfo->objectType, + "VUID-VkDebugUtilsObjectTagInfoEXT-objectType-parameter"); - skip |= ValidateArray(pTagInfo_loc.dot(Field::tagSize), pTagInfo_loc.dot(Field::pTag), pTagInfo->tagSize, &pTagInfo->pTag, - true, true, "VUID-VkDebugUtilsObjectTagInfoEXT-tagSize-arraylength", - "VUID-VkDebugUtilsObjectTagInfoEXT-pTag-parameter"); + skip |= state.ValidateArray(pTagInfo_loc.dot(Field::tagSize), pTagInfo_loc.dot(Field::pTag), pTagInfo->tagSize, + &pTagInfo->pTag, true, true, "VUID-VkDebugUtilsObjectTagInfoEXT-tagSize-arraylength", + "VUID-VkDebugUtilsObjectTagInfoEXT-pTag-parameter"); } - if (!skip) skip |= manual_PreCallValidateSetDebugUtilsObjectTagEXT(device, pTagInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateSetDebugUtilsObjectTagEXT(device, pTagInfo, state); return skip; } bool StatelessValidation::PreCallValidateQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); - skip |= ValidateStructType(loc.dot(Field::pLabelInfo), pLabelInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, true, - "VUID-vkQueueBeginDebugUtilsLabelEXT-pLabelInfo-parameter", "VUID-VkDebugUtilsLabelEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pLabelInfo), pLabelInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, true, + "VUID-vkQueueBeginDebugUtilsLabelEXT-pLabelInfo-parameter", + "VUID-VkDebugUtilsLabelEXT-sType-sType"); if (pLabelInfo != nullptr) { [[maybe_unused]] const Location pLabelInfo_loc = loc.dot(Field::pLabelInfo); - skip |= ValidateStructPnext(pLabelInfo_loc, pLabelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pLabelInfo_loc, pLabelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, - "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); + skip |= state.ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } return skip; } bool StatelessValidation::PreCallValidateQueueEndDebugUtilsLabelEXT(VkQueue queue, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); @@ -21696,19 +24126,20 @@ bool StatelessValidation::PreCallValidateQueueEndDebugUtilsLabelEXT(VkQueue queu bool StatelessValidation::PreCallValidateQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); - skip |= - ValidateStructType(loc.dot(Field::pLabelInfo), pLabelInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, true, - "VUID-vkQueueInsertDebugUtilsLabelEXT-pLabelInfo-parameter", "VUID-VkDebugUtilsLabelEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pLabelInfo), pLabelInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, true, + "VUID-vkQueueInsertDebugUtilsLabelEXT-pLabelInfo-parameter", + "VUID-VkDebugUtilsLabelEXT-sType-sType"); if (pLabelInfo != nullptr) { [[maybe_unused]] const Location pLabelInfo_loc = loc.dot(Field::pLabelInfo); - skip |= ValidateStructPnext(pLabelInfo_loc, pLabelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pLabelInfo_loc, pLabelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, - "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); + skip |= state.ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } return skip; } @@ -21717,18 +24148,20 @@ bool StatelessValidation::PreCallValidateCmdBeginDebugUtilsLabelEXT(VkCommandBuf const VkDebugUtilsLabelEXT* pLabelInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); - skip |= ValidateStructType(loc.dot(Field::pLabelInfo), pLabelInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, true, - "VUID-vkCmdBeginDebugUtilsLabelEXT-pLabelInfo-parameter", "VUID-VkDebugUtilsLabelEXT-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pLabelInfo), pLabelInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, true, + "VUID-vkCmdBeginDebugUtilsLabelEXT-pLabelInfo-parameter", "VUID-VkDebugUtilsLabelEXT-sType-sType"); if (pLabelInfo != nullptr) { [[maybe_unused]] const Location pLabelInfo_loc = loc.dot(Field::pLabelInfo); - skip |= ValidateStructPnext(pLabelInfo_loc, pLabelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pLabelInfo_loc, pLabelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, - "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); + skip |= state.ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } return skip; } @@ -21736,6 +24169,7 @@ bool StatelessValidation::PreCallValidateCmdBeginDebugUtilsLabelEXT(VkCommandBuf bool StatelessValidation::PreCallValidateCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); @@ -21747,18 +24181,20 @@ bool StatelessValidation::PreCallValidateCmdInsertDebugUtilsLabelEXT(VkCommandBu const VkDebugUtilsLabelEXT* pLabelInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); - skip |= ValidateStructType(loc.dot(Field::pLabelInfo), pLabelInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, true, - "VUID-vkCmdInsertDebugUtilsLabelEXT-pLabelInfo-parameter", "VUID-VkDebugUtilsLabelEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pLabelInfo), pLabelInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, true, + "VUID-vkCmdInsertDebugUtilsLabelEXT-pLabelInfo-parameter", + "VUID-VkDebugUtilsLabelEXT-sType-sType"); if (pLabelInfo != nullptr) { [[maybe_unused]] const Location pLabelInfo_loc = loc.dot(Field::pLabelInfo); - skip |= ValidateStructPnext(pLabelInfo_loc, pLabelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pLabelInfo_loc, pLabelInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, - "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); + skip |= state.ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } return skip; } @@ -21769,37 +24205,39 @@ bool StatelessValidation::PreCallValidateCreateDebugUtilsMessengerEXT(VkInstance VkDebugUtilsMessengerEXT* pMessenger, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT, - true, "VUID-vkCreateDebugUtilsMessengerEXT-pCreateInfo-parameter", - "VUID-VkDebugUtilsMessengerCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT, true, + "VUID-vkCreateDebugUtilsMessengerEXT-pCreateInfo-parameter", "VUID-VkDebugUtilsMessengerCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkDebugUtilsMessengerCreateInfoEXT-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkDebugUtilsMessengerCreateInfoEXT-flags-zerobitmask"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::messageSeverity), vvl::FlagBitmask::VkDebugUtilsMessageSeverityFlagBitsEXT, - AllVkDebugUtilsMessageSeverityFlagBitsEXT, pCreateInfo->messageSeverity, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter", - "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::messageSeverity), + vvl::FlagBitmask::VkDebugUtilsMessageSeverityFlagBitsEXT, + AllVkDebugUtilsMessageSeverityFlagBitsEXT, pCreateInfo->messageSeverity, kRequiredFlags, + "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-parameter", + "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageSeverity-requiredbitmask"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::messageType), vvl::FlagBitmask::VkDebugUtilsMessageTypeFlagBitsEXT, - AllVkDebugUtilsMessageTypeFlagBitsEXT, pCreateInfo->messageType, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter", - "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::messageType), vvl::FlagBitmask::VkDebugUtilsMessageTypeFlagBitsEXT, + AllVkDebugUtilsMessageTypeFlagBitsEXT, pCreateInfo->messageType, kRequiredFlags, + "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-parameter", + "VUID-VkDebugUtilsMessengerCreateInfoEXT-messageType-requiredbitmask"); - skip |= ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pfnUserCallback), - reinterpret_cast(pCreateInfo->pfnUserCallback), - "VUID-VkDebugUtilsMessengerCreateInfoEXT-pfnUserCallback-parameter"); + skip |= state.ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pfnUserCallback), + reinterpret_cast(pCreateInfo->pfnUserCallback), + "VUID-VkDebugUtilsMessengerCreateInfoEXT-pfnUserCallback-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pMessenger), pMessenger, "VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMessenger), pMessenger, + "VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter"); return skip; } @@ -21807,12 +24245,13 @@ bool StatelessValidation::PreCallValidateDestroyDebugUtilsMessengerEXT(VkInstanc const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -21823,18 +24262,19 @@ bool StatelessValidation::PreCallValidateSubmitDebugUtilsMessageEXT(VkInstance i const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); - skip |= ValidateFlags(loc.dot(Field::messageSeverity), vvl::FlagBitmask::VkDebugUtilsMessageSeverityFlagBitsEXT, - AllVkDebugUtilsMessageSeverityFlagBitsEXT, messageSeverity, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter", - "VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter"); - skip |= ValidateFlags(loc.dot(Field::messageTypes), vvl::FlagBitmask::VkDebugUtilsMessageTypeFlagBitsEXT, - AllVkDebugUtilsMessageTypeFlagBitsEXT, messageTypes, kRequiredFlags, VK_NULL_HANDLE, - "VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-parameter", - "VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-requiredbitmask"); - skip |= ValidateStructType( + skip |= state.ValidateFlags(loc.dot(Field::messageSeverity), vvl::FlagBitmask::VkDebugUtilsMessageSeverityFlagBitsEXT, + AllVkDebugUtilsMessageSeverityFlagBitsEXT, messageSeverity, kRequiredSingleBit, + "VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter", + "VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::messageTypes), vvl::FlagBitmask::VkDebugUtilsMessageTypeFlagBitsEXT, + AllVkDebugUtilsMessageTypeFlagBitsEXT, messageTypes, kRequiredFlags, + "VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-parameter", + "VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-requiredbitmask"); + skip |= state.ValidateStructType( loc.dot(Field::pCallbackData), pCallbackData, VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT, true, "VUID-vkSubmitDebugUtilsMessageEXT-pCallbackData-parameter", "VUID-VkDebugUtilsMessengerCallbackDataEXT-sType-sType"); if (pCallbackData != nullptr) { @@ -21842,65 +24282,65 @@ bool StatelessValidation::PreCallValidateSubmitDebugUtilsMessageEXT(VkInstance i constexpr std::array allowed_structs_VkDebugUtilsMessengerCallbackDataEXT = { VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT}; - skip |= ValidateStructPnext(pCallbackData_loc, pCallbackData->pNext, - allowed_structs_VkDebugUtilsMessengerCallbackDataEXT.size(), - allowed_structs_VkDebugUtilsMessengerCallbackDataEXT.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDebugUtilsMessengerCallbackDataEXT-pNext-pNext", - "VUID-VkDebugUtilsMessengerCallbackDataEXT-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCallbackData_loc, pCallbackData->pNext, + allowed_structs_VkDebugUtilsMessengerCallbackDataEXT.size(), + allowed_structs_VkDebugUtilsMessengerCallbackDataEXT.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDebugUtilsMessengerCallbackDataEXT-pNext-pNext", + "VUID-VkDebugUtilsMessengerCallbackDataEXT-sType-unique", true); - skip |= ValidateReservedFlags(pCallbackData_loc.dot(Field::flags), pCallbackData->flags, - "VUID-VkDebugUtilsMessengerCallbackDataEXT-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCallbackData_loc.dot(Field::flags), pCallbackData->flags, + "VUID-VkDebugUtilsMessengerCallbackDataEXT-flags-zerobitmask"); - skip |= - ValidateStructTypeArray(pCallbackData_loc.dot(Field::queueLabelCount), pCallbackData_loc.dot(Field::pQueueLabels), - pCallbackData->queueLabelCount, pCallbackData->pQueueLabels, - VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, false, true, "VUID-VkDebugUtilsLabelEXT-sType-sType", - "VUID-VkDebugUtilsMessengerCallbackDataEXT-pQueueLabels-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pCallbackData_loc.dot(Field::queueLabelCount), + pCallbackData_loc.dot(Field::pQueueLabels), pCallbackData->queueLabelCount, + pCallbackData->pQueueLabels, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, false, true, + "VUID-VkDebugUtilsLabelEXT-sType-sType", + "VUID-VkDebugUtilsMessengerCallbackDataEXT-pQueueLabels-parameter", kVUIDUndefined); if (pCallbackData->pQueueLabels != nullptr) { for (uint32_t queueLabelIndex = 0; queueLabelIndex < pCallbackData->queueLabelCount; ++queueLabelIndex) { [[maybe_unused]] const Location pQueueLabels_loc = pCallbackData_loc.dot(Field::pQueueLabels, queueLabelIndex); - skip |= ValidateStructPnext(pQueueLabels_loc, pCallbackData->pQueueLabels[queueLabelIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pQueueLabels_loc, pCallbackData->pQueueLabels[queueLabelIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkDebugUtilsLabelEXT-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pQueueLabels_loc.dot(Field::pLabelName), - pCallbackData->pQueueLabels[queueLabelIndex].pLabelName, - "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); + skip |= state.ValidateRequiredPointer(pQueueLabels_loc.dot(Field::pLabelName), + pCallbackData->pQueueLabels[queueLabelIndex].pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } } - skip |= - ValidateStructTypeArray(pCallbackData_loc.dot(Field::cmdBufLabelCount), pCallbackData_loc.dot(Field::pCmdBufLabels), - pCallbackData->cmdBufLabelCount, pCallbackData->pCmdBufLabels, - VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, false, true, "VUID-VkDebugUtilsLabelEXT-sType-sType", - "VUID-VkDebugUtilsMessengerCallbackDataEXT-pCmdBufLabels-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pCallbackData_loc.dot(Field::cmdBufLabelCount), + pCallbackData_loc.dot(Field::pCmdBufLabels), pCallbackData->cmdBufLabelCount, + pCallbackData->pCmdBufLabels, VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, false, true, + "VUID-VkDebugUtilsLabelEXT-sType-sType", + "VUID-VkDebugUtilsMessengerCallbackDataEXT-pCmdBufLabels-parameter", kVUIDUndefined); if (pCallbackData->pCmdBufLabels != nullptr) { for (uint32_t cmdBufLabelIndex = 0; cmdBufLabelIndex < pCallbackData->cmdBufLabelCount; ++cmdBufLabelIndex) { [[maybe_unused]] const Location pCmdBufLabels_loc = pCallbackData_loc.dot(Field::pCmdBufLabels, cmdBufLabelIndex); - skip |= ValidateStructPnext(pCmdBufLabels_loc, pCallbackData->pCmdBufLabels[cmdBufLabelIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkDebugUtilsLabelEXT-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCmdBufLabels_loc, pCallbackData->pCmdBufLabels[cmdBufLabelIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, "VUID-VkDebugUtilsLabelEXT-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pCmdBufLabels_loc.dot(Field::pLabelName), - pCallbackData->pCmdBufLabels[cmdBufLabelIndex].pLabelName, - "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); + skip |= state.ValidateRequiredPointer(pCmdBufLabels_loc.dot(Field::pLabelName), + pCallbackData->pCmdBufLabels[cmdBufLabelIndex].pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } } - skip |= ValidateStructTypeArray(pCallbackData_loc.dot(Field::objectCount), pCallbackData_loc.dot(Field::pObjects), - pCallbackData->objectCount, pCallbackData->pObjects, - VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, false, true, - "VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType", - "VUID-VkDebugUtilsMessengerCallbackDataEXT-pObjects-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pCallbackData_loc.dot(Field::objectCount), pCallbackData_loc.dot(Field::pObjects), + pCallbackData->objectCount, pCallbackData->pObjects, + VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, false, true, + "VUID-VkDebugUtilsObjectNameInfoEXT-sType-sType", + "VUID-VkDebugUtilsMessengerCallbackDataEXT-pObjects-parameter", kVUIDUndefined); if (pCallbackData->pObjects != nullptr) { for (uint32_t objectIndex = 0; objectIndex < pCallbackData->objectCount; ++objectIndex) { [[maybe_unused]] const Location pObjects_loc = pCallbackData_loc.dot(Field::pObjects, objectIndex); - skip |= ValidateRangedEnum(pObjects_loc.dot(Field::objectType), vvl::Enum::VkObjectType, - pCallbackData->pObjects[objectIndex].objectType, - "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pObjects_loc.dot(Field::objectType), vvl::Enum::VkObjectType, + pCallbackData->pObjects[objectIndex].objectType, + "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter"); } } } @@ -21912,15 +24352,16 @@ bool StatelessValidation::PreCallValidateGetAndroidHardwareBufferPropertiesANDRO VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_ANDROID_external_memory_android_hardware_buffer}); - skip |= ValidateRequiredPointer(loc.dot(Field::buffer), buffer, - "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-parameter"); - skip |= - ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, - true, "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-pProperties-parameter", - "VUID-VkAndroidHardwareBufferPropertiesANDROID-sType-sType"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::buffer), buffer, + "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-parameter"); + skip |= state.ValidateStructType(loc.dot(Field::pProperties), pProperties, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, true, + "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-pProperties-parameter", + "VUID-VkAndroidHardwareBufferPropertiesANDROID-sType-sType"); if (pProperties != nullptr) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties); constexpr std::array allowed_structs_VkAndroidHardwareBufferPropertiesANDROID = { @@ -21928,11 +24369,11 @@ bool StatelessValidation::PreCallValidateGetAndroidHardwareBufferPropertiesANDRO VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID, VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID}; - skip |= ValidateStructPnext(pProperties_loc, pProperties->pNext, - allowed_structs_VkAndroidHardwareBufferPropertiesANDROID.size(), - allowed_structs_VkAndroidHardwareBufferPropertiesANDROID.data(), GeneratedVulkanHeaderVersion, - "VUID-VkAndroidHardwareBufferPropertiesANDROID-pNext-pNext", - "VUID-VkAndroidHardwareBufferPropertiesANDROID-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties->pNext, + allowed_structs_VkAndroidHardwareBufferPropertiesANDROID.size(), + allowed_structs_VkAndroidHardwareBufferPropertiesANDROID.data(), + GeneratedVulkanHeaderVersion, "VUID-VkAndroidHardwareBufferPropertiesANDROID-pNext-pNext", + "VUID-VkAndroidHardwareBufferPropertiesANDROID-sType-unique", false); } return skip; } @@ -21941,22 +24382,23 @@ bool StatelessValidation::PreCallValidateGetMemoryAndroidHardwareBufferANDROID( VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_ANDROID_external_memory_android_hardware_buffer}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID, - true, "VUID-vkGetMemoryAndroidHardwareBufferANDROID-pInfo-parameter", - "VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID, + true, "VUID-vkGetMemoryAndroidHardwareBufferANDROID-pInfo-parameter", + "VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::memory), pInfo->memory); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::memory), pInfo->memory); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pBuffer), pBuffer, "VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pBuffer), pBuffer, + "VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter"); return skip; } #endif // VK_USE_PLATFORM_ANDROID_KHR @@ -21967,14 +24409,15 @@ bool StatelessValidation::PreCallValidateCreateExecutionGraphPipelinesAMDX( const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); - skip |= ValidateStructTypeArray(loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, pCreateInfos, - VK_STRUCTURE_TYPE_EXECUTION_GRAPH_PIPELINE_CREATE_INFO_AMDX, true, true, - "VUID-VkExecutionGraphPipelineCreateInfoAMDX-sType-sType", - "VUID-vkCreateExecutionGraphPipelinesAMDX-pCreateInfos-parameter", - "VUID-vkCreateExecutionGraphPipelinesAMDX-createInfoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, + pCreateInfos, VK_STRUCTURE_TYPE_EXECUTION_GRAPH_PIPELINE_CREATE_INFO_AMDX, true, true, + "VUID-VkExecutionGraphPipelineCreateInfoAMDX-sType-sType", + "VUID-vkCreateExecutionGraphPipelinesAMDX-pCreateInfos-parameter", + "VUID-vkCreateExecutionGraphPipelinesAMDX-createInfoCount-arraylength"); if (pCreateInfos != nullptr) { for (uint32_t createInfoIndex = 0; createInfoIndex < createInfoCount; ++createInfoIndex) { [[maybe_unused]] const Location pCreateInfos_loc = loc.dot(Field::pCreateInfos, createInfoIndex); @@ -21982,16 +24425,18 @@ bool StatelessValidation::PreCallValidateCreateExecutionGraphPipelinesAMDX( VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO}; - skip |= ValidateStructPnext(pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, - allowed_structs_VkExecutionGraphPipelineCreateInfoAMDX.size(), - allowed_structs_VkExecutionGraphPipelineCreateInfoAMDX.data(), GeneratedVulkanHeaderVersion, - "VUID-VkExecutionGraphPipelineCreateInfoAMDX-pNext-pNext", - "VUID-VkExecutionGraphPipelineCreateInfoAMDX-sType-unique", VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, + allowed_structs_VkExecutionGraphPipelineCreateInfoAMDX.size(), + allowed_structs_VkExecutionGraphPipelineCreateInfoAMDX.data(), + GeneratedVulkanHeaderVersion, "VUID-VkExecutionGraphPipelineCreateInfoAMDX-pNext-pNext", + "VUID-VkExecutionGraphPipelineCreateInfoAMDX-sType-unique", true); - skip |= ValidateStructTypeArray(pCreateInfos_loc.dot(Field::stageCount), pCreateInfos_loc.dot(Field::pStages), - pCreateInfos[createInfoIndex].stageCount, pCreateInfos[createInfoIndex].pStages, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, false, - "VUID-VkPipelineShaderStageCreateInfo-sType-sType", kVUIDUndefined, kVUIDUndefined); + skip |= + state.ValidateStructTypeArray(pCreateInfos_loc.dot(Field::stageCount), pCreateInfos_loc.dot(Field::pStages), + pCreateInfos[createInfoIndex].stageCount, pCreateInfos[createInfoIndex].pStages, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, false, + "VUID-VkPipelineShaderStageCreateInfo-sType-sType", kVUIDUndefined, kVUIDUndefined); if (pCreateInfos[createInfoIndex].pStages != nullptr) { for (uint32_t stageIndex = 0; stageIndex < pCreateInfos[createInfoIndex].stageCount; ++stageIndex) { @@ -22005,34 +24450,34 @@ bool StatelessValidation::PreCallValidateCreateExecutionGraphPipelinesAMDX( VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pStages_loc, pCreateInfos[createInfoIndex].pStages[stageIndex].pNext, - allowed_structs_VkPipelineShaderStageCreateInfo.size(), - allowed_structs_VkPipelineShaderStageCreateInfo.data(), - GeneratedVulkanHeaderVersion, "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", - "VUID-VkPipelineShaderStageCreateInfo-sType-unique", VK_NULL_HANDLE, true); - - skip |= ValidateFlags(pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, - pCreateInfos[createInfoIndex].pStages[stageIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); - skip |= - ValidateFlags(pStages_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].stage, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", - "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); - - skip |= ValidateRequiredPointer(pStages_loc.dot(Field::pName), - pCreateInfos[createInfoIndex].pStages[stageIndex].pName, - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + state.ValidateStructPnext(pStages_loc, pCreateInfos[createInfoIndex].pStages[stageIndex].pNext, + allowed_structs_VkPipelineShaderStageCreateInfo.size(), + allowed_structs_VkPipelineShaderStageCreateInfo.data(), + GeneratedVulkanHeaderVersion, "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", + "VUID-VkPipelineShaderStageCreateInfo-sType-unique", true); + + skip |= state.ValidateFlags( + pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].flags, + kOptionalFlags, "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + + skip |= state.ValidateFlags(pStages_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].stage, + kRequiredSingleBit, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); + + skip |= state.ValidateRequiredPointer(pStages_loc.dot(Field::pName), + pCreateInfos[createInfoIndex].pStages[stageIndex].pName, + "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); if (pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo != nullptr) { [[maybe_unused]] const Location pSpecializationInfo_loc = pStages_loc.dot(Field::pSpecializationInfo); - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), - pSpecializationInfo_loc.dot(Field::pMapEntries), - pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->mapEntryCount, - &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries, - false, true, kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); + skip |= state.ValidateArray( + pSpecializationInfo_loc.dot(Field::mapEntryCount), pSpecializationInfo_loc.dot(Field::pMapEntries), + pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->mapEntryCount, + &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries, false, true, + kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); if (pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries != nullptr) { for (uint32_t mapEntryIndex = 0; @@ -22045,38 +24490,38 @@ bool StatelessValidation::PreCallValidateCreateExecutionGraphPipelinesAMDX( } } - skip |= - ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), - pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->dataSize, - &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pData, false, - true, kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), + pSpecializationInfo_loc.dot(Field::pData), + pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->dataSize, + &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pData, + false, true, kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); } } } - skip |= ValidateStructType(pCreateInfos_loc.dot(Field::pLibraryInfo), pCreateInfos[createInfoIndex].pLibraryInfo, - VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR, false, - "VUID-VkExecutionGraphPipelineCreateInfoAMDX-pLibraryInfo-parameter", - "VUID-VkPipelineLibraryCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pCreateInfos_loc.dot(Field::pLibraryInfo), pCreateInfos[createInfoIndex].pLibraryInfo, + VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR, false, + "VUID-VkExecutionGraphPipelineCreateInfoAMDX-pLibraryInfo-parameter", + "VUID-VkPipelineLibraryCreateInfoKHR-sType-sType"); if (pCreateInfos[createInfoIndex].pLibraryInfo != nullptr) { [[maybe_unused]] const Location pLibraryInfo_loc = pCreateInfos_loc.dot(Field::pLibraryInfo); - skip |= ValidateArray(pLibraryInfo_loc.dot(Field::libraryCount), pLibraryInfo_loc.dot(Field::pLibraries), - pCreateInfos[createInfoIndex].pLibraryInfo->libraryCount, - &pCreateInfos[createInfoIndex].pLibraryInfo->pLibraries, false, true, kVUIDUndefined, - "VUID-VkPipelineLibraryCreateInfoKHR-pLibraries-parameter"); + skip |= state.ValidateArray(pLibraryInfo_loc.dot(Field::libraryCount), pLibraryInfo_loc.dot(Field::pLibraries), + pCreateInfos[createInfoIndex].pLibraryInfo->libraryCount, + &pCreateInfos[createInfoIndex].pLibraryInfo->pLibraries, false, true, kVUIDUndefined, + "VUID-VkPipelineLibraryCreateInfoKHR-pLibraries-parameter"); } - skip |= ValidateRequiredHandle(pCreateInfos_loc.dot(Field::layout), pCreateInfos[createInfoIndex].layout); + skip |= state.ValidateRequiredHandle(pCreateInfos_loc.dot(Field::layout), pCreateInfos[createInfoIndex].layout); } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, true, - "VUID-vkCreateExecutionGraphPipelinesAMDX-createInfoCount-arraylength", - "VUID-vkCreateExecutionGraphPipelinesAMDX-pPipelines-parameter"); + skip |= state.ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, + true, "VUID-vkCreateExecutionGraphPipelinesAMDX-createInfoCount-arraylength", + "VUID-vkCreateExecutionGraphPipelinesAMDX-pPipelines-parameter"); return skip; } @@ -22084,13 +24529,15 @@ bool StatelessValidation::PreCallValidateGetExecutionGraphPipelineScratchSizeAMD VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); - skip |= ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); - skip |= ValidateStructType(loc.dot(Field::pSizeInfo), pSizeInfo, VK_STRUCTURE_TYPE_EXECUTION_GRAPH_PIPELINE_SCRATCH_SIZE_AMDX, - true, "VUID-vkGetExecutionGraphPipelineScratchSizeAMDX-pSizeInfo-parameter", - "VUID-VkExecutionGraphPipelineScratchSizeAMDX-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); + skip |= + state.ValidateStructType(loc.dot(Field::pSizeInfo), pSizeInfo, VK_STRUCTURE_TYPE_EXECUTION_GRAPH_PIPELINE_SCRATCH_SIZE_AMDX, + true, "VUID-vkGetExecutionGraphPipelineScratchSizeAMDX-pSizeInfo-parameter", + "VUID-VkExecutionGraphPipelineScratchSizeAMDX-sType-sType"); return skip; } @@ -22098,15 +24545,17 @@ bool StatelessValidation::PreCallValidateGetExecutionGraphPipelineNodeIndexAMDX( VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); - skip |= ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); - skip |= ValidateStructType(loc.dot(Field::pNodeInfo), pNodeInfo, VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_NODE_CREATE_INFO_AMDX, - true, "VUID-vkGetExecutionGraphPipelineNodeIndexAMDX-pNodeInfo-parameter", - "VUID-VkPipelineShaderStageNodeCreateInfoAMDX-sType-sType"); - skip |= ValidateRequiredPointer(loc.dot(Field::pNodeIndex), pNodeIndex, - "VUID-vkGetExecutionGraphPipelineNodeIndexAMDX-pNodeIndex-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); + skip |= state.ValidateStructType(loc.dot(Field::pNodeInfo), pNodeInfo, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_NODE_CREATE_INFO_AMDX, true, + "VUID-vkGetExecutionGraphPipelineNodeIndexAMDX-pNodeInfo-parameter", + "VUID-VkPipelineShaderStageNodeCreateInfoAMDX-sType-sType"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pNodeIndex), pNodeIndex, + "VUID-vkGetExecutionGraphPipelineNodeIndexAMDX-pNodeIndex-parameter"); return skip; } @@ -22115,10 +24564,11 @@ bool StatelessValidation::PreCallValidateCmdInitializeGraphScratchMemoryAMDX(VkC VkDeviceSize scratchSize, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); - skip |= ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); + skip |= state.ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); return skip; } @@ -22127,10 +24577,12 @@ bool StatelessValidation::PreCallValidateCmdDispatchGraphAMDX(VkCommandBuffer co const VkDispatchGraphCountInfoAMDX* pCountInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); - skip |= ValidateRequiredPointer(loc.dot(Field::pCountInfo), pCountInfo, "VUID-vkCmdDispatchGraphAMDX-pCountInfo-parameter"); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::pCountInfo), pCountInfo, "VUID-vkCmdDispatchGraphAMDX-pCountInfo-parameter"); return skip; } @@ -22139,11 +24591,12 @@ bool StatelessValidation::PreCallValidateCmdDispatchGraphIndirectAMDX(VkCommandB const VkDispatchGraphCountInfoAMDX* pCountInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); - skip |= - ValidateRequiredPointer(loc.dot(Field::pCountInfo), pCountInfo, "VUID-vkCmdDispatchGraphIndirectAMDX-pCountInfo-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCountInfo), pCountInfo, + "VUID-vkCmdDispatchGraphIndirectAMDX-pCountInfo-parameter"); return skip; } @@ -22151,6 +24604,7 @@ bool StatelessValidation::PreCallValidateCmdDispatchGraphIndirectCountAMDX(VkCom VkDeviceSize scratchSize, VkDeviceAddress countInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); @@ -22163,20 +24617,21 @@ bool StatelessValidation::PreCallValidateCmdSetSampleLocationsEXT(VkCommandBuffe const VkSampleLocationsInfoEXT* pSampleLocationsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_sample_locations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_sample_locations}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pSampleLocationsInfo), pSampleLocationsInfo, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT, true, "VUID-vkCmdSetSampleLocationsEXT-pSampleLocationsInfo-parameter", "VUID-VkSampleLocationsInfoEXT-sType-sType"); if (pSampleLocationsInfo != nullptr) { [[maybe_unused]] const Location pSampleLocationsInfo_loc = loc.dot(Field::pSampleLocationsInfo); // No xml-driven validation - skip |= ValidateArray(pSampleLocationsInfo_loc.dot(Field::sampleLocationsCount), - pSampleLocationsInfo_loc.dot(Field::pSampleLocations), pSampleLocationsInfo->sampleLocationsCount, - &pSampleLocationsInfo->pSampleLocations, false, true, kVUIDUndefined, - "VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter"); + skip |= state.ValidateArray(pSampleLocationsInfo_loc.dot(Field::sampleLocationsCount), + pSampleLocationsInfo_loc.dot(Field::pSampleLocations), + pSampleLocationsInfo->sampleLocationsCount, &pSampleLocationsInfo->pSampleLocations, false, + true, kVUIDUndefined, "VUID-VkSampleLocationsInfoEXT-pSampleLocations-parameter"); if (pSampleLocationsInfo->pSampleLocations != nullptr) { for (uint32_t sampleLocationsIndex = 0; sampleLocationsIndex < pSampleLocationsInfo->sampleLocationsCount; @@ -22194,19 +24649,22 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceMultisamplePropertiesE VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, samples, - kRequiredSingleBit, physicalDevice, "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter", - "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter"); - skip |= ValidateStructType(loc.dot(Field::pMultisampleProperties), pMultisampleProperties, - VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT, true, - "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter", - "VUID-VkMultisamplePropertiesEXT-sType-sType"); + skip |= state.ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, samples, + kRequiredSingleBit, "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter", + "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter"); + skip |= state.ValidateStructType(loc.dot(Field::pMultisampleProperties), pMultisampleProperties, + VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT, true, + "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-pMultisampleProperties-parameter", + "VUID-VkMultisamplePropertiesEXT-sType-sType"); if (pMultisampleProperties != nullptr) { [[maybe_unused]] const Location pMultisampleProperties_loc = loc.dot(Field::pMultisampleProperties); - skip |= - ValidateStructPnext(pMultisampleProperties_loc, pMultisampleProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMultisamplePropertiesEXT-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pMultisampleProperties_loc, pMultisampleProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMultisamplePropertiesEXT-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -22215,18 +24673,19 @@ bool StatelessValidation::PreCallValidateGetImageDrmFormatModifierPropertiesEXT( VkImageDrmFormatModifierPropertiesEXT* pProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_image_drm_format_modifier}); - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT, - true, "VUID-vkGetImageDrmFormatModifierPropertiesEXT-pProperties-parameter", - "VUID-VkImageDrmFormatModifierPropertiesEXT-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= state.ValidateStructType(loc.dot(Field::pProperties), pProperties, + VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT, true, + "VUID-vkGetImageDrmFormatModifierPropertiesEXT-pProperties-parameter", + "VUID-VkImageDrmFormatModifierPropertiesEXT-sType-sType"); if (pProperties != nullptr) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties); - skip |= - ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageDrmFormatModifierPropertiesEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageDrmFormatModifierPropertiesEXT-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -22237,30 +24696,31 @@ bool StatelessValidation::PreCallValidateCreateValidationCacheEXT(VkDevice devic VkValidationCacheEXT* pValidationCache, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_validation_cache}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT, true, - "VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter", - "VUID-VkValidationCacheCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT, + true, "VUID-vkCreateValidationCacheEXT-pCreateInfo-parameter", + "VUID-VkValidationCacheCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkValidationCacheCreateInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkValidationCacheCreateInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkValidationCacheCreateInfoEXT-flags-zerobitmask"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::initialDataSize), pCreateInfo_loc.dot(Field::pInitialData), - pCreateInfo->initialDataSize, &pCreateInfo->pInitialData, false, true, kVUIDUndefined, - "VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::initialDataSize), pCreateInfo_loc.dot(Field::pInitialData), + pCreateInfo->initialDataSize, &pCreateInfo->pInitialData, false, true, kVUIDUndefined, + "VUID-VkValidationCacheCreateInfoEXT-pInitialData-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pValidationCache), pValidationCache, - "VUID-vkCreateValidationCacheEXT-pValidationCache-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pValidationCache), pValidationCache, + "VUID-vkCreateValidationCacheEXT-pValidationCache-parameter"); return skip; } @@ -22268,12 +24728,13 @@ bool StatelessValidation::PreCallValidateDestroyValidationCacheEXT(VkDevice devi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_validation_cache}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -22282,12 +24743,13 @@ bool StatelessValidation::PreCallValidateMergeValidationCachesEXT(VkDevice devic uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_validation_cache}); - skip |= ValidateRequiredHandle(loc.dot(Field::dstCache), dstCache); - skip |= ValidateHandleArray(loc.dot(Field::srcCacheCount), loc.dot(Field::pSrcCaches), srcCacheCount, pSrcCaches, true, true, - "VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstCache), dstCache); + skip |= state.ValidateHandleArray(loc.dot(Field::srcCacheCount), loc.dot(Field::pSrcCaches), srcCacheCount, pSrcCaches, true, + true, "VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength"); return skip; } @@ -22295,24 +24757,26 @@ bool StatelessValidation::PreCallValidateGetValidationCacheDataEXT(VkDevice devi size_t* pDataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_validation_cache}); - skip |= ValidateRequiredHandle(loc.dot(Field::validationCache), validationCache); - skip |= ValidatePointerArray(loc.dot(Field::pDataSize), loc.dot(Field::pData), pDataSize, &pData, true, false, false, - "VUID-vkGetValidationCacheDataEXT-pDataSize-parameter", kVUIDUndefined, - "VUID-vkGetValidationCacheDataEXT-pData-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::validationCache), validationCache); + skip |= state.ValidatePointerArray(loc.dot(Field::pDataSize), loc.dot(Field::pData), pDataSize, &pData, true, false, false, + "VUID-vkGetValidationCacheDataEXT-pDataSize-parameter", kVUIDUndefined, + "VUID-vkGetValidationCacheDataEXT-pData-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_shading_rate_image}); - skip |= ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, - "VUID-vkCmdBindShadingRateImageNV-imageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, + "VUID-vkCmdBindShadingRateImageNV-imageLayout-parameter"); return skip; } @@ -22321,27 +24785,29 @@ bool StatelessValidation::PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCo const VkShadingRatePaletteNV* pShadingRatePalettes, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_shading_rate_image}); - skip |= ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pShadingRatePalettes), viewportCount, &pShadingRatePalettes, - true, true, "VUID-vkCmdSetViewportShadingRatePaletteNV-viewportCount-arraylength", - "VUID-vkCmdSetViewportShadingRatePaletteNV-pShadingRatePalettes-parameter"); + skip |= state.ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pShadingRatePalettes), viewportCount, + &pShadingRatePalettes, true, true, + "VUID-vkCmdSetViewportShadingRatePaletteNV-viewportCount-arraylength", + "VUID-vkCmdSetViewportShadingRatePaletteNV-pShadingRatePalettes-parameter"); if (pShadingRatePalettes != nullptr) { for (uint32_t viewportIndex = 0; viewportIndex < viewportCount; ++viewportIndex) { [[maybe_unused]] const Location pShadingRatePalettes_loc = loc.dot(Field::pShadingRatePalettes, viewportIndex); - skip |= ValidateRangedEnumArray(pShadingRatePalettes_loc.dot(Field::shadingRatePaletteEntryCount), - pShadingRatePalettes_loc.dot(Field::pShadingRatePaletteEntries), - vvl::Enum::VkShadingRatePaletteEntryNV, - pShadingRatePalettes[viewportIndex].shadingRatePaletteEntryCount, - pShadingRatePalettes[viewportIndex].pShadingRatePaletteEntries, true, true, - "VUID-VkShadingRatePaletteNV-shadingRatePaletteEntryCount-arraylength", - "VUID-VkShadingRatePaletteNV-pShadingRatePaletteEntries-parameter"); + skip |= state.ValidateRangedEnumArray(pShadingRatePalettes_loc.dot(Field::shadingRatePaletteEntryCount), + pShadingRatePalettes_loc.dot(Field::pShadingRatePaletteEntries), + vvl::Enum::VkShadingRatePaletteEntryNV, + pShadingRatePalettes[viewportIndex].shadingRatePaletteEntryCount, + pShadingRatePalettes[viewportIndex].pShadingRatePaletteEntries, true, true, + "VUID-VkShadingRatePaletteNV-shadingRatePaletteEntryCount-arraylength", + "VUID-VkShadingRatePaletteNV-pShadingRatePaletteEntries-parameter"); } } if (!skip) skip |= manual_PreCallValidateCmdSetViewportShadingRatePaletteNV(commandBuffer, firstViewport, viewportCount, - pShadingRatePalettes, error_obj); + pShadingRatePalettes, state); return skip; } @@ -22351,27 +24817,28 @@ bool StatelessValidation::PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuff const VkCoarseSampleOrderCustomNV* pCustomSampleOrders, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_shading_rate_image}); - skip |= ValidateRangedEnum(loc.dot(Field::sampleOrderType), vvl::Enum::VkCoarseSampleOrderTypeNV, sampleOrderType, - "VUID-vkCmdSetCoarseSampleOrderNV-sampleOrderType-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::customSampleOrderCount), loc.dot(Field::pCustomSampleOrders), customSampleOrderCount, - &pCustomSampleOrders, false, true, kVUIDUndefined, - "VUID-vkCmdSetCoarseSampleOrderNV-pCustomSampleOrders-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::sampleOrderType), vvl::Enum::VkCoarseSampleOrderTypeNV, sampleOrderType, + "VUID-vkCmdSetCoarseSampleOrderNV-sampleOrderType-parameter"); + skip |= state.ValidateArray(loc.dot(Field::customSampleOrderCount), loc.dot(Field::pCustomSampleOrders), customSampleOrderCount, + &pCustomSampleOrders, false, true, kVUIDUndefined, + "VUID-vkCmdSetCoarseSampleOrderNV-pCustomSampleOrders-parameter"); if (pCustomSampleOrders != nullptr) { for (uint32_t customSampleOrderIndex = 0; customSampleOrderIndex < customSampleOrderCount; ++customSampleOrderIndex) { [[maybe_unused]] const Location pCustomSampleOrders_loc = loc.dot(Field::pCustomSampleOrders, customSampleOrderIndex); - skip |= ValidateRangedEnum(pCustomSampleOrders_loc.dot(Field::shadingRate), vvl::Enum::VkShadingRatePaletteEntryNV, - pCustomSampleOrders[customSampleOrderIndex].shadingRate, - "VUID-VkCoarseSampleOrderCustomNV-shadingRate-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum( + pCustomSampleOrders_loc.dot(Field::shadingRate), vvl::Enum::VkShadingRatePaletteEntryNV, + pCustomSampleOrders[customSampleOrderIndex].shadingRate, "VUID-VkCoarseSampleOrderCustomNV-shadingRate-parameter"); - skip |= ValidateArray(pCustomSampleOrders_loc.dot(Field::sampleLocationCount), - pCustomSampleOrders_loc.dot(Field::pSampleLocations), - pCustomSampleOrders[customSampleOrderIndex].sampleLocationCount, - &pCustomSampleOrders[customSampleOrderIndex].pSampleLocations, true, true, - "VUID-VkCoarseSampleOrderCustomNV-sampleLocationCount-arraylength", - "VUID-VkCoarseSampleOrderCustomNV-pSampleLocations-parameter"); + skip |= state.ValidateArray(pCustomSampleOrders_loc.dot(Field::sampleLocationCount), + pCustomSampleOrders_loc.dot(Field::pSampleLocations), + pCustomSampleOrders[customSampleOrderIndex].sampleLocationCount, + &pCustomSampleOrders[customSampleOrderIndex].pSampleLocations, true, true, + "VUID-VkCoarseSampleOrderCustomNV-sampleLocationCount-arraylength", + "VUID-VkCoarseSampleOrderCustomNV-pSampleLocations-parameter"); if (pCustomSampleOrders[customSampleOrderIndex].pSampleLocations != nullptr) { for (uint32_t sampleLocationIndex = 0; @@ -22385,7 +24852,7 @@ bool StatelessValidation::PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuff } if (!skip) skip |= manual_PreCallValidateCmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount, - pCustomSampleOrders, error_obj); + pCustomSampleOrders, state); return skip; } @@ -22395,83 +24862,83 @@ bool StatelessValidation::PreCallValidateCreateAccelerationStructureNV(VkDevice VkAccelerationStructureNV* pAccelerationStructure, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV, - true, "VUID-vkCreateAccelerationStructureNV-pCreateInfo-parameter", - "VUID-VkAccelerationStructureCreateInfoNV-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV, true, + "VUID-vkCreateAccelerationStructureNV-pCreateInfo-parameter", "VUID-VkAccelerationStructureCreateInfoNV-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkAccelerationStructureCreateInfoNV = { VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkAccelerationStructureCreateInfoNV.size(), - allowed_structs_VkAccelerationStructureCreateInfoNV.data(), GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureCreateInfoNV-pNext-pNext", - "VUID-VkAccelerationStructureCreateInfoNV-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkAccelerationStructureCreateInfoNV.size(), + allowed_structs_VkAccelerationStructureCreateInfoNV.data(), GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureCreateInfoNV-pNext-pNext", "VUID-VkAccelerationStructureCreateInfoNV-sType-unique", true); - skip |= ValidateStructType(pCreateInfo_loc.dot(Field::info), &(pCreateInfo->info), - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV, false, kVUIDUndefined, - "VUID-VkAccelerationStructureInfoNV-sType-sType"); + skip |= state.ValidateStructType(pCreateInfo_loc.dot(Field::info), &(pCreateInfo->info), + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV, false, kVUIDUndefined, + "VUID-VkAccelerationStructureInfoNV-sType-sType"); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateStructTypeArray(pCreateInfo_loc.dot(Field::geometryCount), pCreateInfo_loc.dot(Field::pGeometries), - pCreateInfo->info.geometryCount, pCreateInfo->info.pGeometries, - VK_STRUCTURE_TYPE_GEOMETRY_NV, false, true, "VUID-VkGeometryNV-sType-sType", - "VUID-VkAccelerationStructureInfoNV-pGeometries-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pCreateInfo_loc.dot(Field::geometryCount), pCreateInfo_loc.dot(Field::pGeometries), + pCreateInfo->info.geometryCount, pCreateInfo->info.pGeometries, + VK_STRUCTURE_TYPE_GEOMETRY_NV, false, true, "VUID-VkGeometryNV-sType-sType", + "VUID-VkAccelerationStructureInfoNV-pGeometries-parameter", kVUIDUndefined); if (pCreateInfo->info.pGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pCreateInfo->info.geometryCount; ++geometryIndex) { [[maybe_unused]] const Location pGeometries_loc = pCreateInfo_loc.dot(Field::pGeometries, geometryIndex); - skip |= ValidateStructPnext(pGeometries_loc, pCreateInfo->info.pGeometries[geometryIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkGeometryNV-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pGeometries_loc, pCreateInfo->info.pGeometries[geometryIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkGeometryNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pCreateInfo->info.pGeometries[geometryIndex].geometryType, - "VUID-VkGeometryNV-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pCreateInfo->info.pGeometries[geometryIndex].geometryType, + "VUID-VkGeometryNV-geometryType-parameter"); - skip |= ValidateStructType( + skip |= state.ValidateStructType( pGeometries_loc.dot(Field::triangles), &(pCreateInfo->info.pGeometries[geometryIndex].geometry.triangles), VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV, false, kVUIDUndefined, "VUID-VkGeometryTrianglesNV-sType-sType"); - skip |= ValidateStructPnext(pGeometries_loc, pCreateInfo->info.pGeometries[geometryIndex].geometry.triangles.pNext, - 0, nullptr, GeneratedVulkanHeaderVersion, "VUID-VkGeometryTrianglesNV-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pGeometries_loc, pCreateInfo->info.pGeometries[geometryIndex].geometry.triangles.pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkGeometryTrianglesNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::vertexFormat), vvl::Enum::VkFormat, - pCreateInfo->info.pGeometries[geometryIndex].geometry.triangles.vertexFormat, - "VUID-VkGeometryTrianglesNV-vertexFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::vertexFormat), vvl::Enum::VkFormat, + pCreateInfo->info.pGeometries[geometryIndex].geometry.triangles.vertexFormat, + "VUID-VkGeometryTrianglesNV-vertexFormat-parameter"); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::indexType), vvl::Enum::VkIndexType, - pCreateInfo->info.pGeometries[geometryIndex].geometry.triangles.indexType, - "VUID-VkGeometryTrianglesNV-indexType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::indexType), vvl::Enum::VkIndexType, + pCreateInfo->info.pGeometries[geometryIndex].geometry.triangles.indexType, + "VUID-VkGeometryTrianglesNV-indexType-parameter"); - skip |= ValidateStructType( + skip |= state.ValidateStructType( pGeometries_loc.dot(Field::aabbs), &(pCreateInfo->info.pGeometries[geometryIndex].geometry.aabbs), VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV, false, kVUIDUndefined, "VUID-VkGeometryAABBNV-sType-sType"); - skip |= ValidateStructPnext(pGeometries_loc, pCreateInfo->info.pGeometries[geometryIndex].geometry.aabbs.pNext, 0, - nullptr, GeneratedVulkanHeaderVersion, "VUID-VkGeometryAABBNV-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pGeometries_loc, pCreateInfo->info.pGeometries[geometryIndex].geometry.aabbs.pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkGeometryAABBNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pCreateInfo->info.pGeometries[geometryIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkGeometryNV-flags-parameter"); + skip |= state.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pCreateInfo->info.pGeometries[geometryIndex].flags, + kOptionalFlags, "VUID-VkGeometryNV-flags-parameter"); } } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pAccelerationStructure), pAccelerationStructure, - "VUID-vkCreateAccelerationStructureNV-pAccelerationStructure-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pAccelerationStructure), pAccelerationStructure, + "VUID-vkCreateAccelerationStructureNV-pAccelerationStructure-parameter"); if (!skip) - skip |= - manual_PreCallValidateCreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure, error_obj); + skip |= manual_PreCallValidateCreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure, state); return skip; } @@ -22480,11 +24947,12 @@ bool StatelessValidation::PreCallValidateDestroyAccelerationStructureNV(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -22493,25 +24961,25 @@ bool StatelessValidation::PreCallValidateGetAccelerationStructureMemoryRequireme VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV, - true, "VUID-vkGetAccelerationStructureMemoryRequirementsNV-pInfo-parameter", - "VUID-VkAccelerationStructureMemoryRequirementsInfoNV-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV, + true, "VUID-vkGetAccelerationStructureMemoryRequirementsNV-pInfo-parameter", + "VUID-VkAccelerationStructureMemoryRequirementsInfoNV-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureMemoryRequirementsInfoNV-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureMemoryRequirementsInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateRangedEnum(pInfo_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureMemoryRequirementsTypeNV, pInfo->type, - "VUID-VkAccelerationStructureMemoryRequirementsInfoNV-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureMemoryRequirementsTypeNV, + pInfo->type, "VUID-VkAccelerationStructureMemoryRequirementsInfoNV-type-parameter"); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::accelerationStructure), pInfo->accelerationStructure); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::accelerationStructure), pInfo->accelerationStructure); } - skip |= ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, - "VUID-vkGetAccelerationStructureMemoryRequirementsNV-pMemoryRequirements-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, + "VUID-vkGetAccelerationStructureMemoryRequirementsNV-pMemoryRequirements-parameter"); return skip; } @@ -22519,28 +24987,30 @@ bool StatelessValidation::PreCallValidateBindAccelerationStructureMemoryNV( VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateStructTypeArray(loc.dot(Field::bindInfoCount), loc.dot(Field::pBindInfos), bindInfoCount, pBindInfos, - VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV, true, true, - "VUID-VkBindAccelerationStructureMemoryInfoNV-sType-sType", - "VUID-vkBindAccelerationStructureMemoryNV-pBindInfos-parameter", - "VUID-vkBindAccelerationStructureMemoryNV-bindInfoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::bindInfoCount), loc.dot(Field::pBindInfos), bindInfoCount, pBindInfos, + VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV, true, true, + "VUID-VkBindAccelerationStructureMemoryInfoNV-sType-sType", + "VUID-vkBindAccelerationStructureMemoryNV-pBindInfos-parameter", + "VUID-vkBindAccelerationStructureMemoryNV-bindInfoCount-arraylength"); if (pBindInfos != nullptr) { for (uint32_t bindInfoIndex = 0; bindInfoIndex < bindInfoCount; ++bindInfoIndex) { [[maybe_unused]] const Location pBindInfos_loc = loc.dot(Field::pBindInfos, bindInfoIndex); - skip |= ValidateStructPnext(pBindInfos_loc, pBindInfos[bindInfoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkBindAccelerationStructureMemoryInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= + state.ValidateStructPnext(pBindInfos_loc, pBindInfos[bindInfoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBindAccelerationStructureMemoryInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pBindInfos_loc.dot(Field::accelerationStructure), - pBindInfos[bindInfoIndex].accelerationStructure); + skip |= state.ValidateRequiredHandle(pBindInfos_loc.dot(Field::accelerationStructure), + pBindInfos[bindInfoIndex].accelerationStructure); - skip |= ValidateRequiredHandle(pBindInfos_loc.dot(Field::memory), pBindInfos[bindInfoIndex].memory); + skip |= state.ValidateRequiredHandle(pBindInfos_loc.dot(Field::memory), pBindInfos[bindInfoIndex].memory); - skip |= ValidateArray(pBindInfos_loc.dot(Field::deviceIndexCount), pBindInfos_loc.dot(Field::pDeviceIndices), - pBindInfos[bindInfoIndex].deviceIndexCount, &pBindInfos[bindInfoIndex].pDeviceIndices, false, - true, kVUIDUndefined, "VUID-VkBindAccelerationStructureMemoryInfoNV-pDeviceIndices-parameter"); + skip |= + state.ValidateArray(pBindInfos_loc.dot(Field::deviceIndexCount), pBindInfos_loc.dot(Field::pDeviceIndices), + pBindInfos[bindInfoIndex].deviceIndexCount, &pBindInfos[bindInfoIndex].pDeviceIndices, false, + true, kVUIDUndefined, "VUID-VkBindAccelerationStructureMemoryInfoNV-pDeviceIndices-parameter"); } } return skip; @@ -22551,68 +25021,69 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructureNV( VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV, true, - "VUID-vkCmdBuildAccelerationStructureNV-pInfo-parameter", - "VUID-VkAccelerationStructureInfoNV-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV, true, + "VUID-vkCmdBuildAccelerationStructureNV-pInfo-parameter", + "VUID-VkAccelerationStructureInfoNV-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateStructTypeArray(pInfo_loc.dot(Field::geometryCount), pInfo_loc.dot(Field::pGeometries), pInfo->geometryCount, - pInfo->pGeometries, VK_STRUCTURE_TYPE_GEOMETRY_NV, false, true, "VUID-VkGeometryNV-sType-sType", - "VUID-VkAccelerationStructureInfoNV-pGeometries-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pInfo_loc.dot(Field::geometryCount), pInfo_loc.dot(Field::pGeometries), + pInfo->geometryCount, pInfo->pGeometries, VK_STRUCTURE_TYPE_GEOMETRY_NV, false, true, + "VUID-VkGeometryNV-sType-sType", + "VUID-VkAccelerationStructureInfoNV-pGeometries-parameter", kVUIDUndefined); if (pInfo->pGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pInfo->geometryCount; ++geometryIndex) { [[maybe_unused]] const Location pGeometries_loc = pInfo_loc.dot(Field::pGeometries, geometryIndex); - skip |= ValidateStructPnext(pGeometries_loc, pInfo->pGeometries[geometryIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkGeometryNV-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pGeometries_loc, pInfo->pGeometries[geometryIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkGeometryNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pInfo->pGeometries[geometryIndex].geometryType, - "VUID-VkGeometryNV-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pInfo->pGeometries[geometryIndex].geometryType, + "VUID-VkGeometryNV-geometryType-parameter"); - skip |= ValidateStructType( + skip |= state.ValidateStructType( pGeometries_loc.dot(Field::triangles), &(pInfo->pGeometries[geometryIndex].geometry.triangles), VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV, false, kVUIDUndefined, "VUID-VkGeometryTrianglesNV-sType-sType"); - skip |= ValidateStructPnext(pGeometries_loc, pInfo->pGeometries[geometryIndex].geometry.triangles.pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkGeometryTrianglesNV-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGeometries_loc, pInfo->pGeometries[geometryIndex].geometry.triangles.pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, "VUID-VkGeometryTrianglesNV-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::vertexFormat), vvl::Enum::VkFormat, - pInfo->pGeometries[geometryIndex].geometry.triangles.vertexFormat, - "VUID-VkGeometryTrianglesNV-vertexFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::vertexFormat), vvl::Enum::VkFormat, + pInfo->pGeometries[geometryIndex].geometry.triangles.vertexFormat, + "VUID-VkGeometryTrianglesNV-vertexFormat-parameter"); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::indexType), vvl::Enum::VkIndexType, - pInfo->pGeometries[geometryIndex].geometry.triangles.indexType, - "VUID-VkGeometryTrianglesNV-indexType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::indexType), vvl::Enum::VkIndexType, + pInfo->pGeometries[geometryIndex].geometry.triangles.indexType, + "VUID-VkGeometryTrianglesNV-indexType-parameter"); - skip |= ValidateStructType(pGeometries_loc.dot(Field::aabbs), &(pInfo->pGeometries[geometryIndex].geometry.aabbs), - VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV, false, kVUIDUndefined, - "VUID-VkGeometryAABBNV-sType-sType"); + skip |= state.ValidateStructType( + pGeometries_loc.dot(Field::aabbs), &(pInfo->pGeometries[geometryIndex].geometry.aabbs), + VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV, false, kVUIDUndefined, "VUID-VkGeometryAABBNV-sType-sType"); - skip |= ValidateStructPnext(pGeometries_loc, pInfo->pGeometries[geometryIndex].geometry.aabbs.pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkGeometryAABBNV-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGeometries_loc, pInfo->pGeometries[geometryIndex].geometry.aabbs.pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, "VUID-VkGeometryAABBNV-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pInfo->pGeometries[geometryIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkGeometryNV-flags-parameter"); + skip |= state.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfo->pGeometries[geometryIndex].flags, kOptionalFlags, + "VUID-VkGeometryNV-flags-parameter"); } } } - skip |= ValidateBool32(loc.dot(Field::update), update); - skip |= ValidateRequiredHandle(loc.dot(Field::dst), dst); - skip |= ValidateRequiredHandle(loc.dot(Field::scratch), scratch); + skip |= state.ValidateBool32(loc.dot(Field::update), update); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dst), dst); + skip |= state.ValidateRequiredHandle(loc.dot(Field::scratch), scratch); if (!skip) skip |= manual_PreCallValidateCmdBuildAccelerationStructureNV(commandBuffer, pInfo, instanceData, instanceOffset, update, - dst, src, scratch, scratchOffset, error_obj); + dst, src, scratch, scratchOffset, state); return skip; } @@ -22622,12 +25093,13 @@ bool StatelessValidation::PreCallValidateCmdCopyAccelerationStructureNV(VkComman VkCopyAccelerationStructureModeKHR mode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateRequiredHandle(loc.dot(Field::dst), dst); - skip |= ValidateRequiredHandle(loc.dot(Field::src), src); - skip |= ValidateRangedEnum(loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, mode, - "VUID-vkCmdCopyAccelerationStructureNV-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dst), dst); + skip |= state.ValidateRequiredHandle(loc.dot(Field::src), src); + skip |= state.ValidateRangedEnum(loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, mode, + "VUID-vkCmdCopyAccelerationStructureNV-mode-parameter"); return skip; } @@ -22638,9 +25110,10 @@ bool StatelessValidation::PreCallValidateCmdTraceRaysNV( VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateRequiredHandle(loc.dot(Field::raygenShaderBindingTableBuffer), raygenShaderBindingTableBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::raygenShaderBindingTableBuffer), raygenShaderBindingTableBuffer); return skip; } @@ -22650,31 +25123,31 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesNV(VkDevice de const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateStructTypeArray(loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, pCreateInfos, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV, true, true, - "VUID-VkRayTracingPipelineCreateInfoNV-sType-sType", - "VUID-vkCreateRayTracingPipelinesNV-pCreateInfos-parameter", - "VUID-vkCreateRayTracingPipelinesNV-createInfoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, + pCreateInfos, VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV, true, true, + "VUID-VkRayTracingPipelineCreateInfoNV-sType-sType", + "VUID-vkCreateRayTracingPipelinesNV-pCreateInfos-parameter", + "VUID-vkCreateRayTracingPipelinesNV-createInfoCount-arraylength"); if (pCreateInfos != nullptr) { for (uint32_t createInfoIndex = 0; createInfoIndex < createInfoCount; ++createInfoIndex) { [[maybe_unused]] const Location pCreateInfos_loc = loc.dot(Field::pCreateInfos, createInfoIndex); constexpr std::array allowed_structs_VkRayTracingPipelineCreateInfoNV = { VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO}; - skip |= ValidateStructPnext(pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, - allowed_structs_VkRayTracingPipelineCreateInfoNV.size(), - allowed_structs_VkRayTracingPipelineCreateInfoNV.data(), GeneratedVulkanHeaderVersion, - "VUID-VkRayTracingPipelineCreateInfoNV-pNext-pNext", - "VUID-VkRayTracingPipelineCreateInfoNV-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, allowed_structs_VkRayTracingPipelineCreateInfoNV.size(), + allowed_structs_VkRayTracingPipelineCreateInfoNV.data(), GeneratedVulkanHeaderVersion, + "VUID-VkRayTracingPipelineCreateInfoNV-pNext-pNext", "VUID-VkRayTracingPipelineCreateInfoNV-sType-unique", true); - skip |= ValidateStructTypeArray(pCreateInfos_loc.dot(Field::stageCount), pCreateInfos_loc.dot(Field::pStages), - pCreateInfos[createInfoIndex].stageCount, pCreateInfos[createInfoIndex].pStages, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, true, true, - "VUID-VkPipelineShaderStageCreateInfo-sType-sType", - "VUID-VkRayTracingPipelineCreateInfoNV-pStages-parameter", - "VUID-VkRayTracingPipelineCreateInfoNV-stageCount-arraylength"); + skip |= state.ValidateStructTypeArray(pCreateInfos_loc.dot(Field::stageCount), pCreateInfos_loc.dot(Field::pStages), + pCreateInfos[createInfoIndex].stageCount, pCreateInfos[createInfoIndex].pStages, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, true, true, + "VUID-VkPipelineShaderStageCreateInfo-sType-sType", + "VUID-VkRayTracingPipelineCreateInfoNV-pStages-parameter", + "VUID-VkRayTracingPipelineCreateInfoNV-stageCount-arraylength"); if (pCreateInfos[createInfoIndex].pStages != nullptr) { for (uint32_t stageIndex = 0; stageIndex < pCreateInfos[createInfoIndex].stageCount; ++stageIndex) { @@ -22688,34 +25161,34 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesNV(VkDevice de VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pStages_loc, pCreateInfos[createInfoIndex].pStages[stageIndex].pNext, - allowed_structs_VkPipelineShaderStageCreateInfo.size(), - allowed_structs_VkPipelineShaderStageCreateInfo.data(), - GeneratedVulkanHeaderVersion, "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", - "VUID-VkPipelineShaderStageCreateInfo-sType-unique", VK_NULL_HANDLE, true); - - skip |= ValidateFlags(pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, - pCreateInfos[createInfoIndex].pStages[stageIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); - skip |= - ValidateFlags(pStages_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].stage, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", - "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); - - skip |= ValidateRequiredPointer(pStages_loc.dot(Field::pName), - pCreateInfos[createInfoIndex].pStages[stageIndex].pName, - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + state.ValidateStructPnext(pStages_loc, pCreateInfos[createInfoIndex].pStages[stageIndex].pNext, + allowed_structs_VkPipelineShaderStageCreateInfo.size(), + allowed_structs_VkPipelineShaderStageCreateInfo.data(), + GeneratedVulkanHeaderVersion, "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", + "VUID-VkPipelineShaderStageCreateInfo-sType-unique", true); + + skip |= state.ValidateFlags( + pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].flags, + kOptionalFlags, "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + + skip |= state.ValidateFlags(pStages_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].stage, + kRequiredSingleBit, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); + + skip |= state.ValidateRequiredPointer(pStages_loc.dot(Field::pName), + pCreateInfos[createInfoIndex].pStages[stageIndex].pName, + "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); if (pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo != nullptr) { [[maybe_unused]] const Location pSpecializationInfo_loc = pStages_loc.dot(Field::pSpecializationInfo); - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), - pSpecializationInfo_loc.dot(Field::pMapEntries), - pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->mapEntryCount, - &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries, - false, true, kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); + skip |= state.ValidateArray( + pSpecializationInfo_loc.dot(Field::mapEntryCount), pSpecializationInfo_loc.dot(Field::pMapEntries), + pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->mapEntryCount, + &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries, false, true, + kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); if (pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries != nullptr) { for (uint32_t mapEntryIndex = 0; @@ -22728,49 +25201,48 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesNV(VkDevice de } } - skip |= - ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), - pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->dataSize, - &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pData, false, - true, kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), + pSpecializationInfo_loc.dot(Field::pData), + pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->dataSize, + &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pData, + false, true, kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); } } } - skip |= ValidateStructTypeArray(pCreateInfos_loc.dot(Field::groupCount), pCreateInfos_loc.dot(Field::pGroups), - pCreateInfos[createInfoIndex].groupCount, pCreateInfos[createInfoIndex].pGroups, - VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV, true, true, - "VUID-VkRayTracingShaderGroupCreateInfoNV-sType-sType", - "VUID-VkRayTracingPipelineCreateInfoNV-pGroups-parameter", - "VUID-VkRayTracingPipelineCreateInfoNV-groupCount-arraylength"); + skip |= state.ValidateStructTypeArray(pCreateInfos_loc.dot(Field::groupCount), pCreateInfos_loc.dot(Field::pGroups), + pCreateInfos[createInfoIndex].groupCount, pCreateInfos[createInfoIndex].pGroups, + VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV, true, true, + "VUID-VkRayTracingShaderGroupCreateInfoNV-sType-sType", + "VUID-VkRayTracingPipelineCreateInfoNV-pGroups-parameter", + "VUID-VkRayTracingPipelineCreateInfoNV-groupCount-arraylength"); if (pCreateInfos[createInfoIndex].pGroups != nullptr) { for (uint32_t groupIndex = 0; groupIndex < pCreateInfos[createInfoIndex].groupCount; ++groupIndex) { [[maybe_unused]] const Location pGroups_loc = pCreateInfos_loc.dot(Field::pGroups, groupIndex); - skip |= - ValidateStructPnext(pGroups_loc, pCreateInfos[createInfoIndex].pGroups[groupIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkRayTracingShaderGroupCreateInfoNV-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGroups_loc, pCreateInfos[createInfoIndex].pGroups[groupIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkRayTracingShaderGroupCreateInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGroups_loc.dot(Field::type), vvl::Enum::VkRayTracingShaderGroupTypeKHR, - pCreateInfos[createInfoIndex].pGroups[groupIndex].type, - "VUID-VkRayTracingShaderGroupCreateInfoNV-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGroups_loc.dot(Field::type), vvl::Enum::VkRayTracingShaderGroupTypeKHR, + pCreateInfos[createInfoIndex].pGroups[groupIndex].type, + "VUID-VkRayTracingShaderGroupCreateInfoNV-type-parameter"); } } - skip |= ValidateRequiredHandle(pCreateInfos_loc.dot(Field::layout), pCreateInfos[createInfoIndex].layout); + skip |= state.ValidateRequiredHandle(pCreateInfos_loc.dot(Field::layout), pCreateInfos[createInfoIndex].layout); } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, true, - "VUID-vkCreateRayTracingPipelinesNV-createInfoCount-arraylength", - "VUID-vkCreateRayTracingPipelinesNV-pPipelines-parameter"); + skip |= state.ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, + true, "VUID-vkCreateRayTracingPipelinesNV-createInfoCount-arraylength", + "VUID-vkCreateRayTracingPipelinesNV-pPipelines-parameter"); if (!skip) skip |= manual_PreCallValidateCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, - pPipelines, error_obj); + pPipelines, state); return skip; } @@ -22779,14 +25251,15 @@ bool StatelessValidation::PreCallValidateGetRayTracingShaderGroupHandlesKHR(VkDe size_t dataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline) && loc.function == vvl::Func::vkGetRayTracingShaderGroupHandlesKHR) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_pipeline}); - skip |= ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); - skip |= ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, - "VUID-vkGetRayTracingShaderGroupHandlesKHR-dataSize-arraylength", - "VUID-vkGetRayTracingShaderGroupHandlesKHR-pData-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= state.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkGetRayTracingShaderGroupHandlesKHR-dataSize-arraylength", + "VUID-vkGetRayTracingShaderGroupHandlesKHR-pData-parameter"); return skip; } @@ -22795,6 +25268,7 @@ bool StatelessValidation::PreCallValidateGetRayTracingShaderGroupHandlesNV(VkDev size_t dataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); skip |= PreCallValidateGetRayTracingShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount, dataSize, pData, error_obj); @@ -22806,14 +25280,15 @@ bool StatelessValidation::PreCallValidateGetAccelerationStructureHandleNV(VkDevi size_t dataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateRequiredHandle(loc.dot(Field::accelerationStructure), accelerationStructure); - skip |= ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, - "VUID-vkGetAccelerationStructureHandleNV-dataSize-arraylength", - "VUID-vkGetAccelerationStructureHandleNV-pData-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::accelerationStructure), accelerationStructure); + skip |= state.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkGetAccelerationStructureHandleNV-dataSize-arraylength", + "VUID-vkGetAccelerationStructureHandleNV-pData-parameter"); if (!skip) - skip |= manual_PreCallValidateGetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData, error_obj); + skip |= manual_PreCallValidateGetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData, state); return skip; } @@ -22821,26 +25296,28 @@ bool StatelessValidation::PreCallValidateCmdWriteAccelerationStructuresPropertie VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), - accelerationStructureCount, pAccelerationStructures, true, true, - "VUID-vkCmdWriteAccelerationStructuresPropertiesNV-accelerationStructureCount-arraylength"); - skip |= ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, - "VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryType-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), + accelerationStructureCount, pAccelerationStructures, true, true, + "VUID-vkCmdWriteAccelerationStructuresPropertiesNV-accelerationStructureCount-arraylength"); + skip |= state.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryType-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); if (!skip) skip |= manual_PreCallValidateCmdWriteAccelerationStructuresPropertiesNV( - commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery, error_obj); + commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery, state); return skip; } bool StatelessValidation::PreCallValidateCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); - skip |= ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); return skip; } @@ -22848,28 +25325,29 @@ bool StatelessValidation::PreCallValidateGetMemoryHostPointerPropertiesEXT( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_external_memory_host)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_external_memory_host}); - skip |= ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter", - "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pHostPointer), pHostPointer, - "VUID-vkGetMemoryHostPointerPropertiesEXT-pHostPointer-parameter"); - skip |= ValidateStructType(loc.dot(Field::pMemoryHostPointerProperties), pMemoryHostPointerProperties, - VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT, true, - "VUID-vkGetMemoryHostPointerPropertiesEXT-pMemoryHostPointerProperties-parameter", - "VUID-VkMemoryHostPointerPropertiesEXT-sType-sType"); + skip |= state.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, + "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter", + "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pHostPointer), pHostPointer, + "VUID-vkGetMemoryHostPointerPropertiesEXT-pHostPointer-parameter"); + skip |= state.ValidateStructType(loc.dot(Field::pMemoryHostPointerProperties), pMemoryHostPointerProperties, + VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT, true, + "VUID-vkGetMemoryHostPointerPropertiesEXT-pMemoryHostPointerProperties-parameter", + "VUID-VkMemoryHostPointerPropertiesEXT-sType-sType"); if (pMemoryHostPointerProperties != nullptr) { [[maybe_unused]] const Location pMemoryHostPointerProperties_loc = loc.dot(Field::pMemoryHostPointerProperties); - skip |= ValidateStructPnext(pMemoryHostPointerProperties_loc, pMemoryHostPointerProperties->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMemoryHostPointerPropertiesEXT-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pMemoryHostPointerProperties_loc, pMemoryHostPointerProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryHostPointerPropertiesEXT-pNext-pNext", + kVUIDUndefined, false); } if (!skip) skip |= manual_PreCallValidateGetMemoryHostPointerPropertiesEXT(device, handleType, pHostPointer, - pMemoryHostPointerProperties, error_obj); + pMemoryHostPointerProperties, state); return skip; } @@ -22878,13 +25356,14 @@ bool StatelessValidation::PreCallValidateCmdWriteBufferMarkerAMD(VkCommandBuffer VkDeviceSize dstOffset, uint32_t marker, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amd_buffer_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_buffer_marker}); skip |= - ValidateFlags(loc.dot(Field::pipelineStage), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, - pipelineStage, kOptionalSingleBit, VK_NULL_HANDLE, "VUID-vkCmdWriteBufferMarkerAMD-pipelineStage-parameter"); - skip |= ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + state.ValidateFlags(loc.dot(Field::pipelineStage), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + pipelineStage, kOptionalSingleBit, "VUID-vkCmdWriteBufferMarkerAMD-pipelineStage-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); return skip; } @@ -22892,12 +25371,13 @@ bool StatelessValidation::PreCallValidateCmdWriteBufferMarker2AMD(VkCommandBuffe VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amd_buffer_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_buffer_marker}); - skip |= ValidateFlags(loc.dot(Field::stage), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, stage, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdWriteBufferMarker2AMD-stage-parameter"); - skip |= ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= state.ValidateFlags(loc.dot(Field::stage), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + stage, kOptionalFlags, "VUID-vkCmdWriteBufferMarker2AMD-stage-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); return skip; } @@ -22906,6 +25386,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCalibrateableTimeDomai VkTimeDomainKHR* pTimeDomains, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; skip |= PreCallValidateGetPhysicalDeviceCalibrateableTimeDomainsKHR(physicalDevice, pTimeDomainCount, pTimeDomains, error_obj); return skip; @@ -22916,6 +25399,7 @@ bool StatelessValidation::PreCallValidateGetCalibratedTimestampsEXT(VkDevice dev uint64_t* pTimestamps, uint64_t* pMaxDeviation, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_calibrated_timestamps)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_calibrated_timestamps}); @@ -22927,6 +25411,7 @@ bool StatelessValidation::PreCallValidateGetCalibratedTimestampsEXT(VkDevice dev bool StatelessValidation::PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_mesh_shader}); // No xml-driven validation @@ -22937,9 +25422,10 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuf VkDeviceSize offset, uint32_t drawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_mesh_shader}); - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } @@ -22948,10 +25434,11 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkComma VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_mesh_shader}); - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); return skip; } @@ -22961,16 +25448,17 @@ bool StatelessValidation::PreCallValidateCmdSetExclusiveScissorEnableNV(VkComman const VkBool32* pExclusiveScissorEnables, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_scissor_exclusive)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_scissor_exclusive}); - skip |= ValidateBool32Array(loc.dot(Field::exclusiveScissorCount), loc.dot(Field::pExclusiveScissorEnables), - exclusiveScissorCount, pExclusiveScissorEnables, true, true, - "VUID-vkCmdSetExclusiveScissorEnableNV-exclusiveScissorCount-arraylength", - "VUID-vkCmdSetExclusiveScissorEnableNV-pExclusiveScissorEnables-parameter"); + skip |= state.ValidateBool32Array(loc.dot(Field::exclusiveScissorCount), loc.dot(Field::pExclusiveScissorEnables), + exclusiveScissorCount, pExclusiveScissorEnables, true, true, + "VUID-vkCmdSetExclusiveScissorEnableNV-exclusiveScissorCount-arraylength", + "VUID-vkCmdSetExclusiveScissorEnableNV-pExclusiveScissorEnables-parameter"); if (!skip) skip |= manual_PreCallValidateCmdSetExclusiveScissorEnableNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, - pExclusiveScissorEnables, error_obj); + pExclusiveScissorEnables, state); return skip; } @@ -22979,21 +25467,24 @@ bool StatelessValidation::PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffe const VkRect2D* pExclusiveScissors, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_scissor_exclusive)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_scissor_exclusive}); - skip |= ValidateArray(loc.dot(Field::exclusiveScissorCount), loc.dot(Field::pExclusiveScissors), exclusiveScissorCount, - &pExclusiveScissors, true, true, "VUID-vkCmdSetExclusiveScissorNV-exclusiveScissorCount-arraylength", - "VUID-vkCmdSetExclusiveScissorNV-pExclusiveScissors-parameter"); + skip |= + state.ValidateArray(loc.dot(Field::exclusiveScissorCount), loc.dot(Field::pExclusiveScissors), exclusiveScissorCount, + &pExclusiveScissors, true, true, "VUID-vkCmdSetExclusiveScissorNV-exclusiveScissorCount-arraylength", + "VUID-vkCmdSetExclusiveScissorNV-pExclusiveScissors-parameter"); if (!skip) skip |= manual_PreCallValidateCmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, - pExclusiveScissors, error_obj); + pExclusiveScissors, state); return skip; } bool StatelessValidation::PreCallValidateCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_diagnostic_checkpoints)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_diagnostic_checkpoints}); @@ -23005,19 +25496,20 @@ bool StatelessValidation::PreCallValidateGetQueueCheckpointDataNV(VkQueue queue, VkCheckpointDataNV* pCheckpointData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_diagnostic_checkpoints)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_diagnostic_checkpoints}); - skip |= ValidateStructTypeArray(loc.dot(Field::pCheckpointDataCount), loc.dot(Field::pCheckpointData), pCheckpointDataCount, - pCheckpointData, VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV, true, false, false, - "VUID-VkCheckpointDataNV-sType-sType", kVUIDUndefined, - "VUID-vkGetQueueCheckpointDataNV-pCheckpointDataCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pCheckpointDataCount), loc.dot(Field::pCheckpointData), + pCheckpointDataCount, pCheckpointData, VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV, true, false, + false, "VUID-VkCheckpointDataNV-sType-sType", kVUIDUndefined, + "VUID-vkGetQueueCheckpointDataNV-pCheckpointDataCount-parameter", kVUIDUndefined); if (pCheckpointData != nullptr) { for (uint32_t pCheckpointDataIndex = 0; pCheckpointDataIndex < *pCheckpointDataCount; ++pCheckpointDataIndex) { [[maybe_unused]] const Location pCheckpointData_loc = loc.dot(Field::pCheckpointData, pCheckpointDataIndex); - skip |= ValidateStructPnext(pCheckpointData_loc, pCheckpointData[pCheckpointDataIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkCheckpointDataNV-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pCheckpointData_loc, pCheckpointData[pCheckpointDataIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCheckpointDataNV-pNext-pNext", kVUIDUndefined, + false); } } return skip; @@ -23027,19 +25519,20 @@ bool StatelessValidation::PreCallValidateGetQueueCheckpointData2NV(VkQueue queue VkCheckpointData2NV* pCheckpointData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_diagnostic_checkpoints)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_diagnostic_checkpoints}); - skip |= ValidateStructTypeArray(loc.dot(Field::pCheckpointDataCount), loc.dot(Field::pCheckpointData), pCheckpointDataCount, - pCheckpointData, VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV, true, false, false, - "VUID-VkCheckpointData2NV-sType-sType", kVUIDUndefined, - "VUID-vkGetQueueCheckpointData2NV-pCheckpointDataCount-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pCheckpointDataCount), loc.dot(Field::pCheckpointData), + pCheckpointDataCount, pCheckpointData, VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV, true, + false, false, "VUID-VkCheckpointData2NV-sType-sType", kVUIDUndefined, + "VUID-vkGetQueueCheckpointData2NV-pCheckpointDataCount-parameter", kVUIDUndefined); if (pCheckpointData != nullptr) { for (uint32_t pCheckpointDataIndex = 0; pCheckpointDataIndex < *pCheckpointDataCount; ++pCheckpointDataIndex) { [[maybe_unused]] const Location pCheckpointData_loc = loc.dot(Field::pCheckpointData, pCheckpointDataIndex); - skip |= ValidateStructPnext(pCheckpointData_loc, pCheckpointData[pCheckpointDataIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkCheckpointData2NV-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pCheckpointData_loc, pCheckpointData[pCheckpointDataIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCheckpointData2NV-pNext-pNext", kVUIDUndefined, + false); } } return skip; @@ -23049,22 +25542,24 @@ bool StatelessValidation::PreCallValidateInitializePerformanceApiINTEL(VkDevice const VkInitializePerformanceApiInfoINTEL* pInitializeInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pInitializeInfo), pInitializeInfo, VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL, true, "VUID-vkInitializePerformanceApiINTEL-pInitializeInfo-parameter", "VUID-VkInitializePerformanceApiInfoINTEL-sType-sType"); if (pInitializeInfo != nullptr) { [[maybe_unused]] const Location pInitializeInfo_loc = loc.dot(Field::pInitializeInfo); - skip |= ValidateStructPnext(pInitializeInfo_loc, pInitializeInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkInitializePerformanceApiInfoINTEL-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInitializeInfo_loc, pInitializeInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkInitializePerformanceApiInfoINTEL-pNext-pNext", kVUIDUndefined, true); } return skip; } bool StatelessValidation::PreCallValidateUninitializePerformanceApiINTEL(VkDevice device, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); @@ -23076,16 +25571,17 @@ bool StatelessValidation::PreCallValidateCmdSetPerformanceMarkerINTEL(VkCommandB const VkPerformanceMarkerInfoINTEL* pMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateStructType(loc.dot(Field::pMarkerInfo), pMarkerInfo, VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL, true, - "VUID-vkCmdSetPerformanceMarkerINTEL-pMarkerInfo-parameter", - "VUID-VkPerformanceMarkerInfoINTEL-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pMarkerInfo), pMarkerInfo, VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL, + true, "VUID-vkCmdSetPerformanceMarkerINTEL-pMarkerInfo-parameter", + "VUID-VkPerformanceMarkerInfoINTEL-sType-sType"); if (pMarkerInfo != nullptr) { [[maybe_unused]] const Location pMarkerInfo_loc = loc.dot(Field::pMarkerInfo); - skip |= ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPerformanceMarkerInfoINTEL-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPerformanceMarkerInfoINTEL-pNext-pNext", kVUIDUndefined, true); } return skip; } @@ -23094,16 +25590,17 @@ bool StatelessValidation::PreCallValidateCmdSetPerformanceStreamMarkerINTEL(VkCo const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateStructType(loc.dot(Field::pMarkerInfo), pMarkerInfo, VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL, - true, "VUID-vkCmdSetPerformanceStreamMarkerINTEL-pMarkerInfo-parameter", - "VUID-VkPerformanceStreamMarkerInfoINTEL-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pMarkerInfo), pMarkerInfo, VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL, true, + "VUID-vkCmdSetPerformanceStreamMarkerINTEL-pMarkerInfo-parameter", "VUID-VkPerformanceStreamMarkerInfoINTEL-sType-sType"); if (pMarkerInfo != nullptr) { [[maybe_unused]] const Location pMarkerInfo_loc = loc.dot(Field::pMarkerInfo); - skip |= ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPerformanceStreamMarkerInfoINTEL-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPerformanceStreamMarkerInfoINTEL-pNext-pNext", kVUIDUndefined, true); } return skip; } @@ -23112,21 +25609,22 @@ bool StatelessValidation::PreCallValidateCmdSetPerformanceOverrideINTEL(VkComman const VkPerformanceOverrideInfoINTEL* pOverrideInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateStructType(loc.dot(Field::pOverrideInfo), pOverrideInfo, VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL, - true, "VUID-vkCmdSetPerformanceOverrideINTEL-pOverrideInfo-parameter", - "VUID-VkPerformanceOverrideInfoINTEL-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pOverrideInfo), pOverrideInfo, VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL, true, + "VUID-vkCmdSetPerformanceOverrideINTEL-pOverrideInfo-parameter", "VUID-VkPerformanceOverrideInfoINTEL-sType-sType"); if (pOverrideInfo != nullptr) { [[maybe_unused]] const Location pOverrideInfo_loc = loc.dot(Field::pOverrideInfo); - skip |= ValidateStructPnext(pOverrideInfo_loc, pOverrideInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPerformanceOverrideInfoINTEL-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pOverrideInfo_loc, pOverrideInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPerformanceOverrideInfoINTEL-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pOverrideInfo_loc.dot(Field::type), vvl::Enum::VkPerformanceOverrideTypeINTEL, - pOverrideInfo->type, "VUID-VkPerformanceOverrideInfoINTEL-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pOverrideInfo_loc.dot(Field::type), vvl::Enum::VkPerformanceOverrideTypeINTEL, + pOverrideInfo->type, "VUID-VkPerformanceOverrideInfoINTEL-type-parameter"); - skip |= ValidateBool32(pOverrideInfo_loc.dot(Field::enable), pOverrideInfo->enable); + skip |= state.ValidateBool32(pOverrideInfo_loc.dot(Field::enable), pOverrideInfo->enable); } return skip; } @@ -23135,25 +25633,24 @@ bool StatelessValidation::PreCallValidateAcquirePerformanceConfigurationINTEL( VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateStructType(loc.dot(Field::pAcquireInfo), pAcquireInfo, - VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL, true, - "VUID-vkAcquirePerformanceConfigurationINTEL-pAcquireInfo-parameter", - "VUID-VkPerformanceConfigurationAcquireInfoINTEL-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pAcquireInfo), pAcquireInfo, + VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL, true, + "VUID-vkAcquirePerformanceConfigurationINTEL-pAcquireInfo-parameter", + "VUID-VkPerformanceConfigurationAcquireInfoINTEL-sType-sType"); if (pAcquireInfo != nullptr) { [[maybe_unused]] const Location pAcquireInfo_loc = loc.dot(Field::pAcquireInfo); - skip |= ValidateStructPnext(pAcquireInfo_loc, pAcquireInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPerformanceConfigurationAcquireInfoINTEL-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pAcquireInfo_loc, pAcquireInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPerformanceConfigurationAcquireInfoINTEL-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pAcquireInfo_loc.dot(Field::type), vvl::Enum::VkPerformanceConfigurationTypeINTEL, - pAcquireInfo->type, "VUID-VkPerformanceConfigurationAcquireInfoINTEL-type-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAcquireInfo_loc.dot(Field::type), vvl::Enum::VkPerformanceConfigurationTypeINTEL, + pAcquireInfo->type, "VUID-VkPerformanceConfigurationAcquireInfoINTEL-type-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pConfiguration), pConfiguration, - "VUID-vkAcquirePerformanceConfigurationINTEL-pConfiguration-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pConfiguration), pConfiguration, + "VUID-vkAcquirePerformanceConfigurationINTEL-pConfiguration-parameter"); return skip; } @@ -23161,6 +25658,7 @@ bool StatelessValidation::PreCallValidateReleasePerformanceConfigurationINTEL(Vk VkPerformanceConfigurationINTEL configuration, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); @@ -23172,10 +25670,11 @@ bool StatelessValidation::PreCallValidateQueueSetPerformanceConfigurationINTEL(V VkPerformanceConfigurationINTEL configuration, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateRequiredHandle(loc.dot(Field::configuration), configuration); + skip |= state.ValidateRequiredHandle(loc.dot(Field::configuration), configuration); return skip; } @@ -23183,23 +25682,25 @@ bool StatelessValidation::PreCallValidateGetPerformanceParameterINTEL(VkDevice d VkPerformanceValueINTEL* pValue, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateRangedEnum(loc.dot(Field::parameter), vvl::Enum::VkPerformanceParameterTypeINTEL, parameter, - "VUID-vkGetPerformanceParameterINTEL-parameter-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredPointer(loc.dot(Field::pValue), pValue, "VUID-vkGetPerformanceParameterINTEL-pValue-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::parameter), vvl::Enum::VkPerformanceParameterTypeINTEL, parameter, + "VUID-vkGetPerformanceParameterINTEL-parameter-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pValue), pValue, "VUID-vkGetPerformanceParameterINTEL-pValue-parameter"); return skip; } bool StatelessValidation::PreCallValidateSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amd_display_native_hdr)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_display_native_hdr}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapChain), swapChain); - skip |= ValidateBool32(loc.dot(Field::localDimmingEnable), localDimmingEnable); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapChain), swapChain); + skip |= state.ValidateBool32(loc.dot(Field::localDimmingEnable), localDimmingEnable); return skip; } @@ -23209,25 +25710,27 @@ bool StatelessValidation::PreCallValidateCreateImagePipeSurfaceFUCHSIA(VkInstanc const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_fuchsia_imagepipe_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_imagepipe_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA, - true, "VUID-vkCreateImagePipeSurfaceFUCHSIA-pCreateInfo-parameter", - "VUID-VkImagePipeSurfaceCreateInfoFUCHSIA-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA, true, + "VUID-vkCreateImagePipeSurfaceFUCHSIA-pCreateInfo-parameter", "VUID-VkImagePipeSurfaceCreateInfoFUCHSIA-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImagePipeSurfaceCreateInfoFUCHSIA-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImagePipeSurfaceCreateInfoFUCHSIA-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkImagePipeSurfaceCreateInfoFUCHSIA-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkImagePipeSurfaceCreateInfoFUCHSIA-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateImagePipeSurfaceFUCHSIA-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, + "VUID-vkCreateImagePipeSurfaceFUCHSIA-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_FUCHSIA @@ -23237,25 +25740,26 @@ bool StatelessValidation::PreCallValidateCreateMetalSurfaceEXT(VkInstance instan const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_metal_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_metal_surface}); - skip |= - ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT, true, - "VUID-vkCreateMetalSurfaceEXT-pCreateInfo-parameter", "VUID-VkMetalSurfaceCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT, + true, "VUID-vkCreateMetalSurfaceEXT-pCreateInfo-parameter", + "VUID-VkMetalSurfaceCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMetalSurfaceCreateInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMetalSurfaceCreateInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkMetalSurfaceCreateInfoEXT-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkMetalSurfaceCreateInfoEXT-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateMetalSurfaceEXT-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateMetalSurfaceEXT-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_METAL_EXT @@ -23263,6 +25767,7 @@ bool StatelessValidation::PreCallValidateCreateMetalSurfaceEXT(VkInstance instan bool StatelessValidation::PreCallValidateGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_buffer_device_address)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_buffer_device_address}); @@ -23274,6 +25779,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceToolPropertiesEXT(VkPh VkPhysicalDeviceToolProperties* pToolProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; skip |= PreCallValidateGetPhysicalDeviceToolProperties(physicalDevice, pToolCount, pToolProperties, error_obj); return skip; @@ -23283,17 +25791,20 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCooperativeMatrixPrope VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV, true, false, false, "VUID-VkCooperativeMatrixPropertiesNV-sType-sType", kVUIDUndefined, "VUID-vkGetPhysicalDeviceCooperativeMatrixPropertiesNV-pPropertyCount-parameter", kVUIDUndefined); if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); - skip |= - ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCooperativeMatrixPropertiesNV-pNext-pNext", kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCooperativeMatrixPropertiesNV-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -23303,8 +25814,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSupportedFramebufferMi VkPhysicalDevice physicalDevice, uint32_t* pCombinationCount, VkFramebufferMixedSamplesCombinationNV* pCombinations, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pCombinationCount), loc.dot(Field::pCombinations), pCombinationCount, pCombinations, VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV, true, false, false, "VUID-VkFramebufferMixedSamplesCombinationNV-sType-sType", kVUIDUndefined, @@ -23312,9 +25826,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSupportedFramebufferMi if (pCombinations != nullptr) { for (uint32_t pCombinationIndex = 0; pCombinationIndex < *pCombinationCount; ++pCombinationIndex) { [[maybe_unused]] const Location pCombinations_loc = loc.dot(Field::pCombinations, pCombinationIndex); - skip |= ValidateStructPnext(pCombinations_loc, pCombinations[pCombinationIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkFramebufferMixedSamplesCombinationNV-pNext-pNext", - kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pCombinations_loc, pCombinations[pCombinationIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, + "VUID-VkFramebufferMixedSamplesCombinationNV-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -23325,48 +25839,54 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfacePresentModes2EX VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pSurfaceInfo), pSurfaceInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, - true, "VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-parameter", - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pSurfaceInfo), pSurfaceInfo, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, + true, "VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-parameter", + "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-sType"); if (pSurfaceInfo != nullptr) { [[maybe_unused]] const Location pSurfaceInfo_loc = loc.dot(Field::pSurfaceInfo); constexpr std::array allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR = { VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT, VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT}; - skip |= ValidateStructPnext(pSurfaceInfo_loc, pSurfaceInfo->pNext, allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.size(), - allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", - "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-unique", physicalDevice, true); + skip |= state.ValidateStructPnext( + pSurfaceInfo_loc, pSurfaceInfo->pNext, allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.size(), + allowed_structs_VkPhysicalDeviceSurfaceInfo2KHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceSurfaceInfo2KHR-pNext-pNext", "VUID-VkPhysicalDeviceSurfaceInfo2KHR-sType-unique", true); } - skip |= - ValidatePointerArray(loc.dot(Field::pPresentModeCount), loc.dot(Field::pPresentModes), pPresentModeCount, &pPresentModes, - true, false, false, "VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pPresentModeCount-parameter", - kVUIDUndefined, "VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pPresentModes-parameter"); + skip |= state.ValidatePointerArray(loc.dot(Field::pPresentModeCount), loc.dot(Field::pPresentModes), pPresentModeCount, + &pPresentModes, true, false, false, + "VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pPresentModeCount-parameter", + kVUIDUndefined, "VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pPresentModes-parameter"); if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceSurfacePresentModes2EXT(physicalDevice, pSurfaceInfo, pPresentModeCount, - pPresentModes, error_obj); + pPresentModes, state); return skip; } bool StatelessValidation::PreCallValidateAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_full_screen_exclusive)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_full_screen_exclusive}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); return skip; } bool StatelessValidation::PreCallValidateReleaseFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_full_screen_exclusive)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_full_screen_exclusive}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -23376,31 +25896,33 @@ bool StatelessValidation::PreCallValidateCreateHeadlessSurfaceEXT(VkInstance ins const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_headless_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_headless_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT, true, - "VUID-vkCreateHeadlessSurfaceEXT-pCreateInfo-parameter", - "VUID-VkHeadlessSurfaceCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT, + true, "VUID-vkCreateHeadlessSurfaceEXT-pCreateInfo-parameter", + "VUID-VkHeadlessSurfaceCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkHeadlessSurfaceCreateInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkHeadlessSurfaceCreateInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkHeadlessSurfaceCreateInfoEXT-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkHeadlessSurfaceCreateInfoEXT-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateHeadlessSurfaceEXT-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateHeadlessSurfaceEXT-pSurface-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_line_rasterization)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_line_rasterization}); @@ -23411,6 +25933,7 @@ bool StatelessValidation::PreCallValidateCmdSetLineStippleEXT(VkCommandBuffer co bool StatelessValidation::PreCallValidateResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_host_query_reset)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_query_reset}); @@ -23421,6 +25944,7 @@ bool StatelessValidation::PreCallValidateResetQueryPoolEXT(VkDevice device, VkQu bool StatelessValidation::PreCallValidateCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23431,6 +25955,7 @@ bool StatelessValidation::PreCallValidateCmdSetCullModeEXT(VkCommandBuffer comma bool StatelessValidation::PreCallValidateCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23442,6 +25967,7 @@ bool StatelessValidation::PreCallValidateCmdSetPrimitiveTopologyEXT(VkCommandBuf VkPrimitiveTopology primitiveTopology, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23453,6 +25979,7 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWithCountEXT(VkCommandBuf const VkViewport* pViewports, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23463,6 +25990,7 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWithCountEXT(VkCommandBuf bool StatelessValidation::PreCallValidateCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23476,6 +26004,7 @@ bool StatelessValidation::PreCallValidateCmdBindVertexBuffers2EXT(VkCommandBuffe const VkDeviceSize* pStrides, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23487,6 +26016,7 @@ bool StatelessValidation::PreCallValidateCmdBindVertexBuffers2EXT(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23497,6 +26027,7 @@ bool StatelessValidation::PreCallValidateCmdSetDepthTestEnableEXT(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23507,6 +26038,7 @@ bool StatelessValidation::PreCallValidateCmdSetDepthWriteEnableEXT(VkCommandBuff bool StatelessValidation::PreCallValidateCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23518,6 +26050,7 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBoundsTestEnableEXT(VkComman VkBool32 depthBoundsTestEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23528,6 +26061,7 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBoundsTestEnableEXT(VkComman bool StatelessValidation::PreCallValidateCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23539,6 +26073,7 @@ bool StatelessValidation::PreCallValidateCmdSetStencilOpEXT(VkCommandBuffer comm VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); @@ -23550,6 +26085,7 @@ bool StatelessValidation::PreCallValidateCopyMemoryToImageEXT(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy}); @@ -23561,6 +26097,7 @@ bool StatelessValidation::PreCallValidateCopyImageToMemoryEXT(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy}); @@ -23571,6 +26108,7 @@ bool StatelessValidation::PreCallValidateCopyImageToMemoryEXT(VkDevice device, bool StatelessValidation::PreCallValidateCopyImageToImageEXT(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy}); @@ -23582,6 +26120,7 @@ bool StatelessValidation::PreCallValidateTransitionImageLayoutEXT(VkDevice devic const VkHostImageLayoutTransitionInfo* pTransitions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy}); @@ -23594,6 +26133,7 @@ bool StatelessValidation::PreCallValidateGetImageSubresourceLayout2EXT(VkDevice VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_host_image_copy) || IsExtEnabled(device_extensions.vk_ext_image_compression_control))) @@ -23607,23 +26147,24 @@ bool StatelessValidation::PreCallValidateReleaseSwapchainImagesEXT(VkDevice devi const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_swapchain_maintenance1}); - skip |= ValidateStructType(loc.dot(Field::pReleaseInfo), pReleaseInfo, VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT, - true, "VUID-vkReleaseSwapchainImagesEXT-pReleaseInfo-parameter", - "VUID-VkReleaseSwapchainImagesInfoEXT-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pReleaseInfo), pReleaseInfo, VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT, true, + "VUID-vkReleaseSwapchainImagesEXT-pReleaseInfo-parameter", "VUID-VkReleaseSwapchainImagesInfoEXT-sType-sType"); if (pReleaseInfo != nullptr) { [[maybe_unused]] const Location pReleaseInfo_loc = loc.dot(Field::pReleaseInfo); - skip |= ValidateStructPnext(pReleaseInfo_loc, pReleaseInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkReleaseSwapchainImagesInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pReleaseInfo_loc, pReleaseInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkReleaseSwapchainImagesInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pReleaseInfo_loc.dot(Field::swapchain), pReleaseInfo->swapchain); + skip |= state.ValidateRequiredHandle(pReleaseInfo_loc.dot(Field::swapchain), pReleaseInfo->swapchain); - skip |= ValidateArray(pReleaseInfo_loc.dot(Field::imageIndexCount), pReleaseInfo_loc.dot(Field::pImageIndices), - pReleaseInfo->imageIndexCount, &pReleaseInfo->pImageIndices, true, true, - "VUID-VkReleaseSwapchainImagesInfoEXT-imageIndexCount-arraylength", - "VUID-VkReleaseSwapchainImagesInfoEXT-pImageIndices-parameter"); + skip |= state.ValidateArray(pReleaseInfo_loc.dot(Field::imageIndexCount), pReleaseInfo_loc.dot(Field::pImageIndices), + pReleaseInfo->imageIndexCount, &pReleaseInfo->pImageIndices, true, true, + "VUID-VkReleaseSwapchainImagesInfoEXT-imageIndexCount-arraylength", + "VUID-VkReleaseSwapchainImagesInfoEXT-pImageIndices-parameter"); } return skip; } @@ -23632,35 +26173,35 @@ bool StatelessValidation::PreCallValidateGetGeneratedCommandsMemoryRequirementsN VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV, true, - "VUID-vkGetGeneratedCommandsMemoryRequirementsNV-pInfo-parameter", - "VUID-VkGeneratedCommandsMemoryRequirementsInfoNV-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV, + true, "VUID-vkGetGeneratedCommandsMemoryRequirementsNV-pInfo-parameter", + "VUID-VkGeneratedCommandsMemoryRequirementsInfoNV-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkGeneratedCommandsMemoryRequirementsInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkGeneratedCommandsMemoryRequirementsInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateRangedEnum(pInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pInfo->pipelineBindPoint, - "VUID-VkGeneratedCommandsMemoryRequirementsInfoNV-pipelineBindPoint-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pInfo->pipelineBindPoint, + "VUID-VkGeneratedCommandsMemoryRequirementsInfoNV-pipelineBindPoint-parameter"); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::indirectCommandsLayout), pInfo->indirectCommandsLayout); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::indirectCommandsLayout), pInfo->indirectCommandsLayout); } - skip |= ValidateStructType(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - true, "VUID-vkGetGeneratedCommandsMemoryRequirementsNV-pMemoryRequirements-parameter", - "VUID-VkMemoryRequirements2-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, true, + "VUID-vkGetGeneratedCommandsMemoryRequirementsNV-pMemoryRequirements-parameter", "VUID-VkMemoryRequirements2-sType-sType"); if (pMemoryRequirements != nullptr) { [[maybe_unused]] const Location pMemoryRequirements_loc = loc.dot(Field::pMemoryRequirements); constexpr std::array allowed_structs_VkMemoryRequirements2 = {VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS}; - skip |= ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements->pNext, - allowed_structs_VkMemoryRequirements2.size(), allowed_structs_VkMemoryRequirements2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", - "VUID-VkMemoryRequirements2-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pMemoryRequirements_loc, pMemoryRequirements->pNext, allowed_structs_VkMemoryRequirements2.size(), + allowed_structs_VkMemoryRequirements2.data(), GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", + "VUID-VkMemoryRequirements2-sType-unique", false); } return skip; } @@ -23669,40 +26210,41 @@ bool StatelessValidation::PreCallValidateCmdPreprocessGeneratedCommandsNV(VkComm const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pGeneratedCommandsInfo), pGeneratedCommandsInfo, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV, true, "VUID-vkCmdPreprocessGeneratedCommandsNV-pGeneratedCommandsInfo-parameter", "VUID-VkGeneratedCommandsInfoNV-sType-sType"); if (pGeneratedCommandsInfo != nullptr) { [[maybe_unused]] const Location pGeneratedCommandsInfo_loc = loc.dot(Field::pGeneratedCommandsInfo); - skip |= - ValidateStructPnext(pGeneratedCommandsInfo_loc, pGeneratedCommandsInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkGeneratedCommandsInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGeneratedCommandsInfo_loc, pGeneratedCommandsInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkGeneratedCommandsInfoNV-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeneratedCommandsInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, - pGeneratedCommandsInfo->pipelineBindPoint, - "VUID-VkGeneratedCommandsInfoNV-pipelineBindPoint-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeneratedCommandsInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pGeneratedCommandsInfo->pipelineBindPoint, + "VUID-VkGeneratedCommandsInfoNV-pipelineBindPoint-parameter"); - skip |= ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), - pGeneratedCommandsInfo->indirectCommandsLayout); + skip |= state.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), + pGeneratedCommandsInfo->indirectCommandsLayout); - skip |= ValidateArray(pGeneratedCommandsInfo_loc.dot(Field::streamCount), pGeneratedCommandsInfo_loc.dot(Field::pStreams), - pGeneratedCommandsInfo->streamCount, &pGeneratedCommandsInfo->pStreams, true, true, - "VUID-VkGeneratedCommandsInfoNV-streamCount-arraylength", - "VUID-VkGeneratedCommandsInfoNV-pStreams-parameter"); + skip |= state.ValidateArray( + pGeneratedCommandsInfo_loc.dot(Field::streamCount), pGeneratedCommandsInfo_loc.dot(Field::pStreams), + pGeneratedCommandsInfo->streamCount, &pGeneratedCommandsInfo->pStreams, true, true, + "VUID-VkGeneratedCommandsInfoNV-streamCount-arraylength", "VUID-VkGeneratedCommandsInfoNV-pStreams-parameter"); if (pGeneratedCommandsInfo->pStreams != nullptr) { for (uint32_t streamIndex = 0; streamIndex < pGeneratedCommandsInfo->streamCount; ++streamIndex) { [[maybe_unused]] const Location pStreams_loc = pGeneratedCommandsInfo_loc.dot(Field::pStreams, streamIndex); - skip |= - ValidateRequiredHandle(pStreams_loc.dot(Field::buffer), pGeneratedCommandsInfo->pStreams[streamIndex].buffer); + skip |= state.ValidateRequiredHandle(pStreams_loc.dot(Field::buffer), + pGeneratedCommandsInfo->pStreams[streamIndex].buffer); } } - skip |= ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::preprocessBuffer), - pGeneratedCommandsInfo->preprocessBuffer); + skip |= state.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::preprocessBuffer), + pGeneratedCommandsInfo->preprocessBuffer); } return skip; } @@ -23711,41 +26253,42 @@ bool StatelessValidation::PreCallValidateCmdExecuteGeneratedCommandsNV(VkCommand const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands}); - skip |= ValidateBool32(loc.dot(Field::isPreprocessed), isPreprocessed); - skip |= ValidateStructType( + skip |= state.ValidateBool32(loc.dot(Field::isPreprocessed), isPreprocessed); + skip |= state.ValidateStructType( loc.dot(Field::pGeneratedCommandsInfo), pGeneratedCommandsInfo, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV, true, "VUID-vkCmdExecuteGeneratedCommandsNV-pGeneratedCommandsInfo-parameter", "VUID-VkGeneratedCommandsInfoNV-sType-sType"); if (pGeneratedCommandsInfo != nullptr) { [[maybe_unused]] const Location pGeneratedCommandsInfo_loc = loc.dot(Field::pGeneratedCommandsInfo); - skip |= - ValidateStructPnext(pGeneratedCommandsInfo_loc, pGeneratedCommandsInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkGeneratedCommandsInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGeneratedCommandsInfo_loc, pGeneratedCommandsInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkGeneratedCommandsInfoNV-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeneratedCommandsInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, - pGeneratedCommandsInfo->pipelineBindPoint, - "VUID-VkGeneratedCommandsInfoNV-pipelineBindPoint-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeneratedCommandsInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pGeneratedCommandsInfo->pipelineBindPoint, + "VUID-VkGeneratedCommandsInfoNV-pipelineBindPoint-parameter"); - skip |= ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), - pGeneratedCommandsInfo->indirectCommandsLayout); + skip |= state.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), + pGeneratedCommandsInfo->indirectCommandsLayout); - skip |= ValidateArray(pGeneratedCommandsInfo_loc.dot(Field::streamCount), pGeneratedCommandsInfo_loc.dot(Field::pStreams), - pGeneratedCommandsInfo->streamCount, &pGeneratedCommandsInfo->pStreams, true, true, - "VUID-VkGeneratedCommandsInfoNV-streamCount-arraylength", - "VUID-VkGeneratedCommandsInfoNV-pStreams-parameter"); + skip |= state.ValidateArray( + pGeneratedCommandsInfo_loc.dot(Field::streamCount), pGeneratedCommandsInfo_loc.dot(Field::pStreams), + pGeneratedCommandsInfo->streamCount, &pGeneratedCommandsInfo->pStreams, true, true, + "VUID-VkGeneratedCommandsInfoNV-streamCount-arraylength", "VUID-VkGeneratedCommandsInfoNV-pStreams-parameter"); if (pGeneratedCommandsInfo->pStreams != nullptr) { for (uint32_t streamIndex = 0; streamIndex < pGeneratedCommandsInfo->streamCount; ++streamIndex) { [[maybe_unused]] const Location pStreams_loc = pGeneratedCommandsInfo_loc.dot(Field::pStreams, streamIndex); - skip |= - ValidateRequiredHandle(pStreams_loc.dot(Field::buffer), pGeneratedCommandsInfo->pStreams[streamIndex].buffer); + skip |= state.ValidateRequiredHandle(pStreams_loc.dot(Field::buffer), + pGeneratedCommandsInfo->pStreams[streamIndex].buffer); } } - skip |= ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::preprocessBuffer), - pGeneratedCommandsInfo->preprocessBuffer); + skip |= state.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::preprocessBuffer), + pGeneratedCommandsInfo->preprocessBuffer); } return skip; } @@ -23754,12 +26297,13 @@ bool StatelessValidation::PreCallValidateCmdBindPipelineShaderGroupNV(VkCommandB VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands}); - skip |= ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, - "VUID-vkCmdBindPipelineShaderGroupNV-pipelineBindPoint-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= state.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdBindPipelineShaderGroupNV-pipelineBindPoint-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); return skip; } @@ -23769,26 +26313,27 @@ bool StatelessValidation::PreCallValidateCreateIndirectCommandsLayoutNV(VkDevice VkIndirectCommandsLayoutNV* pIndirectCommandsLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV, - true, "VUID-vkCreateIndirectCommandsLayoutNV-pCreateInfo-parameter", - "VUID-VkIndirectCommandsLayoutCreateInfoNV-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV, true, + "VUID-vkCreateIndirectCommandsLayoutNV-pCreateInfo-parameter", "VUID-VkIndirectCommandsLayoutCreateInfoNV-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkIndirectCommandsLayoutCreateInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkIndirectCommandsLayoutCreateInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkIndirectCommandsLayoutUsageFlagBitsNV, - AllVkIndirectCommandsLayoutUsageFlagBitsNV, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkIndirectCommandsLayoutCreateInfoNV-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkIndirectCommandsLayoutUsageFlagBitsNV, + AllVkIndirectCommandsLayoutUsageFlagBitsNV, pCreateInfo->flags, kOptionalFlags, + "VUID-VkIndirectCommandsLayoutCreateInfoNV-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, - pCreateInfo->pipelineBindPoint, - "VUID-VkIndirectCommandsLayoutCreateInfoNV-pipelineBindPoint-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pCreateInfo->pipelineBindPoint, + "VUID-VkIndirectCommandsLayoutCreateInfoNV-pipelineBindPoint-parameter"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pCreateInfo_loc.dot(Field::tokenCount), pCreateInfo_loc.dot(Field::pTokens), pCreateInfo->tokenCount, pCreateInfo->pTokens, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV, true, true, "VUID-VkIndirectCommandsLayoutTokenNV-sType-sType", "VUID-VkIndirectCommandsLayoutCreateInfoNV-pTokens-parameter", @@ -23797,50 +26342,49 @@ bool StatelessValidation::PreCallValidateCreateIndirectCommandsLayoutNV(VkDevice if (pCreateInfo->pTokens != nullptr) { for (uint32_t tokenIndex = 0; tokenIndex < pCreateInfo->tokenCount; ++tokenIndex) { [[maybe_unused]] const Location pTokens_loc = pCreateInfo_loc.dot(Field::pTokens, tokenIndex); - skip |= ValidateStructPnext(pTokens_loc, pCreateInfo->pTokens[tokenIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkIndirectCommandsLayoutTokenNV-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pTokens_loc, pCreateInfo->pTokens[tokenIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkIndirectCommandsLayoutTokenNV-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pTokens_loc.dot(Field::tokenType), vvl::Enum::VkIndirectCommandsTokenTypeNV, - pCreateInfo->pTokens[tokenIndex].tokenType, - "VUID-VkIndirectCommandsLayoutTokenNV-tokenType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pTokens_loc.dot(Field::tokenType), vvl::Enum::VkIndirectCommandsTokenTypeNV, + pCreateInfo->pTokens[tokenIndex].tokenType, + "VUID-VkIndirectCommandsLayoutTokenNV-tokenType-parameter"); - skip |= ValidateBool32(pTokens_loc.dot(Field::vertexDynamicStride), - pCreateInfo->pTokens[tokenIndex].vertexDynamicStride); + skip |= state.ValidateBool32(pTokens_loc.dot(Field::vertexDynamicStride), + pCreateInfo->pTokens[tokenIndex].vertexDynamicStride); - skip |= ValidateFlags(pTokens_loc.dot(Field::pushconstantShaderStageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfo->pTokens[tokenIndex].pushconstantShaderStageFlags, - kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkIndirectCommandsLayoutTokenNV-pushconstantShaderStageFlags-parameter"); + skip |= state.ValidateFlags(pTokens_loc.dot(Field::pushconstantShaderStageFlags), + vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, + pCreateInfo->pTokens[tokenIndex].pushconstantShaderStageFlags, kOptionalFlags, + "VUID-VkIndirectCommandsLayoutTokenNV-pushconstantShaderStageFlags-parameter"); - skip |= - ValidateFlags(pTokens_loc.dot(Field::indirectStateFlags), vvl::FlagBitmask::VkIndirectStateFlagBitsNV, - AllVkIndirectStateFlagBitsNV, pCreateInfo->pTokens[tokenIndex].indirectStateFlags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkIndirectCommandsLayoutTokenNV-indirectStateFlags-parameter"); + skip |= state.ValidateFlags(pTokens_loc.dot(Field::indirectStateFlags), vvl::FlagBitmask::VkIndirectStateFlagBitsNV, + AllVkIndirectStateFlagBitsNV, pCreateInfo->pTokens[tokenIndex].indirectStateFlags, + kOptionalFlags, "VUID-VkIndirectCommandsLayoutTokenNV-indirectStateFlags-parameter"); - skip |= ValidateRangedEnumArray(pTokens_loc.dot(Field::indexTypeCount), pTokens_loc.dot(Field::pIndexTypes), - vvl::Enum::VkIndexType, pCreateInfo->pTokens[tokenIndex].indexTypeCount, - pCreateInfo->pTokens[tokenIndex].pIndexTypes, false, true, kVUIDUndefined, - "VUID-VkIndirectCommandsLayoutTokenNV-pIndexTypes-parameter"); + skip |= state.ValidateRangedEnumArray(pTokens_loc.dot(Field::indexTypeCount), pTokens_loc.dot(Field::pIndexTypes), + vvl::Enum::VkIndexType, pCreateInfo->pTokens[tokenIndex].indexTypeCount, + pCreateInfo->pTokens[tokenIndex].pIndexTypes, false, true, kVUIDUndefined, + "VUID-VkIndirectCommandsLayoutTokenNV-pIndexTypes-parameter"); - skip |= ValidateArray(pTokens_loc.dot(Field::indexTypeCount), pTokens_loc.dot(Field::pIndexTypeValues), - pCreateInfo->pTokens[tokenIndex].indexTypeCount, - &pCreateInfo->pTokens[tokenIndex].pIndexTypeValues, false, true, kVUIDUndefined, - "VUID-VkIndirectCommandsLayoutTokenNV-pIndexTypeValues-parameter"); + skip |= state.ValidateArray(pTokens_loc.dot(Field::indexTypeCount), pTokens_loc.dot(Field::pIndexTypeValues), + pCreateInfo->pTokens[tokenIndex].indexTypeCount, + &pCreateInfo->pTokens[tokenIndex].pIndexTypeValues, false, true, kVUIDUndefined, + "VUID-VkIndirectCommandsLayoutTokenNV-pIndexTypeValues-parameter"); } } - skip |= ValidateArray(pCreateInfo_loc.dot(Field::streamCount), pCreateInfo_loc.dot(Field::pStreamStrides), - pCreateInfo->streamCount, &pCreateInfo->pStreamStrides, true, true, - "VUID-VkIndirectCommandsLayoutCreateInfoNV-streamCount-arraylength", - "VUID-VkIndirectCommandsLayoutCreateInfoNV-pStreamStrides-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::streamCount), pCreateInfo_loc.dot(Field::pStreamStrides), + pCreateInfo->streamCount, &pCreateInfo->pStreamStrides, true, true, + "VUID-VkIndirectCommandsLayoutCreateInfoNV-streamCount-arraylength", + "VUID-VkIndirectCommandsLayoutCreateInfoNV-pStreamStrides-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pIndirectCommandsLayout), pIndirectCommandsLayout, - "VUID-vkCreateIndirectCommandsLayoutNV-pIndirectCommandsLayout-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pIndirectCommandsLayout), pIndirectCommandsLayout, + "VUID-vkCreateIndirectCommandsLayoutNV-pIndirectCommandsLayout-parameter"); return skip; } @@ -23849,12 +26393,13 @@ bool StatelessValidation::PreCallValidateDestroyIndirectCommandsLayoutNV(VkDevic const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -23863,19 +26408,19 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBias2EXT(VkCommandBuffer com const VkDepthBiasInfoEXT* pDepthBiasInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_depth_bias_control)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_depth_bias_control}); - skip |= ValidateStructType(loc.dot(Field::pDepthBiasInfo), pDepthBiasInfo, VK_STRUCTURE_TYPE_DEPTH_BIAS_INFO_EXT, true, - "VUID-vkCmdSetDepthBias2EXT-pDepthBiasInfo-parameter", "VUID-VkDepthBiasInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pDepthBiasInfo), pDepthBiasInfo, VK_STRUCTURE_TYPE_DEPTH_BIAS_INFO_EXT, true, + "VUID-vkCmdSetDepthBias2EXT-pDepthBiasInfo-parameter", "VUID-VkDepthBiasInfoEXT-sType-sType"); if (pDepthBiasInfo != nullptr) { [[maybe_unused]] const Location pDepthBiasInfo_loc = loc.dot(Field::pDepthBiasInfo); constexpr std::array allowed_structs_VkDepthBiasInfoEXT = {VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT}; - skip |= ValidateStructPnext(pDepthBiasInfo_loc, pDepthBiasInfo->pNext, allowed_structs_VkDepthBiasInfoEXT.size(), - allowed_structs_VkDepthBiasInfoEXT.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDepthBiasInfoEXT-pNext-pNext", "VUID-VkDepthBiasInfoEXT-sType-unique", VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pDepthBiasInfo_loc, pDepthBiasInfo->pNext, allowed_structs_VkDepthBiasInfoEXT.size(), + allowed_structs_VkDepthBiasInfoEXT.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDepthBiasInfoEXT-pNext-pNext", "VUID-VkDepthBiasInfoEXT-sType-unique", true); } return skip; } @@ -23883,20 +26428,26 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBias2EXT(VkCommandBuffer com bool StatelessValidation::PreCallValidateAcquireDrmDisplayEXT(VkPhysicalDevice physicalDevice, int32_t drmFd, VkDisplayKHR display, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_acquire_drm_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_acquire_drm_display}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); return skip; } bool StatelessValidation::PreCallValidateGetDrmDisplayEXT(VkPhysicalDevice physicalDevice, int32_t drmFd, uint32_t connectorId, VkDisplayKHR* display, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_acquire_drm_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_acquire_drm_display}); - skip |= ValidateRequiredPointer(loc.dot(Field::display), display, "VUID-vkGetDrmDisplayEXT-display-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::display), display, "VUID-vkGetDrmDisplayEXT-display-parameter"); return skip; } @@ -23905,6 +26456,7 @@ bool StatelessValidation::PreCallValidateCreatePrivateDataSlotEXT(VkDevice devic VkPrivateDataSlot* pPrivateDataSlot, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_private_data)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_private_data}); @@ -23916,6 +26468,7 @@ bool StatelessValidation::PreCallValidateDestroyPrivateDataSlotEXT(VkDevice devi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_private_data)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_private_data}); @@ -23927,6 +26480,7 @@ bool StatelessValidation::PreCallValidateSetPrivateDataEXT(VkDevice device, VkOb VkPrivateDataSlot privateDataSlot, uint64_t data, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_private_data)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_private_data}); @@ -23938,6 +26492,7 @@ bool StatelessValidation::PreCallValidateGetPrivateDataEXT(VkDevice device, VkOb VkPrivateDataSlot privateDataSlot, uint64_t* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_private_data)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_private_data}); @@ -23949,38 +26504,41 @@ bool StatelessValidation::PreCallValidateCreateCudaModuleNV(VkDevice device, con const VkAllocationCallbacks* pAllocator, VkCudaModuleNV* pModule, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_cuda_kernel_launch}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_CUDA_MODULE_CREATE_INFO_NV, true, - "VUID-vkCreateCudaModuleNV-pCreateInfo-parameter", "VUID-VkCudaModuleCreateInfoNV-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_CUDA_MODULE_CREATE_INFO_NV, true, + "VUID-vkCreateCudaModuleNV-pCreateInfo-parameter", "VUID-VkCudaModuleCreateInfoNV-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCudaModuleCreateInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCudaModuleCreateInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::dataSize), pCreateInfo_loc.dot(Field::pData), pCreateInfo->dataSize, - &pCreateInfo->pData, true, true, "VUID-VkCudaModuleCreateInfoNV-dataSize-arraylength", - "VUID-VkCudaModuleCreateInfoNV-pData-parameter"); + skip |= state.ValidateArray(pCreateInfo_loc.dot(Field::dataSize), pCreateInfo_loc.dot(Field::pData), pCreateInfo->dataSize, + &pCreateInfo->pData, true, true, "VUID-VkCudaModuleCreateInfoNV-dataSize-arraylength", + "VUID-VkCudaModuleCreateInfoNV-pData-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pModule), pModule, "VUID-vkCreateCudaModuleNV-pModule-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pModule), pModule, "VUID-vkCreateCudaModuleNV-pModule-parameter"); return skip; } bool StatelessValidation::PreCallValidateGetCudaModuleCacheNV(VkDevice device, VkCudaModuleNV module, size_t* pCacheSize, void* pCacheData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_cuda_kernel_launch}); - skip |= ValidateRequiredHandle(loc.dot(Field::module), module); - skip |= ValidatePointerArray(loc.dot(Field::pCacheSize), loc.dot(Field::pCacheData), pCacheSize, &pCacheData, true, false, - false, "VUID-vkGetCudaModuleCacheNV-pCacheSize-parameter", kVUIDUndefined, - "VUID-vkGetCudaModuleCacheNV-pCacheData-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::module), module); + skip |= state.ValidatePointerArray(loc.dot(Field::pCacheSize), loc.dot(Field::pCacheData), pCacheSize, &pCacheData, true, false, + false, "VUID-vkGetCudaModuleCacheNV-pCacheSize-parameter", kVUIDUndefined, + "VUID-vkGetCudaModuleCacheNV-pCacheData-parameter"); return skip; } @@ -23988,26 +26546,28 @@ bool StatelessValidation::PreCallValidateCreateCudaFunctionNV(VkDevice device, c const VkAllocationCallbacks* pAllocator, VkCudaFunctionNV* pFunction, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_cuda_kernel_launch}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_CUDA_FUNCTION_CREATE_INFO_NV, true, - "VUID-vkCreateCudaFunctionNV-pCreateInfo-parameter", "VUID-VkCudaFunctionCreateInfoNV-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_CUDA_FUNCTION_CREATE_INFO_NV, true, + "VUID-vkCreateCudaFunctionNV-pCreateInfo-parameter", + "VUID-VkCudaFunctionCreateInfoNV-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCudaFunctionCreateInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCudaFunctionCreateInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::module), pCreateInfo->module); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::module), pCreateInfo->module); - skip |= ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pName), pCreateInfo->pName, - "VUID-VkCudaFunctionCreateInfoNV-pName-parameter"); + skip |= state.ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pName), pCreateInfo->pName, + "VUID-VkCudaFunctionCreateInfoNV-pName-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFunction), pFunction, "VUID-vkCreateCudaFunctionNV-pFunction-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pFunction), pFunction, "VUID-vkCreateCudaFunctionNV-pFunction-parameter"); return skip; } @@ -24015,13 +26575,14 @@ bool StatelessValidation::PreCallValidateDestroyCudaModuleNV(VkDevice device, Vk const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_cuda_kernel_launch}); - skip |= ValidateRequiredHandle(loc.dot(Field::module), module); + skip |= state.ValidateRequiredHandle(loc.dot(Field::module), module); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -24030,13 +26591,14 @@ bool StatelessValidation::PreCallValidateDestroyCudaFunctionNV(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_cuda_kernel_launch}); - skip |= ValidateRequiredHandle(loc.dot(Field::function), function); + skip |= state.ValidateRequiredHandle(loc.dot(Field::function), function); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -24044,17 +26606,18 @@ bool StatelessValidation::PreCallValidateDestroyCudaFunctionNV(VkDevice device, bool StatelessValidation::PreCallValidateCmdCudaLaunchKernelNV(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV* pLaunchInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_cuda_kernel_launch}); - skip |= ValidateStructType(loc.dot(Field::pLaunchInfo), pLaunchInfo, VK_STRUCTURE_TYPE_CUDA_LAUNCH_INFO_NV, true, - "VUID-vkCmdCudaLaunchKernelNV-pLaunchInfo-parameter", "VUID-VkCudaLaunchInfoNV-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pLaunchInfo), pLaunchInfo, VK_STRUCTURE_TYPE_CUDA_LAUNCH_INFO_NV, true, + "VUID-vkCmdCudaLaunchKernelNV-pLaunchInfo-parameter", "VUID-VkCudaLaunchInfoNV-sType-sType"); if (pLaunchInfo != nullptr) { [[maybe_unused]] const Location pLaunchInfo_loc = loc.dot(Field::pLaunchInfo); - skip |= ValidateStructPnext(pLaunchInfo_loc, pLaunchInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCudaLaunchInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pLaunchInfo_loc, pLaunchInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCudaLaunchInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pLaunchInfo_loc.dot(Field::function), pLaunchInfo->function); + skip |= state.ValidateRequiredHandle(pLaunchInfo_loc.dot(Field::function), pLaunchInfo->function); } return skip; } @@ -24063,10 +26626,11 @@ bool StatelessValidation::PreCallValidateCmdCudaLaunchKernelNV(VkCommandBuffer c bool StatelessValidation::PreCallValidateExportMetalObjectsEXT(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_metal_objects)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_metal_objects}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pMetalObjectsInfo), pMetalObjectsInfo, VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT, true, "VUID-vkExportMetalObjectsEXT-pMetalObjectsInfo-parameter", "VUID-VkExportMetalObjectsInfoEXT-sType-sType"); if (pMetalObjectsInfo != nullptr) { @@ -24076,10 +26640,10 @@ bool StatelessValidation::PreCallValidateExportMetalObjectsEXT(VkDevice device, VK_STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT, VK_STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT, VK_STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT, VK_STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT}; - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pMetalObjectsInfo_loc, pMetalObjectsInfo->pNext, allowed_structs_VkExportMetalObjectsInfoEXT.size(), allowed_structs_VkExportMetalObjectsInfoEXT.data(), GeneratedVulkanHeaderVersion, - "VUID-VkExportMetalObjectsInfoEXT-pNext-pNext", "VUID-VkExportMetalObjectsInfoEXT-sType-unique", VK_NULL_HANDLE, false); + "VUID-VkExportMetalObjectsInfoEXT-pNext-pNext", "VUID-VkExportMetalObjectsInfoEXT-sType-unique", false); } return skip; } @@ -24089,12 +26653,13 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutSizeEXT(VkDevice VkDeviceSize* pLayoutSizeInBytes, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); - skip |= ValidateRequiredPointer(loc.dot(Field::pLayoutSizeInBytes), pLayoutSizeInBytes, - "VUID-vkGetDescriptorSetLayoutSizeEXT-pLayoutSizeInBytes-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pLayoutSizeInBytes), pLayoutSizeInBytes, + "VUID-vkGetDescriptorSetLayoutSizeEXT-pLayoutSizeInBytes-parameter"); return skip; } @@ -24102,34 +26667,37 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutBindingOffsetEXT( uint32_t binding, VkDeviceSize* pOffset, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); - skip |= ValidateRequiredPointer(loc.dot(Field::pOffset), pOffset, - "VUID-vkGetDescriptorSetLayoutBindingOffsetEXT-pOffset-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pOffset), pOffset, + "VUID-vkGetDescriptorSetLayoutBindingOffsetEXT-pOffset-parameter"); return skip; } bool StatelessValidation::PreCallValidateGetDescriptorEXT(VkDevice device, const VkDescriptorGetInfoEXT* pDescriptorInfo, size_t dataSize, void* pDescriptor, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateStructType(loc.dot(Field::pDescriptorInfo), pDescriptorInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT, true, - "VUID-vkGetDescriptorEXT-pDescriptorInfo-parameter", "VUID-VkDescriptorGetInfoEXT-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pDescriptorInfo), pDescriptorInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT, true, + "VUID-vkGetDescriptorEXT-pDescriptorInfo-parameter", "VUID-VkDescriptorGetInfoEXT-sType-sType"); if (pDescriptorInfo != nullptr) { [[maybe_unused]] const Location pDescriptorInfo_loc = loc.dot(Field::pDescriptorInfo); - skip |= ValidateStructPnext(pDescriptorInfo_loc, pDescriptorInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorGetInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDescriptorInfo_loc, pDescriptorInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorGetInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pDescriptorInfo_loc.dot(Field::type), vvl::Enum::VkDescriptorType, pDescriptorInfo->type, - "VUID-VkDescriptorGetInfoEXT-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDescriptorInfo_loc.dot(Field::type), vvl::Enum::VkDescriptorType, pDescriptorInfo->type, + "VUID-VkDescriptorGetInfoEXT-type-parameter"); } - skip |= ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pDescriptor), dataSize, &pDescriptor, true, true, - "VUID-vkGetDescriptorEXT-dataSize-arraylength", "VUID-vkGetDescriptorEXT-pDescriptor-parameter"); - if (!skip) skip |= manual_PreCallValidateGetDescriptorEXT(device, pDescriptorInfo, dataSize, pDescriptor, error_obj); + skip |= state.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pDescriptor), dataSize, &pDescriptor, true, true, + "VUID-vkGetDescriptorEXT-dataSize-arraylength", "VUID-vkGetDescriptorEXT-pDescriptor-parameter"); + if (!skip) skip |= manual_PreCallValidateGetDescriptorEXT(device, pDescriptorInfo, dataSize, pDescriptor, state); return skip; } @@ -24137,10 +26705,11 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorBuffersEXT(VkCommandBu const VkDescriptorBufferBindingInfoEXT* pBindingInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::bufferCount), loc.dot(Field::pBindingInfos), bufferCount, pBindingInfos, VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_INFO_EXT, true, true, "VUID-VkDescriptorBufferBindingInfoEXT-sType-sType", "VUID-vkCmdBindDescriptorBuffersEXT-pBindingInfos-parameter", "VUID-vkCmdBindDescriptorBuffersEXT-bufferCount-arraylength"); @@ -24151,14 +26720,13 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorBuffersEXT(VkCommandBu VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO, VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT}; - skip |= ValidateStructPnext(pBindingInfos_loc, pBindingInfos[bufferIndex].pNext, - allowed_structs_VkDescriptorBufferBindingInfoEXT.size(), - allowed_structs_VkDescriptorBufferBindingInfoEXT.data(), GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorBufferBindingInfoEXT-pNext-pNext", - "VUID-VkDescriptorBufferBindingInfoEXT-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pBindingInfos_loc, pBindingInfos[bufferIndex].pNext, allowed_structs_VkDescriptorBufferBindingInfoEXT.size(), + allowed_structs_VkDescriptorBufferBindingInfoEXT.data(), GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorBufferBindingInfoEXT-pNext-pNext", "VUID-VkDescriptorBufferBindingInfoEXT-sType-unique", true); } } - if (!skip) skip |= manual_PreCallValidateCmdBindDescriptorBuffersEXT(commandBuffer, bufferCount, pBindingInfos, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdBindDescriptorBuffersEXT(commandBuffer, bufferCount, pBindingInfos, state); return skip; } @@ -24166,18 +26734,19 @@ bool StatelessValidation::PreCallValidateCmdSetDescriptorBufferOffsetsEXT( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const uint32_t* pBufferIndices, const VkDeviceSize* pOffsets, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, - "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pipelineBindPoint-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); - skip |= ValidateArray(loc.dot(Field::setCount), loc.dot(Field::pBufferIndices), setCount, &pBufferIndices, true, true, - "VUID-vkCmdSetDescriptorBufferOffsetsEXT-setCount-arraylength", - "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pBufferIndices-parameter"); - skip |= ValidateArray(loc.dot(Field::setCount), loc.dot(Field::pOffsets), setCount, &pOffsets, true, true, - "VUID-vkCmdSetDescriptorBufferOffsetsEXT-setCount-arraylength", - "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pOffsets-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pipelineBindPoint-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= state.ValidateArray(loc.dot(Field::setCount), loc.dot(Field::pBufferIndices), setCount, &pBufferIndices, true, true, + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-setCount-arraylength", + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pBufferIndices-parameter"); + skip |= state.ValidateArray(loc.dot(Field::setCount), loc.dot(Field::pOffsets), setCount, &pOffsets, true, true, + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-setCount-arraylength", + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pOffsets-parameter"); return skip; } @@ -24186,12 +26755,13 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers VkPipelineLayout layout, uint32_t set, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, - "VUID-vkCmdBindDescriptorBufferEmbeddedSamplersEXT-pipelineBindPoint-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= state.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdBindDescriptorBufferEmbeddedSamplersEXT-pipelineBindPoint-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::layout), layout); return skip; } @@ -24199,20 +26769,22 @@ bool StatelessValidation::PreCallValidateGetBufferOpaqueCaptureDescriptorDataEXT const VkBufferCaptureDescriptorDataInfoEXT* pInfo, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_BUFFER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, true, - "VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-pInfo-parameter", - "VUID-VkBufferCaptureDescriptorDataInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_BUFFER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, true, + "VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-pInfo-parameter", + "VUID-VkBufferCaptureDescriptorDataInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkBufferCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); } - skip |= ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pData), pData, + "VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-pData-parameter"); return skip; } @@ -24220,63 +26792,66 @@ bool StatelessValidation::PreCallValidateGetImageOpaqueCaptureDescriptorDataEXT( const VkImageCaptureDescriptorDataInfoEXT* pInfo, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, true, - "VUID-vkGetImageOpaqueCaptureDescriptorDataEXT-pInfo-parameter", - "VUID-VkImageCaptureDescriptorDataInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, true, + "VUID-vkGetImageOpaqueCaptureDescriptorDataEXT-pInfo-parameter", + "VUID-VkImageCaptureDescriptorDataInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); } - skip |= ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetImageOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pData), pData, + "VUID-vkGetImageOpaqueCaptureDescriptorDataEXT-pData-parameter"); return skip; } bool StatelessValidation::PreCallValidateGetImageViewOpaqueCaptureDescriptorDataEXT( VkDevice device, const VkImageViewCaptureDescriptorDataInfoEXT* pInfo, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, true, - "VUID-vkGetImageViewOpaqueCaptureDescriptorDataEXT-pInfo-parameter", - "VUID-VkImageViewCaptureDescriptorDataInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_IMAGE_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, + true, "VUID-vkGetImageViewOpaqueCaptureDescriptorDataEXT-pInfo-parameter", + "VUID-VkImageViewCaptureDescriptorDataInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= - ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageViewCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageViewCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetImageViewOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pData), pData, + "VUID-vkGetImageViewOpaqueCaptureDescriptorDataEXT-pData-parameter"); return skip; } bool StatelessValidation::PreCallValidateGetSamplerOpaqueCaptureDescriptorDataEXT( VkDevice device, const VkSamplerCaptureDescriptorDataInfoEXT* pInfo, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_SAMPLER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, true, - "VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-pInfo-parameter", - "VUID-VkSamplerCaptureDescriptorDataInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_SAMPLER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, true, + "VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-pInfo-parameter", + "VUID-VkSamplerCaptureDescriptorDataInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSamplerCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSamplerCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::sampler), pInfo->sampler); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::sampler), pInfo->sampler); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pData), pData, + "VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-pData-parameter"); return skip; } @@ -24284,21 +26859,22 @@ bool StatelessValidation::PreCallValidateGetAccelerationStructureOpaqueCaptureDe VkDevice device, const VkAccelerationStructureCaptureDescriptorDataInfoEXT* pInfo, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= - ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, - true, "VUID-vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT-pInfo-parameter", - "VUID-VkAccelerationStructureCaptureDescriptorDataInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT, true, + "VUID-vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT-pInfo-parameter", + "VUID-VkAccelerationStructureCaptureDescriptorDataInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); } - skip |= ValidateRequiredPointer(loc.dot(Field::pData), pData, - "VUID-vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pData), pData, + "VUID-vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT-pData-parameter"); return skip; } @@ -24307,13 +26883,15 @@ bool StatelessValidation::PreCallValidateCmdSetFragmentShadingRateEnumNV(VkComma const VkFragmentShadingRateCombinerOpKHR combinerOps[2], const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_fragment_shading_rate_enums)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_fragment_shading_rate_enums}); - skip |= ValidateRangedEnum(loc.dot(Field::shadingRate), vvl::Enum::VkFragmentShadingRateNV, shadingRate, - "VUID-vkCmdSetFragmentShadingRateEnumNV-shadingRate-parameter", VK_NULL_HANDLE); - skip |= ValidateRangedEnumArray(loc, loc.dot(Field::combinerOps), vvl::Enum::VkFragmentShadingRateCombinerOpKHR, 2, combinerOps, - false, true, kVUIDUndefined, "VUID-vkCmdSetFragmentShadingRateEnumNV-combinerOps-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::shadingRate), vvl::Enum::VkFragmentShadingRateNV, shadingRate, + "VUID-vkCmdSetFragmentShadingRateEnumNV-shadingRate-parameter"); + skip |= state.ValidateRangedEnumArray(loc, loc.dot(Field::combinerOps), vvl::Enum::VkFragmentShadingRateCombinerOpKHR, 2, + combinerOps, false, true, kVUIDUndefined, + "VUID-vkCmdSetFragmentShadingRateEnumNV-combinerOps-parameter"); return skip; } @@ -24321,22 +26899,24 @@ bool StatelessValidation::PreCallValidateGetDeviceFaultInfoEXT(VkDevice device, VkDeviceFaultInfoEXT* pFaultInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_fault)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_fault}); - skip |= ValidateStructType(loc.dot(Field::pFaultCounts), pFaultCounts, VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT, true, - "VUID-vkGetDeviceFaultInfoEXT-pFaultCounts-parameter", "VUID-VkDeviceFaultCountsEXT-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pFaultCounts), pFaultCounts, VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT, true, + "VUID-vkGetDeviceFaultInfoEXT-pFaultCounts-parameter", "VUID-VkDeviceFaultCountsEXT-sType-sType"); if (pFaultCounts != nullptr) { [[maybe_unused]] const Location pFaultCounts_loc = loc.dot(Field::pFaultCounts); - skip |= ValidateStructPnext(pFaultCounts_loc, pFaultCounts->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceFaultCountsEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pFaultCounts_loc, pFaultCounts->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceFaultCountsEXT-pNext-pNext", kVUIDUndefined, false); } - skip |= ValidateStructType(loc.dot(Field::pFaultInfo), pFaultInfo, VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT, false, - "VUID-vkGetDeviceFaultInfoEXT-pFaultInfo-parameter", "VUID-VkDeviceFaultInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pFaultInfo), pFaultInfo, VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT, false, + "VUID-vkGetDeviceFaultInfoEXT-pFaultInfo-parameter", "VUID-VkDeviceFaultInfoEXT-sType-sType"); if (pFaultInfo != nullptr) { [[maybe_unused]] const Location pFaultInfo_loc = loc.dot(Field::pFaultInfo); - skip |= ValidateStructPnext(pFaultInfo_loc, pFaultInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDeviceFaultInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pFaultInfo_loc, pFaultInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceFaultInfoEXT-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -24345,16 +26925,22 @@ bool StatelessValidation::PreCallValidateGetDeviceFaultInfoEXT(VkDevice device, bool StatelessValidation::PreCallValidateAcquireWinrtDisplayNV(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= state.ValidateRequiredHandle(loc.dot(Field::display), display); return skip; } bool StatelessValidation::PreCallValidateGetWinrtDisplayNV(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredPointer(loc.dot(Field::pDisplay), pDisplay, "VUID-vkGetWinrtDisplayNV-pDisplay-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pDisplay), pDisplay, "VUID-vkGetWinrtDisplayNV-pDisplay-parameter"); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -24365,25 +26951,26 @@ bool StatelessValidation::PreCallValidateCreateDirectFBSurfaceEXT(VkInstance ins const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_directfb_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_directfb_surface}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT, true, - "VUID-vkCreateDirectFBSurfaceEXT-pCreateInfo-parameter", - "VUID-VkDirectFBSurfaceCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT, + true, "VUID-vkCreateDirectFBSurfaceEXT-pCreateInfo-parameter", + "VUID-VkDirectFBSurfaceCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDirectFBSurfaceCreateInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDirectFBSurfaceCreateInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkDirectFBSurfaceCreateInfoEXT-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkDirectFBSurfaceCreateInfoEXT-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateDirectFBSurfaceEXT-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateDirectFBSurfaceEXT-pSurface-parameter"); return skip; } @@ -24391,11 +26978,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDirectFBPresentationSu uint32_t queueFamilyIndex, IDirectFB* dfb, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_ext_directfb_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_directfb_surface}); - skip |= - ValidateRequiredPointer(loc.dot(Field::dfb), dfb, "VUID-vkGetPhysicalDeviceDirectFBPresentationSupportEXT-dfb-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::dfb), dfb, + "VUID-vkGetPhysicalDeviceDirectFBPresentationSupportEXT-dfb-parameter"); return skip; } #endif // VK_USE_PLATFORM_DIRECTFB_EXT @@ -24405,45 +26995,45 @@ bool StatelessValidation::PreCallValidateCmdSetVertexInputEXT( const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_vertex_input_dynamic_state) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_vertex_input_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateStructTypeArray(loc.dot(Field::vertexBindingDescriptionCount), loc.dot(Field::pVertexBindingDescriptions), - vertexBindingDescriptionCount, pVertexBindingDescriptions, - VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT, false, true, - "VUID-VkVertexInputBindingDescription2EXT-sType-sType", - "VUID-vkCmdSetVertexInputEXT-pVertexBindingDescriptions-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::vertexBindingDescriptionCount), loc.dot(Field::pVertexBindingDescriptions), + vertexBindingDescriptionCount, pVertexBindingDescriptions, + VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT, false, true, + "VUID-VkVertexInputBindingDescription2EXT-sType-sType", + "VUID-vkCmdSetVertexInputEXT-pVertexBindingDescriptions-parameter", kVUIDUndefined); if (pVertexBindingDescriptions != nullptr) { for (uint32_t vertexBindingDescriptionIndex = 0; vertexBindingDescriptionIndex < vertexBindingDescriptionCount; ++vertexBindingDescriptionIndex) { [[maybe_unused]] const Location pVertexBindingDescriptions_loc = loc.dot(Field::pVertexBindingDescriptions, vertexBindingDescriptionIndex); - skip |= ValidateRangedEnum(pVertexBindingDescriptions_loc.dot(Field::inputRate), vvl::Enum::VkVertexInputRate, - pVertexBindingDescriptions[vertexBindingDescriptionIndex].inputRate, - "VUID-VkVertexInputBindingDescription2EXT-inputRate-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pVertexBindingDescriptions_loc.dot(Field::inputRate), vvl::Enum::VkVertexInputRate, + pVertexBindingDescriptions[vertexBindingDescriptionIndex].inputRate, + "VUID-VkVertexInputBindingDescription2EXT-inputRate-parameter"); } } - skip |= ValidateStructTypeArray(loc.dot(Field::vertexAttributeDescriptionCount), loc.dot(Field::pVertexAttributeDescriptions), - vertexAttributeDescriptionCount, pVertexAttributeDescriptions, - VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT, false, true, - "VUID-VkVertexInputAttributeDescription2EXT-sType-sType", - "VUID-vkCmdSetVertexInputEXT-pVertexAttributeDescriptions-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(loc.dot(Field::vertexAttributeDescriptionCount), + loc.dot(Field::pVertexAttributeDescriptions), vertexAttributeDescriptionCount, + pVertexAttributeDescriptions, VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT, + false, true, "VUID-VkVertexInputAttributeDescription2EXT-sType-sType", + "VUID-vkCmdSetVertexInputEXT-pVertexAttributeDescriptions-parameter", kVUIDUndefined); if (pVertexAttributeDescriptions != nullptr) { for (uint32_t vertexAttributeDescriptionIndex = 0; vertexAttributeDescriptionIndex < vertexAttributeDescriptionCount; ++vertexAttributeDescriptionIndex) { [[maybe_unused]] const Location pVertexAttributeDescriptions_loc = loc.dot(Field::pVertexAttributeDescriptions, vertexAttributeDescriptionIndex); - skip |= ValidateRangedEnum(pVertexAttributeDescriptions_loc.dot(Field::format), vvl::Enum::VkFormat, - pVertexAttributeDescriptions[vertexAttributeDescriptionIndex].format, - "VUID-VkVertexInputAttributeDescription2EXT-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pVertexAttributeDescriptions_loc.dot(Field::format), vvl::Enum::VkFormat, + pVertexAttributeDescriptions[vertexAttributeDescriptionIndex].format, + "VUID-VkVertexInputAttributeDescription2EXT-format-parameter"); } } if (!skip) - skip |= - manual_PreCallValidateCmdSetVertexInputEXT(commandBuffer, vertexBindingDescriptionCount, pVertexBindingDescriptions, - vertexAttributeDescriptionCount, pVertexAttributeDescriptions, error_obj); + skip |= manual_PreCallValidateCmdSetVertexInputEXT(commandBuffer, vertexBindingDescriptionCount, pVertexBindingDescriptions, + vertexAttributeDescriptionCount, pVertexAttributeDescriptions, state); return skip; } @@ -24452,27 +27042,30 @@ bool StatelessValidation::PreCallValidateGetMemoryZirconHandleFUCHSIA( VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_external_memory)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_external_memory}); - skip |= ValidateStructType(loc.dot(Field::pGetZirconHandleInfo), pGetZirconHandleInfo, - VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA, true, - "VUID-vkGetMemoryZirconHandleFUCHSIA-pGetZirconHandleInfo-parameter", - "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pGetZirconHandleInfo), pGetZirconHandleInfo, + VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA, true, + "VUID-vkGetMemoryZirconHandleFUCHSIA-pGetZirconHandleInfo-parameter", + "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-sType-sType"); if (pGetZirconHandleInfo != nullptr) { [[maybe_unused]] const Location pGetZirconHandleInfo_loc = loc.dot(Field::pGetZirconHandleInfo); - skip |= ValidateStructPnext(pGetZirconHandleInfo_loc, pGetZirconHandleInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGetZirconHandleInfo_loc, pGetZirconHandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetZirconHandleInfo_loc.dot(Field::memory), pGetZirconHandleInfo->memory); + skip |= state.ValidateRequiredHandle(pGetZirconHandleInfo_loc.dot(Field::memory), pGetZirconHandleInfo->memory); - skip |= ValidateFlags(pGetZirconHandleInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, pGetZirconHandleInfo->handleType, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-handleType-parameter", - "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-handleType-parameter"); + skip |= state.ValidateFlags(pGetZirconHandleInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, AllVkExternalMemoryHandleTypeFlagBits, + pGetZirconHandleInfo->handleType, kRequiredSingleBit, + "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-handleType-parameter", + "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pZirconHandle), pZirconHandle, - "VUID-vkGetMemoryZirconHandleFUCHSIA-pZirconHandle-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pZirconHandle), pZirconHandle, + "VUID-vkGetMemoryZirconHandleFUCHSIA-pZirconHandle-parameter"); return skip; } @@ -24480,22 +27073,23 @@ bool StatelessValidation::PreCallValidateGetMemoryZirconHandlePropertiesFUCHSIA( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_external_memory)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_external_memory}); - skip |= ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-vkGetMemoryZirconHandlePropertiesFUCHSIA-handleType-parameter", - "VUID-vkGetMemoryZirconHandlePropertiesFUCHSIA-handleType-parameter"); - skip |= ValidateStructType(loc.dot(Field::pMemoryZirconHandleProperties), pMemoryZirconHandleProperties, - VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA, true, - "VUID-vkGetMemoryZirconHandlePropertiesFUCHSIA-pMemoryZirconHandleProperties-parameter", - "VUID-VkMemoryZirconHandlePropertiesFUCHSIA-sType-sType"); + skip |= state.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, + "VUID-vkGetMemoryZirconHandlePropertiesFUCHSIA-handleType-parameter", + "VUID-vkGetMemoryZirconHandlePropertiesFUCHSIA-handleType-parameter"); + skip |= state.ValidateStructType(loc.dot(Field::pMemoryZirconHandleProperties), pMemoryZirconHandleProperties, + VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA, true, + "VUID-vkGetMemoryZirconHandlePropertiesFUCHSIA-pMemoryZirconHandleProperties-parameter", + "VUID-VkMemoryZirconHandlePropertiesFUCHSIA-sType-sType"); if (pMemoryZirconHandleProperties != nullptr) { [[maybe_unused]] const Location pMemoryZirconHandleProperties_loc = loc.dot(Field::pMemoryZirconHandleProperties); - skip |= ValidateStructPnext(pMemoryZirconHandleProperties_loc, pMemoryZirconHandleProperties->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMemoryZirconHandlePropertiesFUCHSIA-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pMemoryZirconHandleProperties_loc, pMemoryZirconHandleProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryZirconHandlePropertiesFUCHSIA-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -24504,31 +27098,33 @@ bool StatelessValidation::PreCallValidateImportSemaphoreZirconHandleFUCHSIA( VkDevice device, const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_external_semaphore)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_external_semaphore}); - skip |= ValidateStructType(loc.dot(Field::pImportSemaphoreZirconHandleInfo), pImportSemaphoreZirconHandleInfo, - VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA, true, - "VUID-vkImportSemaphoreZirconHandleFUCHSIA-pImportSemaphoreZirconHandleInfo-parameter", - "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pImportSemaphoreZirconHandleInfo), pImportSemaphoreZirconHandleInfo, + VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA, true, + "VUID-vkImportSemaphoreZirconHandleFUCHSIA-pImportSemaphoreZirconHandleInfo-parameter", + "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-sType-sType"); if (pImportSemaphoreZirconHandleInfo != nullptr) { [[maybe_unused]] const Location pImportSemaphoreZirconHandleInfo_loc = loc.dot(Field::pImportSemaphoreZirconHandleInfo); - skip |= ValidateStructPnext(pImportSemaphoreZirconHandleInfo_loc, pImportSemaphoreZirconHandleInfo->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pImportSemaphoreZirconHandleInfo_loc, pImportSemaphoreZirconHandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportSemaphoreZirconHandleInfo_loc.dot(Field::semaphore), - pImportSemaphoreZirconHandleInfo->semaphore); + skip |= state.ValidateRequiredHandle(pImportSemaphoreZirconHandleInfo_loc.dot(Field::semaphore), + pImportSemaphoreZirconHandleInfo->semaphore); - skip |= ValidateFlags(pImportSemaphoreZirconHandleInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreImportFlagBits, - AllVkSemaphoreImportFlagBits, pImportSemaphoreZirconHandleInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-flags-parameter"); + skip |= + state.ValidateFlags(pImportSemaphoreZirconHandleInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreImportFlagBits, + AllVkSemaphoreImportFlagBits, pImportSemaphoreZirconHandleInfo->flags, kOptionalFlags, + "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-flags-parameter"); - skip |= ValidateFlags(pImportSemaphoreZirconHandleInfo_loc.dot(Field::handleType), - vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, AllVkExternalSemaphoreHandleTypeFlagBits, - pImportSemaphoreZirconHandleInfo->handleType, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-handleType-parameter", - "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-handleType-parameter"); + skip |= state.ValidateFlags(pImportSemaphoreZirconHandleInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, + AllVkExternalSemaphoreHandleTypeFlagBits, pImportSemaphoreZirconHandleInfo->handleType, + kRequiredSingleBit, "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-handleType-parameter", + "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-handleType-parameter"); } return skip; } @@ -24537,28 +27133,30 @@ bool StatelessValidation::PreCallValidateGetSemaphoreZirconHandleFUCHSIA( VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_external_semaphore)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_external_semaphore}); - skip |= ValidateStructType(loc.dot(Field::pGetZirconHandleInfo), pGetZirconHandleInfo, - VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA, true, - "VUID-vkGetSemaphoreZirconHandleFUCHSIA-pGetZirconHandleInfo-parameter", - "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pGetZirconHandleInfo), pGetZirconHandleInfo, + VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA, true, + "VUID-vkGetSemaphoreZirconHandleFUCHSIA-pGetZirconHandleInfo-parameter", + "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-sType-sType"); if (pGetZirconHandleInfo != nullptr) { [[maybe_unused]] const Location pGetZirconHandleInfo_loc = loc.dot(Field::pGetZirconHandleInfo); - skip |= ValidateStructPnext(pGetZirconHandleInfo_loc, pGetZirconHandleInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGetZirconHandleInfo_loc, pGetZirconHandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetZirconHandleInfo_loc.dot(Field::semaphore), pGetZirconHandleInfo->semaphore); + skip |= state.ValidateRequiredHandle(pGetZirconHandleInfo_loc.dot(Field::semaphore), pGetZirconHandleInfo->semaphore); - skip |= - ValidateFlags(pGetZirconHandleInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, - AllVkExternalSemaphoreHandleTypeFlagBits, pGetZirconHandleInfo->handleType, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-handleType-parameter", - "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-handleType-parameter"); + skip |= state.ValidateFlags(pGetZirconHandleInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, + AllVkExternalSemaphoreHandleTypeFlagBits, pGetZirconHandleInfo->handleType, kRequiredSingleBit, + "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-handleType-parameter", + "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pZirconHandle), pZirconHandle, - "VUID-vkGetSemaphoreZirconHandleFUCHSIA-pZirconHandle-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pZirconHandle), pZirconHandle, + "VUID-vkGetSemaphoreZirconHandleFUCHSIA-pZirconHandle-parameter"); return skip; } @@ -24568,23 +27166,24 @@ bool StatelessValidation::PreCallValidateCreateBufferCollectionFUCHSIA(VkDevice VkBufferCollectionFUCHSIA* pCollection, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_buffer_collection}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA, - true, "VUID-vkCreateBufferCollectionFUCHSIA-pCreateInfo-parameter", - "VUID-VkBufferCollectionCreateInfoFUCHSIA-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA, true, + "VUID-vkCreateBufferCollectionFUCHSIA-pCreateInfo-parameter", "VUID-VkBufferCollectionCreateInfoFUCHSIA-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkBufferCollectionCreateInfoFUCHSIA-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferCollectionCreateInfoFUCHSIA-pNext-pNext", kVUIDUndefined, true); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pCollection), pCollection, - "VUID-vkCreateBufferCollectionFUCHSIA-pCollection-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCollection), pCollection, + "VUID-vkCreateBufferCollectionFUCHSIA-pCollection-parameter"); return skip; } @@ -24592,42 +27191,42 @@ bool StatelessValidation::PreCallValidateSetBufferCollectionImageConstraintsFUCH VkDevice device, VkBufferCollectionFUCHSIA collection, const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_buffer_collection}); - skip |= ValidateRequiredHandle(loc.dot(Field::collection), collection); - skip |= ValidateStructType(loc.dot(Field::pImageConstraintsInfo), pImageConstraintsInfo, - VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA, true, - "VUID-vkSetBufferCollectionImageConstraintsFUCHSIA-pImageConstraintsInfo-parameter", - "VUID-VkImageConstraintsInfoFUCHSIA-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::collection), collection); + skip |= state.ValidateStructType(loc.dot(Field::pImageConstraintsInfo), pImageConstraintsInfo, + VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA, true, + "VUID-vkSetBufferCollectionImageConstraintsFUCHSIA-pImageConstraintsInfo-parameter", + "VUID-VkImageConstraintsInfoFUCHSIA-sType-sType"); if (pImageConstraintsInfo != nullptr) { [[maybe_unused]] const Location pImageConstraintsInfo_loc = loc.dot(Field::pImageConstraintsInfo); - skip |= - ValidateStructPnext(pImageConstraintsInfo_loc, pImageConstraintsInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkImageConstraintsInfoFUCHSIA-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); - - skip |= ValidateStructTypeArray(pImageConstraintsInfo_loc.dot(Field::formatConstraintsCount), - pImageConstraintsInfo_loc.dot(Field::pFormatConstraints), - pImageConstraintsInfo->formatConstraintsCount, pImageConstraintsInfo->pFormatConstraints, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA, true, true, - "VUID-VkImageFormatConstraintsInfoFUCHSIA-sType-sType", - "VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-parameter", - "VUID-VkImageConstraintsInfoFUCHSIA-formatConstraintsCount-arraylength"); + skip |= state.ValidateStructPnext(pImageConstraintsInfo_loc, pImageConstraintsInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImageConstraintsInfoFUCHSIA-pNext-pNext", + kVUIDUndefined, true); + + skip |= state.ValidateStructTypeArray( + pImageConstraintsInfo_loc.dot(Field::formatConstraintsCount), pImageConstraintsInfo_loc.dot(Field::pFormatConstraints), + pImageConstraintsInfo->formatConstraintsCount, pImageConstraintsInfo->pFormatConstraints, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA, true, true, + "VUID-VkImageFormatConstraintsInfoFUCHSIA-sType-sType", + "VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-parameter", + "VUID-VkImageConstraintsInfoFUCHSIA-formatConstraintsCount-arraylength"); if (pImageConstraintsInfo->pFormatConstraints != nullptr) { for (uint32_t formatConstraintsIndex = 0; formatConstraintsIndex < pImageConstraintsInfo->formatConstraintsCount; ++formatConstraintsIndex) { [[maybe_unused]] const Location pFormatConstraints_loc = pImageConstraintsInfo_loc.dot(Field::pFormatConstraints, formatConstraintsIndex); - skip |= ValidateStructPnext(pFormatConstraints_loc, - pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkImageFormatConstraintsInfoFUCHSIA-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pFormatConstraints_loc, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImageFormatConstraintsInfoFUCHSIA-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateStructType(pFormatConstraints_loc.dot(Field::imageCreateInfo), - &(pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo), - VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkImageCreateInfo-sType-sType"); + skip |= state.ValidateStructType( + pFormatConstraints_loc.dot(Field::imageCreateInfo), + &(pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo), + VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, false, kVUIDUndefined, "VUID-VkImageCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkImageCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA, @@ -24650,64 +27249,66 @@ bool StatelessValidation::PreCallValidateSetBufferCollectionImageConstraintsFUCH VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pFormatConstraints_loc, - pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.pNext, - allowed_structs_VkImageCreateInfo.size(), allowed_structs_VkImageCreateInfo.data(), - GeneratedVulkanHeaderVersion, "VUID-VkImageCreateInfo-pNext-pNext", - "VUID-VkImageCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pFormatConstraints_loc, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.pNext, + allowed_structs_VkImageCreateInfo.size(), allowed_structs_VkImageCreateInfo.data(), + GeneratedVulkanHeaderVersion, "VUID-VkImageCreateInfo-pNext-pNext", "VUID-VkImageCreateInfo-sType-unique", + true); - skip |= ValidateFlags(pFormatConstraints_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, - AllVkImageCreateFlagBits, - pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pFormatConstraints_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, + AllVkImageCreateFlagBits, + pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.flags, + kOptionalFlags, "VUID-VkImageCreateInfo-flags-parameter"); - skip |= - ValidateRangedEnum(pFormatConstraints_loc.dot(Field::imageType), vvl::Enum::VkImageType, - pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.imageType, - "VUID-VkImageCreateInfo-imageType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum( + pFormatConstraints_loc.dot(Field::imageType), vvl::Enum::VkImageType, + pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.imageType, + "VUID-VkImageCreateInfo-imageType-parameter"); - skip |= ValidateRangedEnum(pFormatConstraints_loc.dot(Field::format), vvl::Enum::VkFormat, - pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.format, - "VUID-VkImageCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum( + pFormatConstraints_loc.dot(Field::format), vvl::Enum::VkFormat, + pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.format, + "VUID-VkImageCreateInfo-format-parameter"); // No xml-driven validation - skip |= ValidateFlags( + skip |= state.ValidateFlags( pFormatConstraints_loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.samples, kRequiredSingleBit, - VK_NULL_HANDLE, "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); + "VUID-VkImageCreateInfo-samples-parameter", "VUID-VkImageCreateInfo-samples-parameter"); - skip |= ValidateRangedEnum(pFormatConstraints_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, - pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.tiling, - "VUID-VkImageCreateInfo-tiling-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum( + pFormatConstraints_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, + pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.tiling, + "VUID-VkImageCreateInfo-tiling-parameter"); - skip |= ValidateFlags( + skip |= state.ValidateFlags( pFormatConstraints_loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.usage, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); + "VUID-VkImageCreateInfo-usage-parameter", "VUID-VkImageCreateInfo-usage-requiredbitmask"); - skip |= ValidateRangedEnum( + skip |= state.ValidateRangedEnum( pFormatConstraints_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.sharingMode, - "VUID-VkImageCreateInfo-sharingMode-parameter", VK_NULL_HANDLE); + "VUID-VkImageCreateInfo-sharingMode-parameter"); - skip |= ValidateRangedEnum( + skip |= state.ValidateRangedEnum( pFormatConstraints_loc.dot(Field::initialLayout), vvl::Enum::VkImageLayout, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.initialLayout, - "VUID-VkImageCreateInfo-initialLayout-parameter", VK_NULL_HANDLE); + "VUID-VkImageCreateInfo-initialLayout-parameter"); - skip |= ValidateFlags(pFormatConstraints_loc.dot(Field::requiredFormatFeatures), - vvl::FlagBitmask::VkFormatFeatureFlagBits, AllVkFormatFeatureFlagBits, - pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].requiredFormatFeatures, - kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkImageFormatConstraintsInfoFUCHSIA-requiredFormatFeatures-parameter", - "VUID-VkImageFormatConstraintsInfoFUCHSIA-requiredFormatFeatures-requiredbitmask"); + skip |= + state.ValidateFlags(pFormatConstraints_loc.dot(Field::requiredFormatFeatures), + vvl::FlagBitmask::VkFormatFeatureFlagBits, AllVkFormatFeatureFlagBits, + pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].requiredFormatFeatures, + kRequiredFlags, "VUID-VkImageFormatConstraintsInfoFUCHSIA-requiredFormatFeatures-parameter", + "VUID-VkImageFormatConstraintsInfoFUCHSIA-requiredFormatFeatures-requiredbitmask"); - skip |= ValidateReservedFlags(pFormatConstraints_loc.dot(Field::flags), - pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].flags, - "VUID-VkImageFormatConstraintsInfoFUCHSIA-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pFormatConstraints_loc.dot(Field::flags), + pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].flags, + "VUID-VkImageFormatConstraintsInfoFUCHSIA-flags-zerobitmask"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pFormatConstraints_loc.dot(Field::colorSpaceCount), pFormatConstraints_loc.dot(Field::pColorSpaces), pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].colorSpaceCount, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].pColorSpaces, @@ -24721,28 +27322,29 @@ bool StatelessValidation::PreCallValidateSetBufferCollectionImageConstraintsFUCH ++colorSpaceIndex) { [[maybe_unused]] const Location pColorSpaces_loc = pFormatConstraints_loc.dot(Field::pColorSpaces, colorSpaceIndex); - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pColorSpaces_loc, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].pColorSpaces[colorSpaceIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, "VUID-VkSysmemColorSpaceFUCHSIA-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + true); } } } } - skip |= ValidateStructType(pImageConstraintsInfo_loc.dot(Field::bufferCollectionConstraints), - &(pImageConstraintsInfo->bufferCollectionConstraints), - VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA, false, kVUIDUndefined, - "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-sType-sType"); + skip |= state.ValidateStructType(pImageConstraintsInfo_loc.dot(Field::bufferCollectionConstraints), + &(pImageConstraintsInfo->bufferCollectionConstraints), + VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA, false, kVUIDUndefined, + "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-sType-sType"); - skip |= ValidateStructPnext(pImageConstraintsInfo_loc, pImageConstraintsInfo->bufferCollectionConstraints.pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pImageConstraintsInfo_loc, pImageConstraintsInfo->bufferCollectionConstraints.pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pImageConstraintsInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageConstraintsInfoFlagBitsFUCHSIA, - AllVkImageConstraintsInfoFlagBitsFUCHSIA, pImageConstraintsInfo->flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkImageConstraintsInfoFUCHSIA-flags-parameter"); + skip |= + state.ValidateFlags(pImageConstraintsInfo_loc.dot(Field::flags), + vvl::FlagBitmask::VkImageConstraintsInfoFlagBitsFUCHSIA, AllVkImageConstraintsInfoFlagBitsFUCHSIA, + pImageConstraintsInfo->flags, kOptionalFlags, "VUID-VkImageConstraintsInfoFUCHSIA-flags-parameter"); } return skip; } @@ -24751,23 +27353,24 @@ bool StatelessValidation::PreCallValidateSetBufferCollectionBufferConstraintsFUC VkDevice device, VkBufferCollectionFUCHSIA collection, const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_buffer_collection}); - skip |= ValidateRequiredHandle(loc.dot(Field::collection), collection); - skip |= ValidateStructType(loc.dot(Field::pBufferConstraintsInfo), pBufferConstraintsInfo, - VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA, true, - "VUID-vkSetBufferCollectionBufferConstraintsFUCHSIA-pBufferConstraintsInfo-parameter", - "VUID-VkBufferConstraintsInfoFUCHSIA-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::collection), collection); + skip |= state.ValidateStructType(loc.dot(Field::pBufferConstraintsInfo), pBufferConstraintsInfo, + VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA, true, + "VUID-vkSetBufferCollectionBufferConstraintsFUCHSIA-pBufferConstraintsInfo-parameter", + "VUID-VkBufferConstraintsInfoFUCHSIA-sType-sType"); if (pBufferConstraintsInfo != nullptr) { [[maybe_unused]] const Location pBufferConstraintsInfo_loc = loc.dot(Field::pBufferConstraintsInfo); - skip |= - ValidateStructPnext(pBufferConstraintsInfo_loc, pBufferConstraintsInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkBufferConstraintsInfoFUCHSIA-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBufferConstraintsInfo_loc, pBufferConstraintsInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkBufferConstraintsInfoFUCHSIA-pNext-pNext", + kVUIDUndefined, true); - skip |= - ValidateStructType(pBufferConstraintsInfo_loc.dot(Field::createInfo), &(pBufferConstraintsInfo->createInfo), - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, false, kVUIDUndefined, "VUID-VkBufferCreateInfo-sType-sType"); + skip |= state.ValidateStructType(pBufferConstraintsInfo_loc.dot(Field::createInfo), &(pBufferConstraintsInfo->createInfo), + VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkBufferCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkBufferCreateInfo = {VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA, VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT, @@ -24778,33 +27381,32 @@ bool StatelessValidation::PreCallValidateSetBufferCollectionBufferConstraintsFUC VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR}; - skip |= ValidateStructPnext(pBufferConstraintsInfo_loc, pBufferConstraintsInfo->createInfo.pNext, - allowed_structs_VkBufferCreateInfo.size(), allowed_structs_VkBufferCreateInfo.data(), - GeneratedVulkanHeaderVersion, "VUID-VkBufferCreateInfo-pNext-pNext", - "VUID-VkBufferCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBufferConstraintsInfo_loc, pBufferConstraintsInfo->createInfo.pNext, + allowed_structs_VkBufferCreateInfo.size(), allowed_structs_VkBufferCreateInfo.data(), + GeneratedVulkanHeaderVersion, "VUID-VkBufferCreateInfo-pNext-pNext", + "VUID-VkBufferCreateInfo-sType-unique", true); - skip |= ValidateFlags(pBufferConstraintsInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, - AllVkBufferCreateFlagBits, pBufferConstraintsInfo->createInfo.flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkBufferCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pBufferConstraintsInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, + AllVkBufferCreateFlagBits, pBufferConstraintsInfo->createInfo.flags, kOptionalFlags, + "VUID-VkBufferCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pBufferConstraintsInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, - pBufferConstraintsInfo->createInfo.sharingMode, "VUID-VkBufferCreateInfo-sharingMode-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pBufferConstraintsInfo_loc.dot(Field::sharingMode), vvl::Enum::VkSharingMode, + pBufferConstraintsInfo->createInfo.sharingMode, + "VUID-VkBufferCreateInfo-sharingMode-parameter"); - skip |= - ValidateFlags(pBufferConstraintsInfo_loc.dot(Field::requiredFormatFeatures), vvl::FlagBitmask::VkFormatFeatureFlagBits, - AllVkFormatFeatureFlagBits, pBufferConstraintsInfo->requiredFormatFeatures, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkBufferConstraintsInfoFUCHSIA-requiredFormatFeatures-parameter"); + skip |= state.ValidateFlags(pBufferConstraintsInfo_loc.dot(Field::requiredFormatFeatures), + vvl::FlagBitmask::VkFormatFeatureFlagBits, AllVkFormatFeatureFlagBits, + pBufferConstraintsInfo->requiredFormatFeatures, kOptionalFlags, + "VUID-VkBufferConstraintsInfoFUCHSIA-requiredFormatFeatures-parameter"); - skip |= ValidateStructType(pBufferConstraintsInfo_loc.dot(Field::bufferCollectionConstraints), - &(pBufferConstraintsInfo->bufferCollectionConstraints), - VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA, false, kVUIDUndefined, - "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-sType-sType"); + skip |= state.ValidateStructType(pBufferConstraintsInfo_loc.dot(Field::bufferCollectionConstraints), + &(pBufferConstraintsInfo->bufferCollectionConstraints), + VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA, false, kVUIDUndefined, + "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-sType-sType"); - skip |= - ValidateStructPnext(pBufferConstraintsInfo_loc, pBufferConstraintsInfo->bufferCollectionConstraints.pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBufferConstraintsInfo_loc, pBufferConstraintsInfo->bufferCollectionConstraints.pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-pNext-pNext", kVUIDUndefined, true); } return skip; } @@ -24813,13 +27415,14 @@ bool StatelessValidation::PreCallValidateDestroyBufferCollectionFUCHSIA(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_buffer_collection}); - skip |= ValidateRequiredHandle(loc.dot(Field::collection), collection); + skip |= state.ValidateRequiredHandle(loc.dot(Field::collection), collection); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -24828,17 +27431,19 @@ bool StatelessValidation::PreCallValidateGetBufferCollectionPropertiesFUCHSIA(Vk VkBufferCollectionPropertiesFUCHSIA* pProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_buffer_collection}); - skip |= ValidateRequiredHandle(loc.dot(Field::collection), collection); - skip |= ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA, - true, "VUID-vkGetBufferCollectionPropertiesFUCHSIA-pProperties-parameter", - "VUID-VkBufferCollectionPropertiesFUCHSIA-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::collection), collection); + skip |= + state.ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA, + true, "VUID-vkGetBufferCollectionPropertiesFUCHSIA-pProperties-parameter", + "VUID-VkBufferCollectionPropertiesFUCHSIA-sType-sType"); if (pProperties != nullptr) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties); - skip |= ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkBufferCollectionPropertiesFUCHSIA-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferCollectionPropertiesFUCHSIA-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -24848,18 +27453,20 @@ bool StatelessValidation::PreCallValidateGetDeviceSubpassShadingMaxWorkgroupSize VkExtent2D* pMaxWorkgroupSize, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_huawei_subpass_shading)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_HUAWEI_subpass_shading}); - skip |= ValidateRequiredHandle(loc.dot(Field::renderpass), renderpass); - skip |= ValidateRequiredPointer(loc.dot(Field::pMaxWorkgroupSize), pMaxWorkgroupSize, - "VUID-vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI-pMaxWorkgroupSize-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::renderpass), renderpass); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMaxWorkgroupSize), pMaxWorkgroupSize, + "VUID-vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI-pMaxWorkgroupSize-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSubpassShadingHUAWEI(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_huawei_subpass_shading)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_HUAWEI_subpass_shading}); @@ -24871,11 +27478,12 @@ bool StatelessValidation::PreCallValidateCmdBindInvocationMaskHUAWEI(VkCommandBu VkImageLayout imageLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_huawei_invocation_mask)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_HUAWEI_invocation_mask}); - skip |= ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, - "VUID-vkCmdBindInvocationMaskHUAWEI-imageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, + "VUID-vkCmdBindInvocationMaskHUAWEI-imageLayout-parameter"); return skip; } @@ -24883,27 +27491,29 @@ bool StatelessValidation::PreCallValidateGetMemoryRemoteAddressNV(VkDevice devic const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo, VkRemoteAddressNV* pAddress, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_external_memory_rdma)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_external_memory_rdma}); - skip |= ValidateStructType(loc.dot(Field::pMemoryGetRemoteAddressInfo), pMemoryGetRemoteAddressInfo, - VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV, true, - "VUID-vkGetMemoryRemoteAddressNV-pMemoryGetRemoteAddressInfo-parameter", - "VUID-VkMemoryGetRemoteAddressInfoNV-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pMemoryGetRemoteAddressInfo), pMemoryGetRemoteAddressInfo, + VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV, true, + "VUID-vkGetMemoryRemoteAddressNV-pMemoryGetRemoteAddressInfo-parameter", + "VUID-VkMemoryGetRemoteAddressInfoNV-sType-sType"); if (pMemoryGetRemoteAddressInfo != nullptr) { [[maybe_unused]] const Location pMemoryGetRemoteAddressInfo_loc = loc.dot(Field::pMemoryGetRemoteAddressInfo); - skip |= ValidateStructPnext(pMemoryGetRemoteAddressInfo_loc, pMemoryGetRemoteAddressInfo->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkMemoryGetRemoteAddressInfoNV-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pMemoryGetRemoteAddressInfo_loc, pMemoryGetRemoteAddressInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryGetRemoteAddressInfoNV-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pMemoryGetRemoteAddressInfo_loc.dot(Field::memory), pMemoryGetRemoteAddressInfo->memory); + skip |= + state.ValidateRequiredHandle(pMemoryGetRemoteAddressInfo_loc.dot(Field::memory), pMemoryGetRemoteAddressInfo->memory); - skip |= ValidateFlags( + skip |= state.ValidateFlags( pMemoryGetRemoteAddressInfo_loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, - AllVkExternalMemoryHandleTypeFlagBits, pMemoryGetRemoteAddressInfo->handleType, kRequiredSingleBit, VK_NULL_HANDLE, + AllVkExternalMemoryHandleTypeFlagBits, pMemoryGetRemoteAddressInfo->handleType, kRequiredSingleBit, "VUID-VkMemoryGetRemoteAddressInfoNV-handleType-parameter", "VUID-VkMemoryGetRemoteAddressInfoNV-handleType-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pAddress), pAddress, "VUID-vkGetMemoryRemoteAddressNV-pAddress-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pAddress), pAddress, "VUID-vkGetMemoryRemoteAddressNV-pAddress-parameter"); return skip; } @@ -24911,18 +27521,20 @@ bool StatelessValidation::PreCallValidateGetPipelinePropertiesEXT(VkDevice devic VkBaseOutStructure* pPipelineProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_pipeline_properties)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_pipeline_properties}); - skip |= ValidateRequiredPointer(loc.dot(Field::pPipelineInfo), pPipelineInfo, - "VUID-vkGetPipelinePropertiesEXT-pPipelineInfo-parameter"); - if (!skip) skip |= manual_PreCallValidateGetPipelinePropertiesEXT(device, pPipelineInfo, pPipelineProperties, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pPipelineInfo), pPipelineInfo, + "VUID-vkGetPipelinePropertiesEXT-pPipelineInfo-parameter"); + if (!skip) skip |= manual_PreCallValidateGetPipelinePropertiesEXT(device, pPipelineInfo, pPipelineProperties, state); return skip; } bool StatelessValidation::PreCallValidateCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer, uint32_t patchControlPoints, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); @@ -24934,6 +27546,7 @@ bool StatelessValidation::PreCallValidateCmdSetRasterizerDiscardEnableEXT(VkComm VkBool32 rasterizerDiscardEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); @@ -24944,6 +27557,7 @@ bool StatelessValidation::PreCallValidateCmdSetRasterizerDiscardEnableEXT(VkComm bool StatelessValidation::PreCallValidateCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); @@ -24954,11 +27568,12 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBiasEnableEXT(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateRangedEnum(loc.dot(Field::logicOp), vvl::Enum::VkLogicOp, logicOp, "VUID-vkCmdSetLogicOpEXT-logicOp-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::logicOp), vvl::Enum::VkLogicOp, logicOp, + "VUID-vkCmdSetLogicOpEXT-logicOp-parameter"); return skip; } @@ -24966,6 +27581,7 @@ bool StatelessValidation::PreCallValidateCmdSetPrimitiveRestartEnableEXT(VkComma VkBool32 primitiveRestartEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); @@ -24979,25 +27595,26 @@ bool StatelessValidation::PreCallValidateCreateScreenSurfaceQNX(VkInstance insta const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_qnx_screen_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_QNX_screen_surface}); - skip |= - ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX, true, - "VUID-vkCreateScreenSurfaceQNX-pCreateInfo-parameter", "VUID-VkScreenSurfaceCreateInfoQNX-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX, + true, "VUID-vkCreateScreenSurfaceQNX-pCreateInfo-parameter", + "VUID-VkScreenSurfaceCreateInfoQNX-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkScreenSurfaceCreateInfoQNX-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkScreenSurfaceCreateInfoQNX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkScreenSurfaceCreateInfoQNX-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkScreenSurfaceCreateInfoQNX-flags-zerobitmask"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateScreenSurfaceQNX-pSurface-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateScreenSurfaceQNX-pSurface-parameter"); return skip; } @@ -25006,11 +27623,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceScreenPresentationSupp struct _screen_window* window, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(instance_extensions.vk_qnx_screen_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_QNX_screen_surface}); - skip |= ValidateRequiredPointer(loc.dot(Field::window), window, - "VUID-vkGetPhysicalDeviceScreenPresentationSupportQNX-window-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::window), window, + "VUID-vkGetPhysicalDeviceScreenPresentationSupportQNX-window-parameter"); return skip; } #endif // VK_USE_PLATFORM_SCREEN_QNX @@ -25019,12 +27639,14 @@ bool StatelessValidation::PreCallValidateCmdSetColorWriteEnableEXT(VkCommandBuff const VkBool32* pColorWriteEnables, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_color_write_enable)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_color_write_enable}); - skip |= ValidateBool32Array(loc.dot(Field::attachmentCount), loc.dot(Field::pColorWriteEnables), attachmentCount, - pColorWriteEnables, true, true, "VUID-vkCmdSetColorWriteEnableEXT-attachmentCount-arraylength", - "VUID-vkCmdSetColorWriteEnableEXT-pColorWriteEnables-parameter"); + skip |= + state.ValidateBool32Array(loc.dot(Field::attachmentCount), loc.dot(Field::pColorWriteEnables), attachmentCount, + pColorWriteEnables, true, true, "VUID-vkCmdSetColorWriteEnableEXT-attachmentCount-arraylength", + "VUID-vkCmdSetColorWriteEnableEXT-pColorWriteEnables-parameter"); return skip; } @@ -25033,6 +27655,7 @@ bool StatelessValidation::PreCallValidateCmdDrawMultiEXT(VkCommandBuffer command uint32_t firstInstance, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_multi_draw)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_multi_draw}); // No xml-driven validation @@ -25044,6 +27667,7 @@ bool StatelessValidation::PreCallValidateCmdDrawMultiIndexedEXT(VkCommandBuffer uint32_t firstInstance, uint32_t stride, const int32_t* pVertexOffset, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_multi_draw)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_multi_draw}); // No xml-driven validation @@ -25054,31 +27678,32 @@ bool StatelessValidation::PreCallValidateCreateMicromapEXT(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkMicromapEXT* pMicromap, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_MICROMAP_CREATE_INFO_EXT, true, - "VUID-vkCreateMicromapEXT-pCreateInfo-parameter", "VUID-VkMicromapCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_MICROMAP_CREATE_INFO_EXT, true, + "VUID-vkCreateMicromapEXT-pCreateInfo-parameter", "VUID-VkMicromapCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMicromapCreateInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMicromapCreateInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::createFlags), vvl::FlagBitmask::VkMicromapCreateFlagBitsEXT, - AllVkMicromapCreateFlagBitsEXT, pCreateInfo->createFlags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkMicromapCreateInfoEXT-createFlags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::createFlags), vvl::FlagBitmask::VkMicromapCreateFlagBitsEXT, + AllVkMicromapCreateFlagBitsEXT, pCreateInfo->createFlags, kOptionalFlags, + "VUID-VkMicromapCreateInfoEXT-createFlags-parameter"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::buffer), pCreateInfo->buffer); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::buffer), pCreateInfo->buffer); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::type), vvl::Enum::VkMicromapTypeEXT, pCreateInfo->type, - "VUID-VkMicromapCreateInfoEXT-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::type), vvl::Enum::VkMicromapTypeEXT, pCreateInfo->type, + "VUID-VkMicromapCreateInfoEXT-type-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pMicromap), pMicromap, "VUID-vkCreateMicromapEXT-pMicromap-parameter"); - if (!skip) skip |= manual_PreCallValidateCreateMicromapEXT(device, pCreateInfo, pAllocator, pMicromap, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMicromap), pMicromap, "VUID-vkCreateMicromapEXT-pMicromap-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateMicromapEXT(device, pCreateInfo, pAllocator, pMicromap, state); return skip; } @@ -25086,14 +27711,15 @@ bool StatelessValidation::PreCallValidateDestroyMicromapEXT(VkDevice device, VkM const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - if (!skip) skip |= manual_PreCallValidateDestroyMicromapEXT(device, micromap, pAllocator, error_obj); + if (!skip) skip |= manual_PreCallValidateDestroyMicromapEXT(device, micromap, pAllocator, state); return skip; } @@ -25101,25 +27727,26 @@ bool StatelessValidation::PreCallValidateCmdBuildMicromapsEXT(VkCommandBuffer co const VkMicromapBuildInfoEXT* pInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, - VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT, true, true, - "VUID-VkMicromapBuildInfoEXT-sType-sType", "VUID-vkCmdBuildMicromapsEXT-pInfos-parameter", - "VUID-vkCmdBuildMicromapsEXT-infoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, + VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT, true, true, + "VUID-VkMicromapBuildInfoEXT-sType-sType", "VUID-vkCmdBuildMicromapsEXT-pInfos-parameter", + "VUID-vkCmdBuildMicromapsEXT-infoCount-arraylength"); if (pInfos != nullptr) { for (uint32_t infoIndex = 0; infoIndex < infoCount; ++infoIndex) { [[maybe_unused]] const Location pInfos_loc = loc.dot(Field::pInfos, infoIndex); - skip |= ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMicromapBuildInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMicromapBuildInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkMicromapTypeEXT, pInfos[infoIndex].type, - "VUID-VkMicromapBuildInfoEXT-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkMicromapTypeEXT, pInfos[infoIndex].type, + "VUID-VkMicromapBuildInfoEXT-type-parameter"); - skip |= ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildMicromapFlagBitsEXT, - AllVkBuildMicromapFlagBitsEXT, pInfos[infoIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkMicromapBuildInfoEXT-flags-parameter"); + skip |= state.ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildMicromapFlagBitsEXT, + AllVkBuildMicromapFlagBitsEXT, pInfos[infoIndex].flags, kOptionalFlags, + "VUID-VkMicromapBuildInfoEXT-flags-parameter"); if (pInfos[infoIndex].pUsageCounts != nullptr) { for (uint32_t usageIndexsIndex = 0; usageIndexsIndex < pInfos[infoIndex].usageCountsCount; ++usageIndexsIndex) { @@ -25136,7 +27763,7 @@ bool StatelessValidation::PreCallValidateCmdBuildMicromapsEXT(VkCommandBuffer co } } } - if (!skip) skip |= manual_PreCallValidateCmdBuildMicromapsEXT(commandBuffer, infoCount, pInfos, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdBuildMicromapsEXT(commandBuffer, infoCount, pInfos, state); return skip; } @@ -25144,25 +27771,26 @@ bool StatelessValidation::PreCallValidateBuildMicromapsEXT(VkDevice device, VkDe uint32_t infoCount, const VkMicromapBuildInfoEXT* pInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= - ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, - VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT, true, true, "VUID-VkMicromapBuildInfoEXT-sType-sType", - "VUID-vkBuildMicromapsEXT-pInfos-parameter", "VUID-vkBuildMicromapsEXT-infoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, + VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT, true, true, + "VUID-VkMicromapBuildInfoEXT-sType-sType", "VUID-vkBuildMicromapsEXT-pInfos-parameter", + "VUID-vkBuildMicromapsEXT-infoCount-arraylength"); if (pInfos != nullptr) { for (uint32_t infoIndex = 0; infoIndex < infoCount; ++infoIndex) { [[maybe_unused]] const Location pInfos_loc = loc.dot(Field::pInfos, infoIndex); - skip |= ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMicromapBuildInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMicromapBuildInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkMicromapTypeEXT, pInfos[infoIndex].type, - "VUID-VkMicromapBuildInfoEXT-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkMicromapTypeEXT, pInfos[infoIndex].type, + "VUID-VkMicromapBuildInfoEXT-type-parameter"); - skip |= ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildMicromapFlagBitsEXT, - AllVkBuildMicromapFlagBitsEXT, pInfos[infoIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkMicromapBuildInfoEXT-flags-parameter"); + skip |= state.ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildMicromapFlagBitsEXT, + AllVkBuildMicromapFlagBitsEXT, pInfos[infoIndex].flags, kOptionalFlags, + "VUID-VkMicromapBuildInfoEXT-flags-parameter"); if (pInfos[infoIndex].pUsageCounts != nullptr) { for (uint32_t usageIndexsIndex = 0; usageIndexsIndex < pInfos[infoIndex].usageCountsCount; ++usageIndexsIndex) { @@ -25179,31 +27807,32 @@ bool StatelessValidation::PreCallValidateBuildMicromapsEXT(VkDevice device, VkDe } } } - if (!skip) skip |= manual_PreCallValidateBuildMicromapsEXT(device, deferredOperation, infoCount, pInfos, error_obj); + if (!skip) skip |= manual_PreCallValidateBuildMicromapsEXT(device, deferredOperation, infoCount, pInfos, state); return skip; } bool StatelessValidation::PreCallValidateCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT, true, - "VUID-vkCopyMicromapEXT-pInfo-parameter", "VUID-VkCopyMicromapInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT, true, + "VUID-vkCopyMicromapEXT-pInfo-parameter", "VUID-VkCopyMicromapInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMicromapInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMicromapInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, - "VUID-VkCopyMicromapInfoEXT-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, + "VUID-VkCopyMicromapInfoEXT-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCopyMicromapEXT(device, deferredOperation, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCopyMicromapEXT(device, deferredOperation, pInfo, state); return skip; } @@ -25211,22 +27840,24 @@ bool StatelessValidation::PreCallValidateCopyMicromapToMemoryEXT(VkDevice device const VkCopyMicromapToMemoryInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT, true, - "VUID-vkCopyMicromapToMemoryEXT-pInfo-parameter", "VUID-VkCopyMicromapToMemoryInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT, true, + "VUID-vkCopyMicromapToMemoryEXT-pInfo-parameter", + "VUID-VkCopyMicromapToMemoryInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMicromapToMemoryInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMicromapToMemoryInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, - "VUID-VkCopyMicromapToMemoryInfoEXT-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, + "VUID-VkCopyMicromapToMemoryInfoEXT-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCopyMicromapToMemoryEXT(device, deferredOperation, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCopyMicromapToMemoryEXT(device, deferredOperation, pInfo, state); return skip; } @@ -25234,22 +27865,24 @@ bool StatelessValidation::PreCallValidateCopyMemoryToMicromapEXT(VkDevice device const VkCopyMemoryToMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT, true, - "VUID-vkCopyMemoryToMicromapEXT-pInfo-parameter", "VUID-VkCopyMemoryToMicromapInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT, true, + "VUID-vkCopyMemoryToMicromapEXT-pInfo-parameter", + "VUID-VkCopyMemoryToMicromapInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMemoryToMicromapInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMemoryToMicromapInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, - "VUID-VkCopyMemoryToMicromapInfoEXT-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, + "VUID-VkCopyMemoryToMicromapInfoEXT-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCopyMemoryToMicromapEXT(device, deferredOperation, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCopyMemoryToMicromapEXT(device, deferredOperation, pInfo, state); return skip; } @@ -25258,43 +27891,45 @@ bool StatelessValidation::PreCallValidateWriteMicromapsPropertiesEXT(VkDevice de size_t dataSize, void* pData, size_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateHandleArray(loc.dot(Field::micromapCount), loc.dot(Field::pMicromaps), micromapCount, pMicromaps, true, true, - "VUID-vkWriteMicromapsPropertiesEXT-micromapCount-arraylength"); - skip |= ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, - "VUID-vkWriteMicromapsPropertiesEXT-queryType-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, - "VUID-vkWriteMicromapsPropertiesEXT-dataSize-arraylength", - "VUID-vkWriteMicromapsPropertiesEXT-pData-parameter"); + skip |= state.ValidateHandleArray(loc.dot(Field::micromapCount), loc.dot(Field::pMicromaps), micromapCount, pMicromaps, true, + true, "VUID-vkWriteMicromapsPropertiesEXT-micromapCount-arraylength"); + skip |= state.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkWriteMicromapsPropertiesEXT-queryType-parameter"); + skip |= state.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkWriteMicromapsPropertiesEXT-dataSize-arraylength", + "VUID-vkWriteMicromapsPropertiesEXT-pData-parameter"); if (!skip) skip |= manual_PreCallValidateWriteMicromapsPropertiesEXT(device, micromapCount, pMicromaps, queryType, dataSize, pData, - stride, error_obj); + stride, state); return skip; } bool StatelessValidation::PreCallValidateCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT, true, - "VUID-vkCmdCopyMicromapEXT-pInfo-parameter", "VUID-VkCopyMicromapInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT, true, + "VUID-vkCmdCopyMicromapEXT-pInfo-parameter", "VUID-VkCopyMicromapInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMicromapInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMicromapInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, - "VUID-VkCopyMicromapInfoEXT-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, + "VUID-VkCopyMicromapInfoEXT-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdCopyMicromapEXT(commandBuffer, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdCopyMicromapEXT(commandBuffer, pInfo, state); return skip; } @@ -25302,23 +27937,24 @@ bool StatelessValidation::PreCallValidateCmdCopyMicromapToMemoryEXT(VkCommandBuf const VkCopyMicromapToMemoryInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= - ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT, true, - "VUID-vkCmdCopyMicromapToMemoryEXT-pInfo-parameter", "VUID-VkCopyMicromapToMemoryInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT, true, + "VUID-vkCmdCopyMicromapToMemoryEXT-pInfo-parameter", + "VUID-VkCopyMicromapToMemoryInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMicromapToMemoryInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMicromapToMemoryInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, - "VUID-VkCopyMicromapToMemoryInfoEXT-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, + "VUID-VkCopyMicromapToMemoryInfoEXT-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdCopyMicromapToMemoryEXT(commandBuffer, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdCopyMicromapToMemoryEXT(commandBuffer, pInfo, state); return skip; } @@ -25326,23 +27962,24 @@ bool StatelessValidation::PreCallValidateCmdCopyMemoryToMicromapEXT(VkCommandBuf const VkCopyMemoryToMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= - ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT, true, - "VUID-vkCmdCopyMemoryToMicromapEXT-pInfo-parameter", "VUID-VkCopyMemoryToMicromapInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT, true, + "VUID-vkCmdCopyMemoryToMicromapEXT-pInfo-parameter", + "VUID-VkCopyMemoryToMicromapInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMemoryToMicromapInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMemoryToMicromapInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, - "VUID-VkCopyMemoryToMicromapInfoEXT-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyMicromapModeEXT, pInfo->mode, + "VUID-VkCopyMemoryToMicromapInfoEXT-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdCopyMemoryToMicromapEXT(commandBuffer, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdCopyMemoryToMicromapEXT(commandBuffer, pInfo, state); return skip; } @@ -25351,17 +27988,18 @@ bool StatelessValidation::PreCallValidateCmdWriteMicromapsPropertiesEXT(VkComman VkQueryPool queryPool, uint32_t firstQuery, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateHandleArray(loc.dot(Field::micromapCount), loc.dot(Field::pMicromaps), micromapCount, pMicromaps, true, true, - "VUID-vkCmdWriteMicromapsPropertiesEXT-micromapCount-arraylength"); - skip |= ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, - "VUID-vkCmdWriteMicromapsPropertiesEXT-queryType-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateHandleArray(loc.dot(Field::micromapCount), loc.dot(Field::pMicromaps), micromapCount, pMicromaps, true, + true, "VUID-vkCmdWriteMicromapsPropertiesEXT-micromapCount-arraylength"); + skip |= state.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkCmdWriteMicromapsPropertiesEXT-queryType-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); if (!skip) skip |= manual_PreCallValidateCmdWriteMicromapsPropertiesEXT(commandBuffer, micromapCount, pMicromaps, queryType, queryPool, - firstQuery, error_obj); + firstQuery, state); return skip; } @@ -25370,23 +28008,24 @@ bool StatelessValidation::PreCallValidateGetDeviceMicromapCompatibilityEXT(VkDev VkAccelerationStructureCompatibilityKHR* pCompatibility, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateStructType(loc.dot(Field::pVersionInfo), pVersionInfo, VK_STRUCTURE_TYPE_MICROMAP_VERSION_INFO_EXT, true, - "VUID-vkGetDeviceMicromapCompatibilityEXT-pVersionInfo-parameter", - "VUID-VkMicromapVersionInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pVersionInfo), pVersionInfo, VK_STRUCTURE_TYPE_MICROMAP_VERSION_INFO_EXT, true, + "VUID-vkGetDeviceMicromapCompatibilityEXT-pVersionInfo-parameter", + "VUID-VkMicromapVersionInfoEXT-sType-sType"); if (pVersionInfo != nullptr) { [[maybe_unused]] const Location pVersionInfo_loc = loc.dot(Field::pVersionInfo); - skip |= ValidateStructPnext(pVersionInfo_loc, pVersionInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMicromapVersionInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pVersionInfo_loc, pVersionInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMicromapVersionInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pVersionInfo_loc.dot(Field::pVersionData), pVersionInfo->pVersionData, - "VUID-VkMicromapVersionInfoEXT-pVersionData-parameter"); + skip |= state.ValidateRequiredPointer(pVersionInfo_loc.dot(Field::pVersionData), pVersionInfo->pVersionData, + "VUID-VkMicromapVersionInfoEXT-pVersionData-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pCompatibility), pCompatibility, - "VUID-vkGetDeviceMicromapCompatibilityEXT-pCompatibility-parameter"); - if (!skip) skip |= manual_PreCallValidateGetDeviceMicromapCompatibilityEXT(device, pVersionInfo, pCompatibility, error_obj); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCompatibility), pCompatibility, + "VUID-vkGetDeviceMicromapCompatibilityEXT-pCompatibility-parameter"); + if (!skip) skip |= manual_PreCallValidateGetDeviceMicromapCompatibilityEXT(device, pVersionInfo, pCompatibility, state); return skip; } @@ -25395,24 +28034,26 @@ bool StatelessValidation::PreCallValidateGetMicromapBuildSizesEXT(VkDevice devic VkMicromapBuildSizesInfoEXT* pSizeInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_opacity_micromap}); - skip |= ValidateRangedEnum(loc.dot(Field::buildType), vvl::Enum::VkAccelerationStructureBuildTypeKHR, buildType, - "VUID-vkGetMicromapBuildSizesEXT-buildType-parameter", VK_NULL_HANDLE); - skip |= ValidateStructType(loc.dot(Field::pBuildInfo), pBuildInfo, VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT, true, - "VUID-vkGetMicromapBuildSizesEXT-pBuildInfo-parameter", "VUID-VkMicromapBuildInfoEXT-sType-sType"); + skip |= state.ValidateRangedEnum(loc.dot(Field::buildType), vvl::Enum::VkAccelerationStructureBuildTypeKHR, buildType, + "VUID-vkGetMicromapBuildSizesEXT-buildType-parameter"); + skip |= + state.ValidateStructType(loc.dot(Field::pBuildInfo), pBuildInfo, VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT, true, + "VUID-vkGetMicromapBuildSizesEXT-pBuildInfo-parameter", "VUID-VkMicromapBuildInfoEXT-sType-sType"); if (pBuildInfo != nullptr) { [[maybe_unused]] const Location pBuildInfo_loc = loc.dot(Field::pBuildInfo); - skip |= ValidateStructPnext(pBuildInfo_loc, pBuildInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMicromapBuildInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBuildInfo_loc, pBuildInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMicromapBuildInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pBuildInfo_loc.dot(Field::type), vvl::Enum::VkMicromapTypeEXT, pBuildInfo->type, - "VUID-VkMicromapBuildInfoEXT-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pBuildInfo_loc.dot(Field::type), vvl::Enum::VkMicromapTypeEXT, pBuildInfo->type, + "VUID-VkMicromapBuildInfoEXT-type-parameter"); - skip |= ValidateFlags(pBuildInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildMicromapFlagBitsEXT, - AllVkBuildMicromapFlagBitsEXT, pBuildInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkMicromapBuildInfoEXT-flags-parameter"); + skip |= state.ValidateFlags(pBuildInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildMicromapFlagBitsEXT, + AllVkBuildMicromapFlagBitsEXT, pBuildInfo->flags, kOptionalFlags, + "VUID-VkMicromapBuildInfoEXT-flags-parameter"); if (pBuildInfo->pUsageCounts != nullptr) { for (uint32_t usageIndexsIndex = 0; usageIndexsIndex < pBuildInfo->usageCountsCount; ++usageIndexsIndex) { @@ -25428,17 +28069,17 @@ bool StatelessValidation::PreCallValidateGetMicromapBuildSizesEXT(VkDevice devic } } } - skip |= - ValidateStructType(loc.dot(Field::pSizeInfo), pSizeInfo, VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT, true, - "VUID-vkGetMicromapBuildSizesEXT-pSizeInfo-parameter", "VUID-VkMicromapBuildSizesInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pSizeInfo), pSizeInfo, VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT, true, + "VUID-vkGetMicromapBuildSizesEXT-pSizeInfo-parameter", + "VUID-VkMicromapBuildSizesInfoEXT-sType-sType"); if (pSizeInfo != nullptr) { [[maybe_unused]] const Location pSizeInfo_loc = loc.dot(Field::pSizeInfo); - skip |= ValidateStructPnext(pSizeInfo_loc, pSizeInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkMicromapBuildSizesInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pSizeInfo_loc, pSizeInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMicromapBuildSizesInfoEXT-pNext-pNext", kVUIDUndefined, false); - skip |= ValidateBool32(pSizeInfo_loc.dot(Field::discardable), pSizeInfo->discardable); + skip |= state.ValidateBool32(pSizeInfo_loc.dot(Field::discardable), pSizeInfo->discardable); } - if (!skip) skip |= manual_PreCallValidateGetMicromapBuildSizesEXT(device, buildType, pBuildInfo, pSizeInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateGetMicromapBuildSizesEXT(device, buildType, pBuildInfo, pSizeInfo, state); return skip; } @@ -25446,6 +28087,7 @@ bool StatelessValidation::PreCallValidateCmdDrawClusterHUAWEI(VkCommandBuffer co uint32_t groupCountY, uint32_t groupCountZ, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_HUAWEI_cluster_culling_shader}); @@ -25456,21 +28098,23 @@ bool StatelessValidation::PreCallValidateCmdDrawClusterHUAWEI(VkCommandBuffer co bool StatelessValidation::PreCallValidateCmdDrawClusterIndirectHUAWEI(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_HUAWEI_cluster_culling_shader}); - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } bool StatelessValidation::PreCallValidateSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_pageable_device_local_memory)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_pageable_device_local_memory}); - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); - if (!skip) skip |= manual_PreCallValidateSetDeviceMemoryPriorityEXT(device, memory, priority, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::memory), memory); + if (!skip) skip |= manual_PreCallValidateSetDeviceMemoryPriorityEXT(device, memory, priority, state); return skip; } @@ -25478,30 +28122,30 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutHostMappingInfoVA VkDevice device, const VkDescriptorSetBindingReferenceVALVE* pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE* pHostMapping, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_valve_descriptor_set_host_mapping)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_VALVE_descriptor_set_host_mapping}); - skip |= ValidateStructType(loc.dot(Field::pBindingReference), pBindingReference, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE, true, - "VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-pBindingReference-parameter", - "VUID-VkDescriptorSetBindingReferenceVALVE-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pBindingReference), pBindingReference, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE, true, + "VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-pBindingReference-parameter", + "VUID-VkDescriptorSetBindingReferenceVALVE-sType-sType"); if (pBindingReference != nullptr) { [[maybe_unused]] const Location pBindingReference_loc = loc.dot(Field::pBindingReference); - skip |= ValidateStructPnext(pBindingReference_loc, pBindingReference->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorSetBindingReferenceVALVE-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pBindingReference_loc, pBindingReference->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorSetBindingReferenceVALVE-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateRequiredHandle(pBindingReference_loc.dot(Field::descriptorSetLayout), pBindingReference->descriptorSetLayout); + skip |= state.ValidateRequiredHandle(pBindingReference_loc.dot(Field::descriptorSetLayout), + pBindingReference->descriptorSetLayout); } - skip |= ValidateStructType(loc.dot(Field::pHostMapping), pHostMapping, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE, true, - "VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-pHostMapping-parameter", - "VUID-VkDescriptorSetLayoutHostMappingInfoVALVE-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pHostMapping), pHostMapping, + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE, true, + "VUID-vkGetDescriptorSetLayoutHostMappingInfoVALVE-pHostMapping-parameter", + "VUID-VkDescriptorSetLayoutHostMappingInfoVALVE-sType-sType"); if (pHostMapping != nullptr) { [[maybe_unused]] const Location pHostMapping_loc = loc.dot(Field::pHostMapping); - skip |= ValidateStructPnext(pHostMapping_loc, pHostMapping->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorSetLayoutHostMappingInfoVALVE-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - false); + skip |= state.ValidateStructPnext(pHostMapping_loc, pHostMapping->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorSetLayoutHostMappingInfoVALVE-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -25509,11 +28153,13 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutHostMappingInfoVA bool StatelessValidation::PreCallValidateGetDescriptorSetHostMappingVALVE(VkDevice device, VkDescriptorSet descriptorSet, void** ppData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_valve_descriptor_set_host_mapping)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_VALVE_descriptor_set_host_mapping}); - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorSet), descriptorSet); - skip |= ValidateRequiredPointer(loc.dot(Field::ppData), ppData, "VUID-vkGetDescriptorSetHostMappingVALVE-ppData-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::descriptorSet), descriptorSet); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::ppData), ppData, "VUID-vkGetDescriptorSetHostMappingVALVE-ppData-parameter"); return skip; } @@ -25521,6 +28167,7 @@ bool StatelessValidation::PreCallValidateCmdCopyMemoryIndirectNV(VkCommandBuffer uint32_t copyCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_copy_memory_indirect)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_copy_memory_indirect}); @@ -25532,22 +28179,23 @@ bool StatelessValidation::PreCallValidateCmdCopyMemoryToImageIndirectNV( VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageSubresourceLayers* pImageSubresources, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_copy_memory_indirect)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_copy_memory_indirect}); - skip |= ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); - skip |= ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, - "VUID-vkCmdCopyMemoryToImageIndirectNV-dstImageLayout-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::copyCount), loc.dot(Field::pImageSubresources), copyCount, &pImageSubresources, true, true, - "VUID-vkCmdCopyMemoryToImageIndirectNV-copyCount-arraylength", - "VUID-vkCmdCopyMemoryToImageIndirectNV-pImageSubresources-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= state.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdCopyMemoryToImageIndirectNV-dstImageLayout-parameter"); + skip |= state.ValidateArray(loc.dot(Field::copyCount), loc.dot(Field::pImageSubresources), copyCount, &pImageSubresources, true, + true, "VUID-vkCmdCopyMemoryToImageIndirectNV-copyCount-arraylength", + "VUID-vkCmdCopyMemoryToImageIndirectNV-pImageSubresources-parameter"); if (pImageSubresources != nullptr) { for (uint32_t copyIndex = 0; copyIndex < copyCount; ++copyIndex) { [[maybe_unused]] const Location pImageSubresources_loc = loc.dot(Field::pImageSubresources, copyIndex); - skip |= ValidateFlags(pImageSubresources_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, - AllVkImageAspectFlagBits, pImageSubresources[copyIndex].aspectMask, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkImageSubresourceLayers-aspectMask-parameter", - "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + skip |= state.ValidateFlags(pImageSubresources_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pImageSubresources[copyIndex].aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); } } return skip; @@ -25557,21 +28205,24 @@ bool StatelessValidation::PreCallValidateCmdDecompressMemoryNV(VkCommandBuffer c const VkDecompressMemoryRegionNV* pDecompressMemoryRegions, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_memory_decompression)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_memory_decompression}); - skip |= ValidateArray(loc.dot(Field::decompressRegionCount), loc.dot(Field::pDecompressMemoryRegions), decompressRegionCount, - &pDecompressMemoryRegions, true, true, "VUID-vkCmdDecompressMemoryNV-decompressRegionCount-arraylength", - "VUID-vkCmdDecompressMemoryNV-pDecompressMemoryRegions-parameter"); + skip |= + state.ValidateArray(loc.dot(Field::decompressRegionCount), loc.dot(Field::pDecompressMemoryRegions), decompressRegionCount, + &pDecompressMemoryRegions, true, true, "VUID-vkCmdDecompressMemoryNV-decompressRegionCount-arraylength", + "VUID-vkCmdDecompressMemoryNV-pDecompressMemoryRegions-parameter"); if (pDecompressMemoryRegions != nullptr) { for (uint32_t decompressRegionIndex = 0; decompressRegionIndex < decompressRegionCount; ++decompressRegionIndex) { [[maybe_unused]] const Location pDecompressMemoryRegions_loc = loc.dot(Field::pDecompressMemoryRegions, decompressRegionIndex); - skip |= ValidateFlags(pDecompressMemoryRegions_loc.dot(Field::decompressionMethod), - vvl::FlagBitmask::VkMemoryDecompressionMethodFlagBitsNV, AllVkMemoryDecompressionMethodFlagBitsNV, - pDecompressMemoryRegions[decompressRegionIndex].decompressionMethod, kRequiredFlags, - VK_NULL_HANDLE, "VUID-VkDecompressMemoryRegionNV-decompressionMethod-parameter", - "VUID-VkDecompressMemoryRegionNV-decompressionMethod-requiredbitmask"); + skip |= state.ValidateFlags(pDecompressMemoryRegions_loc.dot(Field::decompressionMethod), + vvl::FlagBitmask::VkMemoryDecompressionMethodFlagBitsNV, + AllVkMemoryDecompressionMethodFlagBitsNV, + pDecompressMemoryRegions[decompressRegionIndex].decompressionMethod, kRequiredFlags, + "VUID-VkDecompressMemoryRegionNV-decompressionMethod-parameter", + "VUID-VkDecompressMemoryRegionNV-decompressionMethod-requiredbitmask"); } } return skip; @@ -25582,6 +28233,7 @@ bool StatelessValidation::PreCallValidateCmdDecompressMemoryIndirectCountNV(VkCo VkDeviceAddress indirectCommandsCountAddress, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_memory_decompression)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_memory_decompression}); @@ -25594,12 +28246,13 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectMemoryRequirementsNV VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands_compute}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, true, - "VUID-vkGetPipelineIndirectMemoryRequirementsNV-pCreateInfo-parameter", - "VUID-VkComputePipelineCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, true, + "VUID-vkGetPipelineIndirectMemoryRequirementsNV-pCreateInfo-parameter", + "VUID-VkComputePipelineCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkComputePipelineCreateInfo = { @@ -25608,14 +28261,14 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectMemoryRequirementsNV VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO, VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkComputePipelineCreateInfo.size(), - allowed_structs_VkComputePipelineCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkComputePipelineCreateInfo-pNext-pNext", "VUID-VkComputePipelineCreateInfo-sType-unique", - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkComputePipelineCreateInfo.size(), + allowed_structs_VkComputePipelineCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkComputePipelineCreateInfo-pNext-pNext", + "VUID-VkComputePipelineCreateInfo-sType-unique", true); - skip |= ValidateStructType(pCreateInfo_loc.dot(Field::stage), &(pCreateInfo->stage), - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineShaderStageCreateInfo-sType-sType"); + skip |= state.ValidateStructType(pCreateInfo_loc.dot(Field::stage), &(pCreateInfo->stage), + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineShaderStageCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkPipelineShaderStageCreateInfo = { VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, @@ -25626,27 +28279,26 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectMemoryRequirementsNV VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT}; - skip |= - ValidateStructPnext(pCreateInfo_loc, pCreateInfo->stage.pNext, allowed_structs_VkPipelineShaderStageCreateInfo.size(), - allowed_structs_VkPipelineShaderStageCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", - "VUID-VkPipelineShaderStageCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfo_loc, pCreateInfo->stage.pNext, allowed_structs_VkPipelineShaderStageCreateInfo.size(), + allowed_structs_VkPipelineShaderStageCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", "VUID-VkPipelineShaderStageCreateInfo-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, pCreateInfo->stage.flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, pCreateInfo->stage.flags, kOptionalFlags, + "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, - pCreateInfo->stage.stage, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", - "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfo->stage.stage, kRequiredSingleBit, + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); - skip |= ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pName), pCreateInfo->stage.pName, - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + skip |= state.ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pName), pCreateInfo->stage.pName, + "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); if (pCreateInfo->stage.pSpecializationInfo != nullptr) { [[maybe_unused]] const Location pSpecializationInfo_loc = pCreateInfo_loc.dot(Field::pSpecializationInfo); - skip |= ValidateArray( + skip |= state.ValidateArray( pSpecializationInfo_loc.dot(Field::mapEntryCount), pSpecializationInfo_loc.dot(Field::pMapEntries), pCreateInfo->stage.pSpecializationInfo->mapEntryCount, &pCreateInfo->stage.pSpecializationInfo->pMapEntries, false, true, kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); @@ -25660,24 +28312,25 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectMemoryRequirementsNV } } - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), - pCreateInfo->stage.pSpecializationInfo->dataSize, &pCreateInfo->stage.pSpecializationInfo->pData, - false, true, kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), + pCreateInfo->stage.pSpecializationInfo->dataSize, + &pCreateInfo->stage.pSpecializationInfo->pData, false, true, kVUIDUndefined, + "VUID-VkSpecializationInfo-pData-parameter"); } - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::layout), pCreateInfo->layout); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::layout), pCreateInfo->layout); } - skip |= ValidateStructType(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - true, "VUID-vkGetPipelineIndirectMemoryRequirementsNV-pMemoryRequirements-parameter", - "VUID-VkMemoryRequirements2-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, true, + "VUID-vkGetPipelineIndirectMemoryRequirementsNV-pMemoryRequirements-parameter", "VUID-VkMemoryRequirements2-sType-sType"); if (pMemoryRequirements != nullptr) { [[maybe_unused]] const Location pMemoryRequirements_loc = loc.dot(Field::pMemoryRequirements); constexpr std::array allowed_structs_VkMemoryRequirements2 = {VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS}; - skip |= ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements->pNext, - allowed_structs_VkMemoryRequirements2.size(), allowed_structs_VkMemoryRequirements2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", - "VUID-VkMemoryRequirements2-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pMemoryRequirements_loc, pMemoryRequirements->pNext, allowed_structs_VkMemoryRequirements2.size(), + allowed_structs_VkMemoryRequirements2.data(), GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", + "VUID-VkMemoryRequirements2-sType-unique", false); } return skip; } @@ -25687,12 +28340,13 @@ bool StatelessValidation::PreCallValidateCmdUpdatePipelineIndirectBufferNV(VkCom VkPipeline pipeline, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands_compute}); - skip |= ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, - "VUID-vkCmdUpdatePipelineIndirectBufferNV-pipelineBindPoint-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= state.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdUpdatePipelineIndirectBufferNV-pipelineBindPoint-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); return skip; } @@ -25700,22 +28354,23 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectDeviceAddressNV(VkDe const VkPipelineIndirectDeviceAddressInfoNV* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands_compute}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_PIPELINE_INDIRECT_DEVICE_ADDRESS_INFO_NV, true, - "VUID-vkGetPipelineIndirectDeviceAddressNV-pInfo-parameter", - "VUID-VkPipelineIndirectDeviceAddressInfoNV-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_PIPELINE_INDIRECT_DEVICE_ADDRESS_INFO_NV, true, + "VUID-vkGetPipelineIndirectDeviceAddressNV-pInfo-parameter", + "VUID-VkPipelineIndirectDeviceAddressInfoNV-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineIndirectDeviceAddressInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineIndirectDeviceAddressInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateRangedEnum(pInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pInfo->pipelineBindPoint, - "VUID-VkPipelineIndirectDeviceAddressInfoNV-pipelineBindPoint-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pInfo->pipelineBindPoint, + "VUID-VkPipelineIndirectDeviceAddressInfoNV-pipelineBindPoint-parameter"); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::pipeline), pInfo->pipeline); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::pipeline), pInfo->pipeline); } return skip; } @@ -25723,21 +28378,23 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectDeviceAddressNV(VkDe bool StatelessValidation::PreCallValidateCmdSetDepthClampEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::depthClampEnable), depthClampEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthClampEnable), depthClampEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetPolygonModeEXT(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateRangedEnum(loc.dot(Field::polygonMode), vvl::Enum::VkPolygonMode, polygonMode, - "VUID-vkCmdSetPolygonModeEXT-polygonMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::polygonMode), vvl::Enum::VkPolygonMode, polygonMode, + "VUID-vkCmdSetPolygonModeEXT-polygonMode-parameter"); return skip; } @@ -25745,27 +28402,29 @@ bool StatelessValidation::PreCallValidateCmdSetRasterizationSamplesEXT(VkCommand VkSampleCountFlagBits rasterizationSamples, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateFlags(loc.dot(Field::rasterizationSamples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, - rasterizationSamples, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-vkCmdSetRasterizationSamplesEXT-rasterizationSamples-parameter", - "VUID-vkCmdSetRasterizationSamplesEXT-rasterizationSamples-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::rasterizationSamples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, rasterizationSamples, kRequiredSingleBit, + "VUID-vkCmdSetRasterizationSamplesEXT-rasterizationSamples-parameter", + "VUID-vkCmdSetRasterizationSamplesEXT-rasterizationSamples-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetSampleMaskEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits samples, const VkSampleMask* pSampleMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, samples, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-vkCmdSetSampleMaskEXT-samples-parameter", - "VUID-vkCmdSetSampleMaskEXT-samples-parameter"); - skip |= ValidateArray(loc.dot(Field::samples), loc.dot(Field::pSampleMask), (samples + 31) / 32, &pSampleMask, true, true, - kVUIDUndefined, "VUID-vkCmdSetSampleMaskEXT-pSampleMask-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, samples, + kRequiredSingleBit, "VUID-vkCmdSetSampleMaskEXT-samples-parameter", + "VUID-vkCmdSetSampleMaskEXT-samples-parameter"); + skip |= state.ValidateArray(loc.dot(Field::samples), loc.dot(Field::pSampleMask), (samples + 31) / 32, &pSampleMask, true, true, + kVUIDUndefined, "VUID-vkCmdSetSampleMaskEXT-pSampleMask-parameter"); return skip; } @@ -25773,30 +28432,33 @@ bool StatelessValidation::PreCallValidateCmdSetAlphaToCoverageEnableEXT(VkComman VkBool32 alphaToCoverageEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::alphaToCoverageEnable), alphaToCoverageEnable); + skip |= state.ValidateBool32(loc.dot(Field::alphaToCoverageEnable), alphaToCoverageEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetAlphaToOneEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::alphaToOneEnable), alphaToOneEnable); + skip |= state.ValidateBool32(loc.dot(Field::alphaToOneEnable), alphaToOneEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetLogicOpEnableEXT(VkCommandBuffer commandBuffer, VkBool32 logicOpEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::logicOpEnable), logicOpEnable); + skip |= state.ValidateBool32(loc.dot(Field::logicOpEnable), logicOpEnable); return skip; } @@ -25804,12 +28466,14 @@ bool StatelessValidation::PreCallValidateCmdSetColorBlendEnableEXT(VkCommandBuff uint32_t attachmentCount, const VkBool32* pColorBlendEnables, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32Array(loc.dot(Field::attachmentCount), loc.dot(Field::pColorBlendEnables), attachmentCount, - pColorBlendEnables, true, true, "VUID-vkCmdSetColorBlendEnableEXT-attachmentCount-arraylength", - "VUID-vkCmdSetColorBlendEnableEXT-pColorBlendEnables-parameter"); + skip |= + state.ValidateBool32Array(loc.dot(Field::attachmentCount), loc.dot(Field::pColorBlendEnables), attachmentCount, + pColorBlendEnables, true, true, "VUID-vkCmdSetColorBlendEnableEXT-attachmentCount-arraylength", + "VUID-vkCmdSetColorBlendEnableEXT-pColorBlendEnables-parameter"); return skip; } @@ -25818,38 +28482,39 @@ bool StatelessValidation::PreCallValidateCmdSetColorBlendEquationEXT(VkCommandBu const VkColorBlendEquationEXT* pColorBlendEquations, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateArray(loc.dot(Field::attachmentCount), loc.dot(Field::pColorBlendEquations), attachmentCount, - &pColorBlendEquations, true, true, "VUID-vkCmdSetColorBlendEquationEXT-attachmentCount-arraylength", - "VUID-vkCmdSetColorBlendEquationEXT-pColorBlendEquations-parameter"); + skip |= state.ValidateArray(loc.dot(Field::attachmentCount), loc.dot(Field::pColorBlendEquations), attachmentCount, + &pColorBlendEquations, true, true, "VUID-vkCmdSetColorBlendEquationEXT-attachmentCount-arraylength", + "VUID-vkCmdSetColorBlendEquationEXT-pColorBlendEquations-parameter"); if (pColorBlendEquations != nullptr) { for (uint32_t attachmentIndex = 0; attachmentIndex < attachmentCount; ++attachmentIndex) { [[maybe_unused]] const Location pColorBlendEquations_loc = loc.dot(Field::pColorBlendEquations, attachmentIndex); - skip |= ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::srcColorBlendFactor), vvl::Enum::VkBlendFactor, - pColorBlendEquations[attachmentIndex].srcColorBlendFactor, - "VUID-VkColorBlendEquationEXT-srcColorBlendFactor-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::srcColorBlendFactor), vvl::Enum::VkBlendFactor, + pColorBlendEquations[attachmentIndex].srcColorBlendFactor, + "VUID-VkColorBlendEquationEXT-srcColorBlendFactor-parameter"); - skip |= ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::dstColorBlendFactor), vvl::Enum::VkBlendFactor, - pColorBlendEquations[attachmentIndex].dstColorBlendFactor, - "VUID-VkColorBlendEquationEXT-dstColorBlendFactor-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::dstColorBlendFactor), vvl::Enum::VkBlendFactor, + pColorBlendEquations[attachmentIndex].dstColorBlendFactor, + "VUID-VkColorBlendEquationEXT-dstColorBlendFactor-parameter"); - skip |= ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::colorBlendOp), vvl::Enum::VkBlendOp, - pColorBlendEquations[attachmentIndex].colorBlendOp, - "VUID-VkColorBlendEquationEXT-colorBlendOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::colorBlendOp), vvl::Enum::VkBlendOp, + pColorBlendEquations[attachmentIndex].colorBlendOp, + "VUID-VkColorBlendEquationEXT-colorBlendOp-parameter"); - skip |= ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::srcAlphaBlendFactor), vvl::Enum::VkBlendFactor, - pColorBlendEquations[attachmentIndex].srcAlphaBlendFactor, - "VUID-VkColorBlendEquationEXT-srcAlphaBlendFactor-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::srcAlphaBlendFactor), vvl::Enum::VkBlendFactor, + pColorBlendEquations[attachmentIndex].srcAlphaBlendFactor, + "VUID-VkColorBlendEquationEXT-srcAlphaBlendFactor-parameter"); - skip |= ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::dstAlphaBlendFactor), vvl::Enum::VkBlendFactor, - pColorBlendEquations[attachmentIndex].dstAlphaBlendFactor, - "VUID-VkColorBlendEquationEXT-dstAlphaBlendFactor-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::dstAlphaBlendFactor), vvl::Enum::VkBlendFactor, + pColorBlendEquations[attachmentIndex].dstAlphaBlendFactor, + "VUID-VkColorBlendEquationEXT-dstAlphaBlendFactor-parameter"); - skip |= ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::alphaBlendOp), vvl::Enum::VkBlendOp, - pColorBlendEquations[attachmentIndex].alphaBlendOp, - "VUID-VkColorBlendEquationEXT-alphaBlendOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::alphaBlendOp), vvl::Enum::VkBlendOp, + pColorBlendEquations[attachmentIndex].alphaBlendOp, + "VUID-VkColorBlendEquationEXT-alphaBlendOp-parameter"); } } return skip; @@ -25860,13 +28525,14 @@ bool StatelessValidation::PreCallValidateCmdSetColorWriteMaskEXT(VkCommandBuffer const VkColorComponentFlags* pColorWriteMasks, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateFlagsArray(loc.dot(Field::attachmentCount), loc.dot(Field::pColorWriteMasks), - vvl::FlagBitmask::VkColorComponentFlagBits, AllVkColorComponentFlagBits, attachmentCount, - pColorWriteMasks, true, "VUID-vkCmdSetColorWriteMaskEXT-attachmentCount-arraylength", - "VUID-vkCmdSetColorWriteMaskEXT-pColorWriteMasks-parameter"); + skip |= state.ValidateFlagsArray(loc.dot(Field::attachmentCount), loc.dot(Field::pColorWriteMasks), + vvl::FlagBitmask::VkColorComponentFlagBits, AllVkColorComponentFlagBits, attachmentCount, + pColorWriteMasks, true, "VUID-vkCmdSetColorWriteMaskEXT-attachmentCount-arraylength", + "VUID-vkCmdSetColorWriteMaskEXT-pColorWriteMasks-parameter"); return skip; } @@ -25874,17 +28540,19 @@ bool StatelessValidation::PreCallValidateCmdSetTessellationDomainOriginEXT(VkCom VkTessellationDomainOrigin domainOrigin, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateRangedEnum(loc.dot(Field::domainOrigin), vvl::Enum::VkTessellationDomainOrigin, domainOrigin, - "VUID-vkCmdSetTessellationDomainOriginEXT-domainOrigin-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::domainOrigin), vvl::Enum::VkTessellationDomainOrigin, domainOrigin, + "VUID-vkCmdSetTessellationDomainOriginEXT-domainOrigin-parameter"); return skip; } bool StatelessValidation::PreCallValidateCmdSetRasterizationStreamEXT(VkCommandBuffer commandBuffer, uint32_t rasterizationStream, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); @@ -25896,12 +28564,13 @@ bool StatelessValidation::PreCallValidateCmdSetConservativeRasterizationModeEXT( VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateRangedEnum( - loc.dot(Field::conservativeRasterizationMode), vvl::Enum::VkConservativeRasterizationModeEXT, conservativeRasterizationMode, - "VUID-vkCmdSetConservativeRasterizationModeEXT-conservativeRasterizationMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::conservativeRasterizationMode), vvl::Enum::VkConservativeRasterizationModeEXT, + conservativeRasterizationMode, + "VUID-vkCmdSetConservativeRasterizationModeEXT-conservativeRasterizationMode-parameter"); return skip; } @@ -25909,6 +28578,7 @@ bool StatelessValidation::PreCallValidateCmdSetExtraPrimitiveOverestimationSizeE float extraPrimitiveOverestimationSize, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); @@ -25919,10 +28589,11 @@ bool StatelessValidation::PreCallValidateCmdSetExtraPrimitiveOverestimationSizeE bool StatelessValidation::PreCallValidateCmdSetDepthClipEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClipEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::depthClipEnable), depthClipEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthClipEnable), depthClipEnable); return skip; } @@ -25930,10 +28601,11 @@ bool StatelessValidation::PreCallValidateCmdSetSampleLocationsEnableEXT(VkComman VkBool32 sampleLocationsEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::sampleLocationsEnable), sampleLocationsEnable); + skip |= state.ValidateBool32(loc.dot(Field::sampleLocationsEnable), sampleLocationsEnable); return skip; } @@ -25942,31 +28614,32 @@ bool StatelessValidation::PreCallValidateCmdSetColorBlendAdvancedEXT(VkCommandBu const VkColorBlendAdvancedEXT* pColorBlendAdvanced, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateArray(loc.dot(Field::attachmentCount), loc.dot(Field::pColorBlendAdvanced), attachmentCount, - &pColorBlendAdvanced, true, true, "VUID-vkCmdSetColorBlendAdvancedEXT-attachmentCount-arraylength", - "VUID-vkCmdSetColorBlendAdvancedEXT-pColorBlendAdvanced-parameter"); + skip |= state.ValidateArray(loc.dot(Field::attachmentCount), loc.dot(Field::pColorBlendAdvanced), attachmentCount, + &pColorBlendAdvanced, true, true, "VUID-vkCmdSetColorBlendAdvancedEXT-attachmentCount-arraylength", + "VUID-vkCmdSetColorBlendAdvancedEXT-pColorBlendAdvanced-parameter"); if (pColorBlendAdvanced != nullptr) { for (uint32_t attachmentIndex = 0; attachmentIndex < attachmentCount; ++attachmentIndex) { [[maybe_unused]] const Location pColorBlendAdvanced_loc = loc.dot(Field::pColorBlendAdvanced, attachmentIndex); - skip |= ValidateRangedEnum(pColorBlendAdvanced_loc.dot(Field::advancedBlendOp), vvl::Enum::VkBlendOp, - pColorBlendAdvanced[attachmentIndex].advancedBlendOp, - "VUID-VkColorBlendAdvancedEXT-advancedBlendOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorBlendAdvanced_loc.dot(Field::advancedBlendOp), vvl::Enum::VkBlendOp, + pColorBlendAdvanced[attachmentIndex].advancedBlendOp, + "VUID-VkColorBlendAdvancedEXT-advancedBlendOp-parameter"); - skip |= ValidateBool32(pColorBlendAdvanced_loc.dot(Field::srcPremultiplied), - pColorBlendAdvanced[attachmentIndex].srcPremultiplied); + skip |= state.ValidateBool32(pColorBlendAdvanced_loc.dot(Field::srcPremultiplied), + pColorBlendAdvanced[attachmentIndex].srcPremultiplied); - skip |= ValidateBool32(pColorBlendAdvanced_loc.dot(Field::dstPremultiplied), - pColorBlendAdvanced[attachmentIndex].dstPremultiplied); + skip |= state.ValidateBool32(pColorBlendAdvanced_loc.dot(Field::dstPremultiplied), + pColorBlendAdvanced[attachmentIndex].dstPremultiplied); - skip |= ValidateRangedEnum(pColorBlendAdvanced_loc.dot(Field::blendOverlap), vvl::Enum::VkBlendOverlapEXT, - pColorBlendAdvanced[attachmentIndex].blendOverlap, - "VUID-VkColorBlendAdvancedEXT-blendOverlap-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorBlendAdvanced_loc.dot(Field::blendOverlap), vvl::Enum::VkBlendOverlapEXT, + pColorBlendAdvanced[attachmentIndex].blendOverlap, + "VUID-VkColorBlendAdvancedEXT-blendOverlap-parameter"); - skip |= - ValidateBool32(pColorBlendAdvanced_loc.dot(Field::clampResults), pColorBlendAdvanced[attachmentIndex].clampResults); + skip |= state.ValidateBool32(pColorBlendAdvanced_loc.dot(Field::clampResults), + pColorBlendAdvanced[attachmentIndex].clampResults); } } return skip; @@ -25976,11 +28649,12 @@ bool StatelessValidation::PreCallValidateCmdSetProvokingVertexModeEXT(VkCommandB VkProvokingVertexModeEXT provokingVertexMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateRangedEnum(loc.dot(Field::provokingVertexMode), vvl::Enum::VkProvokingVertexModeEXT, provokingVertexMode, - "VUID-vkCmdSetProvokingVertexModeEXT-provokingVertexMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::provokingVertexMode), vvl::Enum::VkProvokingVertexModeEXT, provokingVertexMode, + "VUID-vkCmdSetProvokingVertexModeEXT-provokingVertexMode-parameter"); return skip; } @@ -25988,6 +28662,7 @@ bool StatelessValidation::PreCallValidateCmdSetLineRasterizationModeEXT(VkComman VkLineRasterizationModeEXT lineRasterizationMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); @@ -25998,10 +28673,11 @@ bool StatelessValidation::PreCallValidateCmdSetLineRasterizationModeEXT(VkComman bool StatelessValidation::PreCallValidateCmdSetLineStippleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::stippledLineEnable), stippledLineEnable); + skip |= state.ValidateBool32(loc.dot(Field::stippledLineEnable), stippledLineEnable); return skip; } @@ -26009,10 +28685,11 @@ bool StatelessValidation::PreCallValidateCmdSetDepthClipNegativeOneToOneEXT(VkCo VkBool32 negativeOneToOne, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::negativeOneToOne), negativeOneToOne); + skip |= state.ValidateBool32(loc.dot(Field::negativeOneToOne), negativeOneToOne); return skip; } @@ -26020,10 +28697,11 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWScalingEnableNV(VkComman VkBool32 viewportWScalingEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::viewportWScalingEnable), viewportWScalingEnable); + skip |= state.ValidateBool32(loc.dot(Field::viewportWScalingEnable), viewportWScalingEnable); return skip; } @@ -26032,26 +28710,27 @@ bool StatelessValidation::PreCallValidateCmdSetViewportSwizzleNV(VkCommandBuffer const VkViewportSwizzleNV* pViewportSwizzles, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pViewportSwizzles), viewportCount, &pViewportSwizzles, true, - true, "VUID-vkCmdSetViewportSwizzleNV-viewportCount-arraylength", - "VUID-vkCmdSetViewportSwizzleNV-pViewportSwizzles-parameter"); + skip |= state.ValidateArray(loc.dot(Field::viewportCount), loc.dot(Field::pViewportSwizzles), viewportCount, &pViewportSwizzles, + true, true, "VUID-vkCmdSetViewportSwizzleNV-viewportCount-arraylength", + "VUID-vkCmdSetViewportSwizzleNV-pViewportSwizzles-parameter"); if (pViewportSwizzles != nullptr) { for (uint32_t viewportIndex = 0; viewportIndex < viewportCount; ++viewportIndex) { [[maybe_unused]] const Location pViewportSwizzles_loc = loc.dot(Field::pViewportSwizzles, viewportIndex); - skip |= ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::x), vvl::Enum::VkViewportCoordinateSwizzleNV, - pViewportSwizzles[viewportIndex].x, "VUID-VkViewportSwizzleNV-x-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::x), vvl::Enum::VkViewportCoordinateSwizzleNV, + pViewportSwizzles[viewportIndex].x, "VUID-VkViewportSwizzleNV-x-parameter"); - skip |= ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::y), vvl::Enum::VkViewportCoordinateSwizzleNV, - pViewportSwizzles[viewportIndex].y, "VUID-VkViewportSwizzleNV-y-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::y), vvl::Enum::VkViewportCoordinateSwizzleNV, + pViewportSwizzles[viewportIndex].y, "VUID-VkViewportSwizzleNV-y-parameter"); - skip |= ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::z), vvl::Enum::VkViewportCoordinateSwizzleNV, - pViewportSwizzles[viewportIndex].z, "VUID-VkViewportSwizzleNV-z-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::z), vvl::Enum::VkViewportCoordinateSwizzleNV, + pViewportSwizzles[viewportIndex].z, "VUID-VkViewportSwizzleNV-z-parameter"); - skip |= ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::w), vvl::Enum::VkViewportCoordinateSwizzleNV, - pViewportSwizzles[viewportIndex].w, "VUID-VkViewportSwizzleNV-w-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::w), vvl::Enum::VkViewportCoordinateSwizzleNV, + pViewportSwizzles[viewportIndex].w, "VUID-VkViewportSwizzleNV-w-parameter"); } } return skip; @@ -26061,10 +28740,11 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageToColorEnableNV(VkCommand VkBool32 coverageToColorEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::coverageToColorEnable), coverageToColorEnable); + skip |= state.ValidateBool32(loc.dot(Field::coverageToColorEnable), coverageToColorEnable); return skip; } @@ -26072,6 +28752,7 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageToColorLocationNV(VkComma uint32_t coverageToColorLocation, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); @@ -26083,12 +28764,13 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageModulationModeNV(VkComman VkCoverageModulationModeNV coverageModulationMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); skip |= - ValidateRangedEnum(loc.dot(Field::coverageModulationMode), vvl::Enum::VkCoverageModulationModeNV, coverageModulationMode, - "VUID-vkCmdSetCoverageModulationModeNV-coverageModulationMode-parameter", VK_NULL_HANDLE); + state.ValidateRangedEnum(loc.dot(Field::coverageModulationMode), vvl::Enum::VkCoverageModulationModeNV, + coverageModulationMode, "VUID-vkCmdSetCoverageModulationModeNV-coverageModulationMode-parameter"); return skip; } @@ -26096,10 +28778,11 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageModulationTableEnableNV(V VkBool32 coverageModulationTableEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::coverageModulationTableEnable), coverageModulationTableEnable); + skip |= state.ValidateBool32(loc.dot(Field::coverageModulationTableEnable), coverageModulationTableEnable); return skip; } @@ -26108,13 +28791,14 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageModulationTableNV(VkComma const float* pCoverageModulationTable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateArray(loc.dot(Field::coverageModulationTableCount), loc.dot(Field::pCoverageModulationTable), - coverageModulationTableCount, &pCoverageModulationTable, true, true, - "VUID-vkCmdSetCoverageModulationTableNV-coverageModulationTableCount-arraylength", - "VUID-vkCmdSetCoverageModulationTableNV-pCoverageModulationTable-parameter"); + skip |= state.ValidateArray(loc.dot(Field::coverageModulationTableCount), loc.dot(Field::pCoverageModulationTable), + coverageModulationTableCount, &pCoverageModulationTable, true, true, + "VUID-vkCmdSetCoverageModulationTableNV-coverageModulationTableCount-arraylength", + "VUID-vkCmdSetCoverageModulationTableNV-pCoverageModulationTable-parameter"); return skip; } @@ -26122,10 +28806,11 @@ bool StatelessValidation::PreCallValidateCmdSetShadingRateImageEnableNV(VkComman VkBool32 shadingRateImageEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::shadingRateImageEnable), shadingRateImageEnable); + skip |= state.ValidateBool32(loc.dot(Field::shadingRateImageEnable), shadingRateImageEnable); return skip; } @@ -26133,10 +28818,11 @@ bool StatelessValidation::PreCallValidateCmdSetRepresentativeFragmentTestEnableN VkBool32 representativeFragmentTestEnable, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateBool32(loc.dot(Field::representativeFragmentTestEnable), representativeFragmentTestEnable); + skip |= state.ValidateBool32(loc.dot(Field::representativeFragmentTestEnable), representativeFragmentTestEnable); return skip; } @@ -26144,11 +28830,12 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageReductionModeNV(VkCommand VkCoverageReductionModeNV coverageReductionMode, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(device_extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateRangedEnum(loc.dot(Field::coverageReductionMode), vvl::Enum::VkCoverageReductionModeNV, coverageReductionMode, - "VUID-vkCmdSetCoverageReductionModeNV-coverageReductionMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::coverageReductionMode), vvl::Enum::VkCoverageReductionModeNV, + coverageReductionMode, "VUID-vkCmdSetCoverageReductionModeNV-coverageReductionMode-parameter"); return skip; } @@ -26156,17 +28843,18 @@ bool StatelessValidation::PreCallValidateGetShaderModuleIdentifierEXT(VkDevice d VkShaderModuleIdentifierEXT* pIdentifier, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_shader_module_identifier)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_module_identifier}); - skip |= ValidateRequiredHandle(loc.dot(Field::shaderModule), shaderModule); - skip |= ValidateStructType(loc.dot(Field::pIdentifier), pIdentifier, VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT, true, - "VUID-vkGetShaderModuleIdentifierEXT-pIdentifier-parameter", - "VUID-VkShaderModuleIdentifierEXT-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::shaderModule), shaderModule); + skip |= state.ValidateStructType(loc.dot(Field::pIdentifier), pIdentifier, VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT, true, + "VUID-vkGetShaderModuleIdentifierEXT-pIdentifier-parameter", + "VUID-VkShaderModuleIdentifierEXT-sType-sType"); if (pIdentifier != nullptr) { [[maybe_unused]] const Location pIdentifier_loc = loc.dot(Field::pIdentifier); - skip |= ValidateStructPnext(pIdentifier_loc, pIdentifier->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkShaderModuleIdentifierEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pIdentifier_loc, pIdentifier->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkShaderModuleIdentifierEXT-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -26176,28 +28864,29 @@ bool StatelessValidation::PreCallValidateGetShaderModuleCreateInfoIdentifierEXT( VkShaderModuleIdentifierEXT* pIdentifier, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_shader_module_identifier)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_module_identifier}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, true, - "VUID-vkGetShaderModuleCreateInfoIdentifierEXT-pCreateInfo-parameter", - "VUID-VkShaderModuleCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, true, + "VUID-vkGetShaderModuleCreateInfoIdentifierEXT-pCreateInfo-parameter", + "VUID-VkShaderModuleCreateInfo-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, - "VUID-VkShaderModuleCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkShaderModuleCreateInfo-flags-zerobitmask"); - skip |= ValidateArray(pCreateInfo_loc.dot(Field::codeSize), pCreateInfo_loc.dot(Field::pCode), pCreateInfo->codeSize / 4, - &pCreateInfo->pCode, true, true, "VUID-VkShaderModuleCreateInfo-codeSize-01085", - "VUID-VkShaderModuleCreateInfo-pCode-parameter"); + skip |= state.ValidateArray( + pCreateInfo_loc.dot(Field::codeSize), pCreateInfo_loc.dot(Field::pCode), pCreateInfo->codeSize / 4, &pCreateInfo->pCode, + true, true, "VUID-VkShaderModuleCreateInfo-codeSize-01085", "VUID-VkShaderModuleCreateInfo-pCode-parameter"); } - skip |= ValidateStructType(loc.dot(Field::pIdentifier), pIdentifier, VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT, true, - "VUID-vkGetShaderModuleCreateInfoIdentifierEXT-pIdentifier-parameter", - "VUID-VkShaderModuleIdentifierEXT-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pIdentifier), pIdentifier, VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT, true, + "VUID-vkGetShaderModuleCreateInfoIdentifierEXT-pIdentifier-parameter", + "VUID-VkShaderModuleIdentifierEXT-sType-sType"); if (pIdentifier != nullptr) { [[maybe_unused]] const Location pIdentifier_loc = loc.dot(Field::pIdentifier); - skip |= ValidateStructPnext(pIdentifier_loc, pIdentifier->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkShaderModuleIdentifierEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pIdentifier_loc, pIdentifier->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkShaderModuleIdentifierEXT-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -26206,28 +28895,32 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceOpticalFlowImageFormat VkPhysicalDevice physicalDevice, const VkOpticalFlowImageFormatInfoNV* pOpticalFlowImageFormatInfo, uint32_t* pFormatCount, VkOpticalFlowImageFormatPropertiesNV* pImageFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType(loc.dot(Field::pOpticalFlowImageFormatInfo), pOpticalFlowImageFormatInfo, - VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV, true, - "VUID-vkGetPhysicalDeviceOpticalFlowImageFormatsNV-pOpticalFlowImageFormatInfo-parameter", - "VUID-VkOpticalFlowImageFormatInfoNV-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pOpticalFlowImageFormatInfo), pOpticalFlowImageFormatInfo, + VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV, true, + "VUID-vkGetPhysicalDeviceOpticalFlowImageFormatsNV-pOpticalFlowImageFormatInfo-parameter", + "VUID-VkOpticalFlowImageFormatInfoNV-sType-sType"); if (pOpticalFlowImageFormatInfo != nullptr) { [[maybe_unused]] const Location pOpticalFlowImageFormatInfo_loc = loc.dot(Field::pOpticalFlowImageFormatInfo); - skip |= ValidateFlags(pOpticalFlowImageFormatInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkOpticalFlowUsageFlagBitsNV, - AllVkOpticalFlowUsageFlagBitsNV, pOpticalFlowImageFormatInfo->usage, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkOpticalFlowImageFormatInfoNV-usage-parameter", - "VUID-VkOpticalFlowImageFormatInfoNV-usage-requiredbitmask"); - } - skip |= ValidateStructTypeArray(loc.dot(Field::pFormatCount), loc.dot(Field::pImageFormatProperties), pFormatCount, - pImageFormatProperties, VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV, true, false, - false, "VUID-VkOpticalFlowImageFormatPropertiesNV-sType-sType", kVUIDUndefined, - "VUID-vkGetPhysicalDeviceOpticalFlowImageFormatsNV-pFormatCount-parameter", kVUIDUndefined); + skip |= state.ValidateFlags( + pOpticalFlowImageFormatInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkOpticalFlowUsageFlagBitsNV, + AllVkOpticalFlowUsageFlagBitsNV, pOpticalFlowImageFormatInfo->usage, kRequiredFlags, + "VUID-VkOpticalFlowImageFormatInfoNV-usage-parameter", "VUID-VkOpticalFlowImageFormatInfoNV-usage-requiredbitmask"); + } + skip |= + state.ValidateStructTypeArray(loc.dot(Field::pFormatCount), loc.dot(Field::pImageFormatProperties), pFormatCount, + pImageFormatProperties, VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV, true, + false, false, "VUID-VkOpticalFlowImageFormatPropertiesNV-sType-sType", kVUIDUndefined, + "VUID-vkGetPhysicalDeviceOpticalFlowImageFormatsNV-pFormatCount-parameter", kVUIDUndefined); if (pImageFormatProperties != nullptr) { for (uint32_t pFormatIndex = 0; pFormatIndex < *pFormatCount; ++pFormatIndex) { [[maybe_unused]] const Location pImageFormatProperties_loc = loc.dot(Field::pImageFormatProperties, pFormatIndex); - skip |= ValidateStructPnext(pImageFormatProperties_loc, pImageFormatProperties[pFormatIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkOpticalFlowImageFormatPropertiesNV-pNext-pNext", - kVUIDUndefined, physicalDevice, false); + skip |= state.ValidateStructPnext(pImageFormatProperties_loc, pImageFormatProperties[pFormatIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkOpticalFlowImageFormatPropertiesNV-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -26239,53 +28932,56 @@ bool StatelessValidation::PreCallValidateCreateOpticalFlowSessionNV(VkDevice dev VkOpticalFlowSessionNV* pSession, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_optical_flow)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_optical_flow}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV, - true, "VUID-vkCreateOpticalFlowSessionNV-pCreateInfo-parameter", - "VUID-VkOpticalFlowSessionCreateInfoNV-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV, true, + "VUID-vkCreateOpticalFlowSessionNV-pCreateInfo-parameter", "VUID-VkOpticalFlowSessionCreateInfoNV-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkOpticalFlowSessionCreateInfoNV = { VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV}; - skip |= ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkOpticalFlowSessionCreateInfoNV.size(), - allowed_structs_VkOpticalFlowSessionCreateInfoNV.data(), GeneratedVulkanHeaderVersion, - "VUID-VkOpticalFlowSessionCreateInfoNV-pNext-pNext", - "VUID-VkOpticalFlowSessionCreateInfoNV-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkOpticalFlowSessionCreateInfoNV.size(), + allowed_structs_VkOpticalFlowSessionCreateInfoNV.data(), GeneratedVulkanHeaderVersion, + "VUID-VkOpticalFlowSessionCreateInfoNV-pNext-pNext", "VUID-VkOpticalFlowSessionCreateInfoNV-sType-unique", true); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageFormat), vvl::Enum::VkFormat, pCreateInfo->imageFormat, - "VUID-VkOpticalFlowSessionCreateInfoNV-imageFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageFormat), vvl::Enum::VkFormat, pCreateInfo->imageFormat, + "VUID-VkOpticalFlowSessionCreateInfoNV-imageFormat-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::flowVectorFormat), vvl::Enum::VkFormat, pCreateInfo->flowVectorFormat, - "VUID-VkOpticalFlowSessionCreateInfoNV-flowVectorFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::flowVectorFormat), vvl::Enum::VkFormat, + pCreateInfo->flowVectorFormat, + "VUID-VkOpticalFlowSessionCreateInfoNV-flowVectorFormat-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::costFormat), vvl::Enum::VkFormat, pCreateInfo->costFormat, - "VUID-VkOpticalFlowSessionCreateInfoNV-costFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::costFormat), vvl::Enum::VkFormat, pCreateInfo->costFormat, + "VUID-VkOpticalFlowSessionCreateInfoNV-costFormat-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::outputGridSize), vvl::FlagBitmask::VkOpticalFlowGridSizeFlagBitsNV, - AllVkOpticalFlowGridSizeFlagBitsNV, pCreateInfo->outputGridSize, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkOpticalFlowSessionCreateInfoNV-outputGridSize-parameter", - "VUID-VkOpticalFlowSessionCreateInfoNV-outputGridSize-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::outputGridSize), vvl::FlagBitmask::VkOpticalFlowGridSizeFlagBitsNV, + AllVkOpticalFlowGridSizeFlagBitsNV, pCreateInfo->outputGridSize, kRequiredFlags, + "VUID-VkOpticalFlowSessionCreateInfoNV-outputGridSize-parameter", + "VUID-VkOpticalFlowSessionCreateInfoNV-outputGridSize-requiredbitmask"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::hintGridSize), vvl::FlagBitmask::VkOpticalFlowGridSizeFlagBitsNV, - AllVkOpticalFlowGridSizeFlagBitsNV, pCreateInfo->hintGridSize, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkOpticalFlowSessionCreateInfoNV-hintGridSize-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::hintGridSize), vvl::FlagBitmask::VkOpticalFlowGridSizeFlagBitsNV, + AllVkOpticalFlowGridSizeFlagBitsNV, pCreateInfo->hintGridSize, kOptionalFlags, + "VUID-VkOpticalFlowSessionCreateInfoNV-hintGridSize-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::performanceLevel), vvl::Enum::VkOpticalFlowPerformanceLevelNV, - pCreateInfo->performanceLevel, - "VUID-VkOpticalFlowSessionCreateInfoNV-performanceLevel-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::performanceLevel), vvl::Enum::VkOpticalFlowPerformanceLevelNV, + pCreateInfo->performanceLevel, + "VUID-VkOpticalFlowSessionCreateInfoNV-performanceLevel-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkOpticalFlowSessionCreateFlagBitsNV, - AllVkOpticalFlowSessionCreateFlagBitsNV, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkOpticalFlowSessionCreateInfoNV-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkOpticalFlowSessionCreateFlagBitsNV, + AllVkOpticalFlowSessionCreateFlagBitsNV, pCreateInfo->flags, kOptionalFlags, + "VUID-VkOpticalFlowSessionCreateInfoNV-flags-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSession), pSession, "VUID-vkCreateOpticalFlowSessionNV-pSession-parameter"); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::pSession), pSession, "VUID-vkCreateOpticalFlowSessionNV-pSession-parameter"); return skip; } @@ -26293,13 +28989,14 @@ bool StatelessValidation::PreCallValidateDestroyOpticalFlowSessionNV(VkDevice de const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_optical_flow)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_optical_flow}); - skip |= ValidateRequiredHandle(loc.dot(Field::session), session); + skip |= state.ValidateRequiredHandle(loc.dot(Field::session), session); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -26309,14 +29006,15 @@ bool StatelessValidation::PreCallValidateBindOpticalFlowSessionImageNV(VkDevice VkImageView view, VkImageLayout layout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_optical_flow)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_optical_flow}); - skip |= ValidateRequiredHandle(loc.dot(Field::session), session); - skip |= ValidateRangedEnum(loc.dot(Field::bindingPoint), vvl::Enum::VkOpticalFlowSessionBindingPointNV, bindingPoint, - "VUID-vkBindOpticalFlowSessionImageNV-bindingPoint-parameter", VK_NULL_HANDLE); - skip |= ValidateRangedEnum(loc.dot(Field::layout), vvl::Enum::VkImageLayout, layout, - "VUID-vkBindOpticalFlowSessionImageNV-layout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRequiredHandle(loc.dot(Field::session), session); + skip |= state.ValidateRangedEnum(loc.dot(Field::bindingPoint), vvl::Enum::VkOpticalFlowSessionBindingPointNV, bindingPoint, + "VUID-vkBindOpticalFlowSessionImageNV-bindingPoint-parameter"); + skip |= state.ValidateRangedEnum(loc.dot(Field::layout), vvl::Enum::VkImageLayout, layout, + "VUID-vkBindOpticalFlowSessionImageNV-layout-parameter"); return skip; } @@ -26324,25 +29022,26 @@ bool StatelessValidation::PreCallValidateCmdOpticalFlowExecuteNV(VkCommandBuffer const VkOpticalFlowExecuteInfoNV* pExecuteInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_optical_flow)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_optical_flow}); - skip |= ValidateRequiredHandle(loc.dot(Field::session), session); - skip |= - ValidateStructType(loc.dot(Field::pExecuteInfo), pExecuteInfo, VK_STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV, true, - "VUID-vkCmdOpticalFlowExecuteNV-pExecuteInfo-parameter", "VUID-VkOpticalFlowExecuteInfoNV-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::session), session); + skip |= state.ValidateStructType(loc.dot(Field::pExecuteInfo), pExecuteInfo, VK_STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV, + true, "VUID-vkCmdOpticalFlowExecuteNV-pExecuteInfo-parameter", + "VUID-VkOpticalFlowExecuteInfoNV-sType-sType"); if (pExecuteInfo != nullptr) { [[maybe_unused]] const Location pExecuteInfo_loc = loc.dot(Field::pExecuteInfo); - skip |= ValidateStructPnext(pExecuteInfo_loc, pExecuteInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkOpticalFlowExecuteInfoNV-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pExecuteInfo_loc, pExecuteInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkOpticalFlowExecuteInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pExecuteInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkOpticalFlowExecuteFlagBitsNV, - AllVkOpticalFlowExecuteFlagBitsNV, pExecuteInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkOpticalFlowExecuteInfoNV-flags-parameter"); + skip |= state.ValidateFlags(pExecuteInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkOpticalFlowExecuteFlagBitsNV, + AllVkOpticalFlowExecuteFlagBitsNV, pExecuteInfo->flags, kOptionalFlags, + "VUID-VkOpticalFlowExecuteInfoNV-flags-parameter"); - skip |= ValidateArray(pExecuteInfo_loc.dot(Field::regionCount), pExecuteInfo_loc.dot(Field::pRegions), - pExecuteInfo->regionCount, &pExecuteInfo->pRegions, false, true, kVUIDUndefined, - "VUID-VkOpticalFlowExecuteInfoNV-pRegions-parameter"); + skip |= state.ValidateArray(pExecuteInfo_loc.dot(Field::regionCount), pExecuteInfo_loc.dot(Field::pRegions), + pExecuteInfo->regionCount, &pExecuteInfo->pRegions, false, true, kVUIDUndefined, + "VUID-VkOpticalFlowExecuteInfoNV-pRegions-parameter"); } return skip; } @@ -26350,24 +29049,24 @@ bool StatelessValidation::PreCallValidateCmdOpticalFlowExecuteNV(VkCommandBuffer bool StatelessValidation::PreCallValidateAntiLagUpdateAMD(VkDevice device, const VkAntiLagDataAMD* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_amd_anti_lag)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_anti_lag}); - skip |= ValidateStructType(loc.dot(Field::pData), pData, VK_STRUCTURE_TYPE_ANTI_LAG_DATA_AMD, true, - "VUID-vkAntiLagUpdateAMD-pData-parameter", "VUID-VkAntiLagDataAMD-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pData), pData, VK_STRUCTURE_TYPE_ANTI_LAG_DATA_AMD, true, + "VUID-vkAntiLagUpdateAMD-pData-parameter", "VUID-VkAntiLagDataAMD-sType-sType"); if (pData != nullptr) { [[maybe_unused]] const Location pData_loc = loc.dot(Field::pData); - skip |= ValidateRangedEnum(pData_loc.dot(Field::mode), vvl::Enum::VkAntiLagModeAMD, pData->mode, - "VUID-VkAntiLagDataAMD-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pData_loc.dot(Field::mode), vvl::Enum::VkAntiLagModeAMD, pData->mode, + "VUID-VkAntiLagDataAMD-mode-parameter"); - skip |= ValidateStructType( + skip |= state.ValidateStructType( pData_loc.dot(Field::pPresentationInfo), pData->pPresentationInfo, VK_STRUCTURE_TYPE_ANTI_LAG_PRESENTATION_INFO_AMD, false, "VUID-VkAntiLagDataAMD-pPresentationInfo-parameter", "VUID-VkAntiLagPresentationInfoAMD-sType-sType"); if (pData->pPresentationInfo != nullptr) { [[maybe_unused]] const Location pPresentationInfo_loc = pData_loc.dot(Field::pPresentationInfo); - skip |= ValidateRangedEnum(pPresentationInfo_loc.dot(Field::stage), vvl::Enum::VkAntiLagStageAMD, - pData->pPresentationInfo->stage, "VUID-VkAntiLagPresentationInfoAMD-stage-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pPresentationInfo_loc.dot(Field::stage), vvl::Enum::VkAntiLagStageAMD, + pData->pPresentationInfo->stage, "VUID-VkAntiLagPresentationInfoAMD-stage-parameter"); } } return skip; @@ -26378,13 +29077,14 @@ bool StatelessValidation::PreCallValidateCreateShadersEXT(VkDevice device, uint3 const VkAllocationCallbacks* pAllocator, VkShaderEXT* pShaders, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_shader_object)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateStructTypeArray(loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, pCreateInfos, - VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT, true, true, "VUID-VkShaderCreateInfoEXT-sType-sType", - "VUID-vkCreateShadersEXT-pCreateInfos-parameter", - "VUID-vkCreateShadersEXT-createInfoCount-arraylength"); + skip |= state.ValidateStructTypeArray( + loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, pCreateInfos, + VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT, true, true, "VUID-VkShaderCreateInfoEXT-sType-sType", + "VUID-vkCreateShadersEXT-pCreateInfos-parameter", "VUID-vkCreateShadersEXT-createInfoCount-arraylength"); if (pCreateInfos != nullptr) { for (uint32_t createInfoIndex = 0; createInfoIndex < createInfoCount; ++createInfoIndex) { [[maybe_unused]] const Location pCreateInfos_loc = loc.dot(Field::pCreateInfos, createInfoIndex); @@ -26392,51 +29092,52 @@ bool StatelessValidation::PreCallValidateCreateShadersEXT(VkDevice device, uint3 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT}; - skip |= ValidateStructPnext(pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, - allowed_structs_VkShaderCreateInfoEXT.size(), allowed_structs_VkShaderCreateInfoEXT.data(), - GeneratedVulkanHeaderVersion, "VUID-VkShaderCreateInfoEXT-pNext-pNext", - "VUID-VkShaderCreateInfoEXT-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, allowed_structs_VkShaderCreateInfoEXT.size(), + allowed_structs_VkShaderCreateInfoEXT.data(), GeneratedVulkanHeaderVersion, + "VUID-VkShaderCreateInfoEXT-pNext-pNext", "VUID-VkShaderCreateInfoEXT-sType-unique", true); - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkShaderCreateFlagBitsEXT, - AllVkShaderCreateFlagBitsEXT, pCreateInfos[createInfoIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkShaderCreateInfoEXT-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkShaderCreateFlagBitsEXT, + AllVkShaderCreateFlagBitsEXT, pCreateInfos[createInfoIndex].flags, kOptionalFlags, + "VUID-VkShaderCreateInfoEXT-flags-parameter"); - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].stage, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkShaderCreateInfoEXT-stage-parameter", "VUID-VkShaderCreateInfoEXT-stage-parameter"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].stage, kRequiredSingleBit, + "VUID-VkShaderCreateInfoEXT-stage-parameter", "VUID-VkShaderCreateInfoEXT-stage-parameter"); - skip |= ValidateFlags(pCreateInfos_loc.dot(Field::nextStage), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].nextStage, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkShaderCreateInfoEXT-nextStage-parameter"); + skip |= state.ValidateFlags(pCreateInfos_loc.dot(Field::nextStage), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].nextStage, kOptionalFlags, + "VUID-VkShaderCreateInfoEXT-nextStage-parameter"); - skip |= ValidateRangedEnum(pCreateInfos_loc.dot(Field::codeType), vvl::Enum::VkShaderCodeTypeEXT, - pCreateInfos[createInfoIndex].codeType, "VUID-VkShaderCreateInfoEXT-codeType-parameter", - VK_NULL_HANDLE); + skip |= + state.ValidateRangedEnum(pCreateInfos_loc.dot(Field::codeType), vvl::Enum::VkShaderCodeTypeEXT, + pCreateInfos[createInfoIndex].codeType, "VUID-VkShaderCreateInfoEXT-codeType-parameter"); - skip |= ValidateArray(pCreateInfos_loc.dot(Field::codeSize), pCreateInfos_loc.dot(Field::pCode), - pCreateInfos[createInfoIndex].codeSize, &pCreateInfos[createInfoIndex].pCode, true, true, - "VUID-VkShaderCreateInfoEXT-codeSize-arraylength", "VUID-VkShaderCreateInfoEXT-pCode-parameter"); + skip |= state.ValidateArray(pCreateInfos_loc.dot(Field::codeSize), pCreateInfos_loc.dot(Field::pCode), + pCreateInfos[createInfoIndex].codeSize, &pCreateInfos[createInfoIndex].pCode, true, true, + "VUID-VkShaderCreateInfoEXT-codeSize-arraylength", + "VUID-VkShaderCreateInfoEXT-pCode-parameter"); if (pCreateInfos[createInfoIndex].pPushConstantRanges != nullptr) { for (uint32_t pushConstantRangeIndex = 0; pushConstantRangeIndex < pCreateInfos[createInfoIndex].pushConstantRangeCount; ++pushConstantRangeIndex) { [[maybe_unused]] const Location pPushConstantRanges_loc = pCreateInfos_loc.dot(Field::pPushConstantRanges, pushConstantRangeIndex); - skip |= ValidateFlags(pPushConstantRanges_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, - pCreateInfos[createInfoIndex].pPushConstantRanges[pushConstantRangeIndex].stageFlags, - kRequiredFlags, VK_NULL_HANDLE, "VUID-VkPushConstantRange-stageFlags-parameter", - "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); + skip |= state.ValidateFlags( + pPushConstantRanges_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, + pCreateInfos[createInfoIndex].pPushConstantRanges[pushConstantRangeIndex].stageFlags, kRequiredFlags, + "VUID-VkPushConstantRange-stageFlags-parameter", "VUID-VkPushConstantRange-stageFlags-requiredbitmask"); } } if (pCreateInfos[createInfoIndex].pSpecializationInfo != nullptr) { [[maybe_unused]] const Location pSpecializationInfo_loc = pCreateInfos_loc.dot(Field::pSpecializationInfo); - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), - pSpecializationInfo_loc.dot(Field::pMapEntries), - pCreateInfos[createInfoIndex].pSpecializationInfo->mapEntryCount, - &pCreateInfos[createInfoIndex].pSpecializationInfo->pMapEntries, false, true, kVUIDUndefined, - "VUID-VkSpecializationInfo-pMapEntries-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), + pSpecializationInfo_loc.dot(Field::pMapEntries), + pCreateInfos[createInfoIndex].pSpecializationInfo->mapEntryCount, + &pCreateInfos[createInfoIndex].pSpecializationInfo->pMapEntries, false, true, + kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); if (pCreateInfos[createInfoIndex].pSpecializationInfo->pMapEntries != nullptr) { for (uint32_t mapEntryIndex = 0; @@ -26447,21 +29148,21 @@ bool StatelessValidation::PreCallValidateCreateShadersEXT(VkDevice device, uint3 } } - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), - pCreateInfos[createInfoIndex].pSpecializationInfo->dataSize, - &pCreateInfos[createInfoIndex].pSpecializationInfo->pData, false, true, kVUIDUndefined, - "VUID-VkSpecializationInfo-pData-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), + pCreateInfos[createInfoIndex].pSpecializationInfo->dataSize, + &pCreateInfos[createInfoIndex].pSpecializationInfo->pData, false, true, kVUIDUndefined, + "VUID-VkSpecializationInfo-pData-parameter"); } } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pShaders), createInfoCount, &pShaders, true, true, - "VUID-vkCreateShadersEXT-createInfoCount-arraylength", "VUID-vkCreateShadersEXT-pShaders-parameter"); - if (!skip) - skip |= manual_PreCallValidateCreateShadersEXT(device, createInfoCount, pCreateInfos, pAllocator, pShaders, error_obj); + skip |= + state.ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pShaders), createInfoCount, &pShaders, true, true, + "VUID-vkCreateShadersEXT-createInfoCount-arraylength", "VUID-vkCreateShadersEXT-pShaders-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateShadersEXT(device, createInfoCount, pCreateInfos, pAllocator, pShaders, state); return skip; } @@ -26469,12 +29170,13 @@ bool StatelessValidation::PreCallValidateDestroyShaderEXT(VkDevice device, VkSha const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_shader_object)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_object}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -26482,14 +29184,15 @@ bool StatelessValidation::PreCallValidateDestroyShaderEXT(VkDevice device, VkSha bool StatelessValidation::PreCallValidateGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t* pDataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_shader_object)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateRequiredHandle(loc.dot(Field::shader), shader); - skip |= ValidatePointerArray(loc.dot(Field::pDataSize), loc.dot(Field::pData), pDataSize, &pData, true, false, false, - "VUID-vkGetShaderBinaryDataEXT-pDataSize-parameter", kVUIDUndefined, - "VUID-vkGetShaderBinaryDataEXT-pData-parameter"); - if (!skip) skip |= manual_PreCallValidateGetShaderBinaryDataEXT(device, shader, pDataSize, pData, error_obj); + skip |= state.ValidateRequiredHandle(loc.dot(Field::shader), shader); + skip |= state.ValidatePointerArray(loc.dot(Field::pDataSize), loc.dot(Field::pData), pDataSize, &pData, true, false, false, + "VUID-vkGetShaderBinaryDataEXT-pDataSize-parameter", kVUIDUndefined, + "VUID-vkGetShaderBinaryDataEXT-pData-parameter"); + if (!skip) skip |= manual_PreCallValidateGetShaderBinaryDataEXT(device, shader, pDataSize, pData, state); return skip; } @@ -26497,13 +29200,14 @@ bool StatelessValidation::PreCallValidateCmdBindShadersEXT(VkCommandBuffer comma const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_shader_object)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_object}); - skip |= ValidateArray(loc.dot(Field::stageCount), loc.dot(Field::pStages), stageCount, &pStages, true, true, - "VUID-vkCmdBindShadersEXT-stageCount-arraylength", "VUID-vkCmdBindShadersEXT-pStages-parameter"); - skip |= ValidateArray(loc.dot(Field::stageCount), loc.dot(Field::pShaders), stageCount, &pShaders, true, false, - "VUID-vkCmdBindShadersEXT-stageCount-arraylength", "VUID-vkCmdBindShadersEXT-pShaders-parameter"); + skip |= state.ValidateArray(loc.dot(Field::stageCount), loc.dot(Field::pStages), stageCount, &pStages, true, true, + "VUID-vkCmdBindShadersEXT-stageCount-arraylength", "VUID-vkCmdBindShadersEXT-pStages-parameter"); + skip |= state.ValidateArray(loc.dot(Field::stageCount), loc.dot(Field::pShaders), stageCount, &pShaders, true, false, + "VUID-vkCmdBindShadersEXT-stageCount-arraylength", "VUID-vkCmdBindShadersEXT-pShaders-parameter"); return skip; } @@ -26511,12 +29215,13 @@ bool StatelessValidation::PreCallValidateCmdSetDepthClampRangeEXT(VkCommandBuffe const VkDepthClampRangeEXT* pDepthClampRange, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!(IsExtEnabled(device_extensions.vk_ext_shader_object) || IsExtEnabled(device_extensions.vk_ext_depth_clamp_control))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_object, vvl::Extension::_VK_EXT_depth_clamp_control}); - skip |= ValidateRangedEnum(loc.dot(Field::depthClampMode), vvl::Enum::VkDepthClampModeEXT, depthClampMode, - "VUID-vkCmdSetDepthClampRangeEXT-depthClampMode-parameter", VK_NULL_HANDLE); - if (!skip) skip |= manual_PreCallValidateCmdSetDepthClampRangeEXT(commandBuffer, depthClampMode, pDepthClampRange, error_obj); + skip |= state.ValidateRangedEnum(loc.dot(Field::depthClampMode), vvl::Enum::VkDepthClampModeEXT, depthClampMode, + "VUID-vkCmdSetDepthClampRangeEXT-depthClampMode-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdSetDepthClampRangeEXT(commandBuffer, depthClampMode, pDepthClampRange, state); return skip; } @@ -26525,20 +29230,21 @@ bool StatelessValidation::PreCallValidateGetFramebufferTilePropertiesQCOM(VkDevi VkTilePropertiesQCOM* pProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_qcom_tile_properties)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_QCOM_tile_properties}); - skip |= ValidateRequiredHandle(loc.dot(Field::framebuffer), framebuffer); - skip |= ValidateStructTypeArray(loc.dot(Field::pPropertiesCount), loc.dot(Field::pProperties), pPropertiesCount, pProperties, - VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM, true, false, false, - "VUID-VkTilePropertiesQCOM-sType-sType", kVUIDUndefined, - "VUID-vkGetFramebufferTilePropertiesQCOM-pPropertiesCount-parameter", kVUIDUndefined); + skip |= state.ValidateRequiredHandle(loc.dot(Field::framebuffer), framebuffer); + skip |= state.ValidateStructTypeArray(loc.dot(Field::pPropertiesCount), loc.dot(Field::pProperties), pPropertiesCount, + pProperties, VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM, true, false, false, + "VUID-VkTilePropertiesQCOM-sType-sType", kVUIDUndefined, + "VUID-vkGetFramebufferTilePropertiesQCOM-pPropertiesCount-parameter", kVUIDUndefined); if (pProperties != nullptr) { for (uint32_t pPropertiesIndex = 0; pPropertiesIndex < *pPropertiesCount; ++pPropertiesIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertiesIndex); - skip |= - ValidateStructPnext(pProperties_loc, pProperties[pPropertiesIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkTilePropertiesQCOM-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties[pPropertiesIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkTilePropertiesQCOM-pNext-pNext", kVUIDUndefined, + false); // No xml-driven validation @@ -26555,12 +29261,13 @@ bool StatelessValidation::PreCallValidateGetDynamicRenderingTilePropertiesQCOM(V VkTilePropertiesQCOM* pProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_qcom_tile_properties)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_QCOM_tile_properties}); - skip |= ValidateStructType(loc.dot(Field::pRenderingInfo), pRenderingInfo, VK_STRUCTURE_TYPE_RENDERING_INFO, true, - "VUID-vkGetDynamicRenderingTilePropertiesQCOM-pRenderingInfo-parameter", - "VUID-VkRenderingInfo-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pRenderingInfo), pRenderingInfo, VK_STRUCTURE_TYPE_RENDERING_INFO, true, + "VUID-vkGetDynamicRenderingTilePropertiesQCOM-pRenderingInfo-parameter", + "VUID-VkRenderingInfo-sType-sType"); if (pRenderingInfo != nullptr) { [[maybe_unused]] const Location pRenderingInfo_loc = loc.dot(Field::pRenderingInfo); constexpr std::array allowed_structs_VkRenderingInfo = { @@ -26572,130 +29279,133 @@ bool StatelessValidation::PreCallValidateGetDynamicRenderingTilePropertiesQCOM(V VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT, VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR}; - skip |= ValidateStructPnext(pRenderingInfo_loc, pRenderingInfo->pNext, allowed_structs_VkRenderingInfo.size(), - allowed_structs_VkRenderingInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkRenderingInfo-pNext-pNext", "VUID-VkRenderingInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pRenderingInfo_loc, pRenderingInfo->pNext, allowed_structs_VkRenderingInfo.size(), + allowed_structs_VkRenderingInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkRenderingInfo-pNext-pNext", "VUID-VkRenderingInfo-sType-unique", true); - skip |= ValidateFlags(pRenderingInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderingFlagBits, AllVkRenderingFlagBits, - pRenderingInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkRenderingInfo-flags-parameter"); + skip |= + state.ValidateFlags(pRenderingInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderingFlagBits, AllVkRenderingFlagBits, + pRenderingInfo->flags, kOptionalFlags, "VUID-VkRenderingInfo-flags-parameter"); // No xml-driven validation // No xml-driven validation - skip |= ValidateStructTypeArray(pRenderingInfo_loc.dot(Field::colorAttachmentCount), - pRenderingInfo_loc.dot(Field::pColorAttachments), pRenderingInfo->colorAttachmentCount, - pRenderingInfo->pColorAttachments, VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, true, - "VUID-VkRenderingAttachmentInfo-sType-sType", - "VUID-VkRenderingInfo-pColorAttachments-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + pRenderingInfo_loc.dot(Field::colorAttachmentCount), pRenderingInfo_loc.dot(Field::pColorAttachments), + pRenderingInfo->colorAttachmentCount, pRenderingInfo->pColorAttachments, VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, + false, true, "VUID-VkRenderingAttachmentInfo-sType-sType", "VUID-VkRenderingInfo-pColorAttachments-parameter", + kVUIDUndefined); if (pRenderingInfo->pColorAttachments != nullptr) { for (uint32_t colorAttachmentIndex = 0; colorAttachmentIndex < pRenderingInfo->colorAttachmentCount; ++colorAttachmentIndex) { [[maybe_unused]] const Location pColorAttachments_loc = pRenderingInfo_loc.dot(Field::pColorAttachments, colorAttachmentIndex); - skip |= ValidateStructPnext(pColorAttachments_loc, pRenderingInfo->pColorAttachments[colorAttachmentIndex].pNext, 0, - nullptr, GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pColorAttachments_loc, pRenderingInfo->pColorAttachments[colorAttachmentIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pColorAttachments_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pColorAttachments[colorAttachmentIndex].imageLayout, - "VUID-VkRenderingAttachmentInfo-imageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorAttachments_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].imageLayout, + "VUID-VkRenderingAttachmentInfo-imageLayout-parameter"); - skip |= ValidateFlags(pColorAttachments_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, - AllVkResolveModeFlagBits, pRenderingInfo->pColorAttachments[colorAttachmentIndex].resolveMode, - kOptionalSingleBit, VK_NULL_HANDLE, "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); + skip |= state.ValidateFlags(pColorAttachments_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, + AllVkResolveModeFlagBits, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].resolveMode, kOptionalSingleBit, + "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); - skip |= ValidateRangedEnum(pColorAttachments_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pColorAttachments[colorAttachmentIndex].resolveImageLayout, - "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorAttachments_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].resolveImageLayout, + "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter"); - skip |= ValidateRangedEnum(pColorAttachments_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, - pRenderingInfo->pColorAttachments[colorAttachmentIndex].loadOp, - "VUID-VkRenderingAttachmentInfo-loadOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorAttachments_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].loadOp, + "VUID-VkRenderingAttachmentInfo-loadOp-parameter"); - skip |= ValidateRangedEnum(pColorAttachments_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, - pRenderingInfo->pColorAttachments[colorAttachmentIndex].storeOp, - "VUID-VkRenderingAttachmentInfo-storeOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pColorAttachments_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, + pRenderingInfo->pColorAttachments[colorAttachmentIndex].storeOp, + "VUID-VkRenderingAttachmentInfo-storeOp-parameter"); // No xml-driven validation } } - skip |= ValidateStructType(pRenderingInfo_loc.dot(Field::pDepthAttachment), pRenderingInfo->pDepthAttachment, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, - "VUID-VkRenderingInfo-pDepthAttachment-parameter", "VUID-VkRenderingAttachmentInfo-sType-sType"); + skip |= state.ValidateStructType(pRenderingInfo_loc.dot(Field::pDepthAttachment), pRenderingInfo->pDepthAttachment, + VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, + "VUID-VkRenderingInfo-pDepthAttachment-parameter", + "VUID-VkRenderingAttachmentInfo-sType-sType"); if (pRenderingInfo->pDepthAttachment != nullptr) { [[maybe_unused]] const Location pDepthAttachment_loc = pRenderingInfo_loc.dot(Field::pDepthAttachment); - skip |= ValidateStructPnext(pDepthAttachment_loc, pRenderingInfo->pDepthAttachment->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDepthAttachment_loc, pRenderingInfo->pDepthAttachment->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pDepthAttachment_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pDepthAttachment->imageLayout, - "VUID-VkRenderingAttachmentInfo-imageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthAttachment_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pDepthAttachment->imageLayout, + "VUID-VkRenderingAttachmentInfo-imageLayout-parameter"); - skip |= ValidateFlags(pDepthAttachment_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, - AllVkResolveModeFlagBits, pRenderingInfo->pDepthAttachment->resolveMode, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); + skip |= state.ValidateFlags(pDepthAttachment_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, + AllVkResolveModeFlagBits, pRenderingInfo->pDepthAttachment->resolveMode, kOptionalSingleBit, + "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); - skip |= ValidateRangedEnum(pDepthAttachment_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pDepthAttachment->resolveImageLayout, - "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthAttachment_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pDepthAttachment->resolveImageLayout, + "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter"); - skip |= ValidateRangedEnum(pDepthAttachment_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, - pRenderingInfo->pDepthAttachment->loadOp, "VUID-VkRenderingAttachmentInfo-loadOp-parameter", - VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthAttachment_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, + pRenderingInfo->pDepthAttachment->loadOp, + "VUID-VkRenderingAttachmentInfo-loadOp-parameter"); - skip |= ValidateRangedEnum(pDepthAttachment_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, - pRenderingInfo->pDepthAttachment->storeOp, - "VUID-VkRenderingAttachmentInfo-storeOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pDepthAttachment_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, + pRenderingInfo->pDepthAttachment->storeOp, + "VUID-VkRenderingAttachmentInfo-storeOp-parameter"); // No xml-driven validation } - skip |= - ValidateStructType(pRenderingInfo_loc.dot(Field::pStencilAttachment), pRenderingInfo->pStencilAttachment, - VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, - "VUID-VkRenderingInfo-pStencilAttachment-parameter", "VUID-VkRenderingAttachmentInfo-sType-sType"); + skip |= state.ValidateStructType(pRenderingInfo_loc.dot(Field::pStencilAttachment), pRenderingInfo->pStencilAttachment, + VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, false, + "VUID-VkRenderingInfo-pStencilAttachment-parameter", + "VUID-VkRenderingAttachmentInfo-sType-sType"); if (pRenderingInfo->pStencilAttachment != nullptr) { [[maybe_unused]] const Location pStencilAttachment_loc = pRenderingInfo_loc.dot(Field::pStencilAttachment); - skip |= ValidateStructPnext(pStencilAttachment_loc, pRenderingInfo->pStencilAttachment->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pStencilAttachment_loc, pRenderingInfo->pStencilAttachment->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkRenderingAttachmentInfo-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRangedEnum(pStencilAttachment_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pStencilAttachment->imageLayout, - "VUID-VkRenderingAttachmentInfo-imageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pStencilAttachment_loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pStencilAttachment->imageLayout, + "VUID-VkRenderingAttachmentInfo-imageLayout-parameter"); - skip |= ValidateFlags(pStencilAttachment_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, - AllVkResolveModeFlagBits, pRenderingInfo->pStencilAttachment->resolveMode, kOptionalSingleBit, - VK_NULL_HANDLE, "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); + skip |= state.ValidateFlags(pStencilAttachment_loc.dot(Field::resolveMode), vvl::FlagBitmask::VkResolveModeFlagBits, + AllVkResolveModeFlagBits, pRenderingInfo->pStencilAttachment->resolveMode, + kOptionalSingleBit, "VUID-VkRenderingAttachmentInfo-resolveMode-parameter"); - skip |= ValidateRangedEnum(pStencilAttachment_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, - pRenderingInfo->pStencilAttachment->resolveImageLayout, - "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pStencilAttachment_loc.dot(Field::resolveImageLayout), vvl::Enum::VkImageLayout, + pRenderingInfo->pStencilAttachment->resolveImageLayout, + "VUID-VkRenderingAttachmentInfo-resolveImageLayout-parameter"); - skip |= ValidateRangedEnum(pStencilAttachment_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, - pRenderingInfo->pStencilAttachment->loadOp, - "VUID-VkRenderingAttachmentInfo-loadOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pStencilAttachment_loc.dot(Field::loadOp), vvl::Enum::VkAttachmentLoadOp, + pRenderingInfo->pStencilAttachment->loadOp, + "VUID-VkRenderingAttachmentInfo-loadOp-parameter"); - skip |= ValidateRangedEnum(pStencilAttachment_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, - pRenderingInfo->pStencilAttachment->storeOp, - "VUID-VkRenderingAttachmentInfo-storeOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pStencilAttachment_loc.dot(Field::storeOp), vvl::Enum::VkAttachmentStoreOp, + pRenderingInfo->pStencilAttachment->storeOp, + "VUID-VkRenderingAttachmentInfo-storeOp-parameter"); // No xml-driven validation } } - skip |= ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM, true, - "VUID-vkGetDynamicRenderingTilePropertiesQCOM-pProperties-parameter", - "VUID-VkTilePropertiesQCOM-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM, true, + "VUID-vkGetDynamicRenderingTilePropertiesQCOM-pProperties-parameter", + "VUID-VkTilePropertiesQCOM-sType-sType"); if (pProperties != nullptr) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties); - skip |= ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkTilePropertiesQCOM-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkTilePropertiesQCOM-pNext-pNext", kVUIDUndefined, false); // No xml-driven validation @@ -26710,18 +29420,19 @@ bool StatelessValidation::PreCallValidateSetLatencySleepModeNV(VkDevice device, const VkLatencySleepModeInfoNV* pSleepModeInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= - ValidateStructType(loc.dot(Field::pSleepModeInfo), pSleepModeInfo, VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV, true, - "VUID-vkSetLatencySleepModeNV-pSleepModeInfo-parameter", "VUID-VkLatencySleepModeInfoNV-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateStructType(loc.dot(Field::pSleepModeInfo), pSleepModeInfo, VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV, + true, "VUID-vkSetLatencySleepModeNV-pSleepModeInfo-parameter", + "VUID-VkLatencySleepModeInfoNV-sType-sType"); if (pSleepModeInfo != nullptr) { [[maybe_unused]] const Location pSleepModeInfo_loc = loc.dot(Field::pSleepModeInfo); - skip |= ValidateBool32(pSleepModeInfo_loc.dot(Field::lowLatencyMode), pSleepModeInfo->lowLatencyMode); + skip |= state.ValidateBool32(pSleepModeInfo_loc.dot(Field::lowLatencyMode), pSleepModeInfo->lowLatencyMode); - skip |= ValidateBool32(pSleepModeInfo_loc.dot(Field::lowLatencyBoost), pSleepModeInfo->lowLatencyBoost); + skip |= state.ValidateBool32(pSleepModeInfo_loc.dot(Field::lowLatencyBoost), pSleepModeInfo->lowLatencyBoost); } return skip; } @@ -26730,15 +29441,16 @@ bool StatelessValidation::PreCallValidateLatencySleepNV(VkDevice device, VkSwapc const VkLatencySleepInfoNV* pSleepInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= ValidateStructType(loc.dot(Field::pSleepInfo), pSleepInfo, VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV, true, - "VUID-vkLatencySleepNV-pSleepInfo-parameter", "VUID-VkLatencySleepInfoNV-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateStructType(loc.dot(Field::pSleepInfo), pSleepInfo, VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV, true, + "VUID-vkLatencySleepNV-pSleepInfo-parameter", "VUID-VkLatencySleepInfoNV-sType-sType"); if (pSleepInfo != nullptr) { [[maybe_unused]] const Location pSleepInfo_loc = loc.dot(Field::pSleepInfo); - skip |= ValidateRequiredHandle(pSleepInfo_loc.dot(Field::signalSemaphore), pSleepInfo->signalSemaphore); + skip |= state.ValidateRequiredHandle(pSleepInfo_loc.dot(Field::signalSemaphore), pSleepInfo->signalSemaphore); } return skip; } @@ -26747,17 +29459,18 @@ bool StatelessValidation::PreCallValidateSetLatencyMarkerNV(VkDevice device, VkS const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= ValidateStructType(loc.dot(Field::pLatencyMarkerInfo), pLatencyMarkerInfo, VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV, - true, "VUID-vkSetLatencyMarkerNV-pLatencyMarkerInfo-parameter", - "VUID-VkSetLatencyMarkerInfoNV-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateStructType( + loc.dot(Field::pLatencyMarkerInfo), pLatencyMarkerInfo, VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV, true, + "VUID-vkSetLatencyMarkerNV-pLatencyMarkerInfo-parameter", "VUID-VkSetLatencyMarkerInfoNV-sType-sType"); if (pLatencyMarkerInfo != nullptr) { [[maybe_unused]] const Location pLatencyMarkerInfo_loc = loc.dot(Field::pLatencyMarkerInfo); - skip |= ValidateRangedEnum(pLatencyMarkerInfo_loc.dot(Field::marker), vvl::Enum::VkLatencyMarkerNV, - pLatencyMarkerInfo->marker, "VUID-VkSetLatencyMarkerInfoNV-marker-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pLatencyMarkerInfo_loc.dot(Field::marker), vvl::Enum::VkLatencyMarkerNV, + pLatencyMarkerInfo->marker, "VUID-VkSetLatencyMarkerInfoNV-marker-parameter"); } return skip; } @@ -26766,19 +29479,20 @@ bool StatelessValidation::PreCallValidateGetLatencyTimingsNV(VkDevice device, Vk VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); - skip |= ValidateStructType(loc.dot(Field::pLatencyMarkerInfo), pLatencyMarkerInfo, VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV, - true, "VUID-vkGetLatencyTimingsNV-pLatencyMarkerInfo-parameter", - "VUID-VkGetLatencyMarkerInfoNV-sType-sType"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= state.ValidateStructType( + loc.dot(Field::pLatencyMarkerInfo), pLatencyMarkerInfo, VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV, true, + "VUID-vkGetLatencyTimingsNV-pLatencyMarkerInfo-parameter", "VUID-VkGetLatencyMarkerInfoNV-sType-sType"); if (pLatencyMarkerInfo != nullptr) { [[maybe_unused]] const Location pLatencyMarkerInfo_loc = loc.dot(Field::pLatencyMarkerInfo); - skip |= ValidateStructTypeArray(pLatencyMarkerInfo_loc.dot(Field::timingCount), pLatencyMarkerInfo_loc.dot(Field::pTimings), - pLatencyMarkerInfo->timingCount, pLatencyMarkerInfo->pTimings, - VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV, false, false, - "VUID-VkLatencyTimingsFrameReportNV-sType-sType", kVUIDUndefined, kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + pLatencyMarkerInfo_loc.dot(Field::timingCount), pLatencyMarkerInfo_loc.dot(Field::pTimings), + pLatencyMarkerInfo->timingCount, pLatencyMarkerInfo->pTimings, VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV, false, + false, "VUID-VkLatencyTimingsFrameReportNV-sType-sType", kVUIDUndefined, kVUIDUndefined); if (pLatencyMarkerInfo->pTimings != nullptr) { for (uint32_t timingIndex = 0; timingIndex < pLatencyMarkerInfo->timingCount; ++timingIndex) { @@ -26793,17 +29507,17 @@ bool StatelessValidation::PreCallValidateGetLatencyTimingsNV(VkDevice device, Vk bool StatelessValidation::PreCallValidateQueueNotifyOutOfBandNV(VkQueue queue, const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); - skip |= - ValidateStructType(loc.dot(Field::pQueueTypeInfo), pQueueTypeInfo, VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV, true, - "VUID-vkQueueNotifyOutOfBandNV-pQueueTypeInfo-parameter", "VUID-VkOutOfBandQueueTypeInfoNV-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pQueueTypeInfo), pQueueTypeInfo, VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV, true, + "VUID-vkQueueNotifyOutOfBandNV-pQueueTypeInfo-parameter", "VUID-VkOutOfBandQueueTypeInfoNV-sType-sType"); if (pQueueTypeInfo != nullptr) { [[maybe_unused]] const Location pQueueTypeInfo_loc = loc.dot(Field::pQueueTypeInfo); - skip |= - ValidateRangedEnum(pQueueTypeInfo_loc.dot(Field::queueType), vvl::Enum::VkOutOfBandQueueTypeNV, - pQueueTypeInfo->queueType, "VUID-VkOutOfBandQueueTypeInfoNV-queueType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pQueueTypeInfo_loc.dot(Field::queueType), vvl::Enum::VkOutOfBandQueueTypeNV, + pQueueTypeInfo->queueType, "VUID-VkOutOfBandQueueTypeInfoNV-queueType-parameter"); } return skip; } @@ -26812,11 +29526,12 @@ bool StatelessValidation::PreCallValidateCmdSetAttachmentFeedbackLoopEnableEXT(V VkImageAspectFlags aspectMask, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_dynamic_state)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_attachment_feedback_loop_dynamic_state}); - skip |= ValidateFlags(loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, aspectMask, - kOptionalFlags, VK_NULL_HANDLE, "VUID-vkCmdSetAttachmentFeedbackLoopEnableEXT-aspectMask-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, + aspectMask, kOptionalFlags, "VUID-vkCmdSetAttachmentFeedbackLoopEnableEXT-aspectMask-parameter"); return skip; } @@ -26825,21 +29540,22 @@ bool StatelessValidation::PreCallValidateGetScreenBufferPropertiesQNX(VkDevice d VkScreenBufferPropertiesQNX* pProperties, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_qnx_external_memory_screen_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_QNX_external_memory_screen_buffer}); - skip |= ValidateRequiredPointer(loc.dot(Field::buffer), buffer, "VUID-vkGetScreenBufferPropertiesQNX-buffer-parameter"); - skip |= ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX, true, - "VUID-vkGetScreenBufferPropertiesQNX-pProperties-parameter", - "VUID-VkScreenBufferPropertiesQNX-sType-sType"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::buffer), buffer, "VUID-vkGetScreenBufferPropertiesQNX-buffer-parameter"); + skip |= state.ValidateStructType(loc.dot(Field::pProperties), pProperties, VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX, true, + "VUID-vkGetScreenBufferPropertiesQNX-pProperties-parameter", + "VUID-VkScreenBufferPropertiesQNX-sType-sType"); if (pProperties != nullptr) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties); constexpr std::array allowed_structs_VkScreenBufferPropertiesQNX = {VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX}; - skip |= ValidateStructPnext(pProperties_loc, pProperties->pNext, allowed_structs_VkScreenBufferPropertiesQNX.size(), - allowed_structs_VkScreenBufferPropertiesQNX.data(), GeneratedVulkanHeaderVersion, - "VUID-VkScreenBufferPropertiesQNX-pNext-pNext", "VUID-VkScreenBufferPropertiesQNX-sType-unique", - VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pProperties_loc, pProperties->pNext, allowed_structs_VkScreenBufferPropertiesQNX.size(), + allowed_structs_VkScreenBufferPropertiesQNX.data(), GeneratedVulkanHeaderVersion, + "VUID-VkScreenBufferPropertiesQNX-pNext-pNext", + "VUID-VkScreenBufferPropertiesQNX-sType-unique", false); } return skip; } @@ -26849,35 +29565,38 @@ bool StatelessValidation::PreCallValidateGetGeneratedCommandsMemoryRequirementsE VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoEXT* pInfo, VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_EXT, - true, "VUID-vkGetGeneratedCommandsMemoryRequirementsEXT-pInfo-parameter", - "VUID-VkGeneratedCommandsMemoryRequirementsInfoEXT-sType-sType"); + skip |= + state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_EXT, + true, "VUID-vkGetGeneratedCommandsMemoryRequirementsEXT-pInfo-parameter", + "VUID-VkGeneratedCommandsMemoryRequirementsInfoEXT-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); constexpr std::array allowed_structs_VkGeneratedCommandsMemoryRequirementsInfoEXT = { VK_STRUCTURE_TYPE_GENERATED_COMMANDS_PIPELINE_INFO_EXT, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_SHADER_INFO_EXT}; - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, allowed_structs_VkGeneratedCommandsMemoryRequirementsInfoEXT.size(), - allowed_structs_VkGeneratedCommandsMemoryRequirementsInfoEXT.data(), - GeneratedVulkanHeaderVersion, "VUID-VkGeneratedCommandsMemoryRequirementsInfoEXT-pNext-pNext", - "VUID-VkGeneratedCommandsMemoryRequirementsInfoEXT-sType-unique", VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(pInfo_loc, pInfo->pNext, allowed_structs_VkGeneratedCommandsMemoryRequirementsInfoEXT.size(), + allowed_structs_VkGeneratedCommandsMemoryRequirementsInfoEXT.data(), + GeneratedVulkanHeaderVersion, "VUID-VkGeneratedCommandsMemoryRequirementsInfoEXT-pNext-pNext", + "VUID-VkGeneratedCommandsMemoryRequirementsInfoEXT-sType-unique", true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::indirectCommandsLayout), pInfo->indirectCommandsLayout); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::indirectCommandsLayout), pInfo->indirectCommandsLayout); } - skip |= ValidateStructType(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - true, "VUID-vkGetGeneratedCommandsMemoryRequirementsEXT-pMemoryRequirements-parameter", - "VUID-VkMemoryRequirements2-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pMemoryRequirements), pMemoryRequirements, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, true, + "VUID-vkGetGeneratedCommandsMemoryRequirementsEXT-pMemoryRequirements-parameter", "VUID-VkMemoryRequirements2-sType-sType"); if (pMemoryRequirements != nullptr) { [[maybe_unused]] const Location pMemoryRequirements_loc = loc.dot(Field::pMemoryRequirements); constexpr std::array allowed_structs_VkMemoryRequirements2 = {VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS}; - skip |= ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements->pNext, - allowed_structs_VkMemoryRequirements2.size(), allowed_structs_VkMemoryRequirements2.data(), - GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", - "VUID-VkMemoryRequirements2-sType-unique", VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext( + pMemoryRequirements_loc, pMemoryRequirements->pNext, allowed_structs_VkMemoryRequirements2.size(), + allowed_structs_VkMemoryRequirements2.data(), GeneratedVulkanHeaderVersion, "VUID-VkMemoryRequirements2-pNext-pNext", + "VUID-VkMemoryRequirements2-sType-unique", false); } return skip; } @@ -26887,26 +29606,27 @@ bool StatelessValidation::PreCallValidateCmdPreprocessGeneratedCommandsEXT(VkCom VkCommandBuffer stateCommandBuffer, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); - skip |= ValidateStructType( + skip |= state.ValidateStructType( loc.dot(Field::pGeneratedCommandsInfo), pGeneratedCommandsInfo, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_EXT, true, "VUID-vkCmdPreprocessGeneratedCommandsEXT-pGeneratedCommandsInfo-parameter", "VUID-VkGeneratedCommandsInfoEXT-sType-sType"); if (pGeneratedCommandsInfo != nullptr) { [[maybe_unused]] const Location pGeneratedCommandsInfo_loc = loc.dot(Field::pGeneratedCommandsInfo); - skip |= ValidateFlags(pGeneratedCommandsInfo_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pGeneratedCommandsInfo->shaderStages, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkGeneratedCommandsInfoEXT-shaderStages-parameter", - "VUID-VkGeneratedCommandsInfoEXT-shaderStages-requiredbitmask"); + skip |= state.ValidateFlags(pGeneratedCommandsInfo_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pGeneratedCommandsInfo->shaderStages, kRequiredFlags, + "VUID-VkGeneratedCommandsInfoEXT-shaderStages-parameter", + "VUID-VkGeneratedCommandsInfoEXT-shaderStages-requiredbitmask"); - skip |= ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), - pGeneratedCommandsInfo->indirectCommandsLayout); + skip |= state.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), + pGeneratedCommandsInfo->indirectCommandsLayout); } - skip |= ValidateRequiredHandle(loc.dot(Field::stateCommandBuffer), stateCommandBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::stateCommandBuffer), stateCommandBuffer); if (!skip) skip |= manual_PreCallValidateCmdPreprocessGeneratedCommandsEXT(commandBuffer, pGeneratedCommandsInfo, stateCommandBuffer, - error_obj); + state); return skip; } @@ -26914,26 +29634,26 @@ bool StatelessValidation::PreCallValidateCmdExecuteGeneratedCommandsEXT(VkComman const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); - skip |= ValidateBool32(loc.dot(Field::isPreprocessed), isPreprocessed); - skip |= ValidateStructType( + skip |= state.ValidateBool32(loc.dot(Field::isPreprocessed), isPreprocessed); + skip |= state.ValidateStructType( loc.dot(Field::pGeneratedCommandsInfo), pGeneratedCommandsInfo, VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_EXT, true, "VUID-vkCmdExecuteGeneratedCommandsEXT-pGeneratedCommandsInfo-parameter", "VUID-VkGeneratedCommandsInfoEXT-sType-sType"); if (pGeneratedCommandsInfo != nullptr) { [[maybe_unused]] const Location pGeneratedCommandsInfo_loc = loc.dot(Field::pGeneratedCommandsInfo); - skip |= ValidateFlags(pGeneratedCommandsInfo_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pGeneratedCommandsInfo->shaderStages, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkGeneratedCommandsInfoEXT-shaderStages-parameter", - "VUID-VkGeneratedCommandsInfoEXT-shaderStages-requiredbitmask"); + skip |= state.ValidateFlags(pGeneratedCommandsInfo_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pGeneratedCommandsInfo->shaderStages, kRequiredFlags, + "VUID-VkGeneratedCommandsInfoEXT-shaderStages-parameter", + "VUID-VkGeneratedCommandsInfoEXT-shaderStages-requiredbitmask"); - skip |= ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), - pGeneratedCommandsInfo->indirectCommandsLayout); + skip |= state.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), + pGeneratedCommandsInfo->indirectCommandsLayout); } if (!skip) - skip |= - manual_PreCallValidateCmdExecuteGeneratedCommandsEXT(commandBuffer, isPreprocessed, pGeneratedCommandsInfo, error_obj); + skip |= manual_PreCallValidateCmdExecuteGeneratedCommandsEXT(commandBuffer, isPreprocessed, pGeneratedCommandsInfo, state); return skip; } @@ -26943,33 +29663,34 @@ bool StatelessValidation::PreCallValidateCreateIndirectCommandsLayoutEXT(VkDevic VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_EXT, - true, "VUID-vkCreateIndirectCommandsLayoutEXT-pCreateInfo-parameter", - "VUID-VkIndirectCommandsLayoutCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_EXT, true, + "VUID-vkCreateIndirectCommandsLayoutEXT-pCreateInfo-parameter", "VUID-VkIndirectCommandsLayoutCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkIndirectCommandsLayoutCreateInfoEXT = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; - skip |= - ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkIndirectCommandsLayoutCreateInfoEXT.size(), - allowed_structs_VkIndirectCommandsLayoutCreateInfoEXT.data(), GeneratedVulkanHeaderVersion, - "VUID-VkIndirectCommandsLayoutCreateInfoEXT-pNext-pNext", - "VUID-VkIndirectCommandsLayoutCreateInfoEXT-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, + allowed_structs_VkIndirectCommandsLayoutCreateInfoEXT.size(), + allowed_structs_VkIndirectCommandsLayoutCreateInfoEXT.data(), + GeneratedVulkanHeaderVersion, "VUID-VkIndirectCommandsLayoutCreateInfoEXT-pNext-pNext", + "VUID-VkIndirectCommandsLayoutCreateInfoEXT-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkIndirectCommandsLayoutUsageFlagBitsEXT, - AllVkIndirectCommandsLayoutUsageFlagBitsEXT, pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkIndirectCommandsLayoutCreateInfoEXT-flags-parameter"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkIndirectCommandsLayoutUsageFlagBitsEXT, + AllVkIndirectCommandsLayoutUsageFlagBitsEXT, pCreateInfo->flags, kOptionalFlags, + "VUID-VkIndirectCommandsLayoutCreateInfoEXT-flags-parameter"); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfo->shaderStages, kRequiredFlags, VK_NULL_HANDLE, - "VUID-VkIndirectCommandsLayoutCreateInfoEXT-shaderStages-parameter", - "VUID-VkIndirectCommandsLayoutCreateInfoEXT-shaderStages-requiredbitmask"); + skip |= state.ValidateFlags(pCreateInfo_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfo->shaderStages, kRequiredFlags, + "VUID-VkIndirectCommandsLayoutCreateInfoEXT-shaderStages-parameter", + "VUID-VkIndirectCommandsLayoutCreateInfoEXT-shaderStages-requiredbitmask"); - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( pCreateInfo_loc.dot(Field::tokenCount), pCreateInfo_loc.dot(Field::pTokens), pCreateInfo->tokenCount, pCreateInfo->pTokens, VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_EXT, true, true, "VUID-VkIndirectCommandsLayoutTokenEXT-sType-sType", "VUID-VkIndirectCommandsLayoutCreateInfoEXT-pTokens-parameter", @@ -26978,21 +29699,21 @@ bool StatelessValidation::PreCallValidateCreateIndirectCommandsLayoutEXT(VkDevic if (pCreateInfo->pTokens != nullptr) { for (uint32_t tokenIndex = 0; tokenIndex < pCreateInfo->tokenCount; ++tokenIndex) { [[maybe_unused]] const Location pTokens_loc = pCreateInfo_loc.dot(Field::pTokens, tokenIndex); - skip |= ValidateRangedEnum(pTokens_loc.dot(Field::type), vvl::Enum::VkIndirectCommandsTokenTypeEXT, - pCreateInfo->pTokens[tokenIndex].type, - "VUID-VkIndirectCommandsLayoutTokenEXT-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pTokens_loc.dot(Field::type), vvl::Enum::VkIndirectCommandsTokenTypeEXT, + pCreateInfo->pTokens[tokenIndex].type, + "VUID-VkIndirectCommandsLayoutTokenEXT-type-parameter"); } } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pIndirectCommandsLayout), pIndirectCommandsLayout, - "VUID-vkCreateIndirectCommandsLayoutEXT-pIndirectCommandsLayout-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pIndirectCommandsLayout), pIndirectCommandsLayout, + "VUID-vkCreateIndirectCommandsLayoutEXT-pIndirectCommandsLayout-parameter"); if (!skip) - skip |= manual_PreCallValidateCreateIndirectCommandsLayoutEXT(device, pCreateInfo, pAllocator, pIndirectCommandsLayout, - error_obj); + skip |= + manual_PreCallValidateCreateIndirectCommandsLayoutEXT(device, pCreateInfo, pAllocator, pIndirectCommandsLayout, state); return skip; } @@ -27001,12 +29722,13 @@ bool StatelessValidation::PreCallValidateDestroyIndirectCommandsLayoutEXT(VkDevi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -27017,26 +29739,26 @@ bool StatelessValidation::PreCallValidateCreateIndirectExecutionSetEXT(VkDevice VkIndirectExecutionSetEXT* pIndirectExecutionSet, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_CREATE_INFO_EXT, - true, "VUID-vkCreateIndirectExecutionSetEXT-pCreateInfo-parameter", - "VUID-VkIndirectExecutionSetCreateInfoEXT-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_CREATE_INFO_EXT, true, + "VUID-vkCreateIndirectExecutionSetEXT-pCreateInfo-parameter", "VUID-VkIndirectExecutionSetCreateInfoEXT-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::type), vvl::Enum::VkIndirectExecutionSetInfoTypeEXT, - pCreateInfo->type, "VUID-VkIndirectExecutionSetCreateInfoEXT-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::type), vvl::Enum::VkIndirectExecutionSetInfoTypeEXT, + pCreateInfo->type, "VUID-VkIndirectExecutionSetCreateInfoEXT-type-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pIndirectExecutionSet), pIndirectExecutionSet, - "VUID-vkCreateIndirectExecutionSetEXT-pIndirectExecutionSet-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pIndirectExecutionSet), pIndirectExecutionSet, + "VUID-vkCreateIndirectExecutionSetEXT-pIndirectExecutionSet-parameter"); if (!skip) - skip |= - manual_PreCallValidateCreateIndirectExecutionSetEXT(device, pCreateInfo, pAllocator, pIndirectExecutionSet, error_obj); + skip |= manual_PreCallValidateCreateIndirectExecutionSetEXT(device, pCreateInfo, pAllocator, pIndirectExecutionSet, state); return skip; } @@ -27045,12 +29767,13 @@ bool StatelessValidation::PreCallValidateDestroyIndirectExecutionSetEXT(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -27059,21 +29782,22 @@ bool StatelessValidation::PreCallValidateUpdateIndirectExecutionSetPipelineEXT( VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetPipelineEXT* pExecutionSetWrites, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); - skip |= ValidateRequiredHandle(loc.dot(Field::indirectExecutionSet), indirectExecutionSet); - skip |= - ValidateStructTypeArray(loc.dot(Field::executionSetWriteCount), loc.dot(Field::pExecutionSetWrites), executionSetWriteCount, - pExecutionSetWrites, VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_PIPELINE_EXT, true, true, - "VUID-VkWriteIndirectExecutionSetPipelineEXT-sType-sType", - "VUID-vkUpdateIndirectExecutionSetPipelineEXT-pExecutionSetWrites-parameter", - "VUID-vkUpdateIndirectExecutionSetPipelineEXT-executionSetWriteCount-arraylength"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::indirectExecutionSet), indirectExecutionSet); + skip |= state.ValidateStructTypeArray(loc.dot(Field::executionSetWriteCount), loc.dot(Field::pExecutionSetWrites), + executionSetWriteCount, pExecutionSetWrites, + VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_PIPELINE_EXT, true, true, + "VUID-VkWriteIndirectExecutionSetPipelineEXT-sType-sType", + "VUID-vkUpdateIndirectExecutionSetPipelineEXT-pExecutionSetWrites-parameter", + "VUID-vkUpdateIndirectExecutionSetPipelineEXT-executionSetWriteCount-arraylength"); if (pExecutionSetWrites != nullptr) { for (uint32_t executionSetWriteIndex = 0; executionSetWriteIndex < executionSetWriteCount; ++executionSetWriteIndex) { [[maybe_unused]] const Location pExecutionSetWrites_loc = loc.dot(Field::pExecutionSetWrites, executionSetWriteIndex); - skip |= ValidateRequiredHandle(pExecutionSetWrites_loc.dot(Field::pipeline), - pExecutionSetWrites[executionSetWriteIndex].pipeline); + skip |= state.ValidateRequiredHandle(pExecutionSetWrites_loc.dot(Field::pipeline), + pExecutionSetWrites[executionSetWriteIndex].pipeline); } } return skip; @@ -27083,21 +29807,22 @@ bool StatelessValidation::PreCallValidateUpdateIndirectExecutionSetShaderEXT( VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetShaderEXT* pExecutionSetWrites, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); - skip |= ValidateRequiredHandle(loc.dot(Field::indirectExecutionSet), indirectExecutionSet); - skip |= - ValidateStructTypeArray(loc.dot(Field::executionSetWriteCount), loc.dot(Field::pExecutionSetWrites), executionSetWriteCount, - pExecutionSetWrites, VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_SHADER_EXT, true, true, - "VUID-VkWriteIndirectExecutionSetShaderEXT-sType-sType", - "VUID-vkUpdateIndirectExecutionSetShaderEXT-pExecutionSetWrites-parameter", - "VUID-vkUpdateIndirectExecutionSetShaderEXT-executionSetWriteCount-arraylength"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::indirectExecutionSet), indirectExecutionSet); + skip |= state.ValidateStructTypeArray(loc.dot(Field::executionSetWriteCount), loc.dot(Field::pExecutionSetWrites), + executionSetWriteCount, pExecutionSetWrites, + VK_STRUCTURE_TYPE_WRITE_INDIRECT_EXECUTION_SET_SHADER_EXT, true, true, + "VUID-VkWriteIndirectExecutionSetShaderEXT-sType-sType", + "VUID-vkUpdateIndirectExecutionSetShaderEXT-pExecutionSetWrites-parameter", + "VUID-vkUpdateIndirectExecutionSetShaderEXT-executionSetWriteCount-arraylength"); if (pExecutionSetWrites != nullptr) { for (uint32_t executionSetWriteIndex = 0; executionSetWriteIndex < executionSetWriteCount; ++executionSetWriteIndex) { [[maybe_unused]] const Location pExecutionSetWrites_loc = loc.dot(Field::pExecutionSetWrites, executionSetWriteIndex); - skip |= ValidateRequiredHandle(pExecutionSetWrites_loc.dot(Field::shader), - pExecutionSetWrites[executionSetWriteIndex].shader); + skip |= state.ValidateRequiredHandle(pExecutionSetWrites_loc.dot(Field::shader), + pExecutionSetWrites[executionSetWriteIndex].shader); } } return skip; @@ -27107,8 +29832,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCooperativeMatrixFlexi VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixFlexibleDimensionsPropertiesNV* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= state.ValidateStructTypeArray( loc.dot(Field::pPropertyCount), loc.dot(Field::pProperties), pPropertyCount, pProperties, VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_FLEXIBLE_DIMENSIONS_PROPERTIES_NV, true, false, false, "VUID-VkCooperativeMatrixFlexibleDimensionsPropertiesNV-sType-sType", kVUIDUndefined, @@ -27116,9 +29844,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCooperativeMatrixFlexi if (pProperties != nullptr) { for (uint32_t pPropertyIndex = 0; pPropertyIndex < *pPropertyCount; ++pPropertyIndex) { [[maybe_unused]] const Location pProperties_loc = loc.dot(Field::pProperties, pPropertyIndex); - skip |= ValidateStructPnext( + skip |= state.ValidateStructPnext( pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCooperativeMatrixFlexibleDimensionsPropertiesNV-pNext-pNext", kVUIDUndefined, physicalDevice, false); + "VUID-VkCooperativeMatrixFlexibleDimensionsPropertiesNV-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -27130,42 +29858,44 @@ bool StatelessValidation::PreCallValidateCreateAccelerationStructureKHR(VkDevice VkAccelerationStructureKHR* pAccelerationStructure, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructType(loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR, - true, "VUID-vkCreateAccelerationStructureKHR-pCreateInfo-parameter", - "VUID-VkAccelerationStructureCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType( + loc.dot(Field::pCreateInfo), pCreateInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR, true, + "VUID-vkCreateAccelerationStructureKHR-pCreateInfo-parameter", "VUID-VkAccelerationStructureCreateInfoKHR-sType-sType"); if (pCreateInfo != nullptr) { [[maybe_unused]] const Location pCreateInfo_loc = loc.dot(Field::pCreateInfo); constexpr std::array allowed_structs_VkAccelerationStructureCreateInfoKHR = { VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV, VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT}; - skip |= - ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, allowed_structs_VkAccelerationStructureCreateInfoKHR.size(), - allowed_structs_VkAccelerationStructureCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureCreateInfoKHR-pNext-pNext", - "VUID-VkAccelerationStructureCreateInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, + allowed_structs_VkAccelerationStructureCreateInfoKHR.size(), + allowed_structs_VkAccelerationStructureCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureCreateInfoKHR-pNext-pNext", + "VUID-VkAccelerationStructureCreateInfoKHR-sType-unique", true); - skip |= ValidateFlags(pCreateInfo_loc.dot(Field::createFlags), vvl::FlagBitmask::VkAccelerationStructureCreateFlagBitsKHR, - AllVkAccelerationStructureCreateFlagBitsKHR, pCreateInfo->createFlags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkAccelerationStructureCreateInfoKHR-createFlags-parameter"); + skip |= + state.ValidateFlags(pCreateInfo_loc.dot(Field::createFlags), vvl::FlagBitmask::VkAccelerationStructureCreateFlagBitsKHR, + AllVkAccelerationStructureCreateFlagBitsKHR, pCreateInfo->createFlags, kOptionalFlags, + "VUID-VkAccelerationStructureCreateInfoKHR-createFlags-parameter"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::buffer), pCreateInfo->buffer); + skip |= state.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::buffer), pCreateInfo->buffer); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, pCreateInfo->type, - "VUID-VkAccelerationStructureCreateInfoKHR-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pCreateInfo_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, + pCreateInfo->type, "VUID-VkAccelerationStructureCreateInfoKHR-type-parameter"); } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pAccelerationStructure), pAccelerationStructure, - "VUID-vkCreateAccelerationStructureKHR-pAccelerationStructure-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pAccelerationStructure), pAccelerationStructure, + "VUID-vkCreateAccelerationStructureKHR-pAccelerationStructure-parameter"); if (!skip) - skip |= manual_PreCallValidateCreateAccelerationStructureKHR(device, pCreateInfo, pAllocator, pAccelerationStructure, - error_obj); + skip |= + manual_PreCallValidateCreateAccelerationStructureKHR(device, pCreateInfo, pAllocator, pAccelerationStructure, state); return skip; } @@ -27174,14 +29904,15 @@ bool StatelessValidation::PreCallValidateDestroyAccelerationStructureKHR(VkDevic const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - if (!skip) skip |= manual_PreCallValidateDestroyAccelerationStructureKHR(device, accelerationStructure, pAllocator, error_obj); + if (!skip) skip |= manual_PreCallValidateDestroyAccelerationStructureKHR(device, accelerationStructure, pAllocator, state); return skip; } @@ -27189,53 +29920,52 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructuresKHR( VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, true, true, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType", - "VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-parameter", - "VUID-vkCmdBuildAccelerationStructuresKHR-infoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, true, true, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType", + "VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-parameter", + "VUID-vkCmdBuildAccelerationStructuresKHR-infoCount-arraylength"); if (pInfos != nullptr) { for (uint32_t infoIndex = 0; infoIndex < infoCount; ++infoIndex) { [[maybe_unused]] const Location pInfos_loc = loc.dot(Field::pInfos, infoIndex); - skip |= ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, true); skip |= - ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, pInfos[infoIndex].type, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter", VK_NULL_HANDLE); + state.ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, + pInfos[infoIndex].type, "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter"); - skip |= ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, - AllVkBuildAccelerationStructureFlagBitsKHR, pInfos[infoIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, + AllVkBuildAccelerationStructureFlagBitsKHR, pInfos[infoIndex].flags, kOptionalFlags, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); - skip |= ValidateStructTypeArray(pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::pGeometries), - pInfos[infoIndex].geometryCount, pInfos[infoIndex].pGeometries, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, - "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::pGeometries), pInfos[infoIndex].geometryCount, + pInfos[infoIndex].pGeometries, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, + "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); if (pInfos[infoIndex].pGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pInfos[infoIndex].geometryCount; ++geometryIndex) { [[maybe_unused]] const Location pGeometries_loc = pInfos_loc.dot(Field::pGeometries, geometryIndex); - skip |= ValidateStructPnext(pGeometries_loc, pInfos[infoIndex].pGeometries[geometryIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGeometries_loc, pInfos[infoIndex].pGeometries[geometryIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pInfos[infoIndex].pGeometries[geometryIndex].geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pInfos[infoIndex].pGeometries[geometryIndex].geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); - skip |= - ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); + skip |= state.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } - skip |= ValidateStructPointerTypeArray( + skip |= state.ValidateStructPointerTypeArray( pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::ppGeometries), pInfos[infoIndex].geometryCount, pInfos[infoIndex].ppGeometries, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); @@ -27243,25 +29973,24 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructuresKHR( if (pInfos[infoIndex].ppGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pInfos[infoIndex].geometryCount; ++geometryIndex) { [[maybe_unused]] const Location ppGeometries_loc = pInfos_loc.dot(Field::ppGeometries, geometryIndex); - skip |= ValidateStructPnext(ppGeometries_loc, pInfos[infoIndex].ppGeometries[geometryIndex]->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(ppGeometries_loc, pInfos[infoIndex].ppGeometries[geometryIndex]->pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(ppGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pInfos[infoIndex].ppGeometries[geometryIndex]->geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(ppGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pInfos[infoIndex].ppGeometries[geometryIndex]->geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); - skip |= - ValidateFlags(ppGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pInfos[infoIndex].ppGeometries[geometryIndex]->flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); + skip |= state.ValidateFlags(ppGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].ppGeometries[geometryIndex]->flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } } } - skip |= ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::ppBuildRangeInfos), infoCount, &ppBuildRangeInfos, true, true, - "VUID-vkCmdBuildAccelerationStructuresKHR-infoCount-arraylength", - "VUID-vkCmdBuildAccelerationStructuresKHR-ppBuildRangeInfos-parameter"); + skip |= state.ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::ppBuildRangeInfos), infoCount, &ppBuildRangeInfos, true, + true, "VUID-vkCmdBuildAccelerationStructuresKHR-infoCount-arraylength", + "VUID-vkCmdBuildAccelerationStructuresKHR-ppBuildRangeInfos-parameter"); if (ppBuildRangeInfos != nullptr) { for (uint32_t infoIndex = 0; infoIndex < infoCount; ++infoIndex) { [[maybe_unused]] const Location ppBuildRangeInfos_loc = loc.dot(Field::ppBuildRangeInfos, infoIndex); @@ -27269,8 +29998,7 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructuresKHR( } } if (!skip) - skip |= - manual_PreCallValidateCmdBuildAccelerationStructuresKHR(commandBuffer, infoCount, pInfos, ppBuildRangeInfos, error_obj); + skip |= manual_PreCallValidateCmdBuildAccelerationStructuresKHR(commandBuffer, infoCount, pInfos, ppBuildRangeInfos, state); return skip; } @@ -27279,53 +30007,52 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructuresIndirectK const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides, const uint32_t* const* ppMaxPrimitiveCounts, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, true, true, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType", - "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-parameter", - "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, true, true, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType", + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-parameter", + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength"); if (pInfos != nullptr) { for (uint32_t infoIndex = 0; infoIndex < infoCount; ++infoIndex) { [[maybe_unused]] const Location pInfos_loc = loc.dot(Field::pInfos, infoIndex); - skip |= ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, true); skip |= - ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, pInfos[infoIndex].type, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter", VK_NULL_HANDLE); + state.ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, + pInfos[infoIndex].type, "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter"); - skip |= ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, - AllVkBuildAccelerationStructureFlagBitsKHR, pInfos[infoIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, + AllVkBuildAccelerationStructureFlagBitsKHR, pInfos[infoIndex].flags, kOptionalFlags, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); - skip |= ValidateStructTypeArray(pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::pGeometries), - pInfos[infoIndex].geometryCount, pInfos[infoIndex].pGeometries, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, - "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::pGeometries), pInfos[infoIndex].geometryCount, + pInfos[infoIndex].pGeometries, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, + "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); if (pInfos[infoIndex].pGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pInfos[infoIndex].geometryCount; ++geometryIndex) { [[maybe_unused]] const Location pGeometries_loc = pInfos_loc.dot(Field::pGeometries, geometryIndex); - skip |= ValidateStructPnext(pGeometries_loc, pInfos[infoIndex].pGeometries[geometryIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGeometries_loc, pInfos[infoIndex].pGeometries[geometryIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pInfos[infoIndex].pGeometries[geometryIndex].geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pInfos[infoIndex].pGeometries[geometryIndex].geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); - skip |= - ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); + skip |= state.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } - skip |= ValidateStructPointerTypeArray( + skip |= state.ValidateStructPointerTypeArray( pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::ppGeometries), pInfos[infoIndex].geometryCount, pInfos[infoIndex].ppGeometries, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); @@ -27333,34 +30060,34 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructuresIndirectK if (pInfos[infoIndex].ppGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pInfos[infoIndex].geometryCount; ++geometryIndex) { [[maybe_unused]] const Location ppGeometries_loc = pInfos_loc.dot(Field::ppGeometries, geometryIndex); - skip |= ValidateStructPnext(ppGeometries_loc, pInfos[infoIndex].ppGeometries[geometryIndex]->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(ppGeometries_loc, pInfos[infoIndex].ppGeometries[geometryIndex]->pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(ppGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pInfos[infoIndex].ppGeometries[geometryIndex]->geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(ppGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pInfos[infoIndex].ppGeometries[geometryIndex]->geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); - skip |= - ValidateFlags(ppGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pInfos[infoIndex].ppGeometries[geometryIndex]->flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); + skip |= state.ValidateFlags(ppGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].ppGeometries[geometryIndex]->flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } } } - skip |= ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::pIndirectDeviceAddresses), infoCount, &pIndirectDeviceAddresses, - true, true, "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength", - "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-parameter"); - skip |= ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::pIndirectStrides), infoCount, &pIndirectStrides, true, true, - "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength", - "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-parameter"); - skip |= ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::ppMaxPrimitiveCounts), infoCount, &ppMaxPrimitiveCounts, true, - true, "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength", - "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-parameter"); + skip |= state.ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::pIndirectDeviceAddresses), infoCount, + &pIndirectDeviceAddresses, true, true, + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength", + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-parameter"); + skip |= state.ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::pIndirectStrides), infoCount, &pIndirectStrides, true, + true, "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength", + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-parameter"); + skip |= state.ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::ppMaxPrimitiveCounts), infoCount, &ppMaxPrimitiveCounts, + true, true, "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength", + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-ppMaxPrimitiveCounts-parameter"); if (!skip) skip |= manual_PreCallValidateCmdBuildAccelerationStructuresIndirectKHR( - commandBuffer, infoCount, pInfos, pIndirectDeviceAddresses, pIndirectStrides, ppMaxPrimitiveCounts, error_obj); + commandBuffer, infoCount, pInfos, pIndirectDeviceAddresses, pIndirectStrides, ppMaxPrimitiveCounts, state); return skip; } @@ -27369,53 +30096,52 @@ bool StatelessValidation::PreCallValidateBuildAccelerationStructuresKHR( const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, true, true, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType", - "VUID-vkBuildAccelerationStructuresKHR-pInfos-parameter", - "VUID-vkBuildAccelerationStructuresKHR-infoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::infoCount), loc.dot(Field::pInfos), infoCount, pInfos, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, true, true, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType", + "VUID-vkBuildAccelerationStructuresKHR-pInfos-parameter", + "VUID-vkBuildAccelerationStructuresKHR-infoCount-arraylength"); if (pInfos != nullptr) { for (uint32_t infoIndex = 0; infoIndex < infoCount; ++infoIndex) { [[maybe_unused]] const Location pInfos_loc = loc.dot(Field::pInfos, infoIndex); - skip |= ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, - VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, true); skip |= - ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, pInfos[infoIndex].type, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter", VK_NULL_HANDLE); + state.ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, + pInfos[infoIndex].type, "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter"); - skip |= ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, - AllVkBuildAccelerationStructureFlagBitsKHR, pInfos[infoIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, + AllVkBuildAccelerationStructureFlagBitsKHR, pInfos[infoIndex].flags, kOptionalFlags, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); - skip |= ValidateStructTypeArray(pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::pGeometries), - pInfos[infoIndex].geometryCount, pInfos[infoIndex].pGeometries, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, - "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::pGeometries), pInfos[infoIndex].geometryCount, + pInfos[infoIndex].pGeometries, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, + "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); if (pInfos[infoIndex].pGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pInfos[infoIndex].geometryCount; ++geometryIndex) { [[maybe_unused]] const Location pGeometries_loc = pInfos_loc.dot(Field::pGeometries, geometryIndex); - skip |= ValidateStructPnext(pGeometries_loc, pInfos[infoIndex].pGeometries[geometryIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGeometries_loc, pInfos[infoIndex].pGeometries[geometryIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pInfos[infoIndex].pGeometries[geometryIndex].geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pInfos[infoIndex].pGeometries[geometryIndex].geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); - skip |= - ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); + skip |= state.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } - skip |= ValidateStructPointerTypeArray( + skip |= state.ValidateStructPointerTypeArray( pInfos_loc.dot(Field::geometryCount), pInfos_loc.dot(Field::ppGeometries), pInfos[infoIndex].geometryCount, pInfos[infoIndex].ppGeometries, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); @@ -27423,25 +30149,24 @@ bool StatelessValidation::PreCallValidateBuildAccelerationStructuresKHR( if (pInfos[infoIndex].ppGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pInfos[infoIndex].geometryCount; ++geometryIndex) { [[maybe_unused]] const Location ppGeometries_loc = pInfos_loc.dot(Field::ppGeometries, geometryIndex); - skip |= ValidateStructPnext(ppGeometries_loc, pInfos[infoIndex].ppGeometries[geometryIndex]->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(ppGeometries_loc, pInfos[infoIndex].ppGeometries[geometryIndex]->pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(ppGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pInfos[infoIndex].ppGeometries[geometryIndex]->geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(ppGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pInfos[infoIndex].ppGeometries[geometryIndex]->geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); - skip |= - ValidateFlags(ppGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pInfos[infoIndex].ppGeometries[geometryIndex]->flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); + skip |= state.ValidateFlags(ppGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].ppGeometries[geometryIndex]->flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } } } - skip |= ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::ppBuildRangeInfos), infoCount, &ppBuildRangeInfos, true, true, - "VUID-vkBuildAccelerationStructuresKHR-infoCount-arraylength", - "VUID-vkBuildAccelerationStructuresKHR-ppBuildRangeInfos-parameter"); + skip |= state.ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::ppBuildRangeInfos), infoCount, &ppBuildRangeInfos, true, + true, "VUID-vkBuildAccelerationStructuresKHR-infoCount-arraylength", + "VUID-vkBuildAccelerationStructuresKHR-ppBuildRangeInfos-parameter"); if (ppBuildRangeInfos != nullptr) { for (uint32_t infoIndex = 0; infoIndex < infoCount; ++infoIndex) { [[maybe_unused]] const Location ppBuildRangeInfos_loc = loc.dot(Field::ppBuildRangeInfos, infoIndex); @@ -27450,7 +30175,7 @@ bool StatelessValidation::PreCallValidateBuildAccelerationStructuresKHR( } if (!skip) skip |= manual_PreCallValidateBuildAccelerationStructuresKHR(device, deferredOperation, infoCount, pInfos, - ppBuildRangeInfos, error_obj); + ppBuildRangeInfos, state); return skip; } @@ -27458,25 +30183,26 @@ bool StatelessValidation::PreCallValidateCopyAccelerationStructureKHR(VkDevice d const VkCopyAccelerationStructureInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR, true, - "VUID-vkCopyAccelerationStructureKHR-pInfo-parameter", - "VUID-VkCopyAccelerationStructureInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR, true, + "VUID-vkCopyAccelerationStructureKHR-pInfo-parameter", + "VUID-VkCopyAccelerationStructureInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, - "VUID-VkCopyAccelerationStructureInfoKHR-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, + "VUID-VkCopyAccelerationStructureInfoKHR-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCopyAccelerationStructureKHR(device, deferredOperation, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCopyAccelerationStructureKHR(device, deferredOperation, pInfo, state); return skip; } @@ -27484,24 +30210,24 @@ bool StatelessValidation::PreCallValidateCopyAccelerationStructureToMemoryKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR, true, - "VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-parameter", - "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR, + true, "VUID-vkCopyAccelerationStructureToMemoryKHR-pInfo-parameter", + "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, - "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, + "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCopyAccelerationStructureToMemoryKHR(device, deferredOperation, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCopyAccelerationStructureToMemoryKHR(device, deferredOperation, pInfo, state); return skip; } @@ -27509,24 +30235,24 @@ bool StatelessValidation::PreCallValidateCopyMemoryToAccelerationStructureKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR, true, - "VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-parameter", - "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR, + true, "VUID-vkCopyMemoryToAccelerationStructureKHR-pInfo-parameter", + "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, - "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, + "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCopyMemoryToAccelerationStructureKHR(device, deferredOperation, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCopyMemoryToAccelerationStructureKHR(device, deferredOperation, pInfo, state); return skip; } @@ -27534,20 +30260,21 @@ bool StatelessValidation::PreCallValidateWriteAccelerationStructuresPropertiesKH VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, size_t dataSize, void* pData, size_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), - accelerationStructureCount, pAccelerationStructures, true, true, - "VUID-vkWriteAccelerationStructuresPropertiesKHR-accelerationStructureCount-arraylength"); - skip |= ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, - "VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-parameter", VK_NULL_HANDLE); - skip |= ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, - "VUID-vkWriteAccelerationStructuresPropertiesKHR-dataSize-arraylength", - "VUID-vkWriteAccelerationStructuresPropertiesKHR-pData-parameter"); + skip |= state.ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), + accelerationStructureCount, pAccelerationStructures, true, true, + "VUID-vkWriteAccelerationStructuresPropertiesKHR-accelerationStructureCount-arraylength"); + skip |= state.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-parameter"); + skip |= state.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkWriteAccelerationStructuresPropertiesKHR-dataSize-arraylength", + "VUID-vkWriteAccelerationStructuresPropertiesKHR-pData-parameter"); if (!skip) skip |= manual_PreCallValidateWriteAccelerationStructuresPropertiesKHR( - device, accelerationStructureCount, pAccelerationStructures, queryType, dataSize, pData, stride, error_obj); + device, accelerationStructureCount, pAccelerationStructures, queryType, dataSize, pData, stride, state); return skip; } @@ -27555,92 +30282,93 @@ bool StatelessValidation::PreCallValidateCmdCopyAccelerationStructureKHR(VkComma const VkCopyAccelerationStructureInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR, true, - "VUID-vkCmdCopyAccelerationStructureKHR-pInfo-parameter", - "VUID-VkCopyAccelerationStructureInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR, true, + "VUID-vkCmdCopyAccelerationStructureKHR-pInfo-parameter", + "VUID-VkCopyAccelerationStructureInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, - "VUID-VkCopyAccelerationStructureInfoKHR-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, + "VUID-VkCopyAccelerationStructureInfoKHR-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdCopyAccelerationStructureKHR(commandBuffer, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdCopyAccelerationStructureKHR(commandBuffer, pInfo, state); return skip; } bool StatelessValidation::PreCallValidateCmdCopyAccelerationStructureToMemoryKHR( VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR, true, - "VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-parameter", - "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR, + true, "VUID-vkCmdCopyAccelerationStructureToMemoryKHR-pInfo-parameter", + "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, - "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, + "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdCopyAccelerationStructureToMemoryKHR(commandBuffer, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdCopyAccelerationStructureToMemoryKHR(commandBuffer, pInfo, state); return skip; } bool StatelessValidation::PreCallValidateCmdCopyMemoryToAccelerationStructureKHR( VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR, true, - "VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-parameter", - "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR, + true, "VUID-vkCmdCopyMemoryToAccelerationStructureKHR-pInfo-parameter", + "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); - skip |= ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, - "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-mode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pInfo_loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, pInfo->mode, + "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-mode-parameter"); } - if (!skip) skip |= manual_PreCallValidateCmdCopyMemoryToAccelerationStructureKHR(commandBuffer, pInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdCopyMemoryToAccelerationStructureKHR(commandBuffer, pInfo, state); return skip; } bool StatelessValidation::PreCallValidateGetAccelerationStructureDeviceAddressKHR( VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR, true, - "VUID-vkGetAccelerationStructureDeviceAddressKHR-pInfo-parameter", - "VUID-VkAccelerationStructureDeviceAddressInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pInfo), pInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR, + true, "VUID-vkGetAccelerationStructureDeviceAddressKHR-pInfo-parameter", + "VUID-VkAccelerationStructureDeviceAddressInfoKHR-sType-sType"); if (pInfo != nullptr) { [[maybe_unused]] const Location pInfo_loc = loc.dot(Field::pInfo); - skip |= ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureDeviceAddressInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureDeviceAddressInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::accelerationStructure), pInfo->accelerationStructure); + skip |= state.ValidateRequiredHandle(pInfo_loc.dot(Field::accelerationStructure), pInfo->accelerationStructure); } return skip; } @@ -27649,18 +30377,19 @@ bool StatelessValidation::PreCallValidateCmdWriteAccelerationStructuresPropertie VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), - accelerationStructureCount, pAccelerationStructures, true, true, - "VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-accelerationStructureCount-arraylength"); - skip |= ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, - "VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryType-parameter", VK_NULL_HANDLE); - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= state.ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), + accelerationStructureCount, pAccelerationStructures, true, true, + "VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-accelerationStructureCount-arraylength"); + skip |= state.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryType-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); if (!skip) skip |= manual_PreCallValidateCmdWriteAccelerationStructuresPropertiesKHR( - commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery, error_obj); + commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery, state); return skip; } @@ -27668,26 +30397,26 @@ bool StatelessValidation::PreCallValidateGetDeviceAccelerationStructureCompatibi VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= - ValidateStructType(loc.dot(Field::pVersionInfo), pVersionInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR, - true, "VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-pVersionInfo-parameter", - "VUID-VkAccelerationStructureVersionInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pVersionInfo), pVersionInfo, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR, true, + "VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-pVersionInfo-parameter", + "VUID-VkAccelerationStructureVersionInfoKHR-sType-sType"); if (pVersionInfo != nullptr) { [[maybe_unused]] const Location pVersionInfo_loc = loc.dot(Field::pVersionInfo); - skip |= ValidateStructPnext(pVersionInfo_loc, pVersionInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureVersionInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pVersionInfo_loc, pVersionInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureVersionInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredPointer(pVersionInfo_loc.dot(Field::pVersionData), pVersionInfo->pVersionData, - "VUID-VkAccelerationStructureVersionInfoKHR-pVersionData-parameter"); + skip |= state.ValidateRequiredPointer(pVersionInfo_loc.dot(Field::pVersionData), pVersionInfo->pVersionData, + "VUID-VkAccelerationStructureVersionInfoKHR-pVersionData-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pCompatibility), pCompatibility, - "VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-pCompatibility-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCompatibility), pCompatibility, + "VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-pCompatibility-parameter"); if (!skip) - skip |= - manual_PreCallValidateGetDeviceAccelerationStructureCompatibilityKHR(device, pVersionInfo, pCompatibility, error_obj); + skip |= manual_PreCallValidateGetDeviceAccelerationStructureCompatibilityKHR(device, pVersionInfo, pCompatibility, state); return skip; } @@ -27695,51 +30424,51 @@ bool StatelessValidation::PreCallValidateGetAccelerationStructureBuildSizesKHR( VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo, const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_acceleration_structure}); - skip |= ValidateRangedEnum(loc.dot(Field::buildType), vvl::Enum::VkAccelerationStructureBuildTypeKHR, buildType, - "VUID-vkGetAccelerationStructureBuildSizesKHR-buildType-parameter", VK_NULL_HANDLE); - skip |= - ValidateStructType(loc.dot(Field::pBuildInfo), pBuildInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, - true, "VUID-vkGetAccelerationStructureBuildSizesKHR-pBuildInfo-parameter", - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType"); + skip |= state.ValidateRangedEnum(loc.dot(Field::buildType), vvl::Enum::VkAccelerationStructureBuildTypeKHR, buildType, + "VUID-vkGetAccelerationStructureBuildSizesKHR-buildType-parameter"); + skip |= state.ValidateStructType(loc.dot(Field::pBuildInfo), pBuildInfo, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, true, + "VUID-vkGetAccelerationStructureBuildSizesKHR-pBuildInfo-parameter", + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-sType-sType"); if (pBuildInfo != nullptr) { [[maybe_unused]] const Location pBuildInfo_loc = loc.dot(Field::pBuildInfo); - skip |= ValidateStructPnext(pBuildInfo_loc, pBuildInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(pBuildInfo_loc, pBuildInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pBuildInfo_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, pBuildInfo->type, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pBuildInfo_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, + pBuildInfo->type, "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter"); - skip |= ValidateFlags(pBuildInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, - AllVkBuildAccelerationStructureFlagBitsKHR, pBuildInfo->flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); + skip |= state.ValidateFlags(pBuildInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, + AllVkBuildAccelerationStructureFlagBitsKHR, pBuildInfo->flags, kOptionalFlags, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); - skip |= ValidateStructTypeArray(pBuildInfo_loc.dot(Field::geometryCount), pBuildInfo_loc.dot(Field::pGeometries), - pBuildInfo->geometryCount, pBuildInfo->pGeometries, - VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, - "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); + skip |= state.ValidateStructTypeArray( + pBuildInfo_loc.dot(Field::geometryCount), pBuildInfo_loc.dot(Field::pGeometries), pBuildInfo->geometryCount, + pBuildInfo->pGeometries, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, + "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); if (pBuildInfo->pGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pBuildInfo->geometryCount; ++geometryIndex) { [[maybe_unused]] const Location pGeometries_loc = pBuildInfo_loc.dot(Field::pGeometries, geometryIndex); - skip |= ValidateStructPnext(pGeometries_loc, pBuildInfo->pGeometries[geometryIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pGeometries_loc, pBuildInfo->pGeometries[geometryIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pBuildInfo->pGeometries[geometryIndex].geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pBuildInfo->pGeometries[geometryIndex].geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); - skip |= ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pBuildInfo->pGeometries[geometryIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); + skip |= state.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pBuildInfo->pGeometries[geometryIndex].flags, kOptionalFlags, + "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } - skip |= ValidateStructPointerTypeArray( + skip |= state.ValidateStructPointerTypeArray( pBuildInfo_loc.dot(Field::geometryCount), pBuildInfo_loc.dot(Field::ppGeometries), pBuildInfo->geometryCount, pBuildInfo->ppGeometries, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, false, false, "VUID-VkAccelerationStructureGeometryKHR-sType-sType", kVUIDUndefined, kVUIDUndefined); @@ -27747,32 +30476,32 @@ bool StatelessValidation::PreCallValidateGetAccelerationStructureBuildSizesKHR( if (pBuildInfo->ppGeometries != nullptr) { for (uint32_t geometryIndex = 0; geometryIndex < pBuildInfo->geometryCount; ++geometryIndex) { [[maybe_unused]] const Location ppGeometries_loc = pBuildInfo_loc.dot(Field::ppGeometries, geometryIndex); - skip |= ValidateStructPnext(ppGeometries_loc, pBuildInfo->ppGeometries[geometryIndex]->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(ppGeometries_loc, pBuildInfo->ppGeometries[geometryIndex]->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(ppGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, - pBuildInfo->ppGeometries[geometryIndex]->geometryType, - "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(ppGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pBuildInfo->ppGeometries[geometryIndex]->geometryType, + "VUID-VkAccelerationStructureGeometryKHR-geometryType-parameter"); - skip |= ValidateFlags(ppGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, - AllVkGeometryFlagBitsKHR, pBuildInfo->ppGeometries[geometryIndex]->flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); + skip |= state.ValidateFlags(ppGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pBuildInfo->ppGeometries[geometryIndex]->flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } } - skip |= ValidateStructType(loc.dot(Field::pSizeInfo), pSizeInfo, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR, - true, "VUID-vkGetAccelerationStructureBuildSizesKHR-pSizeInfo-parameter", - "VUID-VkAccelerationStructureBuildSizesInfoKHR-sType-sType"); + skip |= state.ValidateStructType(loc.dot(Field::pSizeInfo), pSizeInfo, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR, true, + "VUID-vkGetAccelerationStructureBuildSizesKHR-pSizeInfo-parameter", + "VUID-VkAccelerationStructureBuildSizesInfoKHR-sType-sType"); if (pSizeInfo != nullptr) { [[maybe_unused]] const Location pSizeInfo_loc = loc.dot(Field::pSizeInfo); - skip |= - ValidateStructPnext(pSizeInfo_loc, pSizeInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureBuildSizesInfoKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(pSizeInfo_loc, pSizeInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureBuildSizesInfoKHR-pNext-pNext", kVUIDUndefined, false); } if (!skip) skip |= manual_PreCallValidateGetAccelerationStructureBuildSizesKHR(device, buildType, pBuildInfo, pMaxPrimitiveCounts, - pSizeInfo, error_obj); + pSizeInfo, state); return skip; } @@ -27784,21 +30513,22 @@ bool StatelessValidation::PreCallValidateCmdTraceRaysKHR(VkCommandBuffer command uint32_t width, uint32_t height, uint32_t depth, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_pipeline}); - skip |= ValidateRequiredPointer(loc.dot(Field::pRaygenShaderBindingTable), pRaygenShaderBindingTable, - "VUID-vkCmdTraceRaysKHR-pRaygenShaderBindingTable-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pMissShaderBindingTable), pMissShaderBindingTable, - "VUID-vkCmdTraceRaysKHR-pMissShaderBindingTable-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pHitShaderBindingTable), pHitShaderBindingTable, - "VUID-vkCmdTraceRaysKHR-pHitShaderBindingTable-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pCallableShaderBindingTable), pCallableShaderBindingTable, - "VUID-vkCmdTraceRaysKHR-pCallableShaderBindingTable-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pRaygenShaderBindingTable), pRaygenShaderBindingTable, + "VUID-vkCmdTraceRaysKHR-pRaygenShaderBindingTable-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMissShaderBindingTable), pMissShaderBindingTable, + "VUID-vkCmdTraceRaysKHR-pMissShaderBindingTable-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pHitShaderBindingTable), pHitShaderBindingTable, + "VUID-vkCmdTraceRaysKHR-pHitShaderBindingTable-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCallableShaderBindingTable), pCallableShaderBindingTable, + "VUID-vkCmdTraceRaysKHR-pCallableShaderBindingTable-parameter"); if (!skip) - skip |= manual_PreCallValidateCmdTraceRaysKHR(commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, - pHitShaderBindingTable, pCallableShaderBindingTable, width, height, depth, - error_obj); + skip |= + manual_PreCallValidateCmdTraceRaysKHR(commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, + pHitShaderBindingTable, pCallableShaderBindingTable, width, height, depth, state); return skip; } @@ -27808,14 +30538,15 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesKHR(VkDevice d const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_pipeline}); - skip |= ValidateStructTypeArray(loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, pCreateInfos, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR, true, true, - "VUID-VkRayTracingPipelineCreateInfoKHR-sType-sType", - "VUID-vkCreateRayTracingPipelinesKHR-pCreateInfos-parameter", - "VUID-vkCreateRayTracingPipelinesKHR-createInfoCount-arraylength"); + skip |= state.ValidateStructTypeArray(loc.dot(Field::createInfoCount), loc.dot(Field::pCreateInfos), createInfoCount, + pCreateInfos, VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR, true, true, + "VUID-VkRayTracingPipelineCreateInfoKHR-sType-sType", + "VUID-vkCreateRayTracingPipelinesKHR-pCreateInfos-parameter", + "VUID-vkCreateRayTracingPipelinesKHR-createInfoCount-arraylength"); if (pCreateInfos != nullptr) { for (uint32_t createInfoIndex = 0; createInfoIndex < createInfoCount; ++createInfoIndex) { [[maybe_unused]] const Location pCreateInfos_loc = loc.dot(Field::pCreateInfos, createInfoIndex); @@ -27823,17 +30554,16 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesKHR(VkDevice d VK_STRUCTURE_TYPE_PIPELINE_BINARY_INFO_KHR, VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO}; - skip |= ValidateStructPnext(pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, - allowed_structs_VkRayTracingPipelineCreateInfoKHR.size(), - allowed_structs_VkRayTracingPipelineCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, - "VUID-VkRayTracingPipelineCreateInfoKHR-pNext-pNext", - "VUID-VkRayTracingPipelineCreateInfoKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext( + pCreateInfos_loc, pCreateInfos[createInfoIndex].pNext, allowed_structs_VkRayTracingPipelineCreateInfoKHR.size(), + allowed_structs_VkRayTracingPipelineCreateInfoKHR.data(), GeneratedVulkanHeaderVersion, + "VUID-VkRayTracingPipelineCreateInfoKHR-pNext-pNext", "VUID-VkRayTracingPipelineCreateInfoKHR-sType-unique", true); - skip |= ValidateStructTypeArray(pCreateInfos_loc.dot(Field::stageCount), pCreateInfos_loc.dot(Field::pStages), - pCreateInfos[createInfoIndex].stageCount, pCreateInfos[createInfoIndex].pStages, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, true, - "VUID-VkPipelineShaderStageCreateInfo-sType-sType", - "VUID-VkRayTracingPipelineCreateInfoKHR-pStages-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pCreateInfos_loc.dot(Field::stageCount), pCreateInfos_loc.dot(Field::pStages), + pCreateInfos[createInfoIndex].stageCount, pCreateInfos[createInfoIndex].pStages, + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, false, true, + "VUID-VkPipelineShaderStageCreateInfo-sType-sType", + "VUID-VkRayTracingPipelineCreateInfoKHR-pStages-parameter", kVUIDUndefined); if (pCreateInfos[createInfoIndex].pStages != nullptr) { for (uint32_t stageIndex = 0; stageIndex < pCreateInfos[createInfoIndex].stageCount; ++stageIndex) { @@ -27847,34 +30577,34 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesKHR(VkDevice d VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(pStages_loc, pCreateInfos[createInfoIndex].pStages[stageIndex].pNext, - allowed_structs_VkPipelineShaderStageCreateInfo.size(), - allowed_structs_VkPipelineShaderStageCreateInfo.data(), - GeneratedVulkanHeaderVersion, "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", - "VUID-VkPipelineShaderStageCreateInfo-sType-unique", VK_NULL_HANDLE, true); - - skip |= ValidateFlags(pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, - pCreateInfos[createInfoIndex].pStages[stageIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); - skip |= - ValidateFlags(pStages_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, - AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].stage, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", - "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); - - skip |= ValidateRequiredPointer(pStages_loc.dot(Field::pName), - pCreateInfos[createInfoIndex].pStages[stageIndex].pName, - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + state.ValidateStructPnext(pStages_loc, pCreateInfos[createInfoIndex].pStages[stageIndex].pNext, + allowed_structs_VkPipelineShaderStageCreateInfo.size(), + allowed_structs_VkPipelineShaderStageCreateInfo.data(), + GeneratedVulkanHeaderVersion, "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", + "VUID-VkPipelineShaderStageCreateInfo-sType-unique", true); + + skip |= state.ValidateFlags( + pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].flags, + kOptionalFlags, "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + + skip |= state.ValidateFlags(pStages_loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].stage, + kRequiredSingleBit, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); + + skip |= state.ValidateRequiredPointer(pStages_loc.dot(Field::pName), + pCreateInfos[createInfoIndex].pStages[stageIndex].pName, + "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); if (pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo != nullptr) { [[maybe_unused]] const Location pSpecializationInfo_loc = pStages_loc.dot(Field::pSpecializationInfo); - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), - pSpecializationInfo_loc.dot(Field::pMapEntries), - pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->mapEntryCount, - &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries, - false, true, kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); + skip |= state.ValidateArray( + pSpecializationInfo_loc.dot(Field::mapEntryCount), pSpecializationInfo_loc.dot(Field::pMapEntries), + pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->mapEntryCount, + &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries, false, true, + kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); if (pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pMapEntries != nullptr) { for (uint32_t mapEntryIndex = 0; @@ -27887,97 +30617,98 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesKHR(VkDevice d } } - skip |= - ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), - pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->dataSize, - &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pData, false, - true, kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), + pSpecializationInfo_loc.dot(Field::pData), + pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->dataSize, + &pCreateInfos[createInfoIndex].pStages[stageIndex].pSpecializationInfo->pData, + false, true, kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); } } } - skip |= ValidateStructTypeArray(pCreateInfos_loc.dot(Field::groupCount), pCreateInfos_loc.dot(Field::pGroups), - pCreateInfos[createInfoIndex].groupCount, pCreateInfos[createInfoIndex].pGroups, - VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR, false, true, - "VUID-VkRayTracingShaderGroupCreateInfoKHR-sType-sType", - "VUID-VkRayTracingPipelineCreateInfoKHR-pGroups-parameter", kVUIDUndefined); + skip |= state.ValidateStructTypeArray(pCreateInfos_loc.dot(Field::groupCount), pCreateInfos_loc.dot(Field::pGroups), + pCreateInfos[createInfoIndex].groupCount, pCreateInfos[createInfoIndex].pGroups, + VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR, false, true, + "VUID-VkRayTracingShaderGroupCreateInfoKHR-sType-sType", + "VUID-VkRayTracingPipelineCreateInfoKHR-pGroups-parameter", kVUIDUndefined); if (pCreateInfos[createInfoIndex].pGroups != nullptr) { for (uint32_t groupIndex = 0; groupIndex < pCreateInfos[createInfoIndex].groupCount; ++groupIndex) { [[maybe_unused]] const Location pGroups_loc = pCreateInfos_loc.dot(Field::pGroups, groupIndex); skip |= - ValidateStructPnext(pGroups_loc, pCreateInfos[createInfoIndex].pGroups[groupIndex].pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkRayTracingShaderGroupCreateInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + state.ValidateStructPnext(pGroups_loc, pCreateInfos[createInfoIndex].pGroups[groupIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, + "VUID-VkRayTracingShaderGroupCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRangedEnum(pGroups_loc.dot(Field::type), vvl::Enum::VkRayTracingShaderGroupTypeKHR, - pCreateInfos[createInfoIndex].pGroups[groupIndex].type, - "VUID-VkRayTracingShaderGroupCreateInfoKHR-type-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pGroups_loc.dot(Field::type), vvl::Enum::VkRayTracingShaderGroupTypeKHR, + pCreateInfos[createInfoIndex].pGroups[groupIndex].type, + "VUID-VkRayTracingShaderGroupCreateInfoKHR-type-parameter"); } } - skip |= ValidateStructType(pCreateInfos_loc.dot(Field::pLibraryInfo), pCreateInfos[createInfoIndex].pLibraryInfo, - VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR, false, - "VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-parameter", - "VUID-VkPipelineLibraryCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pCreateInfos_loc.dot(Field::pLibraryInfo), pCreateInfos[createInfoIndex].pLibraryInfo, + VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR, false, + "VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-parameter", + "VUID-VkPipelineLibraryCreateInfoKHR-sType-sType"); if (pCreateInfos[createInfoIndex].pLibraryInfo != nullptr) { [[maybe_unused]] const Location pLibraryInfo_loc = pCreateInfos_loc.dot(Field::pLibraryInfo); - skip |= ValidateArray(pLibraryInfo_loc.dot(Field::libraryCount), pLibraryInfo_loc.dot(Field::pLibraries), - pCreateInfos[createInfoIndex].pLibraryInfo->libraryCount, - &pCreateInfos[createInfoIndex].pLibraryInfo->pLibraries, false, true, kVUIDUndefined, - "VUID-VkPipelineLibraryCreateInfoKHR-pLibraries-parameter"); + skip |= state.ValidateArray(pLibraryInfo_loc.dot(Field::libraryCount), pLibraryInfo_loc.dot(Field::pLibraries), + pCreateInfos[createInfoIndex].pLibraryInfo->libraryCount, + &pCreateInfos[createInfoIndex].pLibraryInfo->pLibraries, false, true, kVUIDUndefined, + "VUID-VkPipelineLibraryCreateInfoKHR-pLibraries-parameter"); } - skip |= - ValidateStructType(pCreateInfos_loc.dot(Field::pLibraryInterface), pCreateInfos[createInfoIndex].pLibraryInterface, - VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR, false, - "VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInterface-parameter", - "VUID-VkRayTracingPipelineInterfaceCreateInfoKHR-sType-sType"); + skip |= state.ValidateStructType(pCreateInfos_loc.dot(Field::pLibraryInterface), + pCreateInfos[createInfoIndex].pLibraryInterface, + VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR, false, + "VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInterface-parameter", + "VUID-VkRayTracingPipelineInterfaceCreateInfoKHR-sType-sType"); if (pCreateInfos[createInfoIndex].pLibraryInterface != nullptr) { [[maybe_unused]] const Location pLibraryInterface_loc = pCreateInfos_loc.dot(Field::pLibraryInterface); skip |= - ValidateStructPnext(pLibraryInterface_loc, pCreateInfos[createInfoIndex].pLibraryInterface->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkRayTracingPipelineInterfaceCreateInfoKHR-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + state.ValidateStructPnext(pLibraryInterface_loc, pCreateInfos[createInfoIndex].pLibraryInterface->pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkRayTracingPipelineInterfaceCreateInfoKHR-pNext-pNext", kVUIDUndefined, true); } - skip |= ValidateStructType(pCreateInfos_loc.dot(Field::pDynamicState), pCreateInfos[createInfoIndex].pDynamicState, - VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, false, - "VUID-VkRayTracingPipelineCreateInfoKHR-pDynamicState-parameter", - "VUID-VkPipelineDynamicStateCreateInfo-sType-sType"); + skip |= + state.ValidateStructType(pCreateInfos_loc.dot(Field::pDynamicState), pCreateInfos[createInfoIndex].pDynamicState, + VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, false, + "VUID-VkRayTracingPipelineCreateInfoKHR-pDynamicState-parameter", + "VUID-VkPipelineDynamicStateCreateInfo-sType-sType"); if (pCreateInfos[createInfoIndex].pDynamicState != nullptr) { [[maybe_unused]] const Location pDynamicState_loc = pCreateInfos_loc.dot(Field::pDynamicState); - skip |= ValidateStructPnext(pDynamicState_loc, pCreateInfos[createInfoIndex].pDynamicState->pNext, 0, nullptr, - GeneratedVulkanHeaderVersion, "VUID-VkPipelineDynamicStateCreateInfo-pNext-pNext", - kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(pDynamicState_loc, pCreateInfos[createInfoIndex].pDynamicState->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineDynamicStateCreateInfo-pNext-pNext", + kVUIDUndefined, true); - skip |= - ValidateReservedFlags(pDynamicState_loc.dot(Field::flags), pCreateInfos[createInfoIndex].pDynamicState->flags, - "VUID-VkPipelineDynamicStateCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(pDynamicState_loc.dot(Field::flags), + pCreateInfos[createInfoIndex].pDynamicState->flags, + "VUID-VkPipelineDynamicStateCreateInfo-flags-zerobitmask"); - skip |= ValidateRangedEnumArray(pDynamicState_loc.dot(Field::dynamicStateCount), - pDynamicState_loc.dot(Field::pDynamicStates), vvl::Enum::VkDynamicState, - pCreateInfos[createInfoIndex].pDynamicState->dynamicStateCount, - pCreateInfos[createInfoIndex].pDynamicState->pDynamicStates, false, true, - kVUIDUndefined, "VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-parameter"); + skip |= state.ValidateRangedEnumArray( + pDynamicState_loc.dot(Field::dynamicStateCount), pDynamicState_loc.dot(Field::pDynamicStates), + vvl::Enum::VkDynamicState, pCreateInfos[createInfoIndex].pDynamicState->dynamicStateCount, + pCreateInfos[createInfoIndex].pDynamicState->pDynamicStates, false, true, kVUIDUndefined, + "VUID-VkPipelineDynamicStateCreateInfo-pDynamicStates-parameter"); } - skip |= ValidateRequiredHandle(pCreateInfos_loc.dot(Field::layout), pCreateInfos[createInfoIndex].layout); + skip |= state.ValidateRequiredHandle(pCreateInfos_loc.dot(Field::layout), pCreateInfos[createInfoIndex].layout); } } if (pAllocator != nullptr) { [[maybe_unused]] const Location pAllocator_loc = loc.dot(Field::pAllocator); - skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + skip |= state.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, true, - "VUID-vkCreateRayTracingPipelinesKHR-createInfoCount-arraylength", - "VUID-vkCreateRayTracingPipelinesKHR-pPipelines-parameter"); + skip |= state.ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, + true, "VUID-vkCreateRayTracingPipelinesKHR-createInfoCount-arraylength", + "VUID-vkCreateRayTracingPipelinesKHR-pPipelines-parameter"); if (!skip) skip |= manual_PreCallValidateCreateRayTracingPipelinesKHR(device, deferredOperation, pipelineCache, createInfoCount, - pCreateInfos, pAllocator, pPipelines, error_obj); + pCreateInfos, pAllocator, pPipelines, state); return skip; } @@ -27986,16 +30717,17 @@ bool StatelessValidation::PreCallValidateGetRayTracingCaptureReplayShaderGroupHa size_t dataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_pipeline}); - skip |= ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); - skip |= ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, - "VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-dataSize-arraylength", - "VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pData-parameter"); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= state.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-dataSize-arraylength", + "VUID-vkGetRayTracingCaptureReplayShaderGroupHandlesKHR-pData-parameter"); if (!skip) skip |= manual_PreCallValidateGetRayTracingCaptureReplayShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount, - dataSize, pData, error_obj); + dataSize, pData, state); return skip; } @@ -28007,21 +30739,22 @@ bool StatelessValidation::PreCallValidateCmdTraceRaysIndirectKHR(VkCommandBuffer VkDeviceAddress indirectDeviceAddress, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_pipeline}); - skip |= ValidateRequiredPointer(loc.dot(Field::pRaygenShaderBindingTable), pRaygenShaderBindingTable, - "VUID-vkCmdTraceRaysIndirectKHR-pRaygenShaderBindingTable-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pMissShaderBindingTable), pMissShaderBindingTable, - "VUID-vkCmdTraceRaysIndirectKHR-pMissShaderBindingTable-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pHitShaderBindingTable), pHitShaderBindingTable, - "VUID-vkCmdTraceRaysIndirectKHR-pHitShaderBindingTable-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pCallableShaderBindingTable), pCallableShaderBindingTable, - "VUID-vkCmdTraceRaysIndirectKHR-pCallableShaderBindingTable-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pRaygenShaderBindingTable), pRaygenShaderBindingTable, + "VUID-vkCmdTraceRaysIndirectKHR-pRaygenShaderBindingTable-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pMissShaderBindingTable), pMissShaderBindingTable, + "VUID-vkCmdTraceRaysIndirectKHR-pMissShaderBindingTable-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pHitShaderBindingTable), pHitShaderBindingTable, + "VUID-vkCmdTraceRaysIndirectKHR-pHitShaderBindingTable-parameter"); + skip |= state.ValidateRequiredPointer(loc.dot(Field::pCallableShaderBindingTable), pCallableShaderBindingTable, + "VUID-vkCmdTraceRaysIndirectKHR-pCallableShaderBindingTable-parameter"); if (!skip) skip |= manual_PreCallValidateCmdTraceRaysIndirectKHR(commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable, pCallableShaderBindingTable, - indirectDeviceAddress, error_obj); + indirectDeviceAddress, state); return skip; } @@ -28029,12 +30762,13 @@ bool StatelessValidation::PreCallValidateGetRayTracingShaderGroupStackSizeKHR(Vk VkShaderGroupShaderKHR groupShader, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_pipeline}); - skip |= ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); - skip |= ValidateRangedEnum(loc.dot(Field::groupShader), vvl::Enum::VkShaderGroupShaderKHR, groupShader, - "VUID-vkGetRayTracingShaderGroupStackSizeKHR-groupShader-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= state.ValidateRangedEnum(loc.dot(Field::groupShader), vvl::Enum::VkShaderGroupShaderKHR, groupShader, + "VUID-vkGetRayTracingShaderGroupStackSizeKHR-groupShader-parameter"); return skip; } @@ -28042,6 +30776,7 @@ bool StatelessValidation::PreCallValidateCmdSetRayTracingPipelineStackSizeKHR(Vk uint32_t pipelineStackSize, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_pipeline}); @@ -28053,6 +30788,7 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksEXT(VkCommandBuffer com uint32_t groupCountY, uint32_t groupCountZ, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_mesh_shader}); @@ -28064,10 +30800,11 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksIndirectEXT(VkCommandBu VkDeviceSize offset, uint32_t drawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_mesh_shader}); - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } @@ -28076,19 +30813,21 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksIndirectCountEXT(VkComm VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + vvl::stateless::State state(*this, error_obj, device_extensions); [[maybe_unused]] const Location loc = error_obj.location; if (!IsExtEnabled(device_extensions.vk_ext_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_mesh_shader}); - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= state.ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); return skip; } -bool StatelessValidation::ValidatePipelineViewportStateCreateInfo(const VkPipelineViewportStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineViewportStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineViewportStateCreateInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineViewportStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineViewportStateCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkPipelineViewportStateCreateInfo = { VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV, @@ -28099,84 +30838,89 @@ bool StatelessValidation::ValidatePipelineViewportStateCreateInfo(const VkPipeli VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineViewportStateCreateInfo.size(), - allowed_structs_VkPipelineViewportStateCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineViewportStateCreateInfo-pNext-pNext", - "VUID-VkPipelineViewportStateCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineViewportStateCreateInfo.size(), + allowed_structs_VkPipelineViewportStateCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineViewportStateCreateInfo-pNext-pNext", + "VUID-VkPipelineViewportStateCreateInfo-sType-unique", true); - skip |= ValidateReservedFlags(loc.dot(Field::flags), info.flags, "VUID-VkPipelineViewportStateCreateInfo-flags-zerobitmask"); + skip |= + state.ValidateReservedFlags(loc.dot(Field::flags), info.flags, "VUID-VkPipelineViewportStateCreateInfo-flags-zerobitmask"); return skip; } -bool StatelessValidation::ValidatePipelineTessellationStateCreateInfo(const VkPipelineTessellationStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineTessellationStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineTessellationStateCreateInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineTessellationStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineTessellationStateCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkPipelineTessellationStateCreateInfo = { VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineTessellationStateCreateInfo.size(), - allowed_structs_VkPipelineTessellationStateCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineTessellationStateCreateInfo-pNext-pNext", - "VUID-VkPipelineTessellationStateCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineTessellationStateCreateInfo.size(), + allowed_structs_VkPipelineTessellationStateCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineTessellationStateCreateInfo-pNext-pNext", + "VUID-VkPipelineTessellationStateCreateInfo-sType-unique", true); - skip |= - ValidateReservedFlags(loc.dot(Field::flags), info.flags, "VUID-VkPipelineTessellationStateCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(loc.dot(Field::flags), info.flags, + "VUID-VkPipelineTessellationStateCreateInfo-flags-zerobitmask"); return skip; } -bool StatelessValidation::ValidatePipelineVertexInputStateCreateInfo(const VkPipelineVertexInputStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineVertexInputStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineVertexInputStateCreateInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineVertexInputStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineVertexInputStateCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkPipelineVertexInputStateCreateInfo = { VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineVertexInputStateCreateInfo.size(), - allowed_structs_VkPipelineVertexInputStateCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineVertexInputStateCreateInfo-pNext-pNext", - "VUID-VkPipelineVertexInputStateCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineVertexInputStateCreateInfo.size(), + allowed_structs_VkPipelineVertexInputStateCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineVertexInputStateCreateInfo-pNext-pNext", + "VUID-VkPipelineVertexInputStateCreateInfo-sType-unique", true); - skip |= ValidateReservedFlags(loc.dot(Field::flags), info.flags, "VUID-VkPipelineVertexInputStateCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(loc.dot(Field::flags), info.flags, + "VUID-VkPipelineVertexInputStateCreateInfo-flags-zerobitmask"); - skip |= ValidateArray(loc.dot(Field::vertexBindingDescriptionCount), loc.dot(Field::pVertexBindingDescriptions), - info.vertexBindingDescriptionCount, &info.pVertexBindingDescriptions, false, true, kVUIDUndefined, - "VUID-VkPipelineVertexInputStateCreateInfo-pVertexBindingDescriptions-parameter"); + skip |= state.ValidateArray(loc.dot(Field::vertexBindingDescriptionCount), loc.dot(Field::pVertexBindingDescriptions), + info.vertexBindingDescriptionCount, &info.pVertexBindingDescriptions, false, true, kVUIDUndefined, + "VUID-VkPipelineVertexInputStateCreateInfo-pVertexBindingDescriptions-parameter"); if (info.pVertexBindingDescriptions != nullptr) { for (uint32_t vertexBindingDescriptionIndex = 0; vertexBindingDescriptionIndex < info.vertexBindingDescriptionCount; ++vertexBindingDescriptionIndex) { [[maybe_unused]] const Location pVertexBindingDescriptions_loc = loc.dot(Field::pVertexBindingDescriptions, vertexBindingDescriptionIndex); - skip |= ValidateRangedEnum(pVertexBindingDescriptions_loc.dot(Field::inputRate), vvl::Enum::VkVertexInputRate, - info.pVertexBindingDescriptions[vertexBindingDescriptionIndex].inputRate, - "VUID-VkVertexInputBindingDescription-inputRate-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pVertexBindingDescriptions_loc.dot(Field::inputRate), vvl::Enum::VkVertexInputRate, + info.pVertexBindingDescriptions[vertexBindingDescriptionIndex].inputRate, + "VUID-VkVertexInputBindingDescription-inputRate-parameter"); } } - skip |= ValidateArray(loc.dot(Field::vertexAttributeDescriptionCount), loc.dot(Field::pVertexAttributeDescriptions), - info.vertexAttributeDescriptionCount, &info.pVertexAttributeDescriptions, false, true, kVUIDUndefined, - "VUID-VkPipelineVertexInputStateCreateInfo-pVertexAttributeDescriptions-parameter"); + skip |= state.ValidateArray(loc.dot(Field::vertexAttributeDescriptionCount), loc.dot(Field::pVertexAttributeDescriptions), + info.vertexAttributeDescriptionCount, &info.pVertexAttributeDescriptions, false, true, + kVUIDUndefined, "VUID-VkPipelineVertexInputStateCreateInfo-pVertexAttributeDescriptions-parameter"); if (info.pVertexAttributeDescriptions != nullptr) { for (uint32_t vertexAttributeDescriptionIndex = 0; vertexAttributeDescriptionIndex < info.vertexAttributeDescriptionCount; ++vertexAttributeDescriptionIndex) { [[maybe_unused]] const Location pVertexAttributeDescriptions_loc = loc.dot(Field::pVertexAttributeDescriptions, vertexAttributeDescriptionIndex); - skip |= ValidateRangedEnum(pVertexAttributeDescriptions_loc.dot(Field::format), vvl::Enum::VkFormat, - info.pVertexAttributeDescriptions[vertexAttributeDescriptionIndex].format, - "VUID-VkVertexInputAttributeDescription-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pVertexAttributeDescriptions_loc.dot(Field::format), vvl::Enum::VkFormat, + info.pVertexAttributeDescriptions[vertexAttributeDescriptionIndex].format, + "VUID-VkVertexInputAttributeDescription-format-parameter"); } } return skip; } -bool StatelessValidation::ValidatePipelineMultisampleStateCreateInfo(const VkPipelineMultisampleStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineMultisampleStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineMultisampleStateCreateInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineMultisampleStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineMultisampleStateCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkPipelineMultisampleStateCreateInfo = { VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV, @@ -28184,158 +30928,163 @@ bool StatelessValidation::ValidatePipelineMultisampleStateCreateInfo(const VkPip VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV, VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineMultisampleStateCreateInfo.size(), - allowed_structs_VkPipelineMultisampleStateCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineMultisampleStateCreateInfo-pNext-pNext", - "VUID-VkPipelineMultisampleStateCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineMultisampleStateCreateInfo.size(), + allowed_structs_VkPipelineMultisampleStateCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineMultisampleStateCreateInfo-pNext-pNext", + "VUID-VkPipelineMultisampleStateCreateInfo-sType-unique", true); - skip |= ValidateReservedFlags(loc.dot(Field::flags), info.flags, "VUID-VkPipelineMultisampleStateCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(loc.dot(Field::flags), info.flags, + "VUID-VkPipelineMultisampleStateCreateInfo-flags-zerobitmask"); - skip |= ValidateFlags(loc.dot(Field::rasterizationSamples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, - info.rasterizationSamples, kRequiredSingleBit, VK_NULL_HANDLE, - "VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-parameter", - "VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::rasterizationSamples), vvl::FlagBitmask::VkSampleCountFlagBits, + AllVkSampleCountFlagBits, info.rasterizationSamples, kRequiredSingleBit, + "VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-parameter", + "VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-parameter"); - skip |= ValidateBool32(loc.dot(Field::sampleShadingEnable), info.sampleShadingEnable); + skip |= state.ValidateBool32(loc.dot(Field::sampleShadingEnable), info.sampleShadingEnable); - skip |= ValidateArray(loc.dot(Field::rasterizationSamples), loc.dot(Field::pSampleMask), info.rasterizationSamples, - &info.pSampleMask, true, false, kVUIDUndefined, - "VUID-VkPipelineMultisampleStateCreateInfo-pSampleMask-parameter"); + skip |= state.ValidateArray(loc.dot(Field::rasterizationSamples), loc.dot(Field::pSampleMask), info.rasterizationSamples, + &info.pSampleMask, true, false, kVUIDUndefined, + "VUID-VkPipelineMultisampleStateCreateInfo-pSampleMask-parameter"); - skip |= ValidateBool32(loc.dot(Field::alphaToCoverageEnable), info.alphaToCoverageEnable); + skip |= state.ValidateBool32(loc.dot(Field::alphaToCoverageEnable), info.alphaToCoverageEnable); - skip |= ValidateBool32(loc.dot(Field::alphaToOneEnable), info.alphaToOneEnable); + skip |= state.ValidateBool32(loc.dot(Field::alphaToOneEnable), info.alphaToOneEnable); return skip; } -bool StatelessValidation::ValidatePipelineColorBlendStateCreateInfo(const VkPipelineColorBlendStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineColorBlendStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineColorBlendStateCreateInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineColorBlendStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineColorBlendStateCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkPipelineColorBlendStateCreateInfo = { VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineColorBlendStateCreateInfo.size(), - allowed_structs_VkPipelineColorBlendStateCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineColorBlendStateCreateInfo-pNext-pNext", - "VUID-VkPipelineColorBlendStateCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineColorBlendStateCreateInfo.size(), + allowed_structs_VkPipelineColorBlendStateCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineColorBlendStateCreateInfo-pNext-pNext", + "VUID-VkPipelineColorBlendStateCreateInfo-sType-unique", true); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineColorBlendStateCreateFlagBits, - AllVkPipelineColorBlendStateCreateFlagBits, info.flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineColorBlendStateCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineColorBlendStateCreateFlagBits, + AllVkPipelineColorBlendStateCreateFlagBits, info.flags, kOptionalFlags, + "VUID-VkPipelineColorBlendStateCreateInfo-flags-parameter"); - skip |= ValidateBool32(loc.dot(Field::logicOpEnable), info.logicOpEnable); + skip |= state.ValidateBool32(loc.dot(Field::logicOpEnable), info.logicOpEnable); if (info.pAttachments != nullptr) { for (uint32_t attachmentIndex = 0; attachmentIndex < info.attachmentCount; ++attachmentIndex) { [[maybe_unused]] const Location pAttachments_loc = loc.dot(Field::pAttachments, attachmentIndex); - skip |= ValidateBool32(pAttachments_loc.dot(Field::blendEnable), info.pAttachments[attachmentIndex].blendEnable); + skip |= state.ValidateBool32(pAttachments_loc.dot(Field::blendEnable), info.pAttachments[attachmentIndex].blendEnable); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::srcColorBlendFactor), vvl::Enum::VkBlendFactor, - info.pAttachments[attachmentIndex].srcColorBlendFactor, - "VUID-VkPipelineColorBlendAttachmentState-srcColorBlendFactor-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::srcColorBlendFactor), vvl::Enum::VkBlendFactor, + info.pAttachments[attachmentIndex].srcColorBlendFactor, + "VUID-VkPipelineColorBlendAttachmentState-srcColorBlendFactor-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::dstColorBlendFactor), vvl::Enum::VkBlendFactor, - info.pAttachments[attachmentIndex].dstColorBlendFactor, - "VUID-VkPipelineColorBlendAttachmentState-dstColorBlendFactor-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::dstColorBlendFactor), vvl::Enum::VkBlendFactor, + info.pAttachments[attachmentIndex].dstColorBlendFactor, + "VUID-VkPipelineColorBlendAttachmentState-dstColorBlendFactor-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::colorBlendOp), vvl::Enum::VkBlendOp, - info.pAttachments[attachmentIndex].colorBlendOp, - "VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::colorBlendOp), vvl::Enum::VkBlendOp, + info.pAttachments[attachmentIndex].colorBlendOp, + "VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::srcAlphaBlendFactor), vvl::Enum::VkBlendFactor, - info.pAttachments[attachmentIndex].srcAlphaBlendFactor, - "VUID-VkPipelineColorBlendAttachmentState-srcAlphaBlendFactor-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::srcAlphaBlendFactor), vvl::Enum::VkBlendFactor, + info.pAttachments[attachmentIndex].srcAlphaBlendFactor, + "VUID-VkPipelineColorBlendAttachmentState-srcAlphaBlendFactor-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::dstAlphaBlendFactor), vvl::Enum::VkBlendFactor, - info.pAttachments[attachmentIndex].dstAlphaBlendFactor, - "VUID-VkPipelineColorBlendAttachmentState-dstAlphaBlendFactor-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::dstAlphaBlendFactor), vvl::Enum::VkBlendFactor, + info.pAttachments[attachmentIndex].dstAlphaBlendFactor, + "VUID-VkPipelineColorBlendAttachmentState-dstAlphaBlendFactor-parameter"); - skip |= ValidateRangedEnum(pAttachments_loc.dot(Field::alphaBlendOp), vvl::Enum::VkBlendOp, - info.pAttachments[attachmentIndex].alphaBlendOp, - "VUID-VkPipelineColorBlendAttachmentState-alphaBlendOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(pAttachments_loc.dot(Field::alphaBlendOp), vvl::Enum::VkBlendOp, + info.pAttachments[attachmentIndex].alphaBlendOp, + "VUID-VkPipelineColorBlendAttachmentState-alphaBlendOp-parameter"); - skip |= ValidateFlags(pAttachments_loc.dot(Field::colorWriteMask), vvl::FlagBitmask::VkColorComponentFlagBits, - AllVkColorComponentFlagBits, info.pAttachments[attachmentIndex].colorWriteMask, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkPipelineColorBlendAttachmentState-colorWriteMask-parameter"); + skip |= state.ValidateFlags(pAttachments_loc.dot(Field::colorWriteMask), vvl::FlagBitmask::VkColorComponentFlagBits, + AllVkColorComponentFlagBits, info.pAttachments[attachmentIndex].colorWriteMask, + kOptionalFlags, "VUID-VkPipelineColorBlendAttachmentState-colorWriteMask-parameter"); } } return skip; } -bool StatelessValidation::ValidatePipelineDepthStencilStateCreateInfo(const VkPipelineDepthStencilStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineDepthStencilStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineDepthStencilStateCreateInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineDepthStencilStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineDepthStencilStateCreateInfo-sType-sType"); - skip |= ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineDepthStencilStateCreateInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineDepthStencilStateCreateInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineDepthStencilStateCreateFlagBits, - AllVkPipelineDepthStencilStateCreateFlagBits, info.flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineDepthStencilStateCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineDepthStencilStateCreateFlagBits, + AllVkPipelineDepthStencilStateCreateFlagBits, info.flags, kOptionalFlags, + "VUID-VkPipelineDepthStencilStateCreateInfo-flags-parameter"); - skip |= ValidateBool32(loc.dot(Field::depthTestEnable), info.depthTestEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthTestEnable), info.depthTestEnable); - skip |= ValidateBool32(loc.dot(Field::depthWriteEnable), info.depthWriteEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthWriteEnable), info.depthWriteEnable); - skip |= ValidateRangedEnum(loc.dot(Field::depthCompareOp), vvl::Enum::VkCompareOp, info.depthCompareOp, - "VUID-VkPipelineDepthStencilStateCreateInfo-depthCompareOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::depthCompareOp), vvl::Enum::VkCompareOp, info.depthCompareOp, + "VUID-VkPipelineDepthStencilStateCreateInfo-depthCompareOp-parameter"); - skip |= ValidateBool32(loc.dot(Field::depthBoundsTestEnable), info.depthBoundsTestEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthBoundsTestEnable), info.depthBoundsTestEnable); - skip |= ValidateBool32(loc.dot(Field::stencilTestEnable), info.stencilTestEnable); + skip |= state.ValidateBool32(loc.dot(Field::stencilTestEnable), info.stencilTestEnable); - skip |= ValidateRangedEnum(loc.dot(Field::failOp), vvl::Enum::VkStencilOp, info.front.failOp, - "VUID-VkStencilOpState-failOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::failOp), vvl::Enum::VkStencilOp, info.front.failOp, + "VUID-VkStencilOpState-failOp-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::passOp), vvl::Enum::VkStencilOp, info.front.passOp, - "VUID-VkStencilOpState-passOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::passOp), vvl::Enum::VkStencilOp, info.front.passOp, + "VUID-VkStencilOpState-passOp-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::depthFailOp), vvl::Enum::VkStencilOp, info.front.depthFailOp, - "VUID-VkStencilOpState-depthFailOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::depthFailOp), vvl::Enum::VkStencilOp, info.front.depthFailOp, + "VUID-VkStencilOpState-depthFailOp-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, info.front.compareOp, - "VUID-VkStencilOpState-compareOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, info.front.compareOp, + "VUID-VkStencilOpState-compareOp-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::failOp), vvl::Enum::VkStencilOp, info.back.failOp, - "VUID-VkStencilOpState-failOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::failOp), vvl::Enum::VkStencilOp, info.back.failOp, + "VUID-VkStencilOpState-failOp-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::passOp), vvl::Enum::VkStencilOp, info.back.passOp, - "VUID-VkStencilOpState-passOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::passOp), vvl::Enum::VkStencilOp, info.back.passOp, + "VUID-VkStencilOpState-passOp-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::depthFailOp), vvl::Enum::VkStencilOp, info.back.depthFailOp, - "VUID-VkStencilOpState-depthFailOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::depthFailOp), vvl::Enum::VkStencilOp, info.back.depthFailOp, + "VUID-VkStencilOpState-depthFailOp-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, info.back.compareOp, - "VUID-VkStencilOpState-compareOp-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, info.back.compareOp, + "VUID-VkStencilOpState-compareOp-parameter"); return skip; } -bool StatelessValidation::ValidatePipelineInputAssemblyStateCreateInfo(const VkPipelineInputAssemblyStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineInputAssemblyStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineInputAssemblyStateCreateInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineInputAssemblyStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineInputAssemblyStateCreateInfo-sType-sType"); - skip |= ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkPipelineInputAssemblyStateCreateInfo-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineInputAssemblyStateCreateInfo-pNext-pNext", kVUIDUndefined, true); - skip |= - ValidateReservedFlags(loc.dot(Field::flags), info.flags, "VUID-VkPipelineInputAssemblyStateCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(loc.dot(Field::flags), info.flags, + "VUID-VkPipelineInputAssemblyStateCreateInfo-flags-zerobitmask"); - skip |= ValidateRangedEnum(loc.dot(Field::topology), vvl::Enum::VkPrimitiveTopology, info.topology, - "VUID-VkPipelineInputAssemblyStateCreateInfo-topology-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::topology), vvl::Enum::VkPrimitiveTopology, info.topology, + "VUID-VkPipelineInputAssemblyStateCreateInfo-topology-parameter"); - skip |= ValidateBool32(loc.dot(Field::primitiveRestartEnable), info.primitiveRestartEnable); + skip |= state.ValidateBool32(loc.dot(Field::primitiveRestartEnable), info.primitiveRestartEnable); return skip; } -bool StatelessValidation::ValidatePipelineRasterizationStateCreateInfo(const VkPipelineRasterizationStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineRasterizationStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineRasterizationStateCreateInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, false, kVUIDUndefined, - "VUID-VkPipelineRasterizationStateCreateInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, false, kVUIDUndefined, + "VUID-VkPipelineRasterizationStateCreateInfo-sType-sType"); constexpr std::array allowed_structs_VkPipelineRasterizationStateCreateInfo = { VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT, @@ -28346,31 +31095,32 @@ bool StatelessValidation::ValidatePipelineRasterizationStateCreateInfo(const VkP VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineRasterizationStateCreateInfo.size(), - allowed_structs_VkPipelineRasterizationStateCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineRasterizationStateCreateInfo-pNext-pNext", - "VUID-VkPipelineRasterizationStateCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineRasterizationStateCreateInfo.size(), + allowed_structs_VkPipelineRasterizationStateCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineRasterizationStateCreateInfo-pNext-pNext", + "VUID-VkPipelineRasterizationStateCreateInfo-sType-unique", true); - skip |= - ValidateReservedFlags(loc.dot(Field::flags), info.flags, "VUID-VkPipelineRasterizationStateCreateInfo-flags-zerobitmask"); + skip |= state.ValidateReservedFlags(loc.dot(Field::flags), info.flags, + "VUID-VkPipelineRasterizationStateCreateInfo-flags-zerobitmask"); - skip |= ValidateBool32(loc.dot(Field::depthClampEnable), info.depthClampEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthClampEnable), info.depthClampEnable); - skip |= ValidateBool32(loc.dot(Field::rasterizerDiscardEnable), info.rasterizerDiscardEnable); + skip |= state.ValidateBool32(loc.dot(Field::rasterizerDiscardEnable), info.rasterizerDiscardEnable); - skip |= ValidateRangedEnum(loc.dot(Field::polygonMode), vvl::Enum::VkPolygonMode, info.polygonMode, - "VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::polygonMode), vvl::Enum::VkPolygonMode, info.polygonMode, + "VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-parameter"); - skip |= ValidateFlags(loc.dot(Field::cullMode), vvl::FlagBitmask::VkCullModeFlagBits, AllVkCullModeFlagBits, info.cullMode, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkPipelineRasterizationStateCreateInfo-cullMode-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::cullMode), vvl::FlagBitmask::VkCullModeFlagBits, AllVkCullModeFlagBits, + info.cullMode, kOptionalFlags, "VUID-VkPipelineRasterizationStateCreateInfo-cullMode-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::frontFace), vvl::Enum::VkFrontFace, info.frontFace, - "VUID-VkPipelineRasterizationStateCreateInfo-frontFace-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::frontFace), vvl::Enum::VkFrontFace, info.frontFace, + "VUID-VkPipelineRasterizationStateCreateInfo-frontFace-parameter"); - skip |= ValidateBool32(loc.dot(Field::depthBiasEnable), info.depthBiasEnable); + skip |= state.ValidateBool32(loc.dot(Field::depthBiasEnable), info.depthBiasEnable); return skip; } -bool StatelessValidation::ValidatePipelineShaderStageCreateInfo(const VkPipelineShaderStageCreateInfo& info, +bool StatelessValidation::ValidatePipelineShaderStageCreateInfo(const vvl::stateless::State& state, + const VkPipelineShaderStageCreateInfo& info, const Location& loc) const { bool skip = false; constexpr std::array allowed_structs_VkPipelineShaderStageCreateInfo = { @@ -28382,26 +31132,28 @@ bool StatelessValidation::ValidatePipelineShaderStageCreateInfo(const VkPipeline VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineShaderStageCreateInfo.size(), - allowed_structs_VkPipelineShaderStageCreateInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", - "VUID-VkPipelineShaderStageCreateInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkPipelineShaderStageCreateInfo.size(), + allowed_structs_VkPipelineShaderStageCreateInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPipelineShaderStageCreateInfo-pNext-pNext", + "VUID-VkPipelineShaderStageCreateInfo-sType-unique", true); - skip |= ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, info.flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, info.flags, kOptionalFlags, + "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); - skip |= ValidateFlags(loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, info.stage, - kRequiredSingleBit, VK_NULL_HANDLE, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", - "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); + skip |= state.ValidateFlags(loc.dot(Field::stage), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, + info.stage, kRequiredSingleBit, "VUID-VkPipelineShaderStageCreateInfo-stage-parameter", + "VUID-VkPipelineShaderStageCreateInfo-stage-parameter"); - skip |= ValidateRequiredPointer(loc.dot(Field::pName), info.pName, "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + skip |= + state.ValidateRequiredPointer(loc.dot(Field::pName), info.pName, "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); if (info.pSpecializationInfo != nullptr) { [[maybe_unused]] const Location pSpecializationInfo_loc = loc.dot(Field::pSpecializationInfo); - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), pSpecializationInfo_loc.dot(Field::pMapEntries), - info.pSpecializationInfo->mapEntryCount, &info.pSpecializationInfo->pMapEntries, false, true, - kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); + skip |= + state.ValidateArray(pSpecializationInfo_loc.dot(Field::mapEntryCount), pSpecializationInfo_loc.dot(Field::pMapEntries), + info.pSpecializationInfo->mapEntryCount, &info.pSpecializationInfo->pMapEntries, false, true, + kVUIDUndefined, "VUID-VkSpecializationInfo-pMapEntries-parameter"); if (info.pSpecializationInfo->pMapEntries != nullptr) { for (uint32_t mapEntryIndex = 0; mapEntryIndex < info.pSpecializationInfo->mapEntryCount; ++mapEntryIndex) { @@ -28410,17 +31162,18 @@ bool StatelessValidation::ValidatePipelineShaderStageCreateInfo(const VkPipeline } } - skip |= ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), - info.pSpecializationInfo->dataSize, &info.pSpecializationInfo->pData, false, true, kVUIDUndefined, - "VUID-VkSpecializationInfo-pData-parameter"); + skip |= state.ValidateArray(pSpecializationInfo_loc.dot(Field::dataSize), pSpecializationInfo_loc.dot(Field::pData), + info.pSpecializationInfo->dataSize, &info.pSpecializationInfo->pData, false, true, + kVUIDUndefined, "VUID-VkSpecializationInfo-pData-parameter"); } return skip; } -bool StatelessValidation::ValidateCommandBufferInheritanceInfo(const VkCommandBufferInheritanceInfo& info, +bool StatelessValidation::ValidateCommandBufferInheritanceInfo(const vvl::stateless::State& state, + const VkCommandBufferInheritanceInfo& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO, false, kVUIDUndefined, - "VUID-VkCommandBufferInheritanceInfo-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO, false, kVUIDUndefined, + "VUID-VkCommandBufferInheritanceInfo-sType-sType"); constexpr std::array allowed_structs_VkCommandBufferInheritanceInfo = { VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD, @@ -28433,80 +31186,82 @@ bool StatelessValidation::ValidateCommandBufferInheritanceInfo(const VkCommandBu VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO, VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkCommandBufferInheritanceInfo.size(), - allowed_structs_VkCommandBufferInheritanceInfo.data(), GeneratedVulkanHeaderVersion, - "VUID-VkCommandBufferInheritanceInfo-pNext-pNext", - "VUID-VkCommandBufferInheritanceInfo-sType-unique", VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkCommandBufferInheritanceInfo.size(), + allowed_structs_VkCommandBufferInheritanceInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkCommandBufferInheritanceInfo-pNext-pNext", + "VUID-VkCommandBufferInheritanceInfo-sType-unique", true); - skip |= ValidateBool32(loc.dot(Field::occlusionQueryEnable), info.occlusionQueryEnable); + skip |= state.ValidateBool32(loc.dot(Field::occlusionQueryEnable), info.occlusionQueryEnable); return skip; } -bool StatelessValidation::ValidateDescriptorAddressInfoEXT(const VkDescriptorAddressInfoEXT& info, const Location& loc) const { +bool StatelessValidation::ValidateDescriptorAddressInfoEXT(const vvl::stateless::State& state, + const VkDescriptorAddressInfoEXT& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_DESCRIPTOR_ADDRESS_INFO_EXT, false, kVUIDUndefined, - "VUID-VkDescriptorAddressInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_DESCRIPTOR_ADDRESS_INFO_EXT, false, kVUIDUndefined, + "VUID-VkDescriptorAddressInfoEXT-sType-sType"); - skip |= ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkDescriptorAddressInfoEXT-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, false); + skip |= state.ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorAddressInfoEXT-pNext-pNext", kVUIDUndefined, false); - skip |= ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, info.format, - "VUID-VkDescriptorAddressInfoEXT-format-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, info.format, + "VUID-VkDescriptorAddressInfoEXT-format-parameter"); return skip; } bool StatelessValidation::ValidateAccelerationStructureGeometryTrianglesDataKHR( - const VkAccelerationStructureGeometryTrianglesDataKHR& info, const Location& loc) const { + const vvl::stateless::State& state, const VkAccelerationStructureGeometryTrianglesDataKHR& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR, false, - kVUIDUndefined, "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR, false, + kVUIDUndefined, "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-sType-sType"); constexpr std::array allowed_structs_VkAccelerationStructureGeometryTrianglesDataKHR = { VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_DISPLACEMENT_MICROMAP_NV, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT}; - skip |= ValidateStructPnext(loc, info.pNext, allowed_structs_VkAccelerationStructureGeometryTrianglesDataKHR.size(), - allowed_structs_VkAccelerationStructureGeometryTrianglesDataKHR.data(), - GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-pNext-pNext", - "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-sType-unique", VK_NULL_HANDLE, true); + skip |= + state.ValidateStructPnext(loc, info.pNext, allowed_structs_VkAccelerationStructureGeometryTrianglesDataKHR.size(), + allowed_structs_VkAccelerationStructureGeometryTrianglesDataKHR.data(), + GeneratedVulkanHeaderVersion, "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-pNext-pNext", + "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-sType-unique", true); - skip |= ValidateRangedEnum(loc.dot(Field::vertexFormat), vvl::Enum::VkFormat, info.vertexFormat, - "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexFormat-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::vertexFormat), vvl::Enum::VkFormat, info.vertexFormat, + "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-vertexFormat-parameter"); - skip |= ValidateRangedEnum(loc.dot(Field::indexType), vvl::Enum::VkIndexType, info.indexType, - "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-indexType-parameter", VK_NULL_HANDLE); + skip |= state.ValidateRangedEnum(loc.dot(Field::indexType), vvl::Enum::VkIndexType, info.indexType, + "VUID-VkAccelerationStructureGeometryTrianglesDataKHR-indexType-parameter"); return skip; } bool StatelessValidation::ValidateAccelerationStructureGeometryInstancesDataKHR( - const VkAccelerationStructureGeometryInstancesDataKHR& info, const Location& loc) const { + const vvl::stateless::State& state, const VkAccelerationStructureGeometryInstancesDataKHR& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR, false, - kVUIDUndefined, "VUID-VkAccelerationStructureGeometryInstancesDataKHR-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR, false, + kVUIDUndefined, "VUID-VkAccelerationStructureGeometryInstancesDataKHR-sType-sType"); - skip |= ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureGeometryInstancesDataKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, - true); + skip |= state.ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryInstancesDataKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateBool32(loc.dot(Field::arrayOfPointers), info.arrayOfPointers); + skip |= state.ValidateBool32(loc.dot(Field::arrayOfPointers), info.arrayOfPointers); return skip; } -bool StatelessValidation::ValidateAccelerationStructureGeometryAabbsDataKHR(const VkAccelerationStructureGeometryAabbsDataKHR& info, +bool StatelessValidation::ValidateAccelerationStructureGeometryAabbsDataKHR(const vvl::stateless::State& state, + const VkAccelerationStructureGeometryAabbsDataKHR& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR, false, kVUIDUndefined, - "VUID-VkAccelerationStructureGeometryAabbsDataKHR-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR, false, + kVUIDUndefined, "VUID-VkAccelerationStructureGeometryAabbsDataKHR-sType-sType"); - skip |= - ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkAccelerationStructureGeometryAabbsDataKHR-pNext-pNext", kVUIDUndefined, VK_NULL_HANDLE, true); + skip |= state.ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryAabbsDataKHR-pNext-pNext", kVUIDUndefined, true); return skip; } -bool StatelessValidation::ValidateIndirectExecutionSetPipelineInfoEXT(const VkIndirectExecutionSetPipelineInfoEXT& info, +bool StatelessValidation::ValidateIndirectExecutionSetPipelineInfoEXT(const vvl::stateless::State& state, + const VkIndirectExecutionSetPipelineInfoEXT& info, const Location& loc) const { bool skip = false; - skip |= ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_PIPELINE_INFO_EXT, false, kVUIDUndefined, - "VUID-VkIndirectExecutionSetPipelineInfoEXT-sType-sType"); + skip |= state.ValidateStructType(loc, &info, VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_PIPELINE_INFO_EXT, false, kVUIDUndefined, + "VUID-VkIndirectExecutionSetPipelineInfoEXT-sType-sType"); - skip |= ValidateRequiredHandle(loc.dot(Field::initialPipeline), info.initialPipeline); + skip |= state.ValidateRequiredHandle(loc.dot(Field::initialPipeline), info.initialPipeline); return skip; } diff --git a/layers/vulkan/generated/stateless_validation_helper.h b/layers/vulkan/generated/stateless_validation_helper.h index 46a4112a2f3..ec126e8c5e3 100644 --- a/layers/vulkan/generated/stateless_validation_helper.h +++ b/layers/vulkan/generated/stateless_validation_helper.h @@ -42,8 +42,6 @@ static inline bool IsDuplicatePnext(VkStructureType input_value) { } } -bool PreCallValidateCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, - VkInstance* pInstance, const ErrorObject& error_obj) const override; bool PreCallValidateDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const override; bool PreCallValidateEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, @@ -1919,22 +1917,37 @@ bool PreCallValidateCmdDrawMeshTasksIndirectEXT(VkCommandBuffer commandBuffer, V bool PreCallValidateCmdDrawMeshTasksIndirectCountEXT(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const override; -bool ValidatePipelineViewportStateCreateInfo(const VkPipelineViewportStateCreateInfo& info, const Location& loc) const; -bool ValidatePipelineTessellationStateCreateInfo(const VkPipelineTessellationStateCreateInfo& info, const Location& loc) const; -bool ValidatePipelineVertexInputStateCreateInfo(const VkPipelineVertexInputStateCreateInfo& info, const Location& loc) const; -bool ValidatePipelineMultisampleStateCreateInfo(const VkPipelineMultisampleStateCreateInfo& info, const Location& loc) const; -bool ValidatePipelineColorBlendStateCreateInfo(const VkPipelineColorBlendStateCreateInfo& info, const Location& loc) const; -bool ValidatePipelineDepthStencilStateCreateInfo(const VkPipelineDepthStencilStateCreateInfo& info, const Location& loc) const; -bool ValidatePipelineInputAssemblyStateCreateInfo(const VkPipelineInputAssemblyStateCreateInfo& info, const Location& loc) const; -bool ValidatePipelineRasterizationStateCreateInfo(const VkPipelineRasterizationStateCreateInfo& info, const Location& loc) const; -bool ValidatePipelineShaderStageCreateInfo(const VkPipelineShaderStageCreateInfo& info, const Location& loc) const; -bool ValidateCommandBufferInheritanceInfo(const VkCommandBufferInheritanceInfo& info, const Location& loc) const; -bool ValidateDescriptorAddressInfoEXT(const VkDescriptorAddressInfoEXT& info, const Location& loc) const; -bool ValidateAccelerationStructureGeometryTrianglesDataKHR(const VkAccelerationStructureGeometryTrianglesDataKHR& info, +bool ValidatePipelineViewportStateCreateInfo(const vvl::stateless::State& state, const VkPipelineViewportStateCreateInfo& info, + const Location& loc) const; +bool ValidatePipelineTessellationStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineTessellationStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineVertexInputStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineVertexInputStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineMultisampleStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineMultisampleStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineColorBlendStateCreateInfo(const vvl::stateless::State& state, const VkPipelineColorBlendStateCreateInfo& info, + const Location& loc) const; +bool ValidatePipelineDepthStencilStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineDepthStencilStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineInputAssemblyStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineInputAssemblyStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineRasterizationStateCreateInfo(const vvl::stateless::State& state, + const VkPipelineRasterizationStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineShaderStageCreateInfo(const vvl::stateless::State& state, const VkPipelineShaderStageCreateInfo& info, + const Location& loc) const; +bool ValidateCommandBufferInheritanceInfo(const vvl::stateless::State& state, const VkCommandBufferInheritanceInfo& info, + const Location& loc) const; +bool ValidateDescriptorAddressInfoEXT(const vvl::stateless::State& state, const VkDescriptorAddressInfoEXT& info, + const Location& loc) const; +bool ValidateAccelerationStructureGeometryTrianglesDataKHR(const vvl::stateless::State& state, + const VkAccelerationStructureGeometryTrianglesDataKHR& info, const Location& loc) const; -bool ValidateAccelerationStructureGeometryInstancesDataKHR(const VkAccelerationStructureGeometryInstancesDataKHR& info, +bool ValidateAccelerationStructureGeometryInstancesDataKHR(const vvl::stateless::State& state, + const VkAccelerationStructureGeometryInstancesDataKHR& info, const Location& loc) const; -bool ValidateAccelerationStructureGeometryAabbsDataKHR(const VkAccelerationStructureGeometryAabbsDataKHR& info, +bool ValidateAccelerationStructureGeometryAabbsDataKHR(const vvl::stateless::State& state, + const VkAccelerationStructureGeometryAabbsDataKHR& info, const Location& loc) const; -bool ValidateIndirectExecutionSetPipelineInfoEXT(const VkIndirectExecutionSetPipelineInfoEXT& info, const Location& loc) const; +bool ValidateIndirectExecutionSetPipelineInfoEXT(const vvl::stateless::State& state, + const VkIndirectExecutionSetPipelineInfoEXT& info, const Location& loc) const; // NOLINTEND diff --git a/layers/vulkan/generated/valid_enum_values.cpp b/layers/vulkan/generated/valid_enum_values.cpp index 9f6e5010e6f..d36e5d16fcc 100644 --- a/layers/vulkan/generated/valid_enum_values.cpp +++ b/layers/vulkan/generated/valid_enum_values.cpp @@ -3,9 +3,9 @@ /*************************************************************************** * - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ // "forgot to enable an extension" is VERY important template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineCacheHeaderVersion value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPipelineCacheHeaderVersion value) const { switch (value) { case VK_PIPELINE_CACHE_HEADER_VERSION_ONE: return ValidValue::Valid; @@ -47,7 +47,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPipelineCacheHeaderVersion va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageLayout value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkImageLayout value) const { switch (value) { case VK_IMAGE_LAYOUT_UNDEFINED: case VK_IMAGE_LAYOUT_GENERAL: @@ -61,51 +61,46 @@ ValidValue StatelessValidation::IsValidEnumValue(VkImageLayout value) const { return ValidValue::Valid; case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL: case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL: - return IsExtEnabled(device_extensions.vk_khr_maintenance2) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_maintenance2) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL: case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL: case VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL: case VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL: - return IsExtEnabled(device_extensions.vk_khr_separate_depth_stencil_layouts) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_separate_depth_stencil_layouts) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL: case VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL: - return IsExtEnabled(device_extensions.vk_khr_synchronization2) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_synchronization2) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ: - return IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_dynamic_rendering_local_read) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: - return IsExtEnabled(device_extensions.vk_khr_swapchain) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_swapchain) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR: case VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR: case VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR: - return IsExtEnabled(device_extensions.vk_khr_video_decode_queue) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_video_decode_queue) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR: - return IsExtEnabled(device_extensions.vk_khr_shared_presentable_image) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_shared_presentable_image) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT: - return IsExtEnabled(device_extensions.vk_ext_fragment_density_map) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_fragment_density_map) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR: - return IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate) || - IsExtEnabled(device_extensions.vk_nv_shading_rate_image) + return IsExtEnabled(exts.vk_khr_fragment_shading_rate) || IsExtEnabled(exts.vk_nv_shading_rate_image) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR: case VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR: case VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR: - return IsExtEnabled(device_extensions.vk_khr_video_encode_queue) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_video_encode_queue) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT: - return IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_layout) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_attachment_feedback_loop_layout) ? ValidValue::Valid : ValidValue::NoExtension; case VK_IMAGE_LAYOUT_VIDEO_ENCODE_QUANTIZATION_MAP_KHR: - return IsExtEnabled(device_extensions.vk_khr_video_encode_quantization_map) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_video_encode_quantization_map) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkObjectType value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkObjectType value) const { switch (value) { case VK_OBJECT_TYPE_UNKNOWN: case VK_OBJECT_TYPE_INSTANCE: @@ -135,63 +130,63 @@ ValidValue StatelessValidation::IsValidEnumValue(VkObjectType value) const { case VK_OBJECT_TYPE_COMMAND_POOL: return ValidValue::Valid; case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION: - return IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE: - return IsExtEnabled(device_extensions.vk_khr_descriptor_update_template) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_descriptor_update_template) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_PRIVATE_DATA_SLOT: - return IsExtEnabled(device_extensions.vk_ext_private_data) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_private_data) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_SURFACE_KHR: - return IsExtEnabled(device_extensions.vk_khr_surface) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_surface) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_SWAPCHAIN_KHR: - return IsExtEnabled(device_extensions.vk_khr_swapchain) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_swapchain) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_DISPLAY_KHR: case VK_OBJECT_TYPE_DISPLAY_MODE_KHR: - return IsExtEnabled(device_extensions.vk_khr_display) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_display) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT: - return IsExtEnabled(device_extensions.vk_ext_debug_report) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_debug_report) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_VIDEO_SESSION_KHR: case VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR: - return IsExtEnabled(device_extensions.vk_khr_video_queue) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_video_queue) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_CU_MODULE_NVX: case VK_OBJECT_TYPE_CU_FUNCTION_NVX: - return IsExtEnabled(device_extensions.vk_nvx_binary_import) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nvx_binary_import) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT: - return IsExtEnabled(device_extensions.vk_ext_debug_utils) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_debug_utils) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR: - return IsExtEnabled(device_extensions.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_VALIDATION_CACHE_EXT: - return IsExtEnabled(device_extensions.vk_ext_validation_cache) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_validation_cache) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV: - return IsExtEnabled(device_extensions.vk_nv_ray_tracing) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_ray_tracing) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL: - return IsExtEnabled(device_extensions.vk_intel_performance_query) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_intel_performance_query) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR: - return IsExtEnabled(device_extensions.vk_khr_deferred_host_operations) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_deferred_host_operations) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV: - return IsExtEnabled(device_extensions.vk_nv_device_generated_commands) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_device_generated_commands) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_CUDA_MODULE_NV: case VK_OBJECT_TYPE_CUDA_FUNCTION_NV: - return IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_cuda_kernel_launch) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA: - return IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_fuchsia_buffer_collection) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_MICROMAP_EXT: - return IsExtEnabled(device_extensions.vk_ext_opacity_micromap) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_opacity_micromap) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV: - return IsExtEnabled(device_extensions.vk_nv_optical_flow) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_optical_flow) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_SHADER_EXT: - return IsExtEnabled(device_extensions.vk_ext_shader_object) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_shader_object) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_PIPELINE_BINARY_KHR: - return IsExtEnabled(device_extensions.vk_khr_pipeline_binary) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_pipeline_binary) ? ValidValue::Valid : ValidValue::NoExtension; case VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_EXT: case VK_OBJECT_TYPE_INDIRECT_EXECUTION_SET_EXT: - return IsExtEnabled(device_extensions.vk_ext_device_generated_commands) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_device_generated_commands) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFormat value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkFormat value) const { switch (value) { case VK_FORMAT_UNDEFINED: case VK_FORMAT_R4G4_UNORM_PACK8: @@ -413,15 +408,15 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFormat value) const { case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM: case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM: case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM: - return IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion) ? ValidValue::Valid : ValidValue::NoExtension; case VK_FORMAT_G8_B8R8_2PLANE_444_UNORM: case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16: case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16: case VK_FORMAT_G16_B16R16_2PLANE_444_UNORM: - return IsExtEnabled(device_extensions.vk_ext_ycbcr_2plane_444_formats) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_ycbcr_2plane_444_formats) ? ValidValue::Valid : ValidValue::NoExtension; case VK_FORMAT_A4R4G4B4_UNORM_PACK16: case VK_FORMAT_A4B4G4R4_UNORM_PACK16: - return IsExtEnabled(device_extensions.vk_ext_4444_formats) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_4444_formats) ? ValidValue::Valid : ValidValue::NoExtension; case VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK: case VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK: case VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK: @@ -436,11 +431,10 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFormat value) const { case VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK: case VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK: case VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK: - return IsExtEnabled(device_extensions.vk_ext_texture_compression_astc_hdr) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_texture_compression_astc_hdr) ? ValidValue::Valid : ValidValue::NoExtension; case VK_FORMAT_A1B5G5R5_UNORM_PACK16: case VK_FORMAT_A8_UNORM: - return IsExtEnabled(device_extensions.vk_khr_maintenance5) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_maintenance5) ? ValidValue::Valid : ValidValue::NoExtension; case VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: case VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: case VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG: @@ -449,29 +443,29 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFormat value) const { case VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: case VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG: case VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: - return IsExtEnabled(device_extensions.vk_img_format_pvrtc) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_img_format_pvrtc) ? ValidValue::Valid : ValidValue::NoExtension; case VK_FORMAT_R16G16_SFIXED5_NV: - return IsExtEnabled(device_extensions.vk_nv_optical_flow) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_optical_flow) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageTiling value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkImageTiling value) const { switch (value) { case VK_IMAGE_TILING_OPTIMAL: case VK_IMAGE_TILING_LINEAR: return ValidValue::Valid; case VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT: - return IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_image_drm_format_modifier) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageType value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkImageType value) const { switch (value) { case VK_IMAGE_TYPE_1D: case VK_IMAGE_TYPE_2D: @@ -483,44 +477,44 @@ ValidValue StatelessValidation::IsValidEnumValue(VkImageType value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueryType value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkQueryType value) const { switch (value) { case VK_QUERY_TYPE_OCCLUSION: case VK_QUERY_TYPE_PIPELINE_STATISTICS: case VK_QUERY_TYPE_TIMESTAMP: return ValidValue::Valid; case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR: - return IsExtEnabled(device_extensions.vk_khr_video_queue) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_video_queue) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT: - return IsExtEnabled(device_extensions.vk_ext_transform_feedback) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_transform_feedback) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR: - return IsExtEnabled(device_extensions.vk_khr_performance_query) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_performance_query) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR: case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR: - return IsExtEnabled(device_extensions.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV: - return IsExtEnabled(device_extensions.vk_nv_ray_tracing) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_ray_tracing) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL: - return IsExtEnabled(device_extensions.vk_intel_performance_query) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_intel_performance_query) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR: - return IsExtEnabled(device_extensions.vk_khr_video_encode_queue) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_video_encode_queue) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT: - return IsExtEnabled(device_extensions.vk_ext_mesh_shader) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_mesh_shader) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT: - return IsExtEnabled(device_extensions.vk_ext_primitives_generated_query) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_primitives_generated_query) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR: case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR: - return IsExtEnabled(device_extensions.vk_khr_ray_tracing_maintenance1) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_ray_tracing_maintenance1) ? ValidValue::Valid : ValidValue::NoExtension; case VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT: case VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT: - return IsExtEnabled(device_extensions.vk_ext_opacity_micromap) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_opacity_micromap) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSharingMode value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkSharingMode value) const { switch (value) { case VK_SHARING_MODE_EXCLUSIVE: case VK_SHARING_MODE_CONCURRENT: @@ -531,7 +525,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSharingMode value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkComponentSwizzle value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkComponentSwizzle value) const { switch (value) { case VK_COMPONENT_SWIZZLE_IDENTITY: case VK_COMPONENT_SWIZZLE_ZERO: @@ -547,7 +541,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkComponentSwizzle value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageViewType value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkImageViewType value) const { switch (value) { case VK_IMAGE_VIEW_TYPE_1D: case VK_IMAGE_VIEW_TYPE_2D: @@ -563,7 +557,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkImageViewType value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendFactor value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkBlendFactor value) const { switch (value) { case VK_BLEND_FACTOR_ZERO: case VK_BLEND_FACTOR_ONE: @@ -591,7 +585,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBlendFactor value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendOp value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkBlendOp value) const { switch (value) { case VK_BLEND_OP_ADD: case VK_BLEND_OP_SUBTRACT: @@ -645,14 +639,14 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBlendOp value) const { case VK_BLEND_OP_RED_EXT: case VK_BLEND_OP_GREEN_EXT: case VK_BLEND_OP_BLUE_EXT: - return IsExtEnabled(device_extensions.vk_ext_blend_operation_advanced) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_blend_operation_advanced) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCompareOp value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkCompareOp value) const { switch (value) { case VK_COMPARE_OP_NEVER: case VK_COMPARE_OP_LESS: @@ -669,7 +663,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCompareOp value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDynamicState value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDynamicState value) const { switch (value) { case VK_DYNAMIC_STATE_VIEWPORT: case VK_DYNAMIC_STATE_SCISSOR: @@ -693,40 +687,39 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDynamicState value) const { case VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE: case VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE: case VK_DYNAMIC_STATE_STENCIL_OP: - return IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_extended_dynamic_state) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE: case VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE: case VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE: case VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT: case VK_DYNAMIC_STATE_LOGIC_OP_EXT: - return IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state2) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_extended_dynamic_state2) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_LINE_STIPPLE: - return IsExtEnabled(device_extensions.vk_khr_line_rasterization) || - IsExtEnabled(device_extensions.vk_ext_line_rasterization) + return IsExtEnabled(exts.vk_khr_line_rasterization) || IsExtEnabled(exts.vk_ext_line_rasterization) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV: - return IsExtEnabled(device_extensions.vk_nv_clip_space_w_scaling) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_clip_space_w_scaling) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT: case VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT: case VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT: - return IsExtEnabled(device_extensions.vk_ext_discard_rectangles) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_discard_rectangles) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT: - return IsExtEnabled(device_extensions.vk_ext_sample_locations) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_sample_locations) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR: - return IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_ray_tracing_pipeline) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV: case VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV: - return IsExtEnabled(device_extensions.vk_nv_shading_rate_image) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_shading_rate_image) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV: case VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV: - return IsExtEnabled(device_extensions.vk_nv_scissor_exclusive) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_scissor_exclusive) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR: - return IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_fragment_shading_rate) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_VERTEX_INPUT_EXT: - return IsExtEnabled(device_extensions.vk_ext_vertex_input_dynamic_state) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_vertex_input_dynamic_state) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT: - return IsExtEnabled(device_extensions.vk_ext_color_write_enable) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_color_write_enable) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT: case VK_DYNAMIC_STATE_POLYGON_MODE_EXT: case VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT: @@ -758,19 +751,18 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDynamicState value) const { case VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV: case VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV: case VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV: - return IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_extended_dynamic_state3) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT: - return IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_dynamic_state) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_attachment_feedback_loop_dynamic_state) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DYNAMIC_STATE_DEPTH_CLAMP_RANGE_EXT: - return IsExtEnabled(device_extensions.vk_ext_depth_clamp_control) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_depth_clamp_control) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFrontFace value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkFrontFace value) const { switch (value) { case VK_FRONT_FACE_COUNTER_CLOCKWISE: case VK_FRONT_FACE_CLOCKWISE: @@ -781,7 +773,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFrontFace value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVertexInputRate value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkVertexInputRate value) const { switch (value) { case VK_VERTEX_INPUT_RATE_VERTEX: case VK_VERTEX_INPUT_RATE_INSTANCE: @@ -792,7 +784,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkVertexInputRate value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPrimitiveTopology value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPrimitiveTopology value) const { switch (value) { case VK_PRIMITIVE_TOPOLOGY_POINT_LIST: case VK_PRIMITIVE_TOPOLOGY_LINE_LIST: @@ -812,21 +804,21 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPrimitiveTopology value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPolygonMode value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPolygonMode value) const { switch (value) { case VK_POLYGON_MODE_FILL: case VK_POLYGON_MODE_LINE: case VK_POLYGON_MODE_POINT: return ValidValue::Valid; case VK_POLYGON_MODE_FILL_RECTANGLE_NV: - return IsExtEnabled(device_extensions.vk_nv_fill_rectangle) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_fill_rectangle) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkStencilOp value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkStencilOp value) const { switch (value) { case VK_STENCIL_OP_KEEP: case VK_STENCIL_OP_ZERO: @@ -843,7 +835,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkStencilOp value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLogicOp value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkLogicOp value) const { switch (value) { case VK_LOGIC_OP_CLEAR: case VK_LOGIC_OP_AND: @@ -868,7 +860,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkLogicOp value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBorderColor value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkBorderColor value) const { switch (value) { case VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK: case VK_BORDER_COLOR_INT_TRANSPARENT_BLACK: @@ -879,29 +871,28 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBorderColor value) const { return ValidValue::Valid; case VK_BORDER_COLOR_FLOAT_CUSTOM_EXT: case VK_BORDER_COLOR_INT_CUSTOM_EXT: - return IsExtEnabled(device_extensions.vk_ext_custom_border_color) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_custom_border_color) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFilter value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkFilter value) const { switch (value) { case VK_FILTER_NEAREST: case VK_FILTER_LINEAR: return ValidValue::Valid; case VK_FILTER_CUBIC_EXT: - return IsExtEnabled(device_extensions.vk_img_filter_cubic) || IsExtEnabled(device_extensions.vk_ext_filter_cubic) - ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_img_filter_cubic) || IsExtEnabled(exts.vk_ext_filter_cubic) ? ValidValue::Valid + : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerAddressMode value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerAddressMode value) const { switch (value) { case VK_SAMPLER_ADDRESS_MODE_REPEAT: case VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT: @@ -909,15 +900,14 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSamplerAddressMode value) con case VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER: return ValidValue::Valid; case VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE: - return IsExtEnabled(device_extensions.vk_khr_sampler_mirror_clamp_to_edge) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_sampler_mirror_clamp_to_edge) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerMipmapMode value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerMipmapMode value) const { switch (value) { case VK_SAMPLER_MIPMAP_MODE_NEAREST: case VK_SAMPLER_MIPMAP_MODE_LINEAR: @@ -928,7 +918,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSamplerMipmapMode value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorType value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDescriptorType value) const { switch (value) { case VK_DESCRIPTOR_TYPE_SAMPLER: case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: @@ -943,17 +933,16 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorType value) const { case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: return ValidValue::Valid; case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK: - return IsExtEnabled(device_extensions.vk_ext_inline_uniform_block) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_inline_uniform_block) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR: - return IsExtEnabled(device_extensions.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV: - return IsExtEnabled(device_extensions.vk_nv_ray_tracing) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_ray_tracing) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM: case VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM: - return IsExtEnabled(device_extensions.vk_qcom_image_processing) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_qcom_image_processing) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DESCRIPTOR_TYPE_MUTABLE_EXT: - return IsExtEnabled(device_extensions.vk_valve_mutable_descriptor_type) || - IsExtEnabled(device_extensions.vk_ext_mutable_descriptor_type) + return IsExtEnabled(exts.vk_valve_mutable_descriptor_type) || IsExtEnabled(exts.vk_ext_mutable_descriptor_type) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -962,15 +951,14 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorType value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentLoadOp value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAttachmentLoadOp value) const { switch (value) { case VK_ATTACHMENT_LOAD_OP_LOAD: case VK_ATTACHMENT_LOAD_OP_CLEAR: case VK_ATTACHMENT_LOAD_OP_DONT_CARE: return ValidValue::Valid; case VK_ATTACHMENT_LOAD_OP_NONE: - return IsExtEnabled(device_extensions.vk_khr_load_store_op_none) || - IsExtEnabled(device_extensions.vk_ext_load_store_op_none) + return IsExtEnabled(exts.vk_khr_load_store_op_none) || IsExtEnabled(exts.vk_ext_load_store_op_none) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -979,16 +967,14 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentLoadOp value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentStoreOp value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAttachmentStoreOp value) const { switch (value) { case VK_ATTACHMENT_STORE_OP_STORE: case VK_ATTACHMENT_STORE_OP_DONT_CARE: return ValidValue::Valid; case VK_ATTACHMENT_STORE_OP_NONE: - return IsExtEnabled(device_extensions.vk_khr_dynamic_rendering) || - IsExtEnabled(device_extensions.vk_khr_load_store_op_none) || - IsExtEnabled(device_extensions.vk_qcom_render_pass_store_ops) || - IsExtEnabled(device_extensions.vk_ext_load_store_op_none) + return IsExtEnabled(exts.vk_khr_dynamic_rendering) || IsExtEnabled(exts.vk_khr_load_store_op_none) || + IsExtEnabled(exts.vk_qcom_render_pass_store_ops) || IsExtEnabled(exts.vk_ext_load_store_op_none) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -997,26 +983,25 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentStoreOp value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineBindPoint value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPipelineBindPoint value) const { switch (value) { case VK_PIPELINE_BIND_POINT_GRAPHICS: case VK_PIPELINE_BIND_POINT_COMPUTE: return ValidValue::Valid; case VK_PIPELINE_BIND_POINT_EXECUTION_GRAPH_AMDX: - return IsExtEnabled(device_extensions.vk_amdx_shader_enqueue) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_amdx_shader_enqueue) ? ValidValue::Valid : ValidValue::NoExtension; case VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR: - return IsExtEnabled(device_extensions.vk_nv_ray_tracing) || IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline) - ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_ray_tracing) || IsExtEnabled(exts.vk_khr_ray_tracing_pipeline) ? ValidValue::Valid + : ValidValue::NoExtension; case VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI: - return IsExtEnabled(device_extensions.vk_huawei_subpass_shading) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_huawei_subpass_shading) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCommandBufferLevel value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkCommandBufferLevel value) const { switch (value) { case VK_COMMAND_BUFFER_LEVEL_PRIMARY: case VK_COMMAND_BUFFER_LEVEL_SECONDARY: @@ -1027,19 +1012,17 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCommandBufferLevel value) con } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndexType value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkIndexType value) const { switch (value) { case VK_INDEX_TYPE_UINT16: case VK_INDEX_TYPE_UINT32: return ValidValue::Valid; case VK_INDEX_TYPE_UINT8: - return IsExtEnabled(device_extensions.vk_khr_index_type_uint8) || - IsExtEnabled(device_extensions.vk_ext_index_type_uint8) + return IsExtEnabled(exts.vk_khr_index_type_uint8) || IsExtEnabled(exts.vk_ext_index_type_uint8) ? ValidValue::Valid : ValidValue::NoExtension; case VK_INDEX_TYPE_NONE_KHR: - return IsExtEnabled(device_extensions.vk_nv_ray_tracing) || - IsExtEnabled(device_extensions.vk_khr_acceleration_structure) + return IsExtEnabled(exts.vk_nv_ray_tracing) || IsExtEnabled(exts.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -1048,14 +1031,13 @@ ValidValue StatelessValidation::IsValidEnumValue(VkIndexType value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSubpassContents value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkSubpassContents value) const { switch (value) { case VK_SUBPASS_CONTENTS_INLINE: case VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS: return ValidValue::Valid; case VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_KHR: - return IsExtEnabled(device_extensions.vk_khr_maintenance7) || - IsExtEnabled(device_extensions.vk_ext_nested_command_buffer) + return IsExtEnabled(exts.vk_khr_maintenance7) || IsExtEnabled(exts.vk_ext_nested_command_buffer) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -1064,7 +1046,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSubpassContents value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkTessellationDomainOrigin value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkTessellationDomainOrigin value) const { switch (value) { case VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT: case VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT: @@ -1075,7 +1057,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkTessellationDomainOrigin valu } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrModelConversion value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerYcbcrModelConversion value) const { switch (value) { case VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY: case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY: @@ -1089,7 +1071,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrModelConversion v } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrRange value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerYcbcrRange value) const { switch (value) { case VK_SAMPLER_YCBCR_RANGE_ITU_FULL: case VK_SAMPLER_YCBCR_RANGE_ITU_NARROW: @@ -1100,7 +1082,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrRange value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkChromaLocation value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkChromaLocation value) const { switch (value) { case VK_CHROMA_LOCATION_COSITED_EVEN: case VK_CHROMA_LOCATION_MIDPOINT: @@ -1111,33 +1093,33 @@ ValidValue StatelessValidation::IsValidEnumValue(VkChromaLocation value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorUpdateTemplateType value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDescriptorUpdateTemplateType value) const { switch (value) { case VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET: return ValidValue::Valid; case VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS: - return IsExtEnabled(device_extensions.vk_khr_push_descriptor) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_push_descriptor) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerReductionMode value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerReductionMode value) const { switch (value) { case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE: case VK_SAMPLER_REDUCTION_MODE_MIN: case VK_SAMPLER_REDUCTION_MODE_MAX: return ValidValue::Valid; case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM: - return IsExtEnabled(device_extensions.vk_qcom_filter_cubic_clamp) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_qcom_filter_cubic_clamp) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSemaphoreType value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkSemaphoreType value) const { switch (value) { case VK_SEMAPHORE_TYPE_BINARY: case VK_SEMAPHORE_TYPE_TIMELINE: @@ -1148,7 +1130,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSemaphoreType value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessBufferBehavior value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPipelineRobustnessBufferBehavior value) const { switch (value) { case VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT: case VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED: @@ -1161,7 +1143,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessBufferBehav } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessImageBehavior value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPipelineRobustnessImageBehavior value) const { switch (value) { case VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT: case VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED: @@ -1174,7 +1156,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessImageBehavi } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueueGlobalPriority value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkQueueGlobalPriority value) const { switch (value) { case VK_QUEUE_GLOBAL_PRIORITY_LOW: case VK_QUEUE_GLOBAL_PRIORITY_MEDIUM: @@ -1187,7 +1169,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkQueueGlobalPriority value) co } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLineRasterizationMode value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkLineRasterizationMode value) const { switch (value) { case VK_LINE_RASTERIZATION_MODE_DEFAULT: case VK_LINE_RASTERIZATION_MODE_RECTANGULAR: @@ -1200,7 +1182,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkLineRasterizationMode value) } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPresentModeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPresentModeKHR value) const { switch (value) { case VK_PRESENT_MODE_IMMEDIATE_KHR: case VK_PRESENT_MODE_MAILBOX_KHR: @@ -1209,17 +1191,16 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPresentModeKHR value) const { return ValidValue::Valid; case VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR: case VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR: - return IsExtEnabled(device_extensions.vk_khr_shared_presentable_image) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_shared_presentable_image) ? ValidValue::Valid : ValidValue::NoExtension; case VK_PRESENT_MODE_FIFO_LATEST_READY_EXT: - return IsExtEnabled(device_extensions.vk_ext_present_mode_fifo_latest_ready) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_present_mode_fifo_latest_ready) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkColorSpaceKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkColorSpaceKHR value) const { switch (value) { case VK_COLOR_SPACE_SRGB_NONLINEAR_KHR: return ValidValue::Valid; @@ -1237,16 +1218,16 @@ ValidValue StatelessValidation::IsValidEnumValue(VkColorSpaceKHR value) const { case VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT: case VK_COLOR_SPACE_PASS_THROUGH_EXT: case VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT: - return IsExtEnabled(device_extensions.vk_ext_swapchain_colorspace) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_swapchain_colorspace) ? ValidValue::Valid : ValidValue::NoExtension; case VK_COLOR_SPACE_DISPLAY_NATIVE_AMD: - return IsExtEnabled(device_extensions.vk_amd_display_native_hdr) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_amd_display_native_hdr) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateCombinerOpKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkFragmentShadingRateCombinerOpKHR value) const { switch (value) { case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR: case VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR: @@ -1260,7 +1241,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateCombinerOp } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeTuningModeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkVideoEncodeTuningModeKHR value) const { switch (value) { case VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR: case VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR: @@ -1274,7 +1255,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeTuningModeKHR valu } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1PredictionModeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkVideoEncodeAV1PredictionModeKHR value) const { switch (value) { case VK_VIDEO_ENCODE_AV1_PREDICTION_MODE_INTRA_ONLY_KHR: case VK_VIDEO_ENCODE_AV1_PREDICTION_MODE_SINGLE_REFERENCE_KHR: @@ -1287,7 +1268,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1PredictionModeK } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1RateControlGroupKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkVideoEncodeAV1RateControlGroupKHR value) const { switch (value) { case VK_VIDEO_ENCODE_AV1_RATE_CONTROL_GROUP_INTRA_KHR: case VK_VIDEO_ENCODE_AV1_RATE_CONTROL_GROUP_PREDICTIVE_KHR: @@ -1299,7 +1280,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1RateControlGrou } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkTimeDomainKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkTimeDomainKHR value) const { switch (value) { case VK_TIME_DOMAIN_DEVICE_KHR: case VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR: @@ -1312,7 +1293,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkTimeDomainKHR value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDebugReportObjectTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDebugReportObjectTypeEXT value) const { switch (value) { case VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT: case VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT: @@ -1348,28 +1329,28 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDebugReportObjectTypeEXT valu case VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT: return ValidValue::Valid; case VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT: - return IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT: - return IsExtEnabled(device_extensions.vk_khr_descriptor_update_template) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_descriptor_update_template) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT: case VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT: - return IsExtEnabled(device_extensions.vk_nvx_binary_import) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nvx_binary_import) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT: - return IsExtEnabled(device_extensions.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT: - return IsExtEnabled(device_extensions.vk_nv_ray_tracing) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_ray_tracing) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_MODULE_NV_EXT: case VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_FUNCTION_NV_EXT: - return IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_cuda_kernel_launch) ? ValidValue::Valid : ValidValue::NoExtension; case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT: - return IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_fuchsia_buffer_collection) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkRasterizationOrderAMD value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkRasterizationOrderAMD value) const { switch (value) { case VK_RASTERIZATION_ORDER_STRICT_AMD: case VK_RASTERIZATION_ORDER_RELAXED_AMD: @@ -1380,7 +1361,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkRasterizationOrderAMD value) } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderInfoTypeAMD value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkShaderInfoTypeAMD value) const { switch (value) { case VK_SHADER_INFO_TYPE_STATISTICS_AMD: case VK_SHADER_INFO_TYPE_BINARY_AMD: @@ -1392,7 +1373,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkShaderInfoTypeAMD value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationCheckEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkValidationCheckEXT value) const { switch (value) { case VK_VALIDATION_CHECK_ALL_EXT: case VK_VALIDATION_CHECK_SHADERS_EXT: @@ -1403,7 +1384,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkValidationCheckEXT value) con } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplayPowerStateEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDisplayPowerStateEXT value) const { switch (value) { case VK_DISPLAY_POWER_STATE_OFF_EXT: case VK_DISPLAY_POWER_STATE_SUSPEND_EXT: @@ -1415,7 +1396,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDisplayPowerStateEXT value) c } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceEventTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDeviceEventTypeEXT value) const { switch (value) { case VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT: return ValidValue::Valid; @@ -1425,7 +1406,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDeviceEventTypeEXT value) con } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplayEventTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDisplayEventTypeEXT value) const { switch (value) { case VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT: return ValidValue::Valid; @@ -1435,7 +1416,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDisplayEventTypeEXT value) co } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkViewportCoordinateSwizzleNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkViewportCoordinateSwizzleNV value) const { switch (value) { case VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV: case VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV: @@ -1452,7 +1433,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkViewportCoordinateSwizzleNV v } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDiscardRectangleModeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDiscardRectangleModeEXT value) const { switch (value) { case VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT: case VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT: @@ -1463,7 +1444,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDiscardRectangleModeEXT value } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkConservativeRasterizationModeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkConservativeRasterizationModeEXT value) const { switch (value) { case VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT: case VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT: @@ -1475,7 +1456,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkConservativeRasterizationMode } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendOverlapEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkBlendOverlapEXT value) const { switch (value) { case VK_BLEND_OVERLAP_UNCORRELATED_EXT: case VK_BLEND_OVERLAP_DISJOINT_EXT: @@ -1487,7 +1468,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBlendOverlapEXT value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoverageModulationModeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkCoverageModulationModeNV value) const { switch (value) { case VK_COVERAGE_MODULATION_MODE_NONE_NV: case VK_COVERAGE_MODULATION_MODE_RGB_NV: @@ -1500,7 +1481,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCoverageModulationModeNV valu } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShadingRatePaletteEntryNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkShadingRatePaletteEntryNV value) const { switch (value) { case VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV: case VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV: @@ -1521,7 +1502,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkShadingRatePaletteEntryNV val } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoarseSampleOrderTypeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkCoarseSampleOrderTypeNV value) const { switch (value) { case VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV: case VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV: @@ -1534,7 +1515,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCoarseSampleOrderTypeNV value } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR value) const { switch (value) { case VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR: case VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR: @@ -1546,7 +1527,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkGeometryTypeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkGeometryTypeKHR value) const { switch (value) { case VK_GEOMETRY_TYPE_TRIANGLES_KHR: case VK_GEOMETRY_TYPE_AABBS_KHR: @@ -1558,7 +1539,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkGeometryTypeKHR value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureTypeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureTypeKHR value) const { switch (value) { case VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR: case VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR: @@ -1570,7 +1551,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureTypeKHR } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCopyAccelerationStructureModeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkCopyAccelerationStructureModeKHR value) const { switch (value) { case VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR: case VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR: @@ -1583,7 +1564,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCopyAccelerationStructureMode } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMemoryRequirementsTypeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureMemoryRequirementsTypeNV value) const { switch (value) { case VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV: case VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV: @@ -1595,7 +1576,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMemoryRe } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkMemoryOverallocationBehaviorAMD value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkMemoryOverallocationBehaviorAMD value) const { switch (value) { case VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD: case VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD: @@ -1607,7 +1588,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkMemoryOverallocationBehaviorA } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceConfigurationTypeINTEL value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPerformanceConfigurationTypeINTEL value) const { switch (value) { case VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL: return ValidValue::Valid; @@ -1617,7 +1598,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceConfigurationTypeI } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueryPoolSamplingModeINTEL value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkQueryPoolSamplingModeINTEL value) const { switch (value) { case VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL: return ValidValue::Valid; @@ -1627,7 +1608,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkQueryPoolSamplingModeINTEL va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceOverrideTypeINTEL value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPerformanceOverrideTypeINTEL value) const { switch (value) { case VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL: case VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL: @@ -1638,7 +1619,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceOverrideTypeINTEL } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceParameterTypeINTEL value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkPerformanceParameterTypeINTEL value) const { switch (value) { case VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL: case VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL: @@ -1649,7 +1630,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceParameterTypeINTEL } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureEnableEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkValidationFeatureEnableEXT value) const { switch (value) { case VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT: case VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT: @@ -1663,7 +1644,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureEnableEXT va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureDisableEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkValidationFeatureDisableEXT value) const { switch (value) { case VK_VALIDATION_FEATURE_DISABLE_ALL_EXT: case VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT: @@ -1680,7 +1661,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureDisableEXT v } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoverageReductionModeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkCoverageReductionModeNV value) const { switch (value) { case VK_COVERAGE_REDUCTION_MODE_MERGE_NV: case VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV: @@ -1691,7 +1672,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCoverageReductionModeNV value } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkProvokingVertexModeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkProvokingVertexModeEXT value) const { switch (value) { case VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT: case VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT: @@ -1703,7 +1684,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkProvokingVertexModeEXT value) #ifdef VK_USE_PLATFORM_WIN32_KHR template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFullScreenExclusiveEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkFullScreenExclusiveEXT value) const { switch (value) { case VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT: case VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT: @@ -1717,7 +1698,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFullScreenExclusiveEXT value) #endif // VK_USE_PLATFORM_WIN32_KHR template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkIndirectCommandsTokenTypeNV value) const { switch (value) { case VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV: case VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV: @@ -1729,18 +1710,17 @@ ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeNV v case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV: return ValidValue::Valid; case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV: - return IsExtEnabled(device_extensions.vk_ext_mesh_shader) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_mesh_shader) ? ValidValue::Valid : ValidValue::NoExtension; case VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NV: case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NV: - return IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute) ? ValidValue::Valid - : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_device_generated_commands_compute) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDepthBiasRepresentationEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDepthBiasRepresentationEXT value) const { switch (value) { case VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORMAT_EXT: case VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT: @@ -1752,7 +1732,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDepthBiasRepresentationEXT va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateTypeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkFragmentShadingRateTypeNV value) const { switch (value) { case VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV: case VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV: @@ -1763,7 +1743,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateTypeNV val } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkFragmentShadingRateNV value) const { switch (value) { case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV: case VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV: @@ -1784,7 +1764,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateNV value) } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMotionInstanceTypeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureMotionInstanceTypeNV value) const { switch (value) { case VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV: case VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV: @@ -1796,7 +1776,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMotionIn } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultAddressTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDeviceFaultAddressTypeEXT value) const { switch (value) { case VK_DEVICE_FAULT_ADDRESS_TYPE_NONE_EXT: case VK_DEVICE_FAULT_ADDRESS_TYPE_READ_INVALID_EXT: @@ -1812,7 +1792,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultAddressTypeEXT val } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { switch (value) { case VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT: return ValidValue::Valid; @@ -1822,7 +1802,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultVendorBinaryHeader } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceAddressBindingTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDeviceAddressBindingTypeEXT value) const { switch (value) { case VK_DEVICE_ADDRESS_BINDING_TYPE_BIND_EXT: case VK_DEVICE_ADDRESS_BINDING_TYPE_UNBIND_EXT: @@ -1833,19 +1813,19 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDeviceAddressBindingTypeEXT v } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkMicromapTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkMicromapTypeEXT value) const { switch (value) { case VK_MICROMAP_TYPE_OPACITY_MICROMAP_EXT: return ValidValue::Valid; case VK_MICROMAP_TYPE_DISPLACEMENT_MICROMAP_NV: - return IsExtEnabled(device_extensions.vk_nv_displacement_micromap) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_displacement_micromap) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBuildMicromapModeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkBuildMicromapModeEXT value) const { switch (value) { case VK_BUILD_MICROMAP_MODE_BUILD_EXT: return ValidValue::Valid; @@ -1855,7 +1835,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBuildMicromapModeEXT value) c } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCopyMicromapModeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkCopyMicromapModeEXT value) const { switch (value) { case VK_COPY_MICROMAP_MODE_CLONE_EXT: case VK_COPY_MICROMAP_MODE_SERIALIZE_EXT: @@ -1868,7 +1848,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCopyMicromapModeEXT value) co } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureCompatibilityKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureCompatibilityKHR value) const { switch (value) { case VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR: case VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR: @@ -1879,7 +1859,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureCompatib } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureBuildTypeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureBuildTypeKHR value) const { switch (value) { case VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR: case VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR: @@ -1891,7 +1871,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureBuildTyp } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG value) const { switch (value) { case VK_DIRECT_DRIVER_LOADING_MODE_EXCLUSIVE_LUNARG: case VK_DIRECT_DRIVER_LOADING_MODE_INCLUSIVE_LUNARG: @@ -1902,7 +1882,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV value) const { switch (value) { case VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV: case VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV: @@ -1915,7 +1895,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowSessionBindingPointNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkOpticalFlowSessionBindingPointNV value) const { switch (value) { case VK_OPTICAL_FLOW_SESSION_BINDING_POINT_UNKNOWN_NV: case VK_OPTICAL_FLOW_SESSION_BINDING_POINT_INPUT_NV: @@ -1933,7 +1913,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowSessionBindingPoin } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagModeAMD value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAntiLagModeAMD value) const { switch (value) { case VK_ANTI_LAG_MODE_DRIVER_CONTROL_AMD: case VK_ANTI_LAG_MODE_ON_AMD: @@ -1945,7 +1925,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagModeAMD value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagStageAMD value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkAntiLagStageAMD value) const { switch (value) { case VK_ANTI_LAG_STAGE_INPUT_AMD: case VK_ANTI_LAG_STAGE_PRESENT_AMD: @@ -1956,7 +1936,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagStageAMD value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderCodeTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkShaderCodeTypeEXT value) const { switch (value) { case VK_SHADER_CODE_TYPE_BINARY_EXT: case VK_SHADER_CODE_TYPE_SPIRV_EXT: @@ -1967,7 +1947,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkShaderCodeTypeEXT value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDepthClampModeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDepthClampModeEXT value) const { switch (value) { case VK_DEPTH_CLAMP_MODE_VIEWPORT_RANGE_EXT: case VK_DEPTH_CLAMP_MODE_USER_DEFINED_RANGE_EXT: @@ -1978,7 +1958,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDepthClampModeEXT value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLayerSettingTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkLayerSettingTypeEXT value) const { switch (value) { case VK_LAYER_SETTING_TYPE_BOOL32_EXT: case VK_LAYER_SETTING_TYPE_INT32_EXT: @@ -1995,7 +1975,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkLayerSettingTypeEXT value) co } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLatencyMarkerNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkLatencyMarkerNV value) const { switch (value) { case VK_LATENCY_MARKER_SIMULATION_START_NV: case VK_LATENCY_MARKER_SIMULATION_END_NV: @@ -2016,7 +1996,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkLatencyMarkerNV value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOutOfBandQueueTypeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkOutOfBandQueueTypeNV value) const { switch (value) { case VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV: case VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV: @@ -2027,7 +2007,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkOutOfBandQueueTypeNV value) c } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlockMatchWindowCompareModeQCOM value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkBlockMatchWindowCompareModeQCOM value) const { switch (value) { case VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM: case VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM: @@ -2038,7 +2018,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBlockMatchWindowCompareModeQC } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCubicFilterWeightsQCOM value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkCubicFilterWeightsQCOM value) const { switch (value) { case VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM: case VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM: @@ -2051,7 +2031,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCubicFilterWeightsQCOM value) } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV value) const { switch (value) { case VK_DISPLAY_SURFACE_STEREO_TYPE_NONE_NV: case VK_DISPLAY_SURFACE_STEREO_TYPE_ONBOARD_DIN_NV: @@ -2064,7 +2044,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectExecutionSetInfoTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkIndirectExecutionSetInfoTypeEXT value) const { switch (value) { case VK_INDIRECT_EXECUTION_SET_INFO_TYPE_PIPELINES_EXT: case VK_INDIRECT_EXECUTION_SET_INFO_TYPE_SHADER_OBJECTS_EXT: @@ -2075,7 +2055,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkIndirectExecutionSetInfoTypeE } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeEXT value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkIndirectCommandsTokenTypeEXT value) const { switch (value) { case VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT: case VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_EXT: @@ -2090,19 +2070,19 @@ ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeEXT return ValidValue::Valid; case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV_EXT: case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_NV_EXT: - return IsExtEnabled(device_extensions.vk_nv_mesh_shader) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_nv_mesh_shader) ? ValidValue::Valid : ValidValue::NoExtension; case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_EXT: case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_EXT: - return IsExtEnabled(device_extensions.vk_ext_mesh_shader) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_ext_mesh_shader) ? ValidValue::Valid : ValidValue::NoExtension; case VK_INDIRECT_COMMANDS_TOKEN_TYPE_TRACE_RAYS2_EXT: - return IsExtEnabled(device_extensions.vk_khr_ray_tracing_maintenance1) ? ValidValue::Valid : ValidValue::NoExtension; + return IsExtEnabled(exts.vk_khr_ray_tracing_maintenance1) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBuildAccelerationStructureModeKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkBuildAccelerationStructureModeKHR value) const { switch (value) { case VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR: case VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR: @@ -2113,7 +2093,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBuildAccelerationStructureMod } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderGroupShaderKHR value) const { +ValidValue vvl::stateless::State::IsValidEnumValue(VkShaderGroupShaderKHR value) const { switch (value) { case VK_SHADER_GROUP_SHADER_GENERAL_KHR: case VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR: @@ -2126,16 +2106,16 @@ ValidValue StatelessValidation::IsValidEnumValue(VkShaderGroupShaderKHR value) c } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineCacheHeaderVersion value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPipelineCacheHeaderVersion value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPipelineCacheHeaderVersion value) const { +const char* vvl::stateless::State::DescribeEnum(VkPipelineCacheHeaderVersion value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageLayout value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkImageLayout value) const { switch (value) { case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL: case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL: @@ -2175,12 +2155,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageLayout value) cons }; } template <> -const char* StatelessValidation::DescribeEnum(VkImageLayout value) const { +const char* vvl::stateless::State::DescribeEnum(VkImageLayout value) const { return string_VkImageLayout(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkObjectType value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkObjectType value) const { switch (value) { case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION: return {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}; @@ -2238,12 +2218,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkObjectType value) const }; } template <> -const char* StatelessValidation::DescribeEnum(VkObjectType value) const { +const char* vvl::stateless::State::DescribeEnum(VkObjectType value) const { return string_VkObjectType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFormat value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkFormat value) const { switch (value) { case VK_FORMAT_G8B8G8R8_422_UNORM: case VK_FORMAT_B8G8R8G8_422_UNORM: @@ -2322,12 +2302,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkFormat value) const { }; } template <> -const char* StatelessValidation::DescribeEnum(VkFormat value) const { +const char* vvl::stateless::State::DescribeEnum(VkFormat value) const { return string_VkFormat(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageTiling value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkImageTiling value) const { switch (value) { case VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT: return {vvl::Extension::_VK_EXT_image_drm_format_modifier}; @@ -2336,21 +2316,21 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageTiling value) cons }; } template <> -const char* StatelessValidation::DescribeEnum(VkImageTiling value) const { +const char* vvl::stateless::State::DescribeEnum(VkImageTiling value) const { return string_VkImageTiling(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageType value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkImageType value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkImageType value) const { +const char* vvl::stateless::State::DescribeEnum(VkImageType value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkQueryType value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkQueryType value) const { switch (value) { case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR: return {vvl::Extension::_VK_KHR_video_queue}; @@ -2382,48 +2362,48 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkQueryType value) const }; } template <> -const char* StatelessValidation::DescribeEnum(VkQueryType value) const { +const char* vvl::stateless::State::DescribeEnum(VkQueryType value) const { return string_VkQueryType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSharingMode value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkSharingMode value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSharingMode value) const { +const char* vvl::stateless::State::DescribeEnum(VkSharingMode value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkComponentSwizzle value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkComponentSwizzle value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkComponentSwizzle value) const { +const char* vvl::stateless::State::DescribeEnum(VkComponentSwizzle value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageViewType value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkImageViewType value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkImageViewType value) const { +const char* vvl::stateless::State::DescribeEnum(VkImageViewType value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlendFactor value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkBlendFactor value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBlendFactor value) const { +const char* vvl::stateless::State::DescribeEnum(VkBlendFactor value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlendOp value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkBlendOp value) const { switch (value) { case VK_BLEND_OP_ZERO_EXT: case VK_BLEND_OP_SRC_EXT: @@ -2477,21 +2457,21 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlendOp value) const { }; } template <> -const char* StatelessValidation::DescribeEnum(VkBlendOp value) const { +const char* vvl::stateless::State::DescribeEnum(VkBlendOp value) const { return string_VkBlendOp(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCompareOp value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkCompareOp value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCompareOp value) const { +const char* vvl::stateless::State::DescribeEnum(VkCompareOp value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDynamicState value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDynamicState value) const { switch (value) { case VK_DYNAMIC_STATE_CULL_MODE: case VK_DYNAMIC_STATE_FRONT_FACE: @@ -2577,39 +2557,39 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkDynamicState value) con }; } template <> -const char* StatelessValidation::DescribeEnum(VkDynamicState value) const { +const char* vvl::stateless::State::DescribeEnum(VkDynamicState value) const { return string_VkDynamicState(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFrontFace value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkFrontFace value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFrontFace value) const { +const char* vvl::stateless::State::DescribeEnum(VkFrontFace value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkVertexInputRate value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkVertexInputRate value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkVertexInputRate value) const { +const char* vvl::stateless::State::DescribeEnum(VkVertexInputRate value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPrimitiveTopology value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPrimitiveTopology value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPrimitiveTopology value) const { +const char* vvl::stateless::State::DescribeEnum(VkPrimitiveTopology value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPolygonMode value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPolygonMode value) const { switch (value) { case VK_POLYGON_MODE_FILL_RECTANGLE_NV: return {vvl::Extension::_VK_NV_fill_rectangle}; @@ -2618,30 +2598,30 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkPolygonMode value) cons }; } template <> -const char* StatelessValidation::DescribeEnum(VkPolygonMode value) const { +const char* vvl::stateless::State::DescribeEnum(VkPolygonMode value) const { return string_VkPolygonMode(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkStencilOp value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkStencilOp value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkStencilOp value) const { +const char* vvl::stateless::State::DescribeEnum(VkStencilOp value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkLogicOp value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkLogicOp value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkLogicOp value) const { +const char* vvl::stateless::State::DescribeEnum(VkLogicOp value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBorderColor value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkBorderColor value) const { switch (value) { case VK_BORDER_COLOR_FLOAT_CUSTOM_EXT: case VK_BORDER_COLOR_INT_CUSTOM_EXT: @@ -2651,12 +2631,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkBorderColor value) cons }; } template <> -const char* StatelessValidation::DescribeEnum(VkBorderColor value) const { +const char* vvl::stateless::State::DescribeEnum(VkBorderColor value) const { return string_VkBorderColor(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFilter value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkFilter value) const { switch (value) { case VK_FILTER_CUBIC_EXT: return {vvl::Extension::_VK_IMG_filter_cubic, vvl::Extension::_VK_EXT_filter_cubic}; @@ -2665,12 +2645,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkFilter value) const { }; } template <> -const char* StatelessValidation::DescribeEnum(VkFilter value) const { +const char* vvl::stateless::State::DescribeEnum(VkFilter value) const { return string_VkFilter(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerAddressMode value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkSamplerAddressMode value) const { switch (value) { case VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE: return {vvl::Extension::_VK_KHR_sampler_mirror_clamp_to_edge}; @@ -2679,21 +2659,21 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerAddressMode valu }; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerAddressMode value) const { +const char* vvl::stateless::State::DescribeEnum(VkSamplerAddressMode value) const { return string_VkSamplerAddressMode(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerMipmapMode value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkSamplerMipmapMode value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerMipmapMode value) const { +const char* vvl::stateless::State::DescribeEnum(VkSamplerMipmapMode value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDescriptorType value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDescriptorType value) const { switch (value) { case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK: return {vvl::Extension::_VK_EXT_inline_uniform_block}; @@ -2711,12 +2691,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkDescriptorType value) c }; } template <> -const char* StatelessValidation::DescribeEnum(VkDescriptorType value) const { +const char* vvl::stateless::State::DescribeEnum(VkDescriptorType value) const { return string_VkDescriptorType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAttachmentLoadOp value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAttachmentLoadOp value) const { switch (value) { case VK_ATTACHMENT_LOAD_OP_NONE: return {vvl::Extension::_VK_KHR_load_store_op_none, vvl::Extension::_VK_EXT_load_store_op_none}; @@ -2725,12 +2705,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkAttachmentLoadOp value) }; } template <> -const char* StatelessValidation::DescribeEnum(VkAttachmentLoadOp value) const { +const char* vvl::stateless::State::DescribeEnum(VkAttachmentLoadOp value) const { return string_VkAttachmentLoadOp(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAttachmentStoreOp value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAttachmentStoreOp value) const { switch (value) { case VK_ATTACHMENT_STORE_OP_NONE: return {vvl::Extension::_VK_KHR_dynamic_rendering, vvl::Extension::_VK_KHR_load_store_op_none, @@ -2740,12 +2720,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkAttachmentStoreOp value }; } template <> -const char* StatelessValidation::DescribeEnum(VkAttachmentStoreOp value) const { +const char* vvl::stateless::State::DescribeEnum(VkAttachmentStoreOp value) const { return string_VkAttachmentStoreOp(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineBindPoint value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPipelineBindPoint value) const { switch (value) { case VK_PIPELINE_BIND_POINT_EXECUTION_GRAPH_AMDX: return {vvl::Extension::_VK_AMDX_shader_enqueue}; @@ -2758,21 +2738,21 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineBindPoint value }; } template <> -const char* StatelessValidation::DescribeEnum(VkPipelineBindPoint value) const { +const char* vvl::stateless::State::DescribeEnum(VkPipelineBindPoint value) const { return string_VkPipelineBindPoint(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCommandBufferLevel value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkCommandBufferLevel value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCommandBufferLevel value) const { +const char* vvl::stateless::State::DescribeEnum(VkCommandBufferLevel value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndexType value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkIndexType value) const { switch (value) { case VK_INDEX_TYPE_UINT8: return {vvl::Extension::_VK_KHR_index_type_uint8, vvl::Extension::_VK_EXT_index_type_uint8}; @@ -2783,12 +2763,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndexType value) const }; } template <> -const char* StatelessValidation::DescribeEnum(VkIndexType value) const { +const char* vvl::stateless::State::DescribeEnum(VkIndexType value) const { return string_VkIndexType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSubpassContents value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkSubpassContents value) const { switch (value) { case VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_KHR: return {vvl::Extension::_VK_KHR_maintenance7, vvl::Extension::_VK_EXT_nested_command_buffer}; @@ -2797,48 +2777,48 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkSubpassContents value) }; } template <> -const char* StatelessValidation::DescribeEnum(VkSubpassContents value) const { +const char* vvl::stateless::State::DescribeEnum(VkSubpassContents value) const { return string_VkSubpassContents(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkTessellationDomainOrigin value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkTessellationDomainOrigin value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkTessellationDomainOrigin value) const { +const char* vvl::stateless::State::DescribeEnum(VkTessellationDomainOrigin value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerYcbcrModelConversion value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkSamplerYcbcrModelConversion value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerYcbcrModelConversion value) const { +const char* vvl::stateless::State::DescribeEnum(VkSamplerYcbcrModelConversion value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerYcbcrRange value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkSamplerYcbcrRange value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerYcbcrRange value) const { +const char* vvl::stateless::State::DescribeEnum(VkSamplerYcbcrRange value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkChromaLocation value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkChromaLocation value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkChromaLocation value) const { +const char* vvl::stateless::State::DescribeEnum(VkChromaLocation value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDescriptorUpdateTemplateType value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDescriptorUpdateTemplateType value) const { switch (value) { case VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS: return {vvl::Extension::_VK_KHR_push_descriptor}; @@ -2847,12 +2827,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkDescriptorUpdateTemplat }; } template <> -const char* StatelessValidation::DescribeEnum(VkDescriptorUpdateTemplateType value) const { +const char* vvl::stateless::State::DescribeEnum(VkDescriptorUpdateTemplateType value) const { return string_VkDescriptorUpdateTemplateType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerReductionMode value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkSamplerReductionMode value) const { switch (value) { case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM: return {vvl::Extension::_VK_QCOM_filter_cubic_clamp}; @@ -2861,57 +2841,57 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerReductionMode va }; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerReductionMode value) const { +const char* vvl::stateless::State::DescribeEnum(VkSamplerReductionMode value) const { return string_VkSamplerReductionMode(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSemaphoreType value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkSemaphoreType value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSemaphoreType value) const { +const char* vvl::stateless::State::DescribeEnum(VkSemaphoreType value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineRobustnessBufferBehavior value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPipelineRobustnessBufferBehavior value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPipelineRobustnessBufferBehavior value) const { +const char* vvl::stateless::State::DescribeEnum(VkPipelineRobustnessBufferBehavior value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineRobustnessImageBehavior value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPipelineRobustnessImageBehavior value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPipelineRobustnessImageBehavior value) const { +const char* vvl::stateless::State::DescribeEnum(VkPipelineRobustnessImageBehavior value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkQueueGlobalPriority value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkQueueGlobalPriority value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkQueueGlobalPriority value) const { +const char* vvl::stateless::State::DescribeEnum(VkQueueGlobalPriority value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkLineRasterizationMode value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkLineRasterizationMode value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkLineRasterizationMode value) const { +const char* vvl::stateless::State::DescribeEnum(VkLineRasterizationMode value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPresentModeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPresentModeKHR value) const { switch (value) { case VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR: case VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR: @@ -2923,12 +2903,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkPresentModeKHR value) c }; } template <> -const char* StatelessValidation::DescribeEnum(VkPresentModeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkPresentModeKHR value) const { return string_VkPresentModeKHR(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkColorSpaceKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkColorSpaceKHR value) const { switch (value) { case VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT: case VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT: @@ -2952,57 +2932,57 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkColorSpaceKHR value) co }; } template <> -const char* StatelessValidation::DescribeEnum(VkColorSpaceKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkColorSpaceKHR value) const { return string_VkColorSpaceKHR(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFragmentShadingRateCombinerOpKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkFragmentShadingRateCombinerOpKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFragmentShadingRateCombinerOpKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkFragmentShadingRateCombinerOpKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkVideoEncodeTuningModeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkVideoEncodeTuningModeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkVideoEncodeTuningModeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkVideoEncodeTuningModeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkVideoEncodeAV1PredictionModeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkVideoEncodeAV1PredictionModeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkVideoEncodeAV1PredictionModeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkVideoEncodeAV1PredictionModeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkVideoEncodeAV1RateControlGroupKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkVideoEncodeAV1RateControlGroupKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkVideoEncodeAV1RateControlGroupKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkVideoEncodeAV1RateControlGroupKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkTimeDomainKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkTimeDomainKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkTimeDomainKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkTimeDomainKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDebugReportObjectTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDebugReportObjectTypeEXT value) const { switch (value) { case VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT: return {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}; @@ -3025,266 +3005,266 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkDebugReportObjectTypeEX }; } template <> -const char* StatelessValidation::DescribeEnum(VkDebugReportObjectTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDebugReportObjectTypeEXT value) const { return string_VkDebugReportObjectTypeEXT(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkRasterizationOrderAMD value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkRasterizationOrderAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkRasterizationOrderAMD value) const { +const char* vvl::stateless::State::DescribeEnum(VkRasterizationOrderAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkShaderInfoTypeAMD value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkShaderInfoTypeAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkShaderInfoTypeAMD value) const { +const char* vvl::stateless::State::DescribeEnum(VkShaderInfoTypeAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkValidationCheckEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkValidationCheckEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkValidationCheckEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkValidationCheckEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDisplayPowerStateEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDisplayPowerStateEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDisplayPowerStateEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDisplayPowerStateEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDeviceEventTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDeviceEventTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDeviceEventTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDeviceEventTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDisplayEventTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDisplayEventTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDisplayEventTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDisplayEventTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkViewportCoordinateSwizzleNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkViewportCoordinateSwizzleNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkViewportCoordinateSwizzleNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkViewportCoordinateSwizzleNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDiscardRectangleModeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDiscardRectangleModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDiscardRectangleModeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDiscardRectangleModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkConservativeRasterizationModeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkConservativeRasterizationModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkConservativeRasterizationModeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkConservativeRasterizationModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlendOverlapEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkBlendOverlapEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBlendOverlapEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkBlendOverlapEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCoverageModulationModeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkCoverageModulationModeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCoverageModulationModeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkCoverageModulationModeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkShadingRatePaletteEntryNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkShadingRatePaletteEntryNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkShadingRatePaletteEntryNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkShadingRatePaletteEntryNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCoarseSampleOrderTypeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkCoarseSampleOrderTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCoarseSampleOrderTypeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkCoarseSampleOrderTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkRayTracingShaderGroupTypeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkRayTracingShaderGroupTypeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkRayTracingShaderGroupTypeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkRayTracingShaderGroupTypeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkGeometryTypeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkGeometryTypeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkGeometryTypeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkGeometryTypeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureTypeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAccelerationStructureTypeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureTypeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkAccelerationStructureTypeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCopyAccelerationStructureModeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkCopyAccelerationStructureModeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCopyAccelerationStructureModeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkCopyAccelerationStructureModeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureMemoryRequirementsTypeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAccelerationStructureMemoryRequirementsTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureMemoryRequirementsTypeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkAccelerationStructureMemoryRequirementsTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkMemoryOverallocationBehaviorAMD value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkMemoryOverallocationBehaviorAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkMemoryOverallocationBehaviorAMD value) const { +const char* vvl::stateless::State::DescribeEnum(VkMemoryOverallocationBehaviorAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPerformanceConfigurationTypeINTEL value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPerformanceConfigurationTypeINTEL value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPerformanceConfigurationTypeINTEL value) const { +const char* vvl::stateless::State::DescribeEnum(VkPerformanceConfigurationTypeINTEL value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkQueryPoolSamplingModeINTEL value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkQueryPoolSamplingModeINTEL value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkQueryPoolSamplingModeINTEL value) const { +const char* vvl::stateless::State::DescribeEnum(VkQueryPoolSamplingModeINTEL value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPerformanceOverrideTypeINTEL value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPerformanceOverrideTypeINTEL value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPerformanceOverrideTypeINTEL value) const { +const char* vvl::stateless::State::DescribeEnum(VkPerformanceOverrideTypeINTEL value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPerformanceParameterTypeINTEL value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkPerformanceParameterTypeINTEL value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPerformanceParameterTypeINTEL value) const { +const char* vvl::stateless::State::DescribeEnum(VkPerformanceParameterTypeINTEL value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkValidationFeatureEnableEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkValidationFeatureEnableEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkValidationFeatureEnableEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkValidationFeatureEnableEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkValidationFeatureDisableEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkValidationFeatureDisableEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkValidationFeatureDisableEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkValidationFeatureDisableEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCoverageReductionModeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkCoverageReductionModeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCoverageReductionModeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkCoverageReductionModeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkProvokingVertexModeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkProvokingVertexModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkProvokingVertexModeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkProvokingVertexModeEXT value) const { return nullptr; } #ifdef VK_USE_PLATFORM_WIN32_KHR template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFullScreenExclusiveEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkFullScreenExclusiveEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFullScreenExclusiveEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkFullScreenExclusiveEXT value) const { return nullptr; } #endif // VK_USE_PLATFORM_WIN32_KHR template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectCommandsTokenTypeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkIndirectCommandsTokenTypeNV value) const { switch (value) { case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV: return {vvl::Extension::_VK_EXT_mesh_shader}; @@ -3296,75 +3276,75 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectCommandsTokenTy }; } template <> -const char* StatelessValidation::DescribeEnum(VkIndirectCommandsTokenTypeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkIndirectCommandsTokenTypeNV value) const { return string_VkIndirectCommandsTokenTypeNV(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDepthBiasRepresentationEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDepthBiasRepresentationEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDepthBiasRepresentationEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDepthBiasRepresentationEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFragmentShadingRateTypeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkFragmentShadingRateTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFragmentShadingRateTypeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkFragmentShadingRateTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFragmentShadingRateNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkFragmentShadingRateNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFragmentShadingRateNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkFragmentShadingRateNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureMotionInstanceTypeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAccelerationStructureMotionInstanceTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureMotionInstanceTypeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkAccelerationStructureMotionInstanceTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDeviceFaultAddressTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDeviceFaultAddressTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDeviceFaultAddressTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDeviceFaultAddressTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDeviceAddressBindingTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDeviceAddressBindingTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDeviceAddressBindingTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDeviceAddressBindingTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkMicromapTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkMicromapTypeEXT value) const { switch (value) { case VK_MICROMAP_TYPE_DISPLACEMENT_MICROMAP_NV: return {vvl::Extension::_VK_NV_displacement_micromap}; @@ -3373,174 +3353,174 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkMicromapTypeEXT value) }; } template <> -const char* StatelessValidation::DescribeEnum(VkMicromapTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkMicromapTypeEXT value) const { return string_VkMicromapTypeEXT(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBuildMicromapModeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkBuildMicromapModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBuildMicromapModeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkBuildMicromapModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCopyMicromapModeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkCopyMicromapModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCopyMicromapModeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkCopyMicromapModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureCompatibilityKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAccelerationStructureCompatibilityKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureCompatibilityKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkAccelerationStructureCompatibilityKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureBuildTypeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAccelerationStructureBuildTypeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureBuildTypeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkAccelerationStructureBuildTypeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDirectDriverLoadingModeLUNARG value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDirectDriverLoadingModeLUNARG value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDirectDriverLoadingModeLUNARG value) const { +const char* vvl::stateless::State::DescribeEnum(VkDirectDriverLoadingModeLUNARG value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkOpticalFlowPerformanceLevelNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkOpticalFlowPerformanceLevelNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkOpticalFlowPerformanceLevelNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkOpticalFlowPerformanceLevelNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkOpticalFlowSessionBindingPointNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkOpticalFlowSessionBindingPointNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkOpticalFlowSessionBindingPointNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkOpticalFlowSessionBindingPointNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAntiLagModeAMD value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAntiLagModeAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAntiLagModeAMD value) const { +const char* vvl::stateless::State::DescribeEnum(VkAntiLagModeAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAntiLagStageAMD value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkAntiLagStageAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAntiLagStageAMD value) const { +const char* vvl::stateless::State::DescribeEnum(VkAntiLagStageAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkShaderCodeTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkShaderCodeTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkShaderCodeTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkShaderCodeTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDepthClampModeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDepthClampModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDepthClampModeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkDepthClampModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkLayerSettingTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkLayerSettingTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkLayerSettingTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkLayerSettingTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkLatencyMarkerNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkLatencyMarkerNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkLatencyMarkerNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkLatencyMarkerNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkOutOfBandQueueTypeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkOutOfBandQueueTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkOutOfBandQueueTypeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkOutOfBandQueueTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlockMatchWindowCompareModeQCOM value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkBlockMatchWindowCompareModeQCOM value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBlockMatchWindowCompareModeQCOM value) const { +const char* vvl::stateless::State::DescribeEnum(VkBlockMatchWindowCompareModeQCOM value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCubicFilterWeightsQCOM value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkCubicFilterWeightsQCOM value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCubicFilterWeightsQCOM value) const { +const char* vvl::stateless::State::DescribeEnum(VkCubicFilterWeightsQCOM value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDisplaySurfaceStereoTypeNV value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkDisplaySurfaceStereoTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDisplaySurfaceStereoTypeNV value) const { +const char* vvl::stateless::State::DescribeEnum(VkDisplaySurfaceStereoTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectExecutionSetInfoTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkIndirectExecutionSetInfoTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkIndirectExecutionSetInfoTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkIndirectExecutionSetInfoTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectCommandsTokenTypeEXT value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkIndirectCommandsTokenTypeEXT value) const { switch (value) { case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV_EXT: case VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_COUNT_NV_EXT: @@ -3555,25 +3535,25 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectCommandsTokenTy }; } template <> -const char* StatelessValidation::DescribeEnum(VkIndirectCommandsTokenTypeEXT value) const { +const char* vvl::stateless::State::DescribeEnum(VkIndirectCommandsTokenTypeEXT value) const { return string_VkIndirectCommandsTokenTypeEXT(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBuildAccelerationStructureModeKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkBuildAccelerationStructureModeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBuildAccelerationStructureModeKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkBuildAccelerationStructureModeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkShaderGroupShaderKHR value) const { +vvl::Extensions vvl::stateless::State::GetEnumExtensions(VkShaderGroupShaderKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkShaderGroupShaderKHR value) const { +const char* vvl::stateless::State::DescribeEnum(VkShaderGroupShaderKHR value) const { return nullptr; } diff --git a/layers/vulkan/generated/valid_enum_values.h b/layers/vulkan/generated/valid_enum_values.h index 4be11426512..c11922750bf 100644 --- a/layers/vulkan/generated/valid_enum_values.h +++ b/layers/vulkan/generated/valid_enum_values.h @@ -3,9 +3,9 @@ /*************************************************************************** * - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,222 +22,222 @@ // NOLINTBEGIN template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineCacheHeaderVersion value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPipelineCacheHeaderVersion value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageLayout value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkImageLayout value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkObjectType value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkObjectType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFormat value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkFormat value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageTiling value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkImageTiling value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageType value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkImageType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueryType value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkQueryType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSharingMode value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkSharingMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkComponentSwizzle value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkComponentSwizzle value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageViewType value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkImageViewType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendFactor value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkBlendFactor value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendOp value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkBlendOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCompareOp value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkCompareOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDynamicState value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDynamicState value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFrontFace value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkFrontFace value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVertexInputRate value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkVertexInputRate value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPrimitiveTopology value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPrimitiveTopology value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPolygonMode value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPolygonMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkStencilOp value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkStencilOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLogicOp value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkLogicOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBorderColor value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkBorderColor value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFilter value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkFilter value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerAddressMode value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerAddressMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerMipmapMode value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerMipmapMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorType value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDescriptorType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentLoadOp value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAttachmentLoadOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentStoreOp value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAttachmentStoreOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineBindPoint value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPipelineBindPoint value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCommandBufferLevel value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkCommandBufferLevel value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndexType value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkIndexType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSubpassContents value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkSubpassContents value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkTessellationDomainOrigin value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkTessellationDomainOrigin value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrModelConversion value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerYcbcrModelConversion value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrRange value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerYcbcrRange value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkChromaLocation value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkChromaLocation value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorUpdateTemplateType value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDescriptorUpdateTemplateType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerReductionMode value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkSamplerReductionMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSemaphoreType value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkSemaphoreType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessBufferBehavior value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPipelineRobustnessBufferBehavior value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessImageBehavior value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPipelineRobustnessImageBehavior value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueueGlobalPriority value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkQueueGlobalPriority value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLineRasterizationMode value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkLineRasterizationMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPresentModeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPresentModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkColorSpaceKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkColorSpaceKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateCombinerOpKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkFragmentShadingRateCombinerOpKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeTuningModeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkVideoEncodeTuningModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1PredictionModeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkVideoEncodeAV1PredictionModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1RateControlGroupKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkVideoEncodeAV1RateControlGroupKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkTimeDomainKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkTimeDomainKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDebugReportObjectTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDebugReportObjectTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkRasterizationOrderAMD value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkRasterizationOrderAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderInfoTypeAMD value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkShaderInfoTypeAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationCheckEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkValidationCheckEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplayPowerStateEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDisplayPowerStateEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceEventTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDeviceEventTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplayEventTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDisplayEventTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkViewportCoordinateSwizzleNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkViewportCoordinateSwizzleNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDiscardRectangleModeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDiscardRectangleModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkConservativeRasterizationModeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkConservativeRasterizationModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendOverlapEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkBlendOverlapEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoverageModulationModeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkCoverageModulationModeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShadingRatePaletteEntryNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkShadingRatePaletteEntryNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoarseSampleOrderTypeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkCoarseSampleOrderTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkGeometryTypeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkGeometryTypeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureTypeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureTypeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCopyAccelerationStructureModeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkCopyAccelerationStructureModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMemoryRequirementsTypeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureMemoryRequirementsTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkMemoryOverallocationBehaviorAMD value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkMemoryOverallocationBehaviorAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceConfigurationTypeINTEL value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPerformanceConfigurationTypeINTEL value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueryPoolSamplingModeINTEL value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkQueryPoolSamplingModeINTEL value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceOverrideTypeINTEL value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPerformanceOverrideTypeINTEL value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceParameterTypeINTEL value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkPerformanceParameterTypeINTEL value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureEnableEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkValidationFeatureEnableEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureDisableEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkValidationFeatureDisableEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoverageReductionModeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkCoverageReductionModeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkProvokingVertexModeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkProvokingVertexModeEXT value) const; #ifdef VK_USE_PLATFORM_WIN32_KHR template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFullScreenExclusiveEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkFullScreenExclusiveEXT value) const; #endif // VK_USE_PLATFORM_WIN32_KHR template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkIndirectCommandsTokenTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDepthBiasRepresentationEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDepthBiasRepresentationEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateTypeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkFragmentShadingRateTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkFragmentShadingRateNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMotionInstanceTypeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureMotionInstanceTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultAddressTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDeviceFaultAddressTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceAddressBindingTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDeviceAddressBindingTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkMicromapTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkMicromapTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBuildMicromapModeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkBuildMicromapModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCopyMicromapModeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkCopyMicromapModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureCompatibilityKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureCompatibilityKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureBuildTypeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAccelerationStructureBuildTypeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowSessionBindingPointNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkOpticalFlowSessionBindingPointNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagModeAMD value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAntiLagModeAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagStageAMD value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkAntiLagStageAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderCodeTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkShaderCodeTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDepthClampModeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDepthClampModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLayerSettingTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkLayerSettingTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLatencyMarkerNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkLatencyMarkerNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOutOfBandQueueTypeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkOutOfBandQueueTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlockMatchWindowCompareModeQCOM value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkBlockMatchWindowCompareModeQCOM value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCubicFilterWeightsQCOM value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkCubicFilterWeightsQCOM value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectExecutionSetInfoTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkIndirectExecutionSetInfoTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeEXT value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkIndirectCommandsTokenTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBuildAccelerationStructureModeKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkBuildAccelerationStructureModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderGroupShaderKHR value) const; +ValidValue vvl::stateless::State::IsValidEnumValue(VkShaderGroupShaderKHR value) const; // NOLINTEND diff --git a/layers/vulkan/generated/valid_flag_values.cpp b/layers/vulkan/generated/valid_flag_values.cpp index 875a88aa3ab..a30a5e3a930 100644 --- a/layers/vulkan/generated/valid_flag_values.cpp +++ b/layers/vulkan/generated/valid_flag_values.cpp @@ -3,9 +3,9 @@ /*************************************************************************** * - * Copyright (c) 2024 The Khronos Group Inc. - * Copyright (c) 2024 Valve Corporation - * Copyright (c) 2024 LunarG, Inc. + * Copyright (c) 2025 The Khronos Group Inc. + * Copyright (c) 2025 Valve Corporation + * Copyright (c) 2025 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,76 +31,72 @@ // - if the value is even found in the API // so the this file is only focused on checking for extensions being supported -vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitmask, VkFlags value, - const DeviceExtensions& device_extensions) const { +vvl::Extensions vvl::stateless::State::IsValidFlagValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const { switch (flag_bitmask) { case vvl::FlagBitmask::VkAccessFlagBits: if (value & (VK_ACCESS_NONE)) { - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) { + if (!IsExtEnabled(exts.vk_khr_synchronization2)) { return {vvl::Extension::_VK_KHR_synchronization2}; } } if (value & (VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT | VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT | VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) { + if (!IsExtEnabled(exts.vk_ext_transform_feedback)) { return {vvl::Extension::_VK_EXT_transform_feedback}; } } if (value & (VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) { + if (!IsExtEnabled(exts.vk_ext_conditional_rendering)) { return {vvl::Extension::_VK_EXT_conditional_rendering}; } } if (value & (VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_blend_operation_advanced)) { + if (!IsExtEnabled(exts.vk_ext_blend_operation_advanced)) { return {vvl::Extension::_VK_EXT_blend_operation_advanced}; } } if (value & (VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR | VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing) && - !IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing) && !IsExtEnabled(exts.vk_khr_acceleration_structure)) { return {vvl::Extension::_VK_NV_ray_tracing, vvl::Extension::_VK_KHR_acceleration_structure}; } } if (value & (VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { return {vvl::Extension::_VK_EXT_fragment_density_map}; } } if (value & (VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate) && - !IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) { + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate) && !IsExtEnabled(exts.vk_nv_shading_rate_image)) { return {vvl::Extension::_VK_KHR_fragment_shading_rate, vvl::Extension::_VK_NV_shading_rate_image}; } } if (value & (VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV | VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands) && - !IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { + if (!IsExtEnabled(exts.vk_nv_device_generated_commands) && !IsExtEnabled(exts.vk_ext_device_generated_commands)) { return {vvl::Extension::_VK_NV_device_generated_commands, vvl::Extension::_VK_EXT_device_generated_commands}; } } return {}; case vvl::FlagBitmask::VkImageAspectFlagBits: if (value & (VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT | VK_IMAGE_ASPECT_PLANE_2_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) { + if (!IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion)) { return {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}; } } if (value & (VK_IMAGE_ASPECT_NONE)) { - if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) { + if (!IsExtEnabled(exts.vk_khr_maintenance4)) { return {vvl::Extension::_VK_KHR_maintenance4}; } } if (value & (VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT | VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT | VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT | VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier)) { + if (!IsExtEnabled(exts.vk_ext_image_drm_format_modifier)) { return {vvl::Extension::_VK_EXT_image_drm_format_modifier}; } } return {}; case vvl::FlagBitmask::VkFormatFeatureFlagBits: if (value & (VK_FORMAT_FEATURE_TRANSFER_SRC_BIT | VK_FORMAT_FEATURE_TRANSFER_DST_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (!IsExtEnabled(exts.vk_khr_maintenance1)) { return {vvl::Extension::_VK_KHR_maintenance1}; } } @@ -110,225 +106,220 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT | VK_FORMAT_FEATURE_DISJOINT_BIT | VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) { + if (!IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion)) { return {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}; } } if (value & (VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT)) { - if (!IsExtEnabled(device_extensions.vk_ext_sampler_filter_minmax)) { + if (!IsExtEnabled(exts.vk_ext_sampler_filter_minmax)) { return {vvl::Extension::_VK_EXT_sampler_filter_minmax}; } } if (value & (VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR | VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_decode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_decode_queue)) { return {vvl::Extension::_VK_KHR_video_decode_queue}; } } if (value & (VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) { + if (!IsExtEnabled(exts.vk_khr_acceleration_structure)) { return {vvl::Extension::_VK_KHR_acceleration_structure}; } } if (value & (VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_img_filter_cubic) && !IsExtEnabled(device_extensions.vk_ext_filter_cubic)) { + if (!IsExtEnabled(exts.vk_img_filter_cubic) && !IsExtEnabled(exts.vk_ext_filter_cubic)) { return {vvl::Extension::_VK_IMG_filter_cubic, vvl::Extension::_VK_EXT_filter_cubic}; } } if (value & (VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { return {vvl::Extension::_VK_EXT_fragment_density_map}; } } if (value & (VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate)) { + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate)) { return {vvl::Extension::_VK_KHR_fragment_shading_rate}; } } if (value & (VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR | VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { return {vvl::Extension::_VK_KHR_video_encode_queue}; } } return {}; case vvl::FlagBitmask::VkImageCreateFlagBits: if (value & (VK_IMAGE_CREATE_ALIAS_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_bind_memory2)) { + if (!IsExtEnabled(exts.vk_khr_bind_memory2)) { return {vvl::Extension::_VK_KHR_bind_memory2}; } } if (value & (VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { + if (!IsExtEnabled(exts.vk_khr_device_group)) { return {vvl::Extension::_VK_KHR_device_group}; } } if (value & (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (!IsExtEnabled(exts.vk_khr_maintenance1)) { return {vvl::Extension::_VK_KHR_maintenance1}; } } if (value & (VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_maintenance2)) { + if (!IsExtEnabled(exts.vk_khr_maintenance2)) { return {vvl::Extension::_VK_KHR_maintenance2}; } } if (value & (VK_IMAGE_CREATE_DISJOINT_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) { + if (!IsExtEnabled(exts.vk_khr_sampler_ycbcr_conversion)) { return {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}; } } if (value & (VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_corner_sampled_image)) { + if (!IsExtEnabled(exts.vk_nv_corner_sampled_image)) { return {vvl::Extension::_VK_NV_corner_sampled_image}; } } if (value & (VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_sample_locations)) { + if (!IsExtEnabled(exts.vk_ext_sample_locations)) { return {vvl::Extension::_VK_EXT_sample_locations}; } } if (value & (VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { return {vvl::Extension::_VK_EXT_fragment_density_map}; } } if (value & (VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_multisampled_render_to_single_sampled)) { + if (!IsExtEnabled(exts.vk_ext_multisampled_render_to_single_sampled)) { return {vvl::Extension::_VK_EXT_multisampled_render_to_single_sampled}; } } if (value & (VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_image_2d_view_of_3d)) { + if (!IsExtEnabled(exts.vk_ext_image_2d_view_of_3d)) { return {vvl::Extension::_VK_EXT_image_2d_view_of_3d}; } } if (value & (VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM)) { - if (!IsExtEnabled(device_extensions.vk_qcom_fragment_density_map_offset)) { + if (!IsExtEnabled(exts.vk_qcom_fragment_density_map_offset)) { return {vvl::Extension::_VK_QCOM_fragment_density_map_offset}; } } if (value & (VK_IMAGE_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_maintenance1)) { + if (!IsExtEnabled(exts.vk_khr_video_maintenance1)) { return {vvl::Extension::_VK_KHR_video_maintenance1}; } } return {}; case vvl::FlagBitmask::VkImageUsageFlagBits: if (value & (VK_IMAGE_USAGE_HOST_TRANSFER_BIT)) { - if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) { + if (!IsExtEnabled(exts.vk_ext_host_image_copy)) { return {vvl::Extension::_VK_EXT_host_image_copy}; } } if (value & (VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR | VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_decode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_decode_queue)) { return {vvl::Extension::_VK_KHR_video_decode_queue}; } } if (value & (VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { return {vvl::Extension::_VK_EXT_fragment_density_map}; } } if (value & (VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate) && - !IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) { + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate) && !IsExtEnabled(exts.vk_nv_shading_rate_image)) { return {vvl::Extension::_VK_KHR_fragment_shading_rate, vvl::Extension::_VK_NV_shading_rate_image}; } } if (value & (VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { return {vvl::Extension::_VK_KHR_video_encode_queue}; } } if (value & (VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_layout)) { + if (!IsExtEnabled(exts.vk_ext_attachment_feedback_loop_layout)) { return {vvl::Extension::_VK_EXT_attachment_feedback_loop_layout}; } } if (value & (VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI)) { - if (!IsExtEnabled(device_extensions.vk_huawei_invocation_mask)) { + if (!IsExtEnabled(exts.vk_huawei_invocation_mask)) { return {vvl::Extension::_VK_HUAWEI_invocation_mask}; } } if (value & (VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM | VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM)) { - if (!IsExtEnabled(device_extensions.vk_qcom_image_processing)) { + if (!IsExtEnabled(exts.vk_qcom_image_processing)) { return {vvl::Extension::_VK_QCOM_image_processing}; } } if (value & (VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR | VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_quantization_map)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { return {vvl::Extension::_VK_KHR_video_encode_quantization_map}; } } return {}; case vvl::FlagBitmask::VkPipelineStageFlagBits: if (value & (VK_PIPELINE_STAGE_NONE)) { - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) { + if (!IsExtEnabled(exts.vk_khr_synchronization2)) { return {vvl::Extension::_VK_KHR_synchronization2}; } } if (value & (VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) { + if (!IsExtEnabled(exts.vk_ext_transform_feedback)) { return {vvl::Extension::_VK_EXT_transform_feedback}; } } if (value & (VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) { + if (!IsExtEnabled(exts.vk_ext_conditional_rendering)) { return {vvl::Extension::_VK_EXT_conditional_rendering}; } } if (value & (VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing) && - !IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing) && !IsExtEnabled(exts.vk_khr_acceleration_structure)) { return {vvl::Extension::_VK_NV_ray_tracing, vvl::Extension::_VK_KHR_acceleration_structure}; } } if (value & (VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing) && - !IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing) && !IsExtEnabled(exts.vk_khr_ray_tracing_pipeline)) { return {vvl::Extension::_VK_NV_ray_tracing, vvl::Extension::_VK_KHR_ray_tracing_pipeline}; } } if (value & (VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { return {vvl::Extension::_VK_EXT_fragment_density_map}; } } if (value & (VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate) && - !IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) { + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate) && !IsExtEnabled(exts.vk_nv_shading_rate_image)) { return {vvl::Extension::_VK_KHR_fragment_shading_rate, vvl::Extension::_VK_NV_shading_rate_image}; } } if (value & (VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands) && - !IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { + if (!IsExtEnabled(exts.vk_nv_device_generated_commands) && !IsExtEnabled(exts.vk_ext_device_generated_commands)) { return {vvl::Extension::_VK_NV_device_generated_commands, vvl::Extension::_VK_EXT_device_generated_commands}; } } if (value & (VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT | VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_nv_mesh_shader) && !IsExtEnabled(device_extensions.vk_ext_mesh_shader)) { + if (!IsExtEnabled(exts.vk_nv_mesh_shader) && !IsExtEnabled(exts.vk_ext_mesh_shader)) { return {vvl::Extension::_VK_NV_mesh_shader, vvl::Extension::_VK_EXT_mesh_shader}; } } return {}; case vvl::FlagBitmask::VkMemoryMapFlagBits: if (value & (VK_MEMORY_MAP_PLACED_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_map_memory_placed)) { + if (!IsExtEnabled(exts.vk_ext_map_memory_placed)) { return {vvl::Extension::_VK_EXT_map_memory_placed}; } } return {}; case vvl::FlagBitmask::VkEventCreateFlagBits: if (value & (VK_EVENT_CREATE_DEVICE_ONLY_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) { + if (!IsExtEnabled(exts.vk_khr_synchronization2)) { return {vvl::Extension::_VK_KHR_synchronization2}; } } @@ -336,136 +327,133 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm case vvl::FlagBitmask::VkQueryPipelineStatisticFlagBits: if (value & (VK_QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT | VK_QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_mesh_shader)) { + if (!IsExtEnabled(exts.vk_ext_mesh_shader)) { return {vvl::Extension::_VK_EXT_mesh_shader}; } } if (value & (VK_QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI)) { - if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) { + if (!IsExtEnabled(exts.vk_huawei_cluster_culling_shader)) { return {vvl::Extension::_VK_HUAWEI_cluster_culling_shader}; } } return {}; case vvl::FlagBitmask::VkQueryResultFlagBits: if (value & (VK_QUERY_RESULT_WITH_STATUS_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_queue)) { return {vvl::Extension::_VK_KHR_video_queue}; } } return {}; case vvl::FlagBitmask::VkBufferCreateFlagBits: if (value & (VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address) && - !IsExtEnabled(device_extensions.vk_ext_buffer_device_address)) { + if (!IsExtEnabled(exts.vk_khr_buffer_device_address) && !IsExtEnabled(exts.vk_ext_buffer_device_address)) { return {vvl::Extension::_VK_KHR_buffer_device_address, vvl::Extension::_VK_EXT_buffer_device_address}; } } if (value & (VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_BUFFER_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_maintenance1)) { + if (!IsExtEnabled(exts.vk_khr_video_maintenance1)) { return {vvl::Extension::_VK_KHR_video_maintenance1}; } } return {}; case vvl::FlagBitmask::VkBufferUsageFlagBits: if (value & (VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address) && - !IsExtEnabled(device_extensions.vk_ext_buffer_device_address)) { + if (!IsExtEnabled(exts.vk_khr_buffer_device_address) && !IsExtEnabled(exts.vk_ext_buffer_device_address)) { return {vvl::Extension::_VK_KHR_buffer_device_address, vvl::Extension::_VK_EXT_buffer_device_address}; } } if (value & (VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR | VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_decode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_decode_queue)) { return {vvl::Extension::_VK_KHR_video_decode_queue}; } } if (value & (VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT | VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) { + if (!IsExtEnabled(exts.vk_ext_transform_feedback)) { return {vvl::Extension::_VK_EXT_transform_feedback}; } } if (value & (VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) { + if (!IsExtEnabled(exts.vk_ext_conditional_rendering)) { return {vvl::Extension::_VK_EXT_conditional_rendering}; } } if (value & (VK_BUFFER_USAGE_EXECUTION_GRAPH_SCRATCH_BIT_AMDX)) { - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) { + if (!IsExtEnabled(exts.vk_amdx_shader_enqueue)) { return {vvl::Extension::_VK_AMDX_shader_enqueue}; } } if (value & (VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR | VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) { + if (!IsExtEnabled(exts.vk_khr_acceleration_structure)) { return {vvl::Extension::_VK_KHR_acceleration_structure}; } } if (value & (VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing) && - !IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing) && !IsExtEnabled(exts.vk_khr_ray_tracing_pipeline)) { return {vvl::Extension::_VK_NV_ray_tracing, vvl::Extension::_VK_KHR_ray_tracing_pipeline}; } } if (value & (VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR | VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { return {vvl::Extension::_VK_KHR_video_encode_queue}; } } if (value & (VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT | VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT | VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_BUFFER_USAGE_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT | VK_BUFFER_USAGE_MICROMAP_STORAGE_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) { + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { return {vvl::Extension::_VK_EXT_opacity_micromap}; } } return {}; case vvl::FlagBitmask::VkImageViewCreateFlagBits: if (value & (VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { return {vvl::Extension::_VK_EXT_fragment_density_map}; } } if (value & (VK_IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map2)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map2)) { return {vvl::Extension::_VK_EXT_fragment_density_map2}; } } return {}; case vvl::FlagBitmask::VkPipelineCacheCreateFlagBits: if (value & (VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT)) { - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_creation_cache_control)) { + if (!IsExtEnabled(exts.vk_ext_pipeline_creation_cache_control)) { return {vvl::Extension::_VK_EXT_pipeline_creation_cache_control}; } } return {}; case vvl::FlagBitmask::VkPipelineCreateFlagBits: if (value & (VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { + if (!IsExtEnabled(exts.vk_khr_device_group)) { return {vvl::Extension::_VK_KHR_device_group}; } } if (value & (VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT | VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT)) { - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_creation_cache_control)) { + if (!IsExtEnabled(exts.vk_ext_pipeline_creation_cache_control)) { return {vvl::Extension::_VK_EXT_pipeline_creation_cache_control}; } } if (value & (VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT | VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT)) { - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_protected_access)) { + if (!IsExtEnabled(exts.vk_ext_pipeline_protected_access)) { return {vvl::Extension::_VK_EXT_pipeline_protected_access}; } } @@ -475,70 +463,70 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR | VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR | VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR | VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) { + if (!IsExtEnabled(exts.vk_khr_ray_tracing_pipeline)) { return {vvl::Extension::_VK_KHR_ray_tracing_pipeline}; } } if (value & (VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing)) { return {vvl::Extension::_VK_NV_ray_tracing}; } } if (value & (VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { return {vvl::Extension::_VK_EXT_fragment_density_map}; } } if (value & (VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate)) { + if (!IsExtEnabled(exts.vk_khr_fragment_shading_rate)) { return {vvl::Extension::_VK_KHR_fragment_shading_rate}; } } if (value & (VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR | VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_executable_properties)) { + if (!IsExtEnabled(exts.vk_khr_pipeline_executable_properties)) { return {vvl::Extension::_VK_KHR_pipeline_executable_properties}; } } if (value & (VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) { + if (!IsExtEnabled(exts.vk_nv_device_generated_commands)) { return {vvl::Extension::_VK_NV_device_generated_commands}; } } if (value & (VK_PIPELINE_CREATE_LIBRARY_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_library)) { + if (!IsExtEnabled(exts.vk_khr_pipeline_library)) { return {vvl::Extension::_VK_KHR_pipeline_library}; } } if (value & (VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT | VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library)) { + if (!IsExtEnabled(exts.vk_ext_graphics_pipeline_library)) { return {vvl::Extension::_VK_EXT_graphics_pipeline_library}; } } if (value & (VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing_motion_blur)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing_motion_blur)) { return {vvl::Extension::_VK_NV_ray_tracing_motion_blur}; } } if (value & (VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT | VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_layout)) { + if (!IsExtEnabled(exts.vk_ext_attachment_feedback_loop_layout)) { return {vvl::Extension::_VK_EXT_attachment_feedback_loop_layout}; } } if (value & (VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) { + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { return {vvl::Extension::_VK_EXT_opacity_micromap}; } } if (value & (VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_displacement_micromap)) { + if (!IsExtEnabled(exts.vk_nv_displacement_micromap)) { return {vvl::Extension::_VK_NV_displacement_micromap}; } } @@ -546,7 +534,7 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm case vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits: if (value & (VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT | VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT)) { - if (!IsExtEnabled(device_extensions.vk_ext_subgroup_size_control)) { + if (!IsExtEnabled(exts.vk_ext_subgroup_size_control)) { return {vvl::Extension::_VK_EXT_subgroup_size_control}; } } @@ -560,23 +548,22 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm } if (value & (VK_SHADER_STAGE_RAYGEN_BIT_KHR | VK_SHADER_STAGE_ANY_HIT_BIT_KHR | VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR | VK_SHADER_STAGE_MISS_BIT_KHR | VK_SHADER_STAGE_INTERSECTION_BIT_KHR | VK_SHADER_STAGE_CALLABLE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing) && - !IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing) && !IsExtEnabled(exts.vk_khr_ray_tracing_pipeline)) { return {vvl::Extension::_VK_NV_ray_tracing, vvl::Extension::_VK_KHR_ray_tracing_pipeline}; } } if (value & (VK_SHADER_STAGE_TASK_BIT_EXT | VK_SHADER_STAGE_MESH_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_nv_mesh_shader) && !IsExtEnabled(device_extensions.vk_ext_mesh_shader)) { + if (!IsExtEnabled(exts.vk_nv_mesh_shader) && !IsExtEnabled(exts.vk_ext_mesh_shader)) { return {vvl::Extension::_VK_NV_mesh_shader, vvl::Extension::_VK_EXT_mesh_shader}; } } if (value & (VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI)) { - if (!IsExtEnabled(device_extensions.vk_huawei_subpass_shading)) { + if (!IsExtEnabled(exts.vk_huawei_subpass_shading)) { return {vvl::Extension::_VK_HUAWEI_subpass_shading}; } } if (value & (VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI)) { - if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) { + if (!IsExtEnabled(exts.vk_huawei_cluster_culling_shader)) { return {vvl::Extension::_VK_HUAWEI_cluster_culling_shader}; } } @@ -584,8 +571,8 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm case vvl::FlagBitmask::VkPipelineDepthStencilStateCreateFlagBits: if (value & (VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT | VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_arm_rasterization_order_attachment_access) && - !IsExtEnabled(device_extensions.vk_ext_rasterization_order_attachment_access)) { + if (!IsExtEnabled(exts.vk_arm_rasterization_order_attachment_access) && + !IsExtEnabled(exts.vk_ext_rasterization_order_attachment_access)) { return {vvl::Extension::_VK_ARM_rasterization_order_attachment_access, vvl::Extension::_VK_EXT_rasterization_order_attachment_access}; } @@ -593,8 +580,8 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm return {}; case vvl::FlagBitmask::VkPipelineColorBlendStateCreateFlagBits: if (value & (VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_arm_rasterization_order_attachment_access) && - !IsExtEnabled(device_extensions.vk_ext_rasterization_order_attachment_access)) { + if (!IsExtEnabled(exts.vk_arm_rasterization_order_attachment_access) && + !IsExtEnabled(exts.vk_ext_rasterization_order_attachment_access)) { return {vvl::Extension::_VK_ARM_rasterization_order_attachment_access, vvl::Extension::_VK_EXT_rasterization_order_attachment_access}; } @@ -602,113 +589,111 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm return {}; case vvl::FlagBitmask::VkPipelineLayoutCreateFlagBits: if (value & (VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library)) { + if (!IsExtEnabled(exts.vk_ext_graphics_pipeline_library)) { return {vvl::Extension::_VK_EXT_graphics_pipeline_library}; } } return {}; case vvl::FlagBitmask::VkSamplerCreateFlagBits: if (value & (VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT | VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_fragment_density_map)) { + if (!IsExtEnabled(exts.vk_ext_fragment_density_map)) { return {vvl::Extension::_VK_EXT_fragment_density_map}; } } if (value & (VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_non_seamless_cube_map)) { + if (!IsExtEnabled(exts.vk_ext_non_seamless_cube_map)) { return {vvl::Extension::_VK_EXT_non_seamless_cube_map}; } } if (value & (VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM)) { - if (!IsExtEnabled(device_extensions.vk_qcom_image_processing)) { + if (!IsExtEnabled(exts.vk_qcom_image_processing)) { return {vvl::Extension::_VK_QCOM_image_processing}; } } return {}; case vvl::FlagBitmask::VkDescriptorPoolCreateFlagBits: if (value & (VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_indexing)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_indexing)) { return {vvl::Extension::_VK_EXT_descriptor_indexing}; } } if (value & (VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_valve_mutable_descriptor_type) && - !IsExtEnabled(device_extensions.vk_ext_mutable_descriptor_type)) { + if (!IsExtEnabled(exts.vk_valve_mutable_descriptor_type) && !IsExtEnabled(exts.vk_ext_mutable_descriptor_type)) { return {vvl::Extension::_VK_VALVE_mutable_descriptor_type, vvl::Extension::_VK_EXT_mutable_descriptor_type}; } } if (value & (VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV | VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_descriptor_pool_overallocation)) { + if (!IsExtEnabled(exts.vk_nv_descriptor_pool_overallocation)) { return {vvl::Extension::_VK_NV_descriptor_pool_overallocation}; } } return {}; case vvl::FlagBitmask::VkDescriptorSetLayoutCreateFlagBits: if (value & (VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_indexing)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_indexing)) { return {vvl::Extension::_VK_EXT_descriptor_indexing}; } } if (value & (VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_push_descriptor)) { + if (!IsExtEnabled(exts.vk_khr_push_descriptor)) { return {vvl::Extension::_VK_KHR_push_descriptor}; } } if (value & (VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT | VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_DESCRIPTOR_SET_LAYOUT_CREATE_INDIRECT_BINDABLE_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute)) { + if (!IsExtEnabled(exts.vk_nv_device_generated_commands_compute)) { return {vvl::Extension::_VK_NV_device_generated_commands_compute}; } } if (value & (VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_valve_mutable_descriptor_type) && - !IsExtEnabled(device_extensions.vk_ext_mutable_descriptor_type)) { + if (!IsExtEnabled(exts.vk_valve_mutable_descriptor_type) && !IsExtEnabled(exts.vk_ext_mutable_descriptor_type)) { return {vvl::Extension::_VK_VALVE_mutable_descriptor_type, vvl::Extension::_VK_EXT_mutable_descriptor_type}; } } if (value & (VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_per_stage_descriptor_set)) { + if (!IsExtEnabled(exts.vk_nv_per_stage_descriptor_set)) { return {vvl::Extension::_VK_NV_per_stage_descriptor_set}; } } return {}; case vvl::FlagBitmask::VkDependencyFlagBits: if (value & (VK_DEPENDENCY_DEVICE_GROUP_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { + if (!IsExtEnabled(exts.vk_khr_device_group)) { return {vvl::Extension::_VK_KHR_device_group}; } } if (value & (VK_DEPENDENCY_VIEW_LOCAL_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_multiview)) { + if (!IsExtEnabled(exts.vk_khr_multiview)) { return {vvl::Extension::_VK_KHR_multiview}; } } if (value & (VK_DEPENDENCY_FEEDBACK_LOOP_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_layout)) { + if (!IsExtEnabled(exts.vk_ext_attachment_feedback_loop_layout)) { return {vvl::Extension::_VK_EXT_attachment_feedback_loop_layout}; } } return {}; case vvl::FlagBitmask::VkFramebufferCreateFlagBits: if (value & (VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_imageless_framebuffer)) { + if (!IsExtEnabled(exts.vk_khr_imageless_framebuffer)) { return {vvl::Extension::_VK_KHR_imageless_framebuffer}; } } return {}; case vvl::FlagBitmask::VkRenderPassCreateFlagBits: if (value & (VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM)) { - if (!IsExtEnabled(device_extensions.vk_qcom_render_pass_transform)) { + if (!IsExtEnabled(exts.vk_qcom_render_pass_transform)) { return {vvl::Extension::_VK_QCOM_render_pass_transform}; } } @@ -716,142 +701,141 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm case vvl::FlagBitmask::VkSubpassDescriptionFlagBits: if (value & (VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX | VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX)) { - if (!IsExtEnabled(device_extensions.vk_nvx_multiview_per_view_attributes)) { + if (!IsExtEnabled(exts.vk_nvx_multiview_per_view_attributes)) { return {vvl::Extension::_VK_NVX_multiview_per_view_attributes}; } } if (value & (VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM | VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM)) { - if (!IsExtEnabled(device_extensions.vk_qcom_render_pass_shader_resolve)) { + if (!IsExtEnabled(exts.vk_qcom_render_pass_shader_resolve)) { return {vvl::Extension::_VK_QCOM_render_pass_shader_resolve}; } } if (value & (VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT | VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT | VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_arm_rasterization_order_attachment_access) && - !IsExtEnabled(device_extensions.vk_ext_rasterization_order_attachment_access)) { + if (!IsExtEnabled(exts.vk_arm_rasterization_order_attachment_access) && + !IsExtEnabled(exts.vk_ext_rasterization_order_attachment_access)) { return {vvl::Extension::_VK_ARM_rasterization_order_attachment_access, vvl::Extension::_VK_EXT_rasterization_order_attachment_access}; } } if (value & (VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_legacy_dithering)) { + if (!IsExtEnabled(exts.vk_ext_legacy_dithering)) { return {vvl::Extension::_VK_EXT_legacy_dithering}; } } return {}; case vvl::FlagBitmask::VkMemoryAllocateFlagBits: if (value & (VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT | VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) { + if (!IsExtEnabled(exts.vk_khr_buffer_device_address)) { return {vvl::Extension::_VK_KHR_buffer_device_address}; } } return {}; case vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits: if (value & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_external_memory_dma_buf)) { + if (!IsExtEnabled(exts.vk_ext_external_memory_dma_buf)) { return {vvl::Extension::_VK_EXT_external_memory_dma_buf}; } } if (value & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID)) { - if (!IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) { + if (!IsExtEnabled(exts.vk_android_external_memory_android_hardware_buffer)) { return {vvl::Extension::_VK_ANDROID_external_memory_android_hardware_buffer}; } } if (value & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT | VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_external_memory_host)) { + if (!IsExtEnabled(exts.vk_ext_external_memory_host)) { return {vvl::Extension::_VK_EXT_external_memory_host}; } } if (value & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA)) { - if (!IsExtEnabled(device_extensions.vk_fuchsia_external_memory)) { + if (!IsExtEnabled(exts.vk_fuchsia_external_memory)) { return {vvl::Extension::_VK_FUCHSIA_external_memory}; } } if (value & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_external_memory_rdma)) { + if (!IsExtEnabled(exts.vk_nv_external_memory_rdma)) { return {vvl::Extension::_VK_NV_external_memory_rdma}; } } if (value & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_SCREEN_BUFFER_BIT_QNX)) { - if (!IsExtEnabled(device_extensions.vk_qnx_external_memory_screen_buffer)) { + if (!IsExtEnabled(exts.vk_qnx_external_memory_screen_buffer)) { return {vvl::Extension::_VK_QNX_external_memory_screen_buffer}; } } return {}; case vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits: if (value & (VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA)) { - if (!IsExtEnabled(device_extensions.vk_fuchsia_external_semaphore)) { + if (!IsExtEnabled(exts.vk_fuchsia_external_semaphore)) { return {vvl::Extension::_VK_FUCHSIA_external_semaphore}; } } return {}; case vvl::FlagBitmask::VkResolveModeFlagBits: if (value & (VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID)) { - if (!IsExtEnabled(device_extensions.vk_android_external_format_resolve)) { + if (!IsExtEnabled(exts.vk_android_external_format_resolve)) { return {vvl::Extension::_VK_ANDROID_external_format_resolve}; } } return {}; case vvl::FlagBitmask::VkRenderingFlagBits: if (value & (VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_legacy_dithering)) { + if (!IsExtEnabled(exts.vk_ext_legacy_dithering)) { return {vvl::Extension::_VK_EXT_legacy_dithering}; } } if (value & (VK_RENDERING_CONTENTS_INLINE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_maintenance7) && - !IsExtEnabled(device_extensions.vk_ext_nested_command_buffer)) { + if (!IsExtEnabled(exts.vk_khr_maintenance7) && !IsExtEnabled(exts.vk_ext_nested_command_buffer)) { return {vvl::Extension::_VK_KHR_maintenance7, vvl::Extension::_VK_EXT_nested_command_buffer}; } } return {}; case vvl::FlagBitmask::VkMemoryUnmapFlagBits: if (value & (VK_MEMORY_UNMAP_RESERVE_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_map_memory_placed)) { + if (!IsExtEnabled(exts.vk_ext_map_memory_placed)) { return {vvl::Extension::_VK_EXT_map_memory_placed}; } } return {}; case vvl::FlagBitmask::VkSwapchainCreateFlagBitsKHR: if (value & (VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_device_group)) { + if (!IsExtEnabled(exts.vk_khr_device_group)) { return {vvl::Extension::_VK_KHR_device_group}; } } if (value & (VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_swapchain_mutable_format)) { + if (!IsExtEnabled(exts.vk_khr_swapchain_mutable_format)) { return {vvl::Extension::_VK_KHR_swapchain_mutable_format}; } } if (value & (VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) { + if (!IsExtEnabled(exts.vk_ext_swapchain_maintenance1)) { return {vvl::Extension::_VK_EXT_swapchain_maintenance1}; } } return {}; case vvl::FlagBitmask::VkVideoSessionCreateFlagBitsKHR: if (value & (VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_PARAMETER_OPTIMIZATIONS_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { return {vvl::Extension::_VK_KHR_video_encode_queue}; } } if (value & (VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_maintenance1)) { + if (!IsExtEnabled(exts.vk_khr_video_maintenance1)) { return {vvl::Extension::_VK_KHR_video_maintenance1}; } } if (value & (VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR | VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_EMPHASIS_MAP_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_quantization_map)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { return {vvl::Extension::_VK_KHR_video_encode_quantization_map}; } } return {}; case vvl::FlagBitmask::VkVideoSessionParametersCreateFlagBitsKHR: if (value & (VK_VIDEO_SESSION_PARAMETERS_CREATE_QUANTIZATION_MAP_COMPATIBLE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_quantization_map)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { return {vvl::Extension::_VK_KHR_video_encode_quantization_map}; } } @@ -859,21 +843,21 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm case vvl::FlagBitmask::VkVideoCodingControlFlagBitsKHR: if (value & (VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR | VK_VIDEO_CODING_CONTROL_ENCODE_QUALITY_LEVEL_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { return {vvl::Extension::_VK_KHR_video_encode_queue}; } } return {}; case vvl::FlagBitmask::VkVideoEncodeFlagBitsKHR: if (value & (VK_VIDEO_ENCODE_WITH_QUANTIZATION_DELTA_MAP_BIT_KHR | VK_VIDEO_ENCODE_WITH_EMPHASIS_MAP_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_quantization_map)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_quantization_map)) { return {vvl::Extension::_VK_KHR_video_encode_quantization_map}; } } return {}; case vvl::FlagBitmask::VkDebugUtilsMessageTypeFlagBitsEXT: if (value & (VK_DEBUG_UTILS_MESSAGE_TYPE_DEVICE_ADDRESS_BINDING_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_device_address_binding_report)) { + if (!IsExtEnabled(exts.vk_ext_device_address_binding_report)) { return {vvl::Extension::_VK_EXT_device_address_binding_report}; } } @@ -881,50 +865,50 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm case vvl::FlagBitmask::VkGeometryInstanceFlagBitsKHR: if (value & (VK_GEOMETRY_INSTANCE_FORCE_OPACITY_MICROMAP_2_STATE_EXT | VK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) { + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { return {vvl::Extension::_VK_EXT_opacity_micromap}; } } return {}; case vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR: if (value & (VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing_motion_blur)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing_motion_blur)) { return {vvl::Extension::_VK_NV_ray_tracing_motion_blur}; } } if (value & (VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_EXT | VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISABLE_OPACITY_MICROMAPS_EXT | VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) { + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { return {vvl::Extension::_VK_EXT_opacity_micromap}; } } if (value & (VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISPLACEMENT_MICROMAP_UPDATE_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_displacement_micromap)) { + if (!IsExtEnabled(exts.vk_nv_displacement_micromap)) { return {vvl::Extension::_VK_NV_displacement_micromap}; } } if (value & (VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DATA_ACCESS_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_position_fetch)) { + if (!IsExtEnabled(exts.vk_khr_ray_tracing_position_fetch)) { return {vvl::Extension::_VK_KHR_ray_tracing_position_fetch}; } } return {}; case vvl::FlagBitmask::VkShaderCreateFlagBitsEXT: if (value & (VK_SHADER_CREATE_INDIRECT_BINDABLE_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { + if (!IsExtEnabled(exts.vk_ext_device_generated_commands)) { return {vvl::Extension::_VK_EXT_device_generated_commands}; } } return {}; case vvl::FlagBitmask::VkAccelerationStructureCreateFlagBitsKHR: if (value & (VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_ray_tracing_motion_blur)) { + if (!IsExtEnabled(exts.vk_nv_ray_tracing_motion_blur)) { return {vvl::Extension::_VK_NV_ray_tracing_motion_blur}; } } @@ -934,118 +918,117 @@ vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitm } } -vvl::Extensions StatelessValidation::IsValidFlag64Value(vvl::FlagBitmask flag_bitmask, VkFlags64 value, - const DeviceExtensions& device_extensions) const { +vvl::Extensions vvl::stateless::State::IsValidFlag64Value(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const { switch (flag_bitmask) { case vvl::FlagBitmask::VkPipelineStageFlagBits2: if (value & (VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_decode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_decode_queue)) { return {vvl::Extension::_VK_KHR_video_decode_queue}; } } if (value & (VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { return {vvl::Extension::_VK_KHR_video_encode_queue}; } } if (value & (VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI)) { - if (!IsExtEnabled(device_extensions.vk_huawei_subpass_shading)) { + if (!IsExtEnabled(exts.vk_huawei_subpass_shading)) { return {vvl::Extension::_VK_HUAWEI_subpass_shading}; } } if (value & (VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI)) { - if (!IsExtEnabled(device_extensions.vk_huawei_invocation_mask)) { + if (!IsExtEnabled(exts.vk_huawei_invocation_mask)) { return {vvl::Extension::_VK_HUAWEI_invocation_mask}; } } if (value & (VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_maintenance1)) { + if (!IsExtEnabled(exts.vk_khr_ray_tracing_maintenance1)) { return {vvl::Extension::_VK_KHR_ray_tracing_maintenance1}; } } if (value & (VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) { + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { return {vvl::Extension::_VK_EXT_opacity_micromap}; } } if (value & (VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI)) { - if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) { + if (!IsExtEnabled(exts.vk_huawei_cluster_culling_shader)) { return {vvl::Extension::_VK_HUAWEI_cluster_culling_shader}; } } if (value & (VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_optical_flow)) { + if (!IsExtEnabled(exts.vk_nv_optical_flow)) { return {vvl::Extension::_VK_NV_optical_flow}; } } return {}; case vvl::FlagBitmask::VkAccessFlagBits2: if (value & (VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR | VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_decode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_decode_queue)) { return {vvl::Extension::_VK_KHR_video_decode_queue}; } } if (value & (VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR | VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) { + if (!IsExtEnabled(exts.vk_khr_video_encode_queue)) { return {vvl::Extension::_VK_KHR_video_encode_queue}; } } if (value & (VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (!IsExtEnabled(exts.vk_ext_descriptor_buffer)) { return {vvl::Extension::_VK_EXT_descriptor_buffer}; } } if (value & (VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI)) { - if (!IsExtEnabled(device_extensions.vk_huawei_invocation_mask)) { + if (!IsExtEnabled(exts.vk_huawei_invocation_mask)) { return {vvl::Extension::_VK_HUAWEI_invocation_mask}; } } if (value & (VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_maintenance1)) { + if (!IsExtEnabled(exts.vk_khr_ray_tracing_maintenance1)) { return {vvl::Extension::_VK_KHR_ray_tracing_maintenance1}; } } if (value & (VK_ACCESS_2_MICROMAP_READ_BIT_EXT | VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) { + if (!IsExtEnabled(exts.vk_ext_opacity_micromap)) { return {vvl::Extension::_VK_EXT_opacity_micromap}; } } if (value & (VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV | VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV)) { - if (!IsExtEnabled(device_extensions.vk_nv_optical_flow)) { + if (!IsExtEnabled(exts.vk_nv_optical_flow)) { return {vvl::Extension::_VK_NV_optical_flow}; } } return {}; case vvl::FlagBitmask::VkPipelineCreateFlagBits2: if (value & (VK_PIPELINE_CREATE_2_EXECUTION_GRAPH_BIT_AMDX)) { - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) { + if (!IsExtEnabled(exts.vk_amdx_shader_enqueue)) { return {vvl::Extension::_VK_AMDX_shader_enqueue}; } } if (value & (VK_PIPELINE_CREATE_2_ENABLE_LEGACY_DITHERING_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_legacy_dithering)) { + if (!IsExtEnabled(exts.vk_ext_legacy_dithering)) { return {vvl::Extension::_VK_EXT_legacy_dithering}; } } if (value & (VK_PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) { + if (!IsExtEnabled(exts.vk_khr_pipeline_binary)) { return {vvl::Extension::_VK_KHR_pipeline_binary}; } } if (value & (VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { + if (!IsExtEnabled(exts.vk_ext_device_generated_commands)) { return {vvl::Extension::_VK_EXT_device_generated_commands}; } } return {}; case vvl::FlagBitmask::VkBufferUsageFlagBits2: if (value & (VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX)) { - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) { + if (!IsExtEnabled(exts.vk_amdx_shader_enqueue)) { return {vvl::Extension::_VK_AMDX_shader_enqueue}; } } if (value & (VK_BUFFER_USAGE_2_PREPROCESS_BUFFER_BIT_EXT)) { - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { + if (!IsExtEnabled(exts.vk_ext_device_generated_commands)) { return {vvl::Extension::_VK_EXT_device_generated_commands}; } } @@ -1055,7 +1038,7 @@ vvl::Extensions StatelessValidation::IsValidFlag64Value(vvl::FlagBitmask flag_bi } } -std::string StatelessValidation::DescribeFlagBitmaskValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const { +std::string vvl::stateless::State::DescribeFlagBitmaskValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const { switch (flag_bitmask) { case vvl::FlagBitmask::VkAccessFlagBits: return string_VkAccessFlags(value); @@ -1279,7 +1262,7 @@ std::string StatelessValidation::DescribeFlagBitmaskValue(vvl::FlagBitmask flag_ } } -std::string StatelessValidation::DescribeFlagBitmaskValue64(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const { +std::string vvl::stateless::State::DescribeFlagBitmaskValue64(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const { switch (flag_bitmask) { case vvl::FlagBitmask::VkPipelineStageFlagBits2: return string_VkPipelineStageFlags2(value); diff --git a/layers/vulkan/generated/vk_extension_helper.cpp b/layers/vulkan/generated/vk_extension_helper.cpp index 3c5a3851714..53f2ff0826c 100644 --- a/layers/vulkan/generated/vk_extension_helper.cpp +++ b/layers/vulkan/generated/vk_extension_helper.cpp @@ -3,9 +3,9 @@ /*************************************************************************** * - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (c) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -564,11 +564,10 @@ const DeviceExtensions::Info& GetDeviceVersionMap(const char* version) { return (info != version_map.cend()) ? info->second : empty_info; } -APIVersion InstanceExtensions::InitFromInstanceCreateInfo(APIVersion requested_api_version, - const VkInstanceCreateInfo* pCreateInfo) { +InstanceExtensions::InstanceExtensions(APIVersion requested_api_version, const VkInstanceCreateInfo* pCreateInfo) { // Initialize struct data, robust to invalid pCreateInfo - auto api_version = NormalizeApiVersion(requested_api_version); - if (!api_version.Valid()) return api_version; + api_version = NormalizeApiVersion(requested_api_version); + if (!api_version.Valid()) return; const auto promotion_info_map = GetInstancePromotionInfoMap(); for (const auto& version_it : promotion_info_map) { @@ -592,18 +591,13 @@ APIVersion InstanceExtensions::InitFromInstanceCreateInfo(APIVersion requested_a if (info.state) this->*(info.state) = kEnabledByCreateinfo; } } - return api_version; } -APIVersion DeviceExtensions::InitFromDeviceCreateInfo(const InstanceExtensions* instance_extensions, - APIVersion requested_api_version, const VkDeviceCreateInfo* pCreateInfo) { - // Initialize: this to defaults, base class fields to input. - assert(instance_extensions); - *this = DeviceExtensions(*instance_extensions); - - // Initialize struct data, robust to invalid pCreateInfo +DeviceExtensions::DeviceExtensions(const InstanceExtensions& instance_ext, APIVersion requested_api_version, + const VkDeviceCreateInfo* pCreateInfo) + : InstanceExtensions(instance_ext) { auto api_version = NormalizeApiVersion(requested_api_version); - if (!api_version.Valid()) return api_version; + if (!api_version.Valid()) return; const auto promotion_info_map = GetDevicePromotionInfoMap(); for (const auto& version_it : promotion_info_map) { @@ -651,7 +645,55 @@ APIVersion DeviceExtensions::InitFromDeviceCreateInfo(const InstanceExtensions* } } } - return api_version; +} + +DeviceExtensions::DeviceExtensions(const InstanceExtensions& instance_ext, APIVersion requested_api_version, + const std::vector& props) + : InstanceExtensions(instance_ext) { + auto api_version = NormalizeApiVersion(requested_api_version); + if (!api_version.Valid()) return; + + const auto promotion_info_map = GetDevicePromotionInfoMap(); + for (const auto& version_it : promotion_info_map) { + auto info = GetDeviceVersionMap(version_it.second.first); + if (api_version >= version_it.first) { + if (info.state) this->*(info.state) = kEnabledByCreateinfo; + for (const auto& extension : version_it.second.second) { + info = GetInfo(extension); + assert(info.state); + if (info.state) this->*(info.state) = kEnabledByApiLevel; + } + } + } + for (const auto& prop : props) { + vvl::Extension extension = GetExtension(prop.extensionName); + auto info = GetInfo(extension); + if (info.state) this->*(info.state) = kEnabledByCreateinfo; + } + + // Workaround for functions being introduced by multiple extensions, until the layer is fixed to handle this correctly + // See https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5579 and + // https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5600 + { + constexpr std::array shader_object_interactions = { + vvl::Extension::_VK_EXT_extended_dynamic_state, + vvl::Extension::_VK_EXT_extended_dynamic_state2, + vvl::Extension::_VK_EXT_extended_dynamic_state3, + vvl::Extension::_VK_EXT_vertex_input_dynamic_state, + }; + auto info = GetInfo(vvl::Extension::_VK_EXT_shader_object); + if (info.state) { + if (this->*(info.state) != kNotEnabled) { + for (auto interaction_ext : shader_object_interactions) { + info = GetInfo(interaction_ext); + assert(info.state); + if (this->*(info.state) != kEnabledByCreateinfo) { + this->*(info.state) = kEnabledByInteraction; + } + } + } + } + } } // NOLINTEND diff --git a/layers/vulkan/generated/vk_extension_helper.h b/layers/vulkan/generated/vk_extension_helper.h index 6b849cc91a9..52afc31b34f 100644 --- a/layers/vulkan/generated/vk_extension_helper.h +++ b/layers/vulkan/generated/vk_extension_helper.h @@ -3,9 +3,9 @@ /*************************************************************************** * - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (c) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -80,6 +80,7 @@ Times to NOT use it [[maybe_unused]] static bool IsExtEnabledByCreateinfo(ExtEnabled extension) { return (extension == kEnabledByCreateinfo); } struct InstanceExtensions { + APIVersion api_version{}; ExtEnabled vk_feature_version_1_1{kNotEnabled}; ExtEnabled vk_feature_version_1_2{kNotEnabled}; ExtEnabled vk_feature_version_1_3{kNotEnabled}; @@ -278,7 +279,8 @@ struct InstanceExtensions { return (info != ext_map.cend()) ? info->second : empty_info; } - APIVersion InitFromInstanceCreateInfo(APIVersion requested_api_version, const VkInstanceCreateInfo *pCreateInfo); + InstanceExtensions() = default; + InstanceExtensions(APIVersion requested_api_version, const VkInstanceCreateInfo *pCreateInfo); }; struct DeviceExtensions : public InstanceExtensions { @@ -1746,8 +1748,10 @@ struct DeviceExtensions : public InstanceExtensions { DeviceExtensions() = default; DeviceExtensions(const InstanceExtensions &instance_ext) : InstanceExtensions(instance_ext) {} - APIVersion InitFromDeviceCreateInfo(const InstanceExtensions *instance_extensions, APIVersion requested_api_version, - const VkDeviceCreateInfo *pCreateInfo = nullptr); + DeviceExtensions(const InstanceExtensions &instance_extensions, APIVersion requested_api_version, + const VkDeviceCreateInfo *pCreateInfo = nullptr); + DeviceExtensions(const InstanceExtensions &instance_ext, APIVersion requested_api_version, + const std::vector &props); }; const InstanceExtensions::Info &GetInstanceVersionMap(const char *version); diff --git a/scripts/generators/extension_helper_generator.py b/scripts/generators/extension_helper_generator.py index 96eaa31fa7c..e297022c95c 100644 --- a/scripts/generators/extension_helper_generator.py +++ b/scripts/generators/extension_helper_generator.py @@ -1,8 +1,8 @@ #!/usr/bin/python3 -i # -# Copyright (c) 2015-2024 The Khronos Group Inc. -# Copyright (c) 2015-2024 Valve Corporation -# Copyright (c) 2015-2024 LunarG, Inc. +# Copyright (c) 2015-2025 The Khronos Group Inc. +# Copyright (c) 2015-2025 Valve Corporation +# Copyright (c) 2015-2025 LunarG, Inc. # Copyright (c) 2015-2024 Google Inc. # Copyright (c) 2023-2024 RasterGrid Kft. # @@ -97,9 +97,9 @@ def generate(self): /*************************************************************************** * - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (c) 2015-2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -187,6 +187,7 @@ def generateHeader(self): ''') out.append('\nstruct InstanceExtensions {\n') + out.append(' APIVersion api_version{};\n') for version in self.vk.versions.keys(): out.append(f' ExtEnabled {self.fieldName[version]}{{kNotEnabled}};\n') @@ -232,7 +233,8 @@ def generateHeader(self): return (info != ext_map.cend()) ? info->second : empty_info; } - APIVersion InitFromInstanceCreateInfo(APIVersion requested_api_version, const VkInstanceCreateInfo *pCreateInfo); + InstanceExtensions() = default; + InstanceExtensions(APIVersion requested_api_version, const VkInstanceCreateInfo *pCreateInfo); }; ''') @@ -288,8 +290,9 @@ def generateHeader(self): DeviceExtensions() = default; DeviceExtensions(const InstanceExtensions &instance_ext) : InstanceExtensions(instance_ext) {} - APIVersion InitFromDeviceCreateInfo(const InstanceExtensions *instance_extensions, APIVersion requested_api_version, + DeviceExtensions(const InstanceExtensions &instance_extensions, APIVersion requested_api_version, const VkDeviceCreateInfo *pCreateInfo = nullptr); + DeviceExtensions(const InstanceExtensions &instance_ext, APIVersion requested_api_version, const std::vector &props); }; const InstanceExtensions::Info &GetInstanceVersionMap(const char* version); @@ -388,10 +391,10 @@ def generateSource(self): return (info != version_map.cend()) ? info->second : empty_info; } - APIVersion InstanceExtensions::InitFromInstanceCreateInfo(APIVersion requested_api_version, const VkInstanceCreateInfo* pCreateInfo) { + InstanceExtensions::InstanceExtensions(APIVersion requested_api_version, const VkInstanceCreateInfo* pCreateInfo) { // Initialize struct data, robust to invalid pCreateInfo - auto api_version = NormalizeApiVersion(requested_api_version); - if (!api_version.Valid()) return api_version; + api_version = NormalizeApiVersion(requested_api_version); + if (!api_version.Valid()) return; const auto promotion_info_map = GetInstancePromotionInfoMap(); for (const auto& version_it : promotion_info_map) { @@ -415,18 +418,15 @@ def generateSource(self): if (info.state) this->*(info.state) = kEnabledByCreateinfo; } } - return api_version; } - APIVersion DeviceExtensions::InitFromDeviceCreateInfo(const InstanceExtensions* instance_extensions, APIVersion requested_api_version, - const VkDeviceCreateInfo* pCreateInfo) { - // Initialize: this to defaults, base class fields to input. - assert(instance_extensions); - *this = DeviceExtensions(*instance_extensions); + DeviceExtensions::DeviceExtensions(const InstanceExtensions& instance_ext, + APIVersion requested_api_version, + const VkDeviceCreateInfo* pCreateInfo) + : InstanceExtensions(instance_ext) { - // Initialize struct data, robust to invalid pCreateInfo auto api_version = NormalizeApiVersion(requested_api_version); - if (!api_version.Valid()) return api_version; + if (!api_version.Valid()) return; const auto promotion_info_map = GetDevicePromotionInfoMap(); for (const auto& version_it : promotion_info_map) { @@ -474,8 +474,58 @@ def generateSource(self): } } } - return api_version; } - ''') - self.write(''.join(out)) \ No newline at end of file + DeviceExtensions::DeviceExtensions(const InstanceExtensions& instance_ext, + APIVersion requested_api_version, + const std::vector &props) + : InstanceExtensions(instance_ext) { + + auto api_version = NormalizeApiVersion(requested_api_version); + if (!api_version.Valid()) return; + + const auto promotion_info_map = GetDevicePromotionInfoMap(); + for (const auto& version_it : promotion_info_map) { + auto info = GetDeviceVersionMap(version_it.second.first); + if (api_version >= version_it.first) { + if (info.state) this->*(info.state) = kEnabledByCreateinfo; + for (const auto& extension : version_it.second.second) { + info = GetInfo(extension); + assert(info.state); + if (info.state) this->*(info.state) = kEnabledByApiLevel; + } + } + } + for (const auto &prop : props) { + vvl::Extension extension = GetExtension(prop.extensionName); + auto info = GetInfo(extension); + if (info.state) this->*(info.state) = kEnabledByCreateinfo; + } + + // Workaround for functions being introduced by multiple extensions, until the layer is fixed to handle this correctly + // See https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5579 and + // https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5600 + { + constexpr std::array shader_object_interactions = { + vvl::Extension::_VK_EXT_extended_dynamic_state, + vvl::Extension::_VK_EXT_extended_dynamic_state2, + vvl::Extension::_VK_EXT_extended_dynamic_state3, + vvl::Extension::_VK_EXT_vertex_input_dynamic_state, + }; + auto info = GetInfo(vvl::Extension::_VK_EXT_shader_object); + if (info.state) { + if (this->*(info.state) != kNotEnabled) { + for (auto interaction_ext : shader_object_interactions) { + info = GetInfo(interaction_ext); + assert(info.state); + if (this->*(info.state) != kEnabledByCreateinfo) { + this->*(info.state) = kEnabledByInteraction; + } + } + } + } + } + } + ''') + + self.write(''.join(out)) diff --git a/scripts/generators/stateless_validation_helper_generator.py b/scripts/generators/stateless_validation_helper_generator.py index 415fc10b73b..fcebdcc8dc4 100644 --- a/scripts/generators/stateless_validation_helper_generator.py +++ b/scripts/generators/stateless_validation_helper_generator.py @@ -56,7 +56,6 @@ def __init__(self, # to those functions of the form 'bool manual_PreCallValidateAPIName', where the 'vk' is dropped. # see 'manual_PreCallValidateCreateGraphicsPipelines' as an example. self.functionsWithManualChecks = [ - 'vkCreateInstance', 'vkCreateDevice', 'vkCreateQueryPool', 'vkCreateRenderPass', @@ -226,7 +225,9 @@ def __init__(self, 'vkEnumerateInstanceExtensionProperties', 'vkEnumerateDeviceLayerProperties', 'vkEnumerateDeviceExtensionProperties', - 'vkGetDeviceGroupSurfacePresentModes2EXT' + # All checking is manual for the below + 'vkGetDeviceGroupSurfacePresentModes2EXT', + 'vkCreateInstance', ] # Very rare case when structs are needed prior to setting up everything @@ -348,7 +349,7 @@ def generateHeader(self): out.extend(guard_helper.add_guard(None)) for struct_name in self.generateStructHelper: - out.append(f'bool Validate{struct_name[2:]}(const {struct_name} &info, const Location &loc) const;') + out.append(f'bool Validate{struct_name[2:]}(const vvl::stateless::State &state, const {struct_name} &info, const Location &loc) const;') self.write("".join(out)) @@ -409,7 +410,7 @@ def generateSource(self): # Generate the struct member checking code from the captured data for struct in self.vk.structs.values(): # The string returned will be nested in an if check for a NULL pointer, so needs its indent incremented - lines = self.genFuncBody(self.vk.structs[struct.name].members, '{funcName}', '{errorLoc}', '{valuePrefix}', '{displayNamePrefix}', struct.name, False) + lines = self.genFuncBody(self.vk.structs[struct.name].members, '{funcName}', '{errorLoc}', '{valuePrefix}', '{displayNamePrefix}', struct.name, False, '{state}') if lines: self.validatedStructs[struct.name] = lines @@ -428,17 +429,16 @@ def generateSource(self): other_structs = [x for x in extended_structs if x not in feature_structs and x not in property_structs and x.name not in self.structsWithManualChecks] out.append(''' - bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc, + bool vvl::stateless::State::ValidatePnextFeatureStructContents(const Location& loc, const VkBaseOutStructure* header, const char *pnext_vuid, - const VkPhysicalDevice physicalDevice, bool is_const_param) const { + bool is_const_param) const { bool skip = false; - const bool is_physdev_api = physicalDevice != VK_NULL_HANDLE; switch(header->sType) { ''') guard_helper = PlatformGuardHelper() for struct in feature_structs: out.extend(guard_helper.add_guard(struct.protect)) - out.extend(self.genStructBody(struct, False)) + out.extend(self.genStructBody(struct, False, '')) out.extend(guard_helper.add_guard(None)) out.append(''' default: @@ -450,17 +450,16 @@ def generateSource(self): ''') out.append(''' - bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& loc, + bool vvl::stateless::State::ValidatePnextPropertyStructContents(const Location& loc, const VkBaseOutStructure* header, const char *pnext_vuid, - const VkPhysicalDevice physicalDevice, bool is_const_param) const { + bool is_const_param) const { bool skip = false; - const bool is_physdev_api = physicalDevice != VK_NULL_HANDLE; switch(header->sType) { ''') guard_helper = PlatformGuardHelper() for struct in property_structs: out.extend(guard_helper.add_guard(struct.protect)) - out.extend(self.genStructBody(struct, False)) + out.extend(self.genStructBody(struct, False, '')) out.extend(guard_helper.add_guard(None)) out.append(''' default: @@ -473,17 +472,16 @@ def generateSource(self): out.append(''' // All structs that are not a Feature or Property struct - bool StatelessValidation::ValidatePnextStructContents(const Location& loc, - const VkBaseOutStructure* header, const char *pnext_vuid, - const VkPhysicalDevice physicalDevice, bool is_const_param) const { + bool vvl::stateless::State::ValidatePnextStructContents(const Location& loc, + const VkBaseOutStructure* header, const char *pnext_vuid, + bool is_const_param) const { bool skip = false; - const bool is_physdev_api = physicalDevice != VK_NULL_HANDLE; switch(header->sType) { ''') guard_helper = PlatformGuardHelper() for struct in other_structs: out.extend(guard_helper.add_guard(struct.protect)) - out.extend(self.genStructBody(struct, True)) + out.extend(self.genStructBody(struct, True, '')) out.extend(guard_helper.add_guard(None)) out.append(''' default: @@ -511,6 +509,14 @@ def generateSource(self): prototype = prototype.replace(')', ', const ErrorObject& error_obj)') out.append(f'bool StatelessValidation::PreCallValidate{prototype} const {{\n') out.append(' bool skip = false;\n') + # TODO: describe how instance_extensions work here + if command.params[0].type == 'VkPhysicalDevice': + out.append(''' + const auto &physdev_extensions = physical_device_extensions.at(physicalDevice); + vvl::stateless::State state(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); + ''') + else: + out.append(' vvl::stateless::State state(*this, error_obj, device_extensions);\n') # Create a copy here to make the logic simpler passing into ValidatePnextStructContents out.append(' [[maybe_unused]] const Location loc = error_obj.location;\n') @@ -544,7 +550,7 @@ def generateSource(self): else: # Skip first parameter if it is a dispatch handle (everything except vkCreateInstance) startIndex = 0 if command.name == 'vkCreateInstance' else 1 - lines = self.genFuncBody(command.params[startIndex:], command.name, 'loc', '', '', None, isPhysDevice = command.params[0].type == 'VkPhysicalDevice') + lines = self.genFuncBody(command.params[startIndex:], command.name, 'loc', '', '', None, command.params[0].type == 'VkPhysicalDevice', 'state.') if command.instance and command.version: # check function name so KHR version doesn't trigger flase positive @@ -566,18 +572,18 @@ def generateSource(self): manualCheckCmd = None if manualCheckCmd: # Generate parameter list for manual fcn and down-chain calls - params_text = ', '.join([x.name for x in command.params]) + ', error_obj' + params_text = ', '.join([x.name for x in command.params]) + ', state' out.append(f' if (!skip) skip |= manual_PreCallValidate{manualCheckCmd[2:]}({params_text});\n') out.append('return skip;\n') out.append('}\n') out.extend(guard_helper.add_guard(None, extra_newline=True)) for struct_name in self.generateStructHelper: - out.append(f'bool StatelessValidation::Validate{struct_name[2:]}(const {struct_name} &info, const Location &loc) const {{\n') + out.append(f'bool StatelessValidation::Validate{struct_name[2:]}(const vvl::stateless::State &state, const {struct_name} &info, const Location &loc) const {{\n') out.append(' bool skip = false;\n') # Only generate validation code if the structure actually exists in the target API if struct_name in self.vk.structs: - out.extend(self.expandStructCode(struct_name, struct_name, 'loc', 'info.', '', [])) + out.extend(self.expandStructCode(struct_name, struct_name, 'loc', 'info.', '', [], 'state.')) out.append(' return skip;\n') out.append('}\n') @@ -626,7 +632,7 @@ def GetVuid(self, name, suffix): return vuid # Generate the pointer check string - def makePointerCheck(self, valuePrefix, member: Member, lengthMember: Member, errorLoc, arrayRequired, counValueRequired, counPtrRequired, funcName, structTypeName): + def makePointerCheck(self, valuePrefix, member: Member, lengthMember: Member, errorLoc, arrayRequired, counValueRequired, counPtrRequired, funcName, structTypeName, state): checkExpr = [] callerName = structTypeName if structTypeName else funcName if lengthMember: @@ -639,7 +645,7 @@ def makePointerCheck(self, valuePrefix, member: Member, lengthMember: Member, er # If count and array parameters are optional, there will be no validation if arrayRequired == 'true' or counPtrRequired == 'true' or counValueRequired == 'true': # When the length parameter is a pointer, there is an extra Boolean parameter in the function call to indicate if it is required - checkExpr.append(f'skip |= ValidatePointerArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, &{valuePrefix}{member.name}, {counPtrRequired}, {counValueRequired}, {arrayRequired},{countPtrRequiredVuid}, {countRequiredVuid}, {arrayRequiredVuid});\n') + checkExpr.append(f'skip |= {state}ValidatePointerArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, &{valuePrefix}{member.name}, {counPtrRequired}, {counValueRequired}, {arrayRequired},{countPtrRequiredVuid}, {countRequiredVuid}, {arrayRequiredVuid});\n') # This is an array with an integer count value else: # Can't check if a non-null pointer is a valid pointer in a layer @@ -648,7 +654,7 @@ def makePointerCheck(self, valuePrefix, member: Member, lengthMember: Member, er if (arrayRequired == 'true' or counValueRequired == 'true') and not unimplementable: if member.type == 'char': # Arrays of strings receive special processing - checkExpr.append(f'skip |= ValidateStringArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') + checkExpr.append(f'skip |= {state}ValidateStringArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') else: # A valid VU can't use '->' in the middle so the generated VUID from the spec uses '::' instead countRequiredVuid = self.GetVuid(callerName, f"{member.length.replace('->', '::')}-arraylength") @@ -668,7 +674,7 @@ def makePointerCheck(self, valuePrefix, member: Member, lengthMember: Member, er member.length = 'rasterizationSamples' elif ' / ' in member.length: count_loc = f'{errorLoc}.dot(Field::{member.length.split(" / ")[0]})' - checkExpr.append(f'skip |= ValidateArray({count_loc}, {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, &{valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') + checkExpr.append(f'skip |= {state}ValidateArray({count_loc}, {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, &{valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') if checkExpr and lengthMember and length_deref and member.length.count('->'): # Add checks to ensure the validation call does not dereference a NULL pointer to obtain the count count = member.length.count('->') @@ -689,13 +695,13 @@ def makePointerCheck(self, valuePrefix, member: Member, lengthMember: Member, er # Function pointers need a reinterpret_cast to void* ptrRequiredVuid = self.GetVuid(callerName, f"{member.name}-parameter") if member.type.startswith('PFN_'): - checkExpr.append(f'skip |= ValidateRequiredPointer({errorLoc}.dot(Field::{member.name}), reinterpret_cast({valuePrefix}{member.name}), {ptrRequiredVuid});\n') + checkExpr.append(f'skip |= {state}ValidateRequiredPointer({errorLoc}.dot(Field::{member.name}), reinterpret_cast({valuePrefix}{member.name}), {ptrRequiredVuid});\n') else: - checkExpr.append(f'skip |= ValidateRequiredPointer({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name}, {ptrRequiredVuid});\n') + checkExpr.append(f'skip |= {state}ValidateRequiredPointer({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name}, {ptrRequiredVuid});\n') return checkExpr # Process struct member validation code, performing name substitution if required - def processStructMemberCode(self, line, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix): + def processStructMemberCode(self, line, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix, state): # Build format specifier list kwargs = {} if '{funcName}' in line: @@ -710,6 +716,8 @@ def processStructMemberCode(self, line, funcName, errorLoc, memberNamePrefix, me kwargs['displayNamePrefix'] = memberDisplayNamePrefix[0] else: kwargs['displayNamePrefix'] = memberDisplayNamePrefix + if '{state}' in line: + kwargs['state'] = state if kwargs: # Need to escape the C++ curly braces @@ -730,20 +738,20 @@ def ScrubStructCode(self, code): return scrubbed_lines # Process struct validation code for inclusion in function or parent struct validation code - def expandStructCode(self, item_type, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix, output): + def expandStructCode(self, item_type, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix, output, state): lines = self.validatedStructs[item_type] for line in lines: if output: output[-1] += '\n' if isinstance(line, list): for sub in line: - output.append(self.processStructMemberCode(sub, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix)) + output.append(self.processStructMemberCode(sub, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix, state)) else: - output.append(self.processStructMemberCode(line, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix)) + output.append(self.processStructMemberCode(line, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix, state)) return output # Generate the parameter checking code - def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, displayNamePrefix, structTypeName, isPhysDevice): + def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, displayNamePrefix, structTypeName, isPhysDevice, state): struct = self.vk.structs[structTypeName] if structTypeName in self.vk.structs else None callerName = structTypeName if structTypeName else funcName lines = [] # Generated lines of code @@ -754,7 +762,7 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di # Special struct since lots of functions have this, but it can be all combined to the same call (since it is always from the top level of a funciton) if structTypeName == 'VkAllocationCallbacks' : - lines.append('skip |= ValidateAllocationCallbacks(*pAllocator, pAllocator_loc);') + lines.append(f'skip |= {state}ValidateAllocationCallbacks(*pAllocator, pAllocator_loc);') return lines # Returnedonly structs should have most of their members ignored -- on entry, we only care about validating the sType and @@ -837,7 +845,7 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di # Log a diagnostic message when validation cannot be automatically generated and must be implemented manually self.logMsg('diag', f'ParameterValidation: No validation for {callerName} {member.name}') elif countRequiredVuid: - usedLines.append(f'skip |= ValidateArray({errorLoc}.dot(Field::{member.length}), loc, {valuePrefix}{member.length}, &{valuePrefix}{member.name}, true, false, {countRequiredVuid}, kVUIDUndefined);\n') + usedLines.append(f'skip |= {state}ValidateArray({errorLoc}.dot(Field::{member.length}), loc, {valuePrefix}{member.length}, &{valuePrefix}{member.name}, true, false, {countRequiredVuid}, kVUIDUndefined);\n') else: if member.type in self.vk.structs and self.vk.structs[member.type].sType: # If this is a pointer to a struct with an sType field, verify the type @@ -851,18 +859,18 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di paramVuid = 'kVUIDUndefined' # This is an array of struct pointers if member.cDeclaration.count('*') == 2: - usedLines.append(f'skip |= ValidateStructPointerTypeArray({errorLoc}.dot(Field::{lengthMember.name}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{lengthMember.name}, {valuePrefix}{member.name}, {struct.sType}, {counValueRequired}, {arrayRequired}, {sTypeVuid}, {paramVuid}, {countRequiredVuid});\n') + usedLines.append(f'skip |= {state}ValidateStructPointerTypeArray({errorLoc}.dot(Field::{lengthMember.name}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{lengthMember.name}, {valuePrefix}{member.name}, {struct.sType}, {counValueRequired}, {arrayRequired}, {sTypeVuid}, {paramVuid}, {countRequiredVuid});\n') # This is an array with a pointer to a count value elif lengthMember.pointer: # When the length parameter is a pointer, there is an extra Boolean parameter in the function call to indicate if it is required countPtrRequiredVuid = self.GetVuid(callerName, f"{member.length}-parameter") - usedLines.append(f'skip |= ValidateStructTypeArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {struct.sType}, {counPtrRequired}, {counValueRequired}, {arrayRequired}, {sTypeVuid}, {paramVuid}, {countPtrRequiredVuid}, {countRequiredVuid});\n') + usedLines.append(f'skip |= {state}ValidateStructTypeArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {struct.sType}, {counPtrRequired}, {counValueRequired}, {arrayRequired}, {sTypeVuid}, {paramVuid}, {countPtrRequiredVuid}, {countRequiredVuid});\n') # This is an array with an integer count value else: - usedLines.append(f'skip |= ValidateStructTypeArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {struct.sType}, {counValueRequired}, {arrayRequired}, {sTypeVuid}, {paramVuid}, {countRequiredVuid});\n') + usedLines.append(f'skip |= {state}ValidateStructTypeArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {struct.sType}, {counValueRequired}, {arrayRequired}, {sTypeVuid}, {paramVuid}, {countRequiredVuid});\n') # This is an individual struct else: - usedLines.append(f'skip |= ValidateStructType({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name}, {struct.sType}, {arrayRequired}, {paramVuid}, {sTypeVuid});\n') + usedLines.append(f'skip |= {state}ValidateStructType({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name}, {struct.sType}, {arrayRequired}, {paramVuid}, {sTypeVuid});\n') # If this is an input handle array that is not allowed to contain NULL handles, verify that none of the handles are VK_NULL_HANDLE elif member.type in self.vk.handles and member.const and not self.isHandleOptional(member, lengthMember): if not lengthMember: @@ -873,7 +881,7 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di raise Exception('Unsupported parameter validation case: Output handle array elements are not NULL checked') countRequiredVuid = self.GetVuid(callerName, f"{member.length}-arraylength") # This is an array with an integer count value - usedLines.append(f'skip |= ValidateHandleArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid});\n') + usedLines.append(f'skip |= {state}ValidateHandleArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid});\n') elif member.type in self.flags and member.const: # Generate check string for an array of VkFlags values flagBitsName = member.type.replace('Flags', 'FlagBits') @@ -882,16 +890,16 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di allFlags = 'All' + flagBitsName countRequiredVuid = self.GetVuid(callerName, f"{member.length}-arraylength") arrayRequiredVuid = self.GetVuid(callerName, f"{member.name}-parameter") - usedLines.append(f'skip |= ValidateFlagsArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), vvl::FlagBitmask::{flagBitsName}, {allFlags}, {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') + usedLines.append(f'skip |= {state}ValidateFlagsArray({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), vvl::FlagBitmask::{flagBitsName}, {allFlags}, {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') elif member.type == 'VkBool32' and member.const: countRequiredVuid = self.GetVuid(callerName, f"{member.length}-arraylength") arrayRequiredVuid = self.GetVuid(callerName, f"{member.name}-parameter") - usedLines.append(f'skip |= ValidateBool32Array({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') + usedLines.append(f'skip |= {state}ValidateBool32Array({errorLoc}.dot(Field::{member.length}), {errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') elif member.type in self.vk.enums and member.const: lenLoc = 'loc' if member.fixedSizeArray else f'{errorLoc}.dot(Field::{member.length})' countRequiredVuid = self.GetVuid(callerName, f"{member.length}-arraylength") arrayRequiredVuid = self.GetVuid(callerName, f"{member.name}-parameter") - usedLines.append(f'skip |= ValidateRangedEnumArray({lenLoc}, {errorLoc}.dot(Field::{member.name}), vvl::Enum::{member.type}, {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') + usedLines.append(f'skip |= {state}ValidateRangedEnumArray({lenLoc}, {errorLoc}.dot(Field::{member.name}), vvl::Enum::{member.type}, {valuePrefix}{member.length}, {valuePrefix}{member.name}, {counValueRequired}, {arrayRequired}, {countRequiredVuid}, {arrayRequiredVuid});\n') elif member.name == 'pNext': # Generate an array of acceptable VkStructureType values for pNext allowedTypeCount = 0 @@ -908,9 +916,9 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di extendedBy = ", ".join([self.vk.structs[x].sType for x in struct.extendedBy]) usedLines.append(f'constexpr std::array {allowedStructName} = {{ {extendedBy} }};\n') - usedLines.append(f'skip |= ValidateStructPnext({errorLoc}, {valuePrefix}{member.name}, {allowedTypeCount}, {allowedTypes}, GeneratedVulkanHeaderVersion, {pNextVuid}, {sTypeVuid});\n') + usedLines.append(f'skip |= {state}ValidateStructPnext({errorLoc}, {valuePrefix}{member.name}, {allowedTypeCount}, {allowedTypes}, GeneratedVulkanHeaderVersion, {pNextVuid}, {sTypeVuid});\n') else: - usedLines += self.makePointerCheck(valuePrefix, member, lengthMember, errorLoc, arrayRequired, counValueRequired, counPtrRequired, funcName, structTypeName) + usedLines += self.makePointerCheck(valuePrefix, member, lengthMember, errorLoc, arrayRequired, counValueRequired, counPtrRequired, funcName, structTypeName, state) # Feature structs are large and just wasting time checking booleans that are almost impossible to be invalid isFeatureStruct = member.type in ['VkPhysicalDeviceFeatures', 'VkPhysicalDeviceFeatures2'] @@ -940,7 +948,7 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di memberDisplayNamePrefix = f'{valueDisplayName}->' # Expand the struct validation lines - expr = self.expandStructCode(member.type, funcName, newErrorLoc, memberNamePrefix, memberDisplayNamePrefix, expr) + expr = self.expandStructCode(member.type, funcName, newErrorLoc, memberNamePrefix, memberDisplayNamePrefix, expr, state) # If only 4 lines and no "skip" then this is an empty check hasChecks = len(expr) > 4 or 'skip' in expr[3] hasChecks = hasChecks if member.type != 'VkRect2D' else False # exception that doesn't have check actually @@ -953,12 +961,11 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di usedLines.append(expr) isConstStr = 'true' if member.const else 'false' - isPhysDevice_str = 'physicalDevice' if isPhysDevice else 'VK_NULL_HANDLE' for setter, _, elem in multi_string_iter(usedLines): elem = re.sub(r', (true|false|physicalDevice|VK_NULL_HANDLE)', '', elem) m = validatePNextRegex.match(elem) if m is not None: - setter(f'{m.group(1)}, {isPhysDevice_str}, {isConstStr}{m.group(2)}') + setter(f'{m.group(1)}, {isConstStr}{m.group(2)}') # Non-pointer types else: @@ -969,28 +976,22 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di # Log a diagnostic message when validation cannot be automatically generated and must be implemented manually self.logMsg('diag', f'ParameterValidation: No validation for {callerName} {member.name}') else: - physicalLevel = "VK_NULL_HANDLE" # maintenance5 allows Physical-device-level functions to pass in out of range values - if (isPhysDevice): - physicalLevel = "physicalDevice" - elif structTypeName and 'PhysicalDevice' in structTypeName: - physicalLevel = "physicalDevice" - if member.type in self.vk.structs and self.vk.structs[member.type].sType: sTypeVuid = self.GetVuid(member.type, "sType-sType") sType = self.vk.structs[member.type].sType - usedLines.append(f'skip |= ValidateStructType({errorLoc}.dot(Field::{member.name}), &({valuePrefix}{member.name}), {sType}, false, kVUIDUndefined, {sTypeVuid});\n') + usedLines.append(f'skip |= {state}ValidateStructType({errorLoc}.dot(Field::{member.name}), &({valuePrefix}{member.name}), {sType}, false, kVUIDUndefined, {sTypeVuid});\n') elif member.name == 'sType' and structTypeName in self.generateStructHelper: # TODO - This workaround is because this is shared by other pipeline calls that don't need generateStructHelper if structTypeName != 'VkPipelineShaderStageCreateInfo': # special case when dealing with isolated struct helper functions. sTypeVuid = self.GetVuid(struct.name, "sType-sType") - usedLines.append(f'skip |= ValidateStructType(loc, &info, {struct.sType}, false, kVUIDUndefined, {sTypeVuid});\n') + usedLines.append(f'skip |= {state}ValidateStructType(loc, &info, {struct.sType}, false, kVUIDUndefined, {sTypeVuid});\n') elif member.type in self.vk.handles: if not member.optional: - usedLines.append(f'skip |= ValidateRequiredHandle({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name});\n') + usedLines.append(f'skip |= {state}ValidateRequiredHandle({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name});\n') elif member.type in self.flags and member.type.replace('Flags', 'FlagBits') not in self.flagBits: vuid = self.GetVuid(callerName, f"{member.name}-zerobitmask") - usedLines.append(f'skip |= ValidateReservedFlags({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name}, {vuid});\n') + usedLines.append(f'skip |= {state}ValidateReservedFlags({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name}, {vuid});\n') elif member.type in self.flags or member.type in self.flagBits: if member.type in self.flags: flagBitsName = member.type.replace('Flags', 'FlagBits') @@ -1008,17 +1009,17 @@ def genFuncBody(self, members: list[Member], funcName, errorLoc, valuePrefix, di allFlagsName = 'All' + flagBitsName zeroVuidArg = '' if member.optional else ', ' + zeroVuid condition = [item for item in self.structMemberValidationConditions if (item['struct'] == structTypeName and item['field'] == flagBitsName)] - usedLines.append(f'skip |= ValidateFlags({errorLoc}.dot(Field::{member.name}), vvl::FlagBitmask::{flagBitsName}, {allFlagsName}, {valuePrefix}{member.name}, {flagsType}, {physicalLevel}, {invalidVuid}{zeroVuidArg});\n') + usedLines.append(f'skip |= {state}ValidateFlags({errorLoc}.dot(Field::{member.name}), vvl::FlagBitmask::{flagBitsName}, {allFlagsName}, {valuePrefix}{member.name}, {flagsType}, {invalidVuid}{zeroVuidArg});\n') elif member.type == 'VkBool32': - usedLines.append(f'skip |= ValidateBool32({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name});\n') + usedLines.append(f'skip |= {state}ValidateBool32({errorLoc}.dot(Field::{member.name}), {valuePrefix}{member.name});\n') elif member.type in self.vk.enums and member.type != 'VkStructureType': vuid = self.GetVuid(callerName, f"{member.name}-parameter") - usedLines.append(f'skip |= ValidateRangedEnum({errorLoc}.dot(Field::{member.name}), vvl::Enum::{member.type}, {valuePrefix}{member.name}, {vuid}, {physicalLevel});\n') + usedLines.append(f'skip |= {state}ValidateRangedEnum({errorLoc}.dot(Field::{member.name}), vvl::Enum::{member.type}, {valuePrefix}{member.name}, {vuid});\n') # If this is a struct, see if it contains members that need to be checked if member.type in self.validatedStructs: memberNamePrefix = f'{valuePrefix}{member.name}.' memberDisplayNamePrefix = f'{valueDisplayName}.' - usedLines.append(self.expandStructCode(member.type, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix, [])) + usedLines.append(self.expandStructCode(member.type, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix, [], state)) # Append the parameter check to the function body for the current command if usedLines: # Apply special conditional checks @@ -1047,7 +1048,7 @@ def englishJoin(self, strings, conjunction: str): # This logic was broken into its own function because we need to fill multiple functions with these structs - def genStructBody(self, struct: Struct, nonPropFeature: bool): + def genStructBody(self, struct: Struct, nonPropFeature: bool, state: str): pNextCase = '\n' pNextCheck = '' @@ -1060,21 +1061,16 @@ def genStructBody(self, struct: Struct, nonPropFeature: bool): if struct.sType and struct.version and all(not x.promotedTo for x in struct.extensions): pNextCheck += f''' - if (is_physdev_api) {{ - VkPhysicalDeviceProperties device_properties = {{}}; - DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); - if (device_properties.apiVersion < {struct.version.nameApi}) {{ - APIVersion device_api_version(static_cast(device_properties.apiVersion)); - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), - "includes a pointer to a VkStructureType ({struct.sType}) which was added in {struct.version.nameApi} but the " - "current effective API version is %s.", StringAPIVersion(device_api_version).c_str()); - }} + if (exts.api_version < {struct.version.nameApi}) {{ + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType ({struct.sType}) which was added in {struct.version.nameApi} but the " + "current effective API version is %s.", StringAPIVersion(exts.api_version).c_str()); }} ''' - elif struct.sType in self.stype_version_dict.keys(): - extNames = self.stype_version_dict[struct.sType] + elif struct.sType and len(struct.extensions) > 0: + extNames = set([x.name for x in struct.extensions]) # Skip extensions that are not in the target API # This check is needed because parts of the base generator code bypass the @@ -1089,27 +1085,24 @@ def genStructBody(self, struct: Struct, nonPropFeature: bool): extNames = sorted(list(extNames)) # make the order deterministic # Dependent on enabled extension - extension_conditinals = list() + extension_conditionals = list() for ext_name in extNames: extension = self.vk.extensions[ext_name] - if extension.device: - extension_conditinals.append( f'((is_physdev_api && !SupportedByPdev(physical_device, vvl::Extension::_{extension.name})) || (!is_physdev_api && !IsExtEnabled(device_extensions.{extension.name.lower()})))' ) - else: - extension_conditinals.append( f'!IsExtEnabled(instance_extensions.{extension.name.lower()})' ) - if len(extension_conditinals) == 1 and extension_conditinals[0][0] == '(' and extension_conditinals[0][-1] == ')': - extension_conditinals[0] = extension_conditinals[0][1:-1]# strip extraneous parentheses + extension_conditionals.append( f'(!IsExtEnabled(exts.{extension.name.lower()}))' ) + if len(extension_conditionals) == 1 and extension_conditionals[0][0] == '(' and extension_conditionals[0][-1] == ')': + extension_conditionals[0] = extension_conditionals[0][1:-1]# strip extraneous parentheses - extension_check = f'if ({" && ".join(extension_conditinals)}) {{' + extension_check = f'if ({" && ".join(extension_conditionals)}) {{' pNextCheck += f''' {extension_check} - skip |= LogError( - pnext_vuid, instance, loc.dot(Field::pNext), + skip |= log.LogError( + pnext_vuid, error_obj.handle, loc.dot(Field::pNext), "includes a pointer to a VkStructureType ({struct.sType}), but its parent extension " "{self.englishJoin(extNames, "or")} has not been enabled."); }} ''' - expr = self.expandStructCode(struct.name, struct.name, 'pNext_loc', 'structure->', '', []) + expr = self.expandStructCode(struct.name, struct.name, 'pNext_loc', 'structure->', '', [], '') structValidationSource = self.ScrubStructCode(expr) if structValidationSource != '': # Only reasonable to validate content of structs if const as otherwise the date inside has not been writen to yet @@ -1130,32 +1123,6 @@ def genStructBody(self, struct: Struct, nonPropFeature: bool): if not isDeviceStruct(self.vk.structs[extend]): check_for_instance = True - # We do the extension checking here at the pNext chaining because if the struct is only used in a new extended command, - # using that command will always trigger a "missing extension" VU - checkExpression = [] - resultExpression = [] - for extension in [x.name for x in struct.extensions if x.device]: - if check_for_instance: - checkExpression.append(f'(!is_physdev_api && !IsExtEnabled(device_extensions.{extension.lower()}))') - else: - checkExpression.append(f'!IsExtEnabled(device_extensions.{extension.lower()})') - resultExpression.append(extension) - # TODO - Video session creation checks will fail tests if no extensions are found (need to fix test logic) - if len(checkExpression) > 0 and 'Video' not in struct.name: - # Special message for device features - if 'VkPhysicalDeviceFeatures2' in struct.extends and 'VkDeviceCreateInfo' in struct.extends: - pNextCheck += f'''if ({" && ".join(checkExpression)}){{ - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a {struct.name}, but when creating VkDevice, the parent extension " - "({" or ".join(resultExpression)}) was not included in ppEnabledExtensionNames."); - }} - ''' - else: - pNextCheck += f'''if ({" && ".join(checkExpression)}){{ - skip |= LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions {" or ".join(resultExpression)}"); - }} - ''' - structValidationSource = f'{struct.name} *structure = ({struct.name} *) header;\n{structValidationSource}' structValidationSource += '}\n' pNextCase += f'{pNextCheck}{structValidationSource}' diff --git a/scripts/generators/valid_enum_values_generator.py b/scripts/generators/valid_enum_values_generator.py index 557a0844470..6b9ce152fe0 100644 --- a/scripts/generators/valid_enum_values_generator.py +++ b/scripts/generators/valid_enum_values_generator.py @@ -1,8 +1,8 @@ #!/usr/bin/python3 -i # -# Copyright (c) 2015-2024 The Khronos Group Inc. -# Copyright (c) 2015-2024 Valve Corporation -# Copyright (c) 2015-2024 LunarG, Inc. +# Copyright (c) 2015-2025 The Khronos Group Inc. +# Copyright (c) 2015-2025 Valve Corporation +# Copyright (c) 2015-2025 LunarG, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,9 +35,9 @@ def generate(self): /*************************************************************************** * - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ def generateHeader(self): guard_helper = PlatformGuardHelper() for enum in [x for x in self.vk.enums.values() if x.name not in self.ignoreList and not x.returnedOnly]: out.extend(guard_helper.add_guard(enum.protect)) - out.append(f'template<> ValidValue StatelessValidation::IsValidEnumValue({enum.name} value) const;\n') + out.append(f'template<> ValidValue vvl::stateless::State::IsValidEnumValue({enum.name} value) const;\n') out.extend(guard_helper.add_guard(None)) self.write("".join(out)) @@ -94,7 +94,7 @@ def generateSource(self): for enum in [x for x in self.vk.enums.values() if x.name not in self.ignoreList and not x.returnedOnly]: out.extend(guard_helper.add_guard(enum.protect, extra_newline=True)) - out.append(f'template<> ValidValue StatelessValidation::IsValidEnumValue({enum.name} value) const {{\n') + out.append(f'template<> ValidValue vvl::stateless::State::IsValidEnumValue({enum.name} value) const {{\n') out.append(' switch (value) {\n') # If the field has same/subset extensions as enum, we count it as "core" for the struct coreEnums = [x for x in enum.fields if not x.extensions or (x.extensions and all(e in enum.extensions for e in x.extensions))] @@ -108,7 +108,7 @@ def generateSource(self): expression = [] # Ignore the base extensions needed to use the enum, only focus on the field specific extensions for extension in [x for x in field.extensions if x not in enum.extensions]: - expression.append(f'IsExtEnabled(device_extensions.{extension.name.lower()})') + expression.append(f'IsExtEnabled(exts.{extension.name.lower()})') if (len(expression) == 0): continue expression = " || ".join(expression) @@ -132,12 +132,12 @@ def generateSource(self): # Need empty functions to resolve all template variations if len(enum.fieldExtensions) <= len(enum.extensions): - out.append(f'template<> vvl::Extensions StatelessValidation::GetEnumExtensions({enum.name} value) const {{ return {{}}; }}\n') - out.append(f'template<> const char* StatelessValidation::DescribeEnum({enum.name} value) const {{ return nullptr; }}\n') + out.append(f'template<> vvl::Extensions vvl::stateless::State::GetEnumExtensions({enum.name} value) const {{ return {{}}; }}\n') + out.append(f'template<> const char* vvl::stateless::State::DescribeEnum({enum.name} value) const {{ return nullptr; }}\n') out.extend(guard_helper.add_guard(None, extra_newline=True)) continue - out.append(f'template<> vvl::Extensions StatelessValidation::GetEnumExtensions({enum.name} value) const {{\n') + out.append(f'template<> vvl::Extensions vvl::stateless::State::GetEnumExtensions({enum.name} value) const {{\n') out.append(' switch (value) {\n') expressionMap = defaultdict(list) @@ -161,7 +161,7 @@ def generateSource(self): } ''') - out.append(f'template<> const char* StatelessValidation::DescribeEnum({enum.name} value) const {{\n') + out.append(f'template<> const char* vvl::stateless::State::DescribeEnum({enum.name} value) const {{\n') out.append(f' return string_{enum.name}(value);\n') out.append('}\n') out.extend(guard_helper.add_guard(None, extra_newline=True)) diff --git a/scripts/generators/valid_flag_values_generator.py b/scripts/generators/valid_flag_values_generator.py index 2a19d43116d..a72ff68c4de 100644 --- a/scripts/generators/valid_flag_values_generator.py +++ b/scripts/generators/valid_flag_values_generator.py @@ -1,8 +1,8 @@ #!/usr/bin/python3 -i # -# Copyright (c) 2024 The Khronos Group Inc. -# Copyright (c) 2024 Valve Corporation -# Copyright (c) 2024 LunarG, Inc. +# Copyright (c) 2025 The Khronos Group Inc. +# Copyright (c) 2025 Valve Corporation +# Copyright (c) 2025 LunarG, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,9 +37,9 @@ def generate(self): /*************************************************************************** * - * Copyright (c) 2024 The Khronos Group Inc. - * Copyright (c) 2024 Valve Corporation - * Copyright (c) 2024 LunarG, Inc. + * Copyright (c) 2025 The Khronos Group Inc. + * Copyright (c) 2025 Valve Corporation + * Copyright (c) 2025 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ def generateSource(self): ''') out.append(''' - vvl::Extensions StatelessValidation::IsValidFlagValue(vvl::FlagBitmask flag_bitmask, VkFlags value, const DeviceExtensions& device_extensions) const { + vvl::Extensions vvl::stateless::State::IsValidFlagValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const { switch(flag_bitmask) { ''') for bitmask in [x for x in self.vk.bitmasks.values() if x.name not in self.ignoreList and not x.returnedOnly and x.bitWidth == 32]: @@ -103,7 +103,7 @@ def generateSource(self): extensions = expression.split(',') checkExpression = [] for extension in extensions: - checkExpression.append(f'!IsExtEnabled(device_extensions.{extension.lower()})') + checkExpression.append(f'!IsExtEnabled(exts.{extension.lower()})') checkExpression = " && ".join(checkExpression) resultExpression = [] for extension in extensions: @@ -125,7 +125,7 @@ def generateSource(self): ''') out.append(''' - vvl::Extensions StatelessValidation::IsValidFlag64Value(vvl::FlagBitmask flag_bitmask, VkFlags64 value, const DeviceExtensions& device_extensions) const { + vvl::Extensions vvl::stateless::State::IsValidFlag64Value(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const { switch(flag_bitmask) { ''') for bitmask in [x for x in self.vk.bitmasks.values() if x.name not in self.ignoreList and not x.returnedOnly and x.bitWidth == 64]: @@ -151,7 +151,7 @@ def generateSource(self): extensions = expression.split(',') checkExpression = [] for extension in extensions: - checkExpression.append(f'!IsExtEnabled(device_extensions.{extension.lower()})') + checkExpression.append(f'!IsExtEnabled(exts.{extension.lower()})') checkExpression = " && ".join(checkExpression) resultExpression = [] for extension in extensions: @@ -170,7 +170,7 @@ def generateSource(self): } } - std::string StatelessValidation::DescribeFlagBitmaskValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const { + std::string vvl::stateless::State::DescribeFlagBitmaskValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const { switch(flag_bitmask) { ''') for bitmask in [x for x in self.vk.bitmasks.values() if x.name not in self.ignoreList and not x.returnedOnly and len(x.flags) > 0 and x.bitWidth == 32]: @@ -186,7 +186,7 @@ def generateSource(self): } } - std::string StatelessValidation::DescribeFlagBitmaskValue64(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const { + std::string vvl::stateless::State::DescribeFlagBitmaskValue64(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const { switch(flag_bitmask) { ''') for bitmask in [x for x in self.vk.bitmasks.values() if x.name not in self.ignoreList and not x.returnedOnly and len(x.flags) > 0 and x.bitWidth == 64]: diff --git a/tests/framework/video_objects.h b/tests/framework/video_objects.h index ba6be14c99d..6b795224037 100644 --- a/tests/framework/video_objects.h +++ b/tests/framework/video_objects.h @@ -3635,7 +3635,10 @@ class PositiveVideo : public VkVideoLayerTest {}; class VkVideoSyncLayerTest : public VkVideoLayerTest { public: - VkVideoSyncLayerTest() { setInstancePNext(&features_); } + VkVideoSyncLayerTest() { + setInstancePNext(&features_); + AddRequiredExtensions(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME); + } private: const VkValidationFeatureEnableEXT enables_[1] = {VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT}; @@ -3650,7 +3653,10 @@ class PositiveSyncValVideo : public VkVideoSyncLayerTest {}; class VkVideoBestPracticesLayerTest : public VkVideoLayerTest { public: - VkVideoBestPracticesLayerTest() { setInstancePNext(&features_); } + VkVideoBestPracticesLayerTest() { + setInstancePNext(&features_); + AddRequiredExtensions(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME); + } private: VkValidationFeatureEnableEXT enables_[1] = {VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT}; diff --git a/tests/unit/best_practices.cpp b/tests/unit/best_practices.cpp index 790d87c9317..1050b82e8d2 100644 --- a/tests/unit/best_practices.cpp +++ b/tests/unit/best_practices.cpp @@ -30,6 +30,7 @@ void VkBestPracticesLayerTest::InitBestPracticesFramework(const char *vendor_che features_.pNext = &layer_settings_create_info; + AddRequiredExtensions(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME); InitFramework(&features_); } @@ -92,7 +93,6 @@ TEST_F(VkBestPracticesLayerTest, UseDeprecatedInstanceExtensions) { AllowPromotedExtensions(); SetTargetApiVersion(VK_API_VERSION_1_1); - AddRequiredExtensions(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); RETURN_IF_SKIP(InitBestPracticesFramework()); if (IsPlatformMockICD()) { GTEST_SKIP() << "Test not supported by MockICD - currently can't create 2 concurrent instances"; @@ -103,9 +103,10 @@ TEST_F(VkBestPracticesLayerTest, UseDeprecatedInstanceExtensions) { // Extra error if VK_EXT_debug_report is used on Android still m_errorMonitor->SetDesiredWarning("BestPractices-deprecated-extension"); } + m_errorMonitor->SetDesiredWarning("BestPractices-deprecated-extension"); // VK_EXT_validation_features + m_errorMonitor->SetDesiredWarning("BestPractices-specialuse-extension"); // VK_EXT_debug_utils + m_errorMonitor->SetDesiredWarning("BestPractices-specialuse-extension"); // VK_EXT_validation_features - m_errorMonitor->SetDesiredWarning("BestPractices-deprecated-extension"); // VK_KHR_get_physical_device_properties2, - m_errorMonitor->SetDesiredWarning("BestPractices-specialuse-extension"); // VK_EXT_debug_utils VkInstance dummy; auto features = features_; auto ici = GetInstanceCreateInfo(); diff --git a/tests/unit/debug_printf.cpp b/tests/unit/debug_printf.cpp index 4a1e417d138..740ac64d389 100644 --- a/tests/unit/debug_printf.cpp +++ b/tests/unit/debug_printf.cpp @@ -31,6 +31,7 @@ void DebugPrintfTests::InitDebugPrintfFramework(void *p_next, bool reserve_slot) SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME); + AddRequiredExtensions(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME); RETURN_IF_SKIP(InitFramework(&features)); if (!CanEnableGpuAV(*this)) { diff --git a/tests/unit/device_feature_property.cpp b/tests/unit/device_feature_property.cpp index 8afb3744105..f7e031bf841 100644 --- a/tests/unit/device_feature_property.cpp +++ b/tests/unit/device_feature_property.cpp @@ -1,7 +1,7 @@ /* - * Copyright (c) 2024 The Khronos Group Inc. - * Copyright (c) 2024 Valve Corporation - * Copyright (c) 2024 LunarG, Inc. + * Copyright (c) 2025 The Khronos Group Inc. + * Copyright (c) 2025 Valve Corporation + * Copyright (c) 2025 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -248,7 +248,6 @@ TEST_F(NegativeDeviceFeatureProperty, VertexAttributeDivisor) { VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT vadf = vku::InitStructHelper(); m_second_device_ci.pNext = &vadf; m_errorMonitor->SetDesiredError("VUID-VkDeviceCreateInfo-pNext-pNext"); - m_errorMonitor->SetDesiredError("VUID-VkDeviceCreateInfo-pNext-pNext"); vk::CreateDevice(Gpu(), &m_second_device_ci, nullptr, &m_second_device); m_errorMonitor->VerifyFound(); } @@ -392,7 +391,6 @@ TEST_F(NegativeDeviceFeatureProperty, PhysicalDeviceGlobalPriorityQueryFeaturesK query_feature.globalPriorityQuery = VK_TRUE; m_second_device_ci.pNext = &query_feature; - m_errorMonitor->SetDesiredError("VUID-VkDeviceCreateInfo-pNext-pNext"); m_errorMonitor->SetDesiredError("VUID-VkDeviceCreateInfo-pNext-pNext"); vk::CreateDevice(Gpu(), &m_second_device_ci, nullptr, &m_second_device); m_errorMonitor->VerifyFound(); diff --git a/tests/unit/dynamic_rendering.cpp b/tests/unit/dynamic_rendering.cpp index 42a3f428504..2598283aefb 100644 --- a/tests/unit/dynamic_rendering.cpp +++ b/tests/unit/dynamic_rendering.cpp @@ -1,7 +1,7 @@ /* - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (c) 2015-2024 Google, Inc. * Modifications Copyright (C) 2020-2022 Advanced Micro Devices, Inc. All rights reserved. * Modifications Copyright (C) 2021-2022 ARM, Inc. All rights reserved. @@ -24,8 +24,16 @@ TEST_F(NegativeDynamicRendering, CommandBufferInheritanceRenderingInfo) { TEST_DESCRIPTION("VkCommandBufferInheritanceRenderingInfo Dynamic Rendering Tests."); SetTargetApiVersion(VK_API_VERSION_1_2); AddRequiredExtensions(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME); + AddOptionalExtensions(VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME); + AddOptionalExtensions(VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME); AddRequiredFeature(vkt::Feature::dynamicRendering); + RETURN_IF_SKIP(Init()); + const bool amd_samples = IsExtensionsEnabled(VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME); + const bool nv_samples = IsExtensionsEnabled(VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME); + if (!amd_samples && !nv_samples) { + GTEST_SKIP() << "Test requires either VK_AMD_mixed_attachment_samples or VK_NV_framebuffer_mixed_samples"; + } VkPhysicalDeviceMultiviewProperties multiview_props = vku::InitStructHelper(); GetPhysicalDeviceProperties2(multiview_props); @@ -1557,7 +1565,9 @@ TEST_F(NegativeDynamicRendering, PipelineMissingFlags) { bool shading_rate = IsExtensionsEnabled(VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME); VkPhysicalDeviceFragmentShadingRatePropertiesKHR fsr_properties = vku::InitStructHelper(); - GetPhysicalDeviceProperties2(fsr_properties); + if (IsExtensionsEnabled(VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME)) { + GetPhysicalDeviceProperties2(fsr_properties); + } InitRenderTarget(); @@ -2897,8 +2907,15 @@ TEST_F(NegativeDynamicRendering, LibraryViewMask) { TEST_F(NegativeDynamicRendering, AttachmentSampleCount) { TEST_DESCRIPTION("Create pipeline with invalid color attachment samples"); + AddOptionalExtensions(VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME); + AddOptionalExtensions(VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME); RETURN_IF_SKIP(InitBasicDynamicRendering()); InitRenderTarget(); + const bool amd_samples = IsExtensionsEnabled(VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME); + const bool nv_samples = IsExtensionsEnabled(VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME); + if (!amd_samples && !nv_samples) { + GTEST_SKIP() << "Test requires either VK_AMD_mixed_attachment_samples or VK_NV_framebuffer_mixed_samples"; + } VkSampleCountFlagBits color_attachment_samples = VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM; diff --git a/tests/unit/gpu_av.cpp b/tests/unit/gpu_av.cpp index 3ec58e42cbb..9a5ee9d7bda 100644 --- a/tests/unit/gpu_av.cpp +++ b/tests/unit/gpu_av.cpp @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020-2024 The Khronos Group Inc. - * Copyright (c) 2020-2024 Valve Corporation - * Copyright (c) 2020-2024 LunarG, Inc. + * Copyright (c) 2020-2025 The Khronos Group Inc. + * Copyright (c) 2020-2025 Valve Corporation + * Copyright (c) 2020-2025 LunarG, Inc. * Copyright (c) 2020-2024 Google, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -58,6 +58,7 @@ TEST_F(NegativeGpuAV, ValidationAbort) { TEST_F(NegativeGpuAV, ValidationFeatures) { TEST_DESCRIPTION("Validate Validation Features"); SetTargetApiVersion(VK_API_VERSION_1_1); + AddRequiredExtensions(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME); VkValidationFeatureEnableEXT enables[] = {VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT}; VkValidationFeaturesEXT features = vku::InitStructHelper(); features.enabledValidationFeatureCount = 1; diff --git a/tests/unit/instanceless.cpp b/tests/unit/instanceless.cpp index 7fb7cc9ff14..79fa9983684 100644 --- a/tests/unit/instanceless.cpp +++ b/tests/unit/instanceless.cpp @@ -319,14 +319,13 @@ TEST_F(NegativeInstanceless, ExtensionStructsWithoutExtensions) { ici.ppEnabledExtensionNames = m_instance_extension_names.data(); VkInstance instance; - VkDebugReportCallbackCreateInfoEXT debug_report_callback = vku::InitStructHelper(); debug_report_callback.pfnCallback = callback; debug_report_callback.pNext = m_errorMonitor->GetDebugCreateInfo(); ici.pNext = &debug_report_callback; - Monitor().SetDesiredError("VUID-VkInstanceCreateInfo-pNext-04925"); + m_errorMonitor->SetDesiredError("VUID-VkInstanceCreateInfo-pNext-04925"); vk::CreateInstance(&ici, nullptr, &instance); - Monitor().VerifyFound(); + m_errorMonitor->VerifyFound(); VkDirectDriverLoadingInfoLUNARG driver = vku::InitStructHelper(); @@ -339,6 +338,14 @@ TEST_F(NegativeInstanceless, ExtensionStructsWithoutExtensions) { vk::CreateInstance(&ici, nullptr, &instance); m_errorMonitor->VerifyFound(); + VkValidationFeaturesEXT features = vku::InitStructHelper(); + features.pNext = m_errorMonitor->GetDebugCreateInfo(); + ici.pNext = &features; + m_errorMonitor->SetDesiredError("VUID-VkInstanceCreateInfo-pNext-10243"); + vk::CreateInstance(&ici, nullptr, &instance); + m_errorMonitor->VerifyFound(); + + // This must be last because it messes up the extension list VkDebugUtilsMessengerCreateInfoEXT debug_utils_messenger = vku::InitStructHelper(); debug_utils_messenger.pNext = m_errorMonitor->GetDebugCreateInfo(); debug_utils_messenger.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; diff --git a/tests/unit/nvidia_best_practices.cpp b/tests/unit/nvidia_best_practices.cpp index 679d4c68904..1973225f2bb 100644 --- a/tests/unit/nvidia_best_practices.cpp +++ b/tests/unit/nvidia_best_practices.cpp @@ -1,7 +1,7 @@ /* - * Copyright (c) 2015-2024 The Khronos Group Inc. - * Copyright (c) 2015-2024 Valve Corporation - * Copyright (c) 2015-2024 LunarG, Inc. + * Copyright (c) 2015-2025 The Khronos Group Inc. + * Copyright (c) 2015-2025 Valve Corporation + * Copyright (c) 2015-2025 LunarG, Inc. * Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -290,6 +290,7 @@ TEST_F(VkNvidiaBestPracticesLayerTest, AccelerationStructure_NotAsync) { } TEST_F(VkNvidiaBestPracticesLayerTest, AllocateMemory_SetPriority) { + AddRequiredExtensions(VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME); RETURN_IF_SKIP(InitBestPracticesFramework(kEnableNVIDIAValidation)); RETURN_IF_SKIP(InitState()); @@ -315,6 +316,7 @@ TEST_F(VkNvidiaBestPracticesLayerTest, AllocateMemory_SetPriority) { } TEST_F(VkNvidiaBestPracticesLayerTest, AllocateMemory_ReuseAllocations) { + AddRequiredExtensions(VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME); RETURN_IF_SKIP(InitBestPracticesFramework(kEnableNVIDIAValidation)); RETURN_IF_SKIP(InitState()); diff --git a/tests/unit/others.cpp b/tests/unit/others.cpp index b9d249ce40a..10c05da2fd2 100644 --- a/tests/unit/others.cpp +++ b/tests/unit/others.cpp @@ -285,8 +285,7 @@ TEST_F(VkLayerTest, UsePnextOnlyStructWithoutExtensionEnabled) { pipe.gp_ci_.pTessellationState = &tsci; pipe.gp_ci_.pInputAssemblyState = &iasci; pipe.shader_stages_ = {vs.GetStageCreateInfo(), tcs.GetStageCreateInfo(), tes.GetStageCreateInfo(), fs.GetStageCreateInfo()}; - // one for each struct - m_errorMonitor->SetDesiredError("VUID-VkPipelineTessellationStateCreateInfo-pNext-pNext"); + m_errorMonitor->SetDesiredError("VUID-VkPipelineTessellationStateCreateInfo-pNext-pNext"); pipe.CreateGraphicsPipeline(); m_errorMonitor->VerifyFound(); @@ -1240,9 +1239,11 @@ TEST_F(VkLayerTest, InvalidGetExternalBufferPropertiesUsage) { VkExternalBufferProperties externalBufferProperties = vku::InitStructHelper(); - m_errorMonitor->SetDesiredError("VUID-VkPhysicalDeviceExternalBufferInfo-None-09499"); - vk::GetPhysicalDeviceExternalBufferPropertiesKHR(Gpu(), &externalBufferInfo, &externalBufferProperties); - m_errorMonitor->VerifyFound(); + if (!DeviceExtensionSupported(Gpu(), nullptr, VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) { + m_errorMonitor->SetDesiredError("VUID-VkPhysicalDeviceExternalBufferInfo-None-09499"); + vk::GetPhysicalDeviceExternalBufferPropertiesKHR(Gpu(), &externalBufferInfo, &externalBufferProperties); + m_errorMonitor->VerifyFound(); + } externalBufferInfo.usage = 0u; m_errorMonitor->SetDesiredError("VUID-VkPhysicalDeviceExternalBufferInfo-None-09500"); @@ -1282,7 +1283,6 @@ TEST_F(VkLayerTest, MissingExtensionStruct) { buffer_view_ci.range = VK_WHOLE_SIZE; buffer_view_ci.buffer = buffer.handle(); m_errorMonitor->SetDesiredError("VUID-VkBufferViewCreateInfo-pNext-pNext"); - m_errorMonitor->SetDesiredError("VUID-VkBufferViewCreateInfo-pNext-pNext"); vkt::BufferView view(*m_device, buffer_view_ci); m_errorMonitor->VerifyFound(); } @@ -1517,4 +1517,4 @@ TEST_F(VkLayerTest, UnrecognizedEnumExtension) { m_errorMonitor->SetDesiredError("VUID-VkImageCreateInfo-format-parameter"); vkt::Image image(*m_device, 4, 4, 1, VK_FORMAT_A4B4G4R4_UNORM_PACK16, VK_IMAGE_USAGE_SAMPLED_BIT); m_errorMonitor->VerifyFound(); -} \ No newline at end of file +} diff --git a/tests/unit/pipeline_positive.cpp b/tests/unit/pipeline_positive.cpp index d8b40d346bf..cab54a98cd5 100644 --- a/tests/unit/pipeline_positive.cpp +++ b/tests/unit/pipeline_positive.cpp @@ -486,6 +486,7 @@ TEST_F(PositivePipeline, CreateGraphicsPipelineWithIgnoredPointers) { TEST_F(PositivePipeline, CoreChecksDisabled) { TEST_DESCRIPTION("Test CreatePipeline while the CoreChecks validation object is disabled"); + AddRequiredExtensions(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME); // Enable KHR validation features extension VkValidationFeatureDisableEXT disables[] = {VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT}; diff --git a/tests/unit/shader_object.cpp b/tests/unit/shader_object.cpp index 2ac7e6ee860..5c95b16d7e0 100644 --- a/tests/unit/shader_object.cpp +++ b/tests/unit/shader_object.cpp @@ -6596,6 +6596,7 @@ TEST_F(NegativeShaderObject, MissingSubgroupSizeControlFeature) { TEST_F(NegativeShaderObject, MissingComputeFullSubgroups) { TEST_DESCRIPTION("Create shader with invalid flags when computeFullSubgroups is not enabled."); + SetTargetApiVersion(VK_API_VERSION_1_2); m_errorMonitor->SetDesiredError("VUID-VkShaderCreateInfoEXT-flags-09405"); RETURN_IF_SKIP(InitBasicShaderObject()); diff --git a/tests/unit/sync_val_positive.cpp b/tests/unit/sync_val_positive.cpp index 0675792bd73..25dedd74f5f 100644 --- a/tests/unit/sync_val_positive.cpp +++ b/tests/unit/sync_val_positive.cpp @@ -64,6 +64,7 @@ void VkSyncValTest::InitSyncValFramework(const SyncValSettings *p_sync_settings) } validation_features.pNext = &settings_create_info; + AddRequiredExtensions(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME); InitFramework(&validation_features); } diff --git a/tests/unit/wsi.cpp b/tests/unit/wsi.cpp index f5baf784b53..3587231c197 100644 --- a/tests/unit/wsi.cpp +++ b/tests/unit/wsi.cpp @@ -3270,6 +3270,7 @@ TEST_F(NegativeWsi, ImageCompressionControlSwapchainWithoutFeature) { TEST_DESCRIPTION("Use image compression control swapchain pNext without feature enabled"); AddSurfaceExtension(); + AddRequiredExtensions(VK_EXT_IMAGE_COMPRESSION_CONTROL_EXTENSION_NAME); RETURN_IF_SKIP(Init()); RETURN_IF_SKIP(InitSurface()); InitSwapchainInfo();