diff --git a/layers/best_practices/bp_descriptor.cpp b/layers/best_practices/bp_descriptor.cpp index e86451d1516..1b17a6c722f 100644 --- a/layers/best_practices/bp_descriptor.cpp +++ b/layers/best_practices/bp_descriptor.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. * Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. * Modifications Copyright (C) 2022 RasterGrid Kft. * @@ -40,7 +40,7 @@ bool BestPractices::PreCallValidateAllocateDescriptorSets(VkDevice device, const VendorSpecificTag(kBPVendorArm)); } - if (IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (IsExtEnabled(extensions.vk_khr_maintenance1)) { // Track number of descriptorSets allowable in this pool if (pool_state->GetAvailableSets() < pAllocateInfo->descriptorSetCount) { skip |= diff --git a/layers/best_practices/bp_device_memory.cpp b/layers/best_practices/bp_device_memory.cpp index bf6b135eb32..c54a7983097 100644 --- a/layers/best_practices/bp_device_memory.cpp +++ b/layers/best_practices/bp_device_memory.cpp @@ -62,7 +62,7 @@ bool BestPractices::PreCallValidateAllocateMemory(VkDevice device, const VkMemor } if (VendorCheckEnabled(kBPVendorNVIDIA)) { - if (!IsExtEnabled(device_extensions.vk_ext_pageable_device_local_memory) && + if (!IsExtEnabled(extensions.vk_ext_pageable_device_local_memory) && !vku::FindStructInPNextChain(pAllocateInfo->pNext)) { skip |= LogPerformanceWarning( "BestPractices-NVIDIA-AllocateMemory-SetPriority", device, error_obj.location, @@ -293,7 +293,7 @@ void BestPractices::PostCallRecordSetDeviceMemoryPriorityEXT(VkDevice device, Vk bool BestPractices::ValidateBindMemory(VkDevice device, VkDeviceMemory memory, const Location& loc) const { bool skip = false; - if (VendorCheckEnabled(kBPVendorNVIDIA) && IsExtEnabled(device_extensions.vk_ext_pageable_device_local_memory)) { + if (VendorCheckEnabled(kBPVendorNVIDIA) && IsExtEnabled(extensions.vk_ext_pageable_device_local_memory)) { auto mem_info = std::static_pointer_cast(Get(memory)); bool has_static_priority = vku::FindStructInPNextChain(mem_info->allocate_info.pNext); if (!mem_info->dynamic_priority && !has_static_priority) { diff --git a/layers/best_practices/bp_instance_device.cpp b/layers/best_practices/bp_instance_device.cpp index b5b11b75441..f41687c4ca1 100644 --- a/layers/best_practices/bp_instance_device.cpp +++ b/layers/best_practices/bp_instance_device.cpp @@ -135,16 +135,16 @@ bool BestPractices::PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, dev_api_name.c_str()); } - std::vector extensions; + std::vector extension_names; { uint32_t property_count = 0; if (DispatchEnumerateDeviceExtensionProperties(physicalDevice, nullptr, &property_count, nullptr) == VK_SUCCESS) { std::vector property_list(property_count); if (DispatchEnumerateDeviceExtensionProperties(physicalDevice, nullptr, &property_count, property_list.data()) == VK_SUCCESS) { - extensions.reserve(property_list.size()); + extension_names.reserve(property_list.size()); for (const VkExtensionProperties& properties : property_list) { - extensions.emplace_back(properties.extensionName); + extension_names.emplace_back(properties.extensionName); } } } @@ -183,9 +183,10 @@ bool BestPractices::PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, VendorSpecificTag(kBPVendorArm), VendorSpecificTag(kBPVendorAMD), VendorSpecificTag(kBPVendorIMG)); } - const bool enabled_pageable_device_local_memory = IsExtEnabled(device_extensions.vk_ext_pageable_device_local_memory); + const bool enabled_pageable_device_local_memory = IsExtEnabled(extensions.vk_ext_pageable_device_local_memory); if (VendorCheckEnabled(kBPVendorNVIDIA) && !enabled_pageable_device_local_memory && - std::find(extensions.begin(), extensions.end(), VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME) != extensions.end()) { + std::find(extension_names.begin(), extension_names.end(), VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME) != + extension_names.end()) { skip |= LogPerformanceWarning("BestPractices-NVIDIA-CreateDevice-PageableDeviceLocalMemory", instance, error_obj.location, "%s called without pageable device local memory. " diff --git a/layers/best_practices/bp_pipeline.cpp b/layers/best_practices/bp_pipeline.cpp index 4cc68c7aca7..94a5e2a5623 100644 --- a/layers/best_practices/bp_pipeline.cpp +++ b/layers/best_practices/bp_pipeline.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. * Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. * Modifications Copyright (C) 2022 RasterGrid Kft. * @@ -301,7 +301,7 @@ bool BestPractices::PreCallValidateCreateComputePipelines(VkDevice device, VkPip skip |= ValidateCreateComputePipelineAmd(create_info, create_info_loc); } - if (IsExtEnabled(device_extensions.vk_khr_maintenance4)) { + if (IsExtEnabled(extensions.vk_khr_maintenance4)) { auto module_state = Get(create_info.stage.module); if (module_state && module_state->spirv->static_data_.has_builtin_workgroup_size) { // No module if creating from module identifier diff --git a/layers/best_practices/bp_render_pass.cpp b/layers/best_practices/bp_render_pass.cpp index 0812a11ab97..9cb49b92091 100644 --- a/layers/best_practices/bp_render_pass.cpp +++ b/layers/best_practices/bp_render_pass.cpp @@ -128,7 +128,7 @@ bool BestPractices::PreCallValidateCreateRenderPass(VkDevice device, const VkRen } } - if (IsExtEnabled(device_extensions.vk_ext_multisampled_render_to_single_sampled)) { + if (IsExtEnabled(extensions.vk_ext_multisampled_render_to_single_sampled)) { for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) { if (!pCreateInfo->pSubpasses[i].pResolveAttachments) continue; for (uint32_t j = 0; j < pCreateInfo->pSubpasses[i].colorAttachmentCount; ++j) { diff --git a/layers/best_practices/bp_wsi.cpp b/layers/best_practices/bp_wsi.cpp index 5f91a295113..b72311b87cb 100644 --- a/layers/best_practices/bp_wsi.cpp +++ b/layers/best_practices/bp_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. * Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. * Modifications Copyright (C) 2022 RasterGrid Kft. * @@ -111,7 +111,7 @@ bool BestPractices::PreCallValidateCreateSwapchainKHR(VkDevice device, const VkS pCreateInfo->minImageCount); } - if (IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1) && + if (IsExtEnabled(extensions.vk_ext_swapchain_maintenance1) && !vku::FindStructInPNextChain(pCreateInfo->pNext)) { skip |= LogWarning("BestPractices-vkCreateSwapchainKHR-no-VkSwapchainPresentModesCreateInfoEXT-provided", device, error_obj.location, @@ -344,4 +344,4 @@ void BestPractices::ManualPostCallRecordGetSwapchainImagesKHR(VkDevice device, V std::shared_ptr BestPractices::CreateSwapchainState(const VkSwapchainCreateInfoKHR* create_info, VkSwapchainKHR handle) { return std::static_pointer_cast(std::make_shared(*this, create_info, handle)); -} \ No newline at end of file +} diff --git a/layers/chassis/chassis_manual.cpp b/layers/chassis/chassis_manual.cpp index 2a82343985a..e3f9c4df61b 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. * @@ -111,7 +111,7 @@ const vvl::unordered_map& GetNameToFuncPtrMap(); VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr(VkDevice device, const char* funcName) { auto layer_data = vvl::dispatch::GetData(device); - if (!ApiParentExtensionEnabled(funcName, &layer_data->device_extensions)) { + if (!ApiParentExtensionEnabled(funcName, &layer_data->extensions)) { return nullptr; } const auto& item = GetNameToFuncPtrMap().find(funcName); @@ -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 @@ -291,10 +286,10 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice gpu, const VkDevice // use a unique pointer to make sure we destroy this object on error auto device_dispatch = std::make_unique(instance_dispatch, gpu, pCreateInfo); - // This is odd but we need to set the current device_extensions in all of the + // This is odd but we need to set the current extensions in all of the // instance validation objects so that they are available for validating CreateDevice for (auto& vo : instance_dispatch->object_dispatch) { - vo->device_extensions = device_dispatch->device_extensions; + vo->extensions = device_dispatch->extensions; } // Make copy to modify as some ValidationObjects will want to add extensions/features on @@ -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->extensions = DeviceExtensions(instance_dispatch->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.h b/layers/chassis/dispatch_object.h index 7eee7bd3593..472845bc1ef 100644 --- a/layers/chassis/dispatch_object.h +++ b/layers/chassis/dispatch_object.h @@ -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. * @@ -179,8 +179,7 @@ class Instance : public HandleWrapper { Settings settings; APIVersion api_version; - InstanceExtensions instance_extensions; - DeviceExtensions device_extensions = {}; + DeviceExtensions extensions{}; mutable std::vector> object_dispatch; @@ -208,7 +207,7 @@ class Device : public HandleWrapper { Instance* dispatch_instance; APIVersion api_version; - DeviceExtensions device_extensions = {}; + DeviceExtensions extensions = {}; VkPhysicalDevice physical_device = VK_NULL_HANDLE; VkDevice device = VK_NULL_HANDLE; diff --git a/layers/chassis/dispatch_object_manual.cpp b/layers/chassis/dispatch_object_manual.cpp index 19c41c70218..c559ab85656 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); + InstanceExtensions instance_extensions(specified_version, pCreateInfo); + 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); + extensions = DeviceExtensions(dispatch_instance->extensions, effective_api_version, pCreateInfo); InitValidationObjects(); InitObjectDispatchVectors(); diff --git a/layers/chassis/validation_object.h b/layers/chassis/validation_object.h index 1a56c6740db..8c0b4ae2277 100644 --- a/layers/chassis/validation_object.h +++ b/layers/chassis/validation_object.h @@ -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. * @@ -84,8 +84,7 @@ class ValidationObject : public Logger { vvl::dispatch::Instance* dispatch_instance_{}; vvl::dispatch::Device* dispatch_device_{}; - const InstanceExtensions& instance_extensions; - DeviceExtensions device_extensions; + DeviceExtensions extensions; const GlobalSettings& global_settings; GpuAVSettings& gpuav_settings; const SyncValSettings& syncval_settings; @@ -106,8 +105,7 @@ class ValidationObject : public Logger { api_version(dev->api_version), dispatch_instance_(dev->dispatch_instance), dispatch_device_(dev), - instance_extensions(dev->dispatch_instance->instance_extensions), - device_extensions(dev->device_extensions), + extensions(dev->extensions), global_settings(dev->settings.global_settings), gpuav_settings(dev->settings.gpuav_settings), syncval_settings(dev->settings.syncval_settings), @@ -123,8 +121,7 @@ class ValidationObject : public Logger { api_version(instance->api_version), dispatch_instance_(instance), dispatch_device_(nullptr), - instance_extensions(instance->instance_extensions), - device_extensions(instance->device_extensions), + extensions(instance->extensions), global_settings(instance->settings.global_settings), gpuav_settings(instance->settings.gpuav_settings), syncval_settings(instance->settings.syncval_settings), @@ -139,12 +136,12 @@ class ValidationObject : public Logger { void CopyDispatchState() { if (dispatch_device_) { - device_extensions = dispatch_device_->device_extensions; + extensions = dispatch_device_->extensions; instance = dispatch_device_->dispatch_instance->instance; physical_device = dispatch_device_->physical_device; device = dispatch_device_->device; } else { - device_extensions = dispatch_instance_->device_extensions; + extensions = dispatch_instance_->extensions; instance = dispatch_instance_->instance; physical_device = VK_NULL_HANDLE; device = VK_NULL_HANDLE; diff --git a/layers/core_checks/cc_buffer.cpp b/layers/core_checks/cc_buffer.cpp index f8f1a1a7278..031f9e74762 100644 --- a/layers/core_checks/cc_buffer.cpp +++ b/layers/core_checks/cc_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. * Modifications Copyright (C) 2020-2022 Advanced Micro Devices, Inc. All rights reserved. * @@ -498,7 +498,7 @@ bool CoreChecks::PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkB FormatHandle(dstBuffer).c_str(), buffer_state->create_info.size, dstOffset); } - if (!IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (!IsExtEnabled(extensions.vk_khr_maintenance1)) { const VkQueueFlags required_flags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT; if (!HasRequiredQueueFlags(cb_state, *physical_device_state, required_flags)) { const LogObjectList objlist_pool(cb_state.Handle(), cb_state.command_pool->Handle()); diff --git a/layers/core_checks/cc_cmd_buffer_dynamic.cpp b/layers/core_checks/cc_cmd_buffer_dynamic.cpp index eaea11b5cc7..b895dafb22b 100644 --- a/layers/core_checks/cc_cmd_buffer_dynamic.cpp +++ b/layers/core_checks/cc_cmd_buffer_dynamic.cpp @@ -298,7 +298,7 @@ bool CoreChecks::ValidateGraphicsDynamicStateSetStatus(const LastBound& last_bou skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_FRONT_FACE, vuid); } - if (IsExtEnabled(device_extensions.vk_ext_sample_locations)) { + if (IsExtEnabled(extensions.vk_ext_sample_locations)) { skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT, vuid); if (last_bound_state.IsSampleLocationsEnable()) { @@ -327,7 +327,7 @@ bool CoreChecks::ValidateGraphicsDynamicStateSetStatus(const LastBound& last_bou } skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT, vuid); - if (IsExtEnabled(device_extensions.vk_ext_conservative_rasterization)) { + if (IsExtEnabled(extensions.vk_ext_conservative_rasterization)) { skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT, vuid); if (last_bound_state.GetConservativeRasterizationMode() == VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT) { @@ -336,7 +336,7 @@ bool CoreChecks::ValidateGraphicsDynamicStateSetStatus(const LastBound& last_bou } } - if (IsExtEnabled(device_extensions.vk_nv_fragment_coverage_to_color)) { + if (IsExtEnabled(extensions.vk_nv_fragment_coverage_to_color)) { skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV, vuid); if (last_bound_state.IsCoverageToColorEnabled()) { @@ -372,7 +372,7 @@ bool CoreChecks::ValidateGraphicsDynamicStateSetStatus(const LastBound& last_bou skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV, vuid); } - if (IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples)) { + if (IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples)) { skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV, vuid); if (last_bound_state.GetCoverageModulationMode() != VK_COVERAGE_MODULATION_MODE_NONE_NV) { @@ -385,7 +385,7 @@ bool CoreChecks::ValidateGraphicsDynamicStateSetStatus(const LastBound& last_bou } } - if (IsExtEnabled(device_extensions.vk_ext_discard_rectangles)) { + if (IsExtEnabled(extensions.vk_ext_discard_rectangles)) { skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT, vuid); if (last_bound_state.IsDiscardRectangleEnable()) { @@ -435,7 +435,7 @@ bool CoreChecks::ValidateGraphicsDynamicStateSetStatus(const LastBound& last_bou } if (vertex_shader_bound) { - if (IsExtEnabled(device_extensions.vk_ext_provoking_vertex)) { + if (IsExtEnabled(extensions.vk_ext_provoking_vertex)) { skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT, vuid); } @@ -508,7 +508,7 @@ bool CoreChecks::ValidateGraphicsDynamicStateSetStatus(const LastBound& last_bou } } - if (IsExtEnabled(device_extensions.vk_nv_clip_space_w_scaling)) { + if (IsExtEnabled(extensions.vk_nv_clip_space_w_scaling)) { skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV, vuid); if (last_bound_state.IsViewportWScalingEnable() && has_dynamic_state(CB_DYNAMIC_STATE_VIEWPORT_WITH_COUNT) && @@ -525,7 +525,7 @@ bool CoreChecks::ValidateGraphicsDynamicStateSetStatus(const LastBound& last_bou } } - if (IsExtEnabled(device_extensions.vk_nv_viewport_swizzle)) { + if (IsExtEnabled(extensions.vk_nv_viewport_swizzle)) { skip |= ValidateDynamicStateIsSet(last_bound_state, state_status_cb, CB_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV, vuid); } @@ -840,9 +840,8 @@ bool CoreChecks::ValidateGraphicsDynamicStateValue(const LastBound& last_bound_s } if (pipeline.IsDynamic(CB_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT)) { - if (!IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples) && - !IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples) && - !enabled_features.multisampledRenderToSingleSampled) { + if (!IsExtEnabled(extensions.vk_amd_mixed_attachment_samples) && + !IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples) && !enabled_features.multisampledRenderToSingleSampled) { for (uint32_t i = 0; i < cb_state.active_attachments.size(); ++i) { const AttachmentInfo& attachment_info = cb_state.active_attachments[i]; const auto* attachment = attachment_info.image_view; @@ -1261,7 +1260,7 @@ bool CoreChecks::ValidateDrawDynamicState(const LastBound& last_bound_state, con } if (pipeline_state && cb_state.activeRenderPass->UsesDynamicRendering() && - (!IsExtEnabled(device_extensions.vk_ext_shader_object) || !last_bound_state.IsAnyGraphicsShaderBound())) { + (!IsExtEnabled(extensions.vk_ext_shader_object) || !last_bound_state.IsAnyGraphicsShaderBound())) { skip |= ValidateDrawRenderingAttachmentLocation(cb_state, *pipeline_state, vuid); skip |= ValidateDrawRenderingInputAttachmentIndex(cb_state, *pipeline_state, vuid); } @@ -1454,8 +1453,8 @@ bool CoreChecks::ValidateDrawDynamicStateShaderObject(const LastBound& last_boun i, string_VkFormat(attachment->create_info.format), i); } } - if (!IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples) && - !IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples) && + if (!IsExtEnabled(extensions.vk_amd_mixed_attachment_samples) && + !IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples) && enabled_features.multisampledRenderToSingleSampled == VK_FALSE && cb_state.IsDynamicStateSet(CB_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT)) { for (uint32_t i = 0; i < cb_state.active_attachments.size(); ++i) { @@ -1569,7 +1568,7 @@ bool CoreChecks::ValidateDrawDynamicStateShaderObject(const LastBound& last_boun DynamicStateToString(CB_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT), i); } } - if (IsExtEnabled(device_extensions.vk_ext_blend_operation_advanced)) { + if (IsExtEnabled(extensions.vk_ext_blend_operation_advanced)) { if (!cb_state.IsDynamicStateSet(CB_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT) && !cb_state.IsDynamicStateSet(CB_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT)) { skip |= LogError(vuid.set_blend_operation_advance_09416, objlist, loc, @@ -1578,7 +1577,7 @@ bool CoreChecks::ValidateDrawDynamicStateShaderObject(const LastBound& last_boun DynamicStateToString(CB_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT)); } } - if (IsExtEnabled(device_extensions.vk_nv_fragment_coverage_to_color)) { + if (IsExtEnabled(extensions.vk_nv_fragment_coverage_to_color)) { if (cb_state.IsDynamicStateSet(CB_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV) && cb_state.dynamic_state_value.coverage_to_color_enable) { if (cb_state.IsDynamicStateSet(CB_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV)) { @@ -1616,7 +1615,7 @@ bool CoreChecks::ValidateDrawDynamicStateShaderObject(const LastBound& last_boun } } - if (IsExtEnabled(device_extensions.vk_nv_viewport_swizzle)) { + if (IsExtEnabled(extensions.vk_nv_viewport_swizzle)) { if (cb_state.IsDynamicStateSet(CB_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV)) { if (cb_state.dynamic_state_value.viewport_swizzle_count < cb_state.dynamic_state_value.viewport_count) { skip |= @@ -1886,7 +1885,7 @@ bool CoreChecks::PreCallValidateCmdSetDepthBounds(VkCommandBuffer commandBuffer, bool skip = false; skip |= ValidateCmd(*cb_state, error_obj.location); - if (!IsExtEnabled(device_extensions.vk_ext_depth_range_unrestricted)) { + if (!IsExtEnabled(extensions.vk_ext_depth_range_unrestricted)) { if (!(minDepthBounds >= 0.0) || !(minDepthBounds <= 1.0)) { skip |= LogError( "VUID-vkCmdSetDepthBounds-minDepthBounds-00600", commandBuffer, error_obj.location.dot(Field::minDepthBounds), @@ -2309,7 +2308,7 @@ bool CoreChecks::PreCallValidateCmdSetPolygonModeEXT(VkCommandBuffer commandBuff "is %s but the " "fillModeNonSolid feature was not enabled.", string_VkPolygonMode(polygonMode)); - } else if (polygonMode == VK_POLYGON_MODE_FILL_RECTANGLE_NV && !IsExtEnabled(device_extensions.vk_nv_fill_rectangle)) { + } else if (polygonMode == VK_POLYGON_MODE_FILL_RECTANGLE_NV && !IsExtEnabled(extensions.vk_nv_fill_rectangle)) { skip |= LogError("VUID-vkCmdSetPolygonModeEXT-polygonMode-07425", commandBuffer, error_obj.location.dot(Field::polygonMode), "is VK_POLYGON_MODE_FILL_RECTANGLE_NV but the VK_NV_fill_rectangle " "extension was not enabled."); @@ -2444,7 +2443,7 @@ bool CoreChecks::PreCallValidateCmdSetColorBlendEquationEXT(VkCommandBuffer comm "(%s) and alphaBlendOp (%s) must not be an advanced blending operation.", string_VkBlendOp(equation.colorBlendOp), string_VkBlendOp(equation.alphaBlendOp)); } - if (IsExtEnabled(device_extensions.vk_khr_portability_subset) && !enabled_features.constantAlphaColorBlendFactors) { + if (IsExtEnabled(extensions.vk_khr_portability_subset) && !enabled_features.constantAlphaColorBlendFactors) { if (equation.srcColorBlendFactor == VK_BLEND_FACTOR_CONSTANT_ALPHA || equation.srcColorBlendFactor == VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA) { skip |= LogError("VUID-VkColorBlendEquationEXT-constantAlphaColorBlendFactors-07362", commandBuffer, @@ -2821,7 +2820,7 @@ bool CoreChecks::PreCallValidateCreateEvent(VkDevice device, const VkEventCreate const ErrorObject& error_obj) const { bool skip = false; skip |= ValidateDeviceQueueSupport(error_obj.location); - if (IsExtEnabled(device_extensions.vk_khr_portability_subset)) { + if (IsExtEnabled(extensions.vk_khr_portability_subset)) { if (VK_FALSE == enabled_features.events) { skip |= LogError("VUID-vkCreateEvent-events-04468", device, error_obj.location, "events are not supported via VK_KHR_portability_subset"); diff --git a/layers/core_checks/cc_copy_blit_resolve.cpp b/layers/core_checks/cc_copy_blit_resolve.cpp index 0542c8e24f7..70ed50058e9 100644 --- a/layers/core_checks/cc_copy_blit_resolve.cpp +++ b/layers/core_checks/cc_copy_blit_resolve.cpp @@ -1132,7 +1132,7 @@ bool CoreChecks::ValidateImageCopyData(const HandleT handle, const RegionType &r } // Handle difference between Maintenance 1 - if (IsExtEnabled(device_extensions.vk_khr_maintenance1) || is_host) { + if (IsExtEnabled(extensions.vk_khr_maintenance1) || is_host) { if (src_image_state.create_info.imageType == VK_IMAGE_TYPE_3D) { const LogObjectList objlist(handle, src_image_state.Handle()); if ((0 != region.srcSubresource.baseArrayLayer) || (1 != region.srcSubresource.layerCount)) { @@ -1336,7 +1336,7 @@ bool CoreChecks::ValidateCopyImageRegionCommon(HandleT handle, const vvl::Image } if (api_version < VK_API_VERSION_1_1) { - if (!IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (!IsExtEnabled(extensions.vk_khr_maintenance1)) { // For each region the layerCount member of srcSubresource and dstSubresource must match if (region.srcSubresource.layerCount != region.dstSubresource.layerCount) { const LogObjectList objlist(handle, src_image_state.VkHandle(), dst_image_state.VkHandle()); @@ -1346,7 +1346,7 @@ bool CoreChecks::ValidateCopyImageRegionCommon(HandleT handle, const vvl::Image dst_subresource_loc.dot(Field::layerCount).Fields().c_str(), region.dstSubresource.layerCount); } } - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) { + if (!IsExtEnabled(extensions.vk_khr_sampler_ycbcr_conversion)) { // For each region the aspectMask member of srcSubresource and dstSubresource must match if (region.srcSubresource.aspectMask != region.dstSubresource.aspectMask) { const LogObjectList objlist(handle, src_image_state.VkHandle(), dst_image_state.VkHandle()); @@ -1548,7 +1548,7 @@ bool CoreChecks::ValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage src slice_override = (depth_slices != 1); } - if (IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (IsExtEnabled(extensions.vk_khr_maintenance1)) { // No chance of mismatch if we're overriding depth slice count if (!slice_override) { // The number of depth slices in srcSubresource and dstSubresource must match @@ -1860,7 +1860,7 @@ bool CoreChecks::ValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage src } // Validate that SRC & DST images have correct usage flags set - if (!IsExtEnabled(device_extensions.vk_ext_separate_stencil_usage)) { + if (!IsExtEnabled(extensions.vk_ext_separate_stencil_usage)) { vuid = is_2 ? "VUID-VkCopyImageInfo2-aspect-06662" : "VUID-vkCmdCopyImage-aspect-06662"; skip |= ValidateImageUsageFlags(commandBuffer, *src_image_state, VK_IMAGE_USAGE_TRANSFER_SRC_BIT, false, vuid, src_image_loc); @@ -2304,7 +2304,7 @@ bool CoreChecks::ValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkI skip |= LogError(vuid, objlist, src_image_loc, "was created with VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT."); } - if (IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (IsExtEnabled(extensions.vk_khr_maintenance1)) { vuid = is_2 ? "VUID-VkCopyImageToBufferInfo2-srcImage-01998" : "VUID-vkCmdCopyImageToBuffer-srcImage-01998"; skip |= ValidateImageFormatFeatureFlags(commandBuffer, *src_image_state, VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT, src_image_loc, vuid); @@ -2459,7 +2459,7 @@ bool CoreChecks::ValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkB skip |= LogError(vuid, dst_objlist, dst_image_loc, "was created with VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT."); } - if (IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (IsExtEnabled(extensions.vk_khr_maintenance1)) { vuid = is_2 ? "VUID-VkCopyBufferToImageInfo2-dstImage-01997" : "VUID-vkCmdCopyBufferToImage-dstImage-01997"; skip |= ValidateImageFormatFeatureFlags(commandBuffer, *dst_image_state, VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT, dst_image_loc, vuid); diff --git a/layers/core_checks/cc_descriptor.cpp b/layers/core_checks/cc_descriptor.cpp index 99ac610c819..bc263ec570b 100644 --- a/layers/core_checks/cc_descriptor.cpp +++ b/layers/core_checks/cc_descriptor.cpp @@ -1301,9 +1301,8 @@ bool CoreChecks::ValidateImageUpdate(const vvl::ImageView &view_state, VkImageLa "was created with %s, but descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_IMAGE.", string_VkImageUsageFlags(usage).c_str()); - } else if ((VK_IMAGE_LAYOUT_GENERAL != image_layout) && - (!IsExtEnabled(device_extensions.vk_khr_shared_presentable_image) || - (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR != image_layout))) { + } else if ((VK_IMAGE_LAYOUT_GENERAL != image_layout) && (!IsExtEnabled(extensions.vk_khr_shared_presentable_image) || + (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR != image_layout))) { skip |= LogError("VUID-VkWriteDescriptorSet-descriptorType-04152", objlist, image_info_loc.dot(Field::imageView), "image layout is %s, but descriptorType is VK_DESCRIPTOR_TYPE_STORAGE_IMAGE. (allowed layouts are " "VK_IMAGE_LAYOUT_GENERAL or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR).", @@ -1364,7 +1363,7 @@ bool CoreChecks::ValidateImageUpdate(const vvl::ImageView &view_state, VkImageLa {VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ, &DeviceExtensions::vk_khr_dynamic_rendering_local_read}, }}; auto is_layout = [image_layout, this](const ExtensionLayout &ext_layout) { - return IsExtEnabled(device_extensions.*(ext_layout.extension)) && (ext_layout.layout == image_layout); + return IsExtEnabled(extensions.*(ext_layout.extension)) && (ext_layout.layout == image_layout); }; const bool valid_layout = (std::find(valid_layouts.cbegin(), valid_layouts.cend(), image_layout) != valid_layouts.cend()) || @@ -1393,7 +1392,7 @@ bool CoreChecks::ValidateImageUpdate(const vvl::ImageView &view_state, VkImageLa << ". Allowed layouts are: VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, " << "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL"; for (auto &ext_layout : extended_layouts) { - if (IsExtEnabled(device_extensions.*(ext_layout.extension))) { + if (IsExtEnabled(extensions.*(ext_layout.extension))) { error_str << ", " << string_VkImageLayout(ext_layout.layout); } } @@ -2082,7 +2081,7 @@ bool CoreChecks::VerifyWriteUpdateContents(const vvl::DescriptorSet &dst_set, co // Verify portability if (auto sampler_state = Get(sampler)) { - if (IsExtEnabled(device_extensions.vk_khr_portability_subset)) { + if (IsExtEnabled(extensions.vk_khr_portability_subset)) { if ((VK_FALSE == enabled_features.mutableComparisonSamplers) && (VK_FALSE != sampler_state->create_info.compareEnable)) { skip |= LogError("VUID-VkDescriptorImageInfo-mutableComparisonSamplers-04450", device, write_loc, @@ -3376,7 +3375,7 @@ bool CoreChecks::PreCallValidateAllocateDescriptorSets(VkDevice device, const Vk string_VkDescriptorPoolCreateFlags(ds_pool_state->create_info.flags).c_str()); } } - if (!IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (!IsExtEnabled(extensions.vk_khr_maintenance1)) { // Track number of descriptorSets allowable in this pool if (ds_pool_state->GetAvailableSets() < pAllocateInfo->descriptorSetCount) { skip |= LogError("VUID-VkDescriptorSetAllocateInfo-apiVersion-07895", ds_pool_state->Handle(), error_obj.location, @@ -4285,7 +4284,7 @@ bool CoreChecks::PreCallValidateCreatePipelineLayout(VkDevice device, const VkPi } // Extension exposes new properties limits - if (IsExtEnabled(device_extensions.vk_ext_descriptor_indexing)) { + if (IsExtEnabled(extensions.vk_ext_descriptor_indexing)) { // Max descriptors by type, within a single pipeline stage std::valarray max_descriptors_per_stage_update_after_bind = GetDescriptorCountMaxPerStage(&enabled_features, set_layouts, false); @@ -4534,7 +4533,7 @@ bool CoreChecks::PreCallValidateCreatePipelineLayout(VkDevice device, const VkPi } // Extension exposes new properties limits - if (IsExtEnabled(device_extensions.vk_ext_fragment_density_map2)) { + if (IsExtEnabled(extensions.vk_ext_fragment_density_map2)) { uint32_t sum_subsampled_samplers = 0; for (const auto &dsl : set_layouts) { // find the number of subsampled samplers across all stages @@ -4710,7 +4709,7 @@ bool CoreChecks::PreCallValidateCreateSampler(VkDevice device, const VkSamplerCr } } - if (IsExtEnabled(device_extensions.vk_khr_portability_subset)) { + if (IsExtEnabled(extensions.vk_khr_portability_subset)) { if ((VK_FALSE == enabled_features.samplerMipLodBias) && pCreateInfo->mipLodBias != 0) { skip |= LogError("VUID-VkSamplerCreateInfo-samplerMipLodBias-04467", device, error_obj.location, "(portability error) mipLodBias is %f, but samplerMipLodBias not supported.", pCreateInfo->mipLodBias); diff --git a/layers/core_checks/cc_device.cpp b/layers/core_checks/cc_device.cpp index c931720f666..b183d41191d 100644 --- a/layers/core_checks/cc_device.cpp +++ b/layers/core_checks/cc_device.cpp @@ -166,7 +166,7 @@ bool CoreChecks::ValidateQueueFamilyIndex(const vvl::PhysicalDevice &pd_state, u if (requested_queue_family >= pd_state.queue_family_known_count) { const char *conditional_ext_cmd = - instance_extensions.vk_khr_get_physical_device_properties2 ? " or vkGetPhysicalDeviceQueueFamilyProperties2[KHR]" : ""; + extensions.vk_khr_get_physical_device_properties2 ? " or vkGetPhysicalDeviceQueueFamilyProperties2[KHR]" : ""; skip |= LogError(vuid, pd_state.Handle(), loc, "(%" PRIu32 ") is not less than any previously obtained pQueueFamilyPropertyCount %" PRIu32 @@ -287,9 +287,8 @@ bool CoreChecks::ValidateDeviceQueueCreateInfos(const vvl::PhysicalDevice &pd_st const uint32_t available_queue_count = queue_family_has_props ? requested_queue_family_props.queueCount : 1; if (requested_queue_count > available_queue_count) { - const char *conditional_ext_cmd = instance_extensions.vk_khr_get_physical_device_properties2 - ? " or vkGetPhysicalDeviceQueueFamilyProperties2[KHR]" - : ""; + const char *conditional_ext_cmd = + extensions.vk_khr_get_physical_device_properties2 ? " or vkGetPhysicalDeviceQueueFamilyProperties2[KHR]" : ""; const std::string count_note = queue_family_has_props ? "i.e. is not less than or equal to " + std::to_string(requested_queue_family_props.queueCount) @@ -343,7 +342,7 @@ void CoreChecks::PostCreateDevice(const VkDeviceCreateInfo *pCreateInfo, const L // The state tracker sets up the device state (also if extension and/or features are enabled) BaseClass::PostCreateDevice(pCreateInfo, loc); - AdjustValidatorOptions(device_extensions, enabled_features, spirv_val_options, &spirv_val_option_hash); + AdjustValidatorOptions(extensions, enabled_features, spirv_val_options, &spirv_val_option_hash); // Allocate shader validation cache if (!disabled[shader_validation_caching] && !disabled[shader_validation] && !core_validation_cache) { diff --git a/layers/core_checks/cc_device_memory.cpp b/layers/core_checks/cc_device_memory.cpp index 731b14f4472..195a56b4064 100644 --- a/layers/core_checks/cc_device_memory.cpp +++ b/layers/core_checks/cc_device_memory.cpp @@ -413,7 +413,7 @@ bool CoreChecks::PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAl } const Location allocate_info_loc = error_obj.location.dot(Field::pAllocateInfo); - if (IsExtEnabled(device_extensions.vk_khr_maintenance3) && + if (IsExtEnabled(extensions.vk_khr_maintenance3) && pAllocateInfo->allocationSize > phys_dev_props_core11.maxMemoryAllocationSize) { // Discussed in https://gitlab.khronos.org/vulkan/vulkan/-/issues/4119 and finalized in // https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/7073 This is a limit the Working Group feels should be alerted @@ -427,7 +427,7 @@ bool CoreChecks::PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAl pAllocateInfo->allocationSize, phys_dev_props_core11.maxMemoryAllocationSize); } - if (IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) { + if (IsExtEnabled(extensions.vk_android_external_memory_android_hardware_buffer)) { skip |= ValidateAllocateMemoryANDROID(*pAllocateInfo, allocate_info_loc); } else { if (!IgnoreAllocationSize(*pAllocateInfo) && 0 == pAllocateInfo->allocationSize) { @@ -1916,7 +1916,7 @@ bool CoreChecks::ValidateBindImageMemory(uint32_t bindInfoCount, const VkBindIma swapchain_info->imageIndex, FormatHandle(swapchain_info->swapchain).c_str(), swapchain_state->images.size()); } - if (IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1) && + if (IsExtEnabled(extensions.vk_ext_swapchain_maintenance1) && (swapchain_state->create_info.flags & VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT)) { if (swapchain_state->images[swapchain_info->imageIndex].acquired == false) { const LogObjectList objlist(bind_info.image, bind_info.memory); diff --git a/layers/core_checks/cc_drawdispatch.cpp b/layers/core_checks/cc_drawdispatch.cpp index 91c53857146..7b4c86e91b0 100644 --- a/layers/core_checks/cc_drawdispatch.cpp +++ b/layers/core_checks/cc_drawdispatch.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. * Modifications Copyright (C) 2020-2024 Advanced Micro Devices, Inc. All rights reserved. * @@ -554,7 +554,7 @@ bool CoreChecks::PreCallValidateCmdDrawIndirectCount(VkCommandBuffer commandBuff error_obj.location.dot(Field::countBufferOffset), "(%" PRIu64 "), is not a multiple of 4.", countBufferOffset); } - if ((device_extensions.vk_khr_draw_indirect_count != kEnabledByCreateinfo) && + if ((extensions.vk_khr_draw_indirect_count != kEnabledByCreateinfo) && ((api_version >= VK_API_VERSION_1_2) && (enabled_features.drawIndirectCount == VK_FALSE))) { skip |= LogError("VUID-vkCmdDrawIndirectCount-None-04445", cb_state.GetObjectList(VK_PIPELINE_BIND_POINT_GRAPHICS), error_obj.location, @@ -605,7 +605,7 @@ bool CoreChecks::PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBuffer comm cb_state.GetObjectList(VK_PIPELINE_BIND_POINT_GRAPHICS), error_obj.location.dot(Field::countBufferOffset), "(%" PRIu64 "), is not a multiple of 4.", countBufferOffset); } - if ((device_extensions.vk_khr_draw_indirect_count != kEnabledByCreateinfo) && + if ((extensions.vk_khr_draw_indirect_count != kEnabledByCreateinfo) && ((api_version >= VK_API_VERSION_1_2) && (enabled_features.drawIndirectCount == VK_FALSE))) { skip |= LogError("VUID-vkCmdDrawIndexedIndirectCount-None-04445", cb_state.GetObjectList(VK_PIPELINE_BIND_POINT_GRAPHICS), error_obj.location, @@ -655,8 +655,7 @@ bool CoreChecks::PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBuffer comm cb_state.GetObjectList(VK_PIPELINE_BIND_POINT_GRAPHICS), error_obj.location, "transformFeedback feature is not enabled."); } - if (IsExtEnabled(device_extensions.vk_ext_transform_feedback) && - !phys_dev_ext_props.transform_feedback_props.transformFeedbackDraw) { + if (IsExtEnabled(extensions.vk_ext_transform_feedback) && !phys_dev_ext_props.transform_feedback_props.transformFeedbackDraw) { skip |= LogError("VUID-vkCmdDrawIndirectByteCountEXT-transformFeedbackDraw-02288", cb_state.GetObjectList(VK_PIPELINE_BIND_POINT_GRAPHICS), error_obj.location, "VkPhysicalDeviceTransformFeedbackPropertiesEXT::transformFeedbackDraw is not supported"); diff --git a/layers/core_checks/cc_image.cpp b/layers/core_checks/cc_image.cpp index aa55d25ca10..5ab03ce2d62 100644 --- a/layers/core_checks/cc_image.cpp +++ b/layers/core_checks/cc_image.cpp @@ -173,7 +173,7 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate bool skip = false; skip |= ValidateDeviceQueueSupport(error_obj.location); const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo); - if (IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) { + if (IsExtEnabled(extensions.vk_android_external_memory_android_hardware_buffer)) { skip |= ValidateCreateImageANDROID(*pCreateInfo, create_info_loc); } else { // These checks are omitted or replaced when Android HW Buffer extension is active if (pCreateInfo->format == VK_FORMAT_UNDEFINED) { @@ -244,7 +244,7 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate // Exit early if any thing is not succesful VkResult result = VK_SUCCESS; if (pCreateInfo->tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { - if (IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) { + if (IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) { result = DispatchGetPhysicalDeviceImageFormatProperties2Helper(physical_device, &image_format_info, &image_format_properties); } else { @@ -261,7 +261,7 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate #ifdef VK_USE_PLATFORM_ANDROID_KHR if (!vku::FindStructInPNextChain(pCreateInfo->pNext)) { #endif // VK_USE_PLATFORM_ANDROID_KHR - Func command = IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2) + Func command = IsExtEnabled(extensions.vk_khr_get_physical_device_properties2) ? Func::vkGetPhysicalDeviceImageFormatProperties2 : Func::vkGetPhysicalDeviceImageFormatProperties; skip |= LogError("VUID-VkImageCreateInfo-imageCreateMaxMipLevels-02251", device, create_info_loc, @@ -412,7 +412,7 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate } } - if (IsExtEnabled(device_extensions.vk_khr_maintenance2)) { + if (IsExtEnabled(extensions.vk_khr_maintenance2)) { if (pCreateInfo->flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT) { if (!vkuFormatIsCompressed(pCreateInfo->format)) { skip |= LogError( @@ -556,7 +556,7 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate skip |= ValidateImageAlignmentControlCreateInfo(*pCreateInfo, create_info_loc); // Check compatibility with VK_KHR_portability_subset - if (IsExtEnabled(device_extensions.vk_khr_portability_subset)) { + if (IsExtEnabled(extensions.vk_khr_portability_subset)) { if (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT & pCreateInfo->flags && VK_FALSE == enabled_features.imageView2DOn3DImage) { skip |= LogError("VUID-VkImageCreateInfo-imageView2DOn3DImage-04459", device, create_info_loc, "(portability error) VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT is not supported."); @@ -966,7 +966,7 @@ bool CoreChecks::PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer LogObjectList objlist(commandBuffer, image); skip |= ValidateMemoryIsBoundToImage(objlist, image_state, image_loc, "VUID-vkCmdClearColorImage-image-00003"); skip |= ValidateCmd(cb_state, error_obj.location); - if (IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (IsExtEnabled(extensions.vk_khr_maintenance1)) { skip |= ValidateImageFormatFeatureFlags(commandBuffer, image_state, VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT, image_loc, "VUID-vkCmdClearColorImage-image-01993"); } @@ -1027,7 +1027,7 @@ bool CoreChecks::ValidateClearDepthStencilValue(VkCommandBuffer commandBuffer, V const Location &loc) const { bool skip = false; - if (!IsExtEnabled(device_extensions.vk_ext_depth_range_unrestricted)) { + if (!IsExtEnabled(extensions.vk_ext_depth_range_unrestricted)) { if (!(clearValue.depth >= 0.0) || !(clearValue.depth <= 1.0)) { skip |= LogError("VUID-VkClearDepthStencilValue-depth-00022", commandBuffer, loc.dot(Field::depth), @@ -1058,7 +1058,7 @@ bool CoreChecks::PreCallValidateCmdClearDepthStencilImage(VkCommandBuffer comman const LogObjectList objlist(commandBuffer, image); skip |= ValidateMemoryIsBoundToImage(objlist, image_state, image_loc, "VUID-vkCmdClearDepthStencilImage-image-00010"); skip |= ValidateCmd(cb_state, error_obj.location); - if (IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (IsExtEnabled(extensions.vk_khr_maintenance1)) { skip |= ValidateImageFormatFeatureFlags(commandBuffer, image_state, VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT, image_loc, "VUID-vkCmdClearDepthStencilImage-image-01994"); } @@ -1682,7 +1682,7 @@ bool CoreChecks::ValidateImageSubresourceRange(const uint32_t image_mip_count, c bool CoreChecks::ValidateCreateImageViewSubresourceRange(const vvl::Image &image_state, bool is_imageview_2d_type, const VkImageSubresourceRange &subresourceRange, const Location &loc) const { - const bool is_khr_maintenance1 = IsExtEnabled(device_extensions.vk_khr_maintenance1); + const bool is_khr_maintenance1 = IsExtEnabled(extensions.vk_khr_maintenance1); const bool is_2d_compatible = image_state.create_info.flags & (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT | VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT); const bool is_image_slicable = (image_state.create_info.imageType == VK_IMAGE_TYPE_3D) && is_2d_compatible; @@ -1960,7 +1960,7 @@ bool CoreChecks::PreCallValidateCreateImageView(VkDevice device, const VkImageVi // If there's a chained VkImageViewUsageCreateInfo struct, modify image_usage to match VkImageUsageFlags image_usage = image_state.create_info.usage; if (const auto chained_ivuci_struct = vku::FindStructInPNextChain(pCreateInfo->pNext); chained_ivuci_struct) { - if (IsExtEnabled(device_extensions.vk_khr_maintenance2)) { + if (IsExtEnabled(extensions.vk_khr_maintenance2)) { const auto image_stencil_struct = vku::FindStructInPNextChain(image_state.create_info.pNext); if (image_stencil_struct == nullptr) { @@ -2155,10 +2155,10 @@ bool CoreChecks::PreCallValidateCreateImageView(VkDevice device, const VkImageVi } break; case VK_IMAGE_TYPE_3D: - if (IsExtEnabled(device_extensions.vk_khr_maintenance1)) { + if (IsExtEnabled(extensions.vk_khr_maintenance1)) { if (view_type != VK_IMAGE_VIEW_TYPE_3D) { if ((view_type == VK_IMAGE_VIEW_TYPE_2D || view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY)) { - if (IsExtEnabled(device_extensions.vk_ext_image_2d_view_of_3d)) { + if (IsExtEnabled(extensions.vk_ext_image_2d_view_of_3d)) { if (!(image_flags & VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT)) { if (view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY) { skip |= LogError( @@ -2322,8 +2322,8 @@ bool CoreChecks::PreCallValidateCreateImageView(VkDevice device, const VkImageVi string_VkFormat(view_format), string_LevelCount(image_state.create_info, pCreateInfo->subresourceRange).c_str()); } - if (normalized_subresource_range.layerCount != 1 && (!IsExtEnabled(device_extensions.vk_khr_maintenance6) || - !phys_dev_props_core14.blockTexelViewCompatibleMultipleLayers)) { + if (normalized_subresource_range.layerCount != 1 && + (!IsExtEnabled(extensions.vk_khr_maintenance6) || !phys_dev_props_core14.blockTexelViewCompatibleMultipleLayers)) { skip |= LogError("VUID-VkImageViewCreateInfo-image-09487", pCreateInfo->image, create_info_loc.dot(Field::image), "was created with VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT bit, " "and format (%s) is not compressed, but subresourcesRange.layerCount is %s (instead of 1).", @@ -2356,7 +2356,7 @@ bool CoreChecks::PreCallValidateCreateImageView(VkDevice device, const VkImageVi string_VkImageViewCreateFlags(pCreateInfo->flags).c_str()); } } - if (IsExtEnabled(device_extensions.vk_ext_fragment_density_map2)) { + if (IsExtEnabled(extensions.vk_ext_fragment_density_map2)) { if ((image_flags & VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT) && (image_usage & VK_IMAGE_USAGE_SAMPLED_BIT) && (normalized_subresource_range.layerCount > phys_dev_ext_props.fragment_density_map2_props.maxSubsampledArrayLayers)) { skip |= LogError("VUID-VkImageViewCreateInfo-image-03569", pCreateInfo->image, create_info_loc.dot(Field::image), @@ -2378,7 +2378,7 @@ bool CoreChecks::PreCallValidateCreateImageView(VkDevice device, const VkImageVi } } - if (IsExtEnabled(device_extensions.vk_khr_portability_subset)) { + if (IsExtEnabled(extensions.vk_khr_portability_subset)) { // If swizzling is disabled, make sure it isn't used // NOTE: as of spec version 1.2.183, VUID 04465 states: "all elements of components _must_ be // VK_COMPONENT_SWIZZLE_IDENTITY." diff --git a/layers/core_checks/cc_image_layout.cpp b/layers/core_checks/cc_image_layout.cpp index 50a211b1936..8d82ed240a4 100644 --- a/layers/core_checks/cc_image_layout.cpp +++ b/layers/core_checks/cc_image_layout.cpp @@ -307,7 +307,7 @@ bool CoreChecks::ValidateLayoutVsAttachmentDescription(const VkImageLayout first skip |= LogError("VUID-VkRenderPassCreateInfo2-pAttachments-02522", device, layout_loc, "(%s) is an invalid for pAttachments[%d] (first attachment to have LOAD_OP_CLEAR).", string_VkImageLayout(first_layout), attachment); - } else if ((use_rp2 == false) && IsExtEnabled(device_extensions.vk_khr_maintenance2) && + } else if ((use_rp2 == false) && IsExtEnabled(extensions.vk_khr_maintenance2) && (first_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL)) { skip |= LogError("VUID-VkRenderPassCreateInfo-pAttachments-01566", device, layout_loc, "(%s) is an invalid for pAttachments[%d] (first attachment to have LOAD_OP_CLEAR).", @@ -328,7 +328,7 @@ bool CoreChecks::ValidateLayoutVsAttachmentDescription(const VkImageLayout first skip |= LogError("VUID-VkRenderPassCreateInfo2-pAttachments-02523", device, layout_loc, "(%s) is an invalid for pAttachments[%d] (first attachment to have LOAD_OP_CLEAR).", string_VkImageLayout(first_layout), attachment); - } else if ((use_rp2 == false) && IsExtEnabled(device_extensions.vk_khr_maintenance2) && + } else if ((use_rp2 == false) && IsExtEnabled(extensions.vk_khr_maintenance2) && (first_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL)) { skip |= LogError("VUID-VkRenderPassCreateInfo-pAttachments-01567", device, layout_loc, "(%s) is an invalid for pAttachments[%d] (first attachment to have LOAD_OP_CLEAR).", diff --git a/layers/core_checks/cc_pipeline_graphics.cpp b/layers/core_checks/cc_pipeline_graphics.cpp index edb90541586..d10a5b1dc9b 100644 --- a/layers/core_checks/cc_pipeline_graphics.cpp +++ b/layers/core_checks/cc_pipeline_graphics.cpp @@ -98,7 +98,7 @@ bool CoreChecks::ValidateGraphicsPipeline(const vvl::Pipeline &pipeline, const v // Check for portability errors // Issue raised in https://gitlab.khronos.org/vulkan/vulkan/-/issues/3436 // The combination of GPL/DynamicRendering and Portability has spec issues that need to be clarified - if (IsExtEnabled(device_extensions.vk_khr_portability_subset) && !pipeline.IsGraphicsLibrary()) { + if (IsExtEnabled(extensions.vk_khr_portability_subset) && !pipeline.IsGraphicsLibrary()) { skip |= ValidateGraphicsPipelinePortability(pipeline, create_info_loc); } } @@ -461,7 +461,7 @@ bool CoreChecks::ValidateGraphicsPipelineVertexInputState(const vvl::Pipeline &p } const bool ignore_vertex_input_state = pipeline.IsDynamic(CB_DYNAMIC_STATE_VERTEX_INPUT_EXT); - const bool ignore_input_assembly_state = IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) && + const bool ignore_input_assembly_state = IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) && pipeline.IsDynamic(CB_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE) && pipeline.IsDynamic(CB_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY) && phys_dev_ext_props.extended_dynamic_state3_props.dynamicPrimitiveTopologyUnrestricted; @@ -1450,7 +1450,7 @@ bool CoreChecks::ValidateGraphicsPipelineTessellationState(const vvl::Pipeline & if (pipeline.OwnsSubState(pipeline.pre_raster_state) && (pipeline.create_info_shaders & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT)) { if (!pipeline.TessellationState() && (!pipeline.IsDynamic(CB_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT) || - !IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3))) { + !IsExtEnabled(extensions.vk_ext_extended_dynamic_state3))) { skip |= LogError("VUID-VkGraphicsPipelineCreateInfo-pStages-09022", device, create_info_loc.dot(Field::pStages), "includes a tessellation control shader stage, but pTessellationState is NULL."); } @@ -1954,7 +1954,7 @@ bool CoreChecks::ValidateGraphicsPipelineRenderPassRasterization(const vvl::Pipe const Location ds_loc = create_info_loc.dot(Field::pDepthStencilState); const auto ds_state = pipeline.DepthStencilState(); if (!ds_state) { - if (!pipeline.IsDepthStencilStateDynamic() || !IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3)) { + if (!pipeline.IsDepthStencilStateDynamic() || !IsExtEnabled(extensions.vk_ext_extended_dynamic_state3)) { skip |= LogError("VUID-VkGraphicsPipelineCreateInfo-renderPass-09028", rp_state.Handle(), ds_loc, "is NULL when rasterization is enabled " "and subpass %" PRIu32 " uses a depth/stencil attachment.", @@ -1968,7 +1968,7 @@ bool CoreChecks::ValidateGraphicsPipelineRenderPassRasterization(const vvl::Pipe ds_loc.dot(Field::depthBoundsTestEnable), "is VK_TRUE, but depthBounds feature was not enabled."); } - if (!IsExtEnabled(device_extensions.vk_ext_depth_range_unrestricted) && + if (!IsExtEnabled(extensions.vk_ext_depth_range_unrestricted) && !pipeline.IsDynamic(CB_DYNAMIC_STATE_DEPTH_BOUNDS)) { const float minDepthBounds = ds_state->minDepthBounds; const float maxDepthBounds = ds_state->maxDepthBounds; @@ -2053,9 +2053,8 @@ bool CoreChecks::ValidateGraphicsPipelineMultisampleState(const vvl::Pipeline &p if (!pipeline.IsDynamic(CB_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT)) { const uint32_t raster_samples = SampleCountSize(multisample_state->rasterizationSamples); - if (!(IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples) || - IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples) || - (enabled_features.multisampledRenderToSingleSampled))) { + if (!(IsExtEnabled(extensions.vk_amd_mixed_attachment_samples) || + IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples) || (enabled_features.multisampledRenderToSingleSampled))) { uint32_t subpass_num_samples = 0; accum_color_samples(subpass_num_samples); @@ -2077,7 +2076,7 @@ bool CoreChecks::ValidateGraphicsPipelineMultisampleState(const vvl::Pipeline &p } } - if (IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples)) { + if (IsExtEnabled(extensions.vk_amd_mixed_attachment_samples)) { VkSampleCountFlagBits max_sample_count = static_cast(0); for (uint32_t i = 0; i < subpass_desc.colorAttachmentCount; ++i) { if (subpass_desc.pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) { @@ -2098,7 +2097,7 @@ bool CoreChecks::ValidateGraphicsPipelineMultisampleState(const vvl::Pipeline &p } } - if (IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples)) { + if (IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples)) { uint32_t subpass_color_samples = 0; accum_color_samples(subpass_color_samples); @@ -2158,7 +2157,7 @@ bool CoreChecks::ValidateGraphicsPipelineMultisampleState(const vvl::Pipeline &p } } - if (IsExtEnabled(device_extensions.vk_nv_coverage_reduction_mode)) { + if (IsExtEnabled(extensions.vk_nv_coverage_reduction_mode)) { uint32_t subpass_color_samples = 0; uint32_t subpass_depth_samples = 0; @@ -2323,7 +2322,7 @@ bool CoreChecks::ValidateGraphicsPipelineMultisampleState(const vvl::Pipeline &p } } - if (IsExtEnabled(device_extensions.vk_qcom_render_pass_shader_resolve)) { + if (IsExtEnabled(extensions.vk_qcom_render_pass_shader_resolve)) { uint32_t subpass_input_attachment_samples = 0; for (uint32_t i = 0; i < subpass_desc.inputAttachmentCount; i++) { @@ -2365,7 +2364,7 @@ bool CoreChecks::ValidateGraphicsPipelineNullState(const vvl::Pipeline &pipeline if (null_rp) { if (!pipeline.DepthStencilState()) { if (pipeline.fragment_shader_state && !pipeline.fragment_output_state) { - if (!pipeline.IsDepthStencilStateDynamic() || !IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3)) { + if (!pipeline.IsDepthStencilStateDynamic() || !IsExtEnabled(extensions.vk_ext_extended_dynamic_state3)) { skip |= LogError("VUID-VkGraphicsPipelineCreateInfo-renderPass-09035", device, create_info_loc.dot(Field::pDepthStencilState), "is NULL."); } @@ -2373,7 +2372,7 @@ bool CoreChecks::ValidateGraphicsPipelineNullState(const vvl::Pipeline &pipeline } } - if (IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library)) { + if (IsExtEnabled(extensions.vk_ext_graphics_pipeline_library)) { if (pipeline.OwnsSubState(pipeline.fragment_output_state) && !pipeline.MultisampleState()) { // if VK_KHR_dynamic_rendering is not enabled, can be null renderpass if using GPL if (!null_rp) { @@ -2399,7 +2398,7 @@ bool CoreChecks::ValidateGraphicsPipelineNullState(const vvl::Pipeline &pipeline if (!pipeline.RasterizationState()) { if (!pipeline_ci.pRasterizationState && pipeline.OwnsSubState(pipeline.pre_raster_state)) { - if (!IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3) || + if (!IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || !pipeline.IsDynamic(CB_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT) || !pipeline.IsDynamic(CB_DYNAMIC_STATE_POLYGON_MODE_EXT) || !pipeline.IsDynamic(CB_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE) || @@ -3030,7 +3029,7 @@ bool CoreChecks::ValidateGraphicsPipelineDynamicRendering(const vvl::Pipeline &p ((rendering_struct->depthAttachmentFormat != VK_FORMAT_UNDEFINED) || (rendering_struct->stencilAttachmentFormat != VK_FORMAT_UNDEFINED)) && !pipeline.DepthStencilState() && !pipeline.IsDepthStencilStateDynamic() && - !IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3)) { + !IsExtEnabled(extensions.vk_ext_extended_dynamic_state3)) { skip |= LogError( "VUID-VkGraphicsPipelineCreateInfo-renderPass-09033", device, create_info_loc.dot(Field::pDepthStencilState), "is NULL, but %s is %s and stencilAttachmentFormat is %s.", @@ -4309,9 +4308,8 @@ bool CoreChecks::ValidateDrawPipelineRasterizationState(const LastBound &last_bo } const VkSampleCountFlagBits rasterization_samples = last_bound_state.GetRasterizationSamples(); - if (!(IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples) || - IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples) || - enabled_features.multisampledRenderToSingleSampled) && + if (!(IsExtEnabled(extensions.vk_amd_mixed_attachment_samples) || + IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples) || enabled_features.multisampledRenderToSingleSampled) && ((subpass_num_samples & static_cast(rasterization_samples)) != subpass_num_samples)) { const LogObjectList objlist(cb_state.Handle(), pipeline.Handle(), cb_state.activeRenderPass->Handle()); skip |= LogError(vuid.msrtss_rasterization_samples_07284, objlist, vuid.loc(), diff --git a/layers/core_checks/cc_query.cpp b/layers/core_checks/cc_query.cpp index cd5d765d8d9..d05cb002c58 100644 --- a/layers/core_checks/cc_query.cpp +++ b/layers/core_checks/cc_query.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. * Modifications Copyright (C) 2020-2022 Advanced Micro Devices, Inc. All rights reserved. * @@ -1385,7 +1385,7 @@ bool CoreChecks::PreCallValidateCmdBeginQueryIndexedEXT(VkCommandBuffer commandB index); } } else if (query_pool_ci.queryType == VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT) { - if (IsExtEnabled(device_extensions.vk_ext_transform_feedback) && + if (IsExtEnabled(extensions.vk_ext_transform_feedback) && (index >= phys_dev_ext_props.transform_feedback_props.maxTransformFeedbackStreams)) { skip |= LogError( "VUID-vkCmdBeginQueryIndexedEXT-queryType-02339", commandBuffer, error_obj.location.dot(Field::index), diff --git a/layers/core_checks/cc_render_pass.cpp b/layers/core_checks/cc_render_pass.cpp index 5ae0790b5f2..302a4ef7078 100644 --- a/layers/core_checks/cc_render_pass.cpp +++ b/layers/core_checks/cc_render_pass.cpp @@ -1921,8 +1921,8 @@ bool CoreChecks::ValidateRenderpassAttachmentUsage(const VkRenderPassCreateInfo2 } } if (last_sample_count_attachment != VK_ATTACHMENT_UNUSED) { - if (!(IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples) || - IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples) || + if (!(IsExtEnabled(extensions.vk_amd_mixed_attachment_samples) || + IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples) || (enabled_features.multisampledRenderToSingleSampled && use_rp2))) { VkSampleCountFlagBits last_sample_count = pCreateInfo->pAttachments[subpass.pColorAttachments[last_sample_count_attachment].attachment] @@ -1951,7 +1951,7 @@ bool CoreChecks::ValidateRenderpassAttachmentUsage(const VkRenderPassCreateInfo2 const auto depth_stencil_sample_count = pCreateInfo->pAttachments[subpass.pDepthStencilAttachment->attachment].samples; - if (IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples)) { + if (IsExtEnabled(extensions.vk_amd_mixed_attachment_samples)) { if (current_sample_count > depth_stencil_sample_count) { const char *vuid = use_rp2 ? "VUID-VkSubpassDescription2-None-09456" : "VUID-VkSubpassDescription-None-09431"; @@ -1967,8 +1967,8 @@ bool CoreChecks::ValidateRenderpassAttachmentUsage(const VkRenderPassCreateInfo2 } } - if (!IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples) && - !IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples) && + if (!IsExtEnabled(extensions.vk_amd_mixed_attachment_samples) && + !IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples) && !(use_rp2 && enabled_features.multisampledRenderToSingleSampled) && current_sample_count != depth_stencil_sample_count) { const char *vuid = use_rp2 ? "VUID-VkSubpassDescription2-multisampledRenderToSingleSampled-06872" @@ -2948,9 +2948,8 @@ bool CoreChecks::ValidateRenderingAttachmentInfo(VkCommandBuffer commandBuffer, } if (attachment_info.imageLayout == VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR) { - const char *vuid = IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate) - ? "VUID-VkRenderingAttachmentInfo-imageView-06143" - : "VUID-VkRenderingAttachmentInfo-imageView-06138"; + const char *vuid = IsExtEnabled(extensions.vk_khr_fragment_shading_rate) ? "VUID-VkRenderingAttachmentInfo-imageView-06143" + : "VUID-VkRenderingAttachmentInfo-imageView-06138"; skip |= LogError(vuid, commandBuffer, attachment_loc.dot(Field::imageLayout), "must not be VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR (or the alias " "VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV)"); @@ -3008,7 +3007,7 @@ bool CoreChecks::ValidateRenderingAttachmentInfo(VkCommandBuffer commandBuffer, } if (attachment_info.resolveImageLayout == VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR) { - const char *vuid = IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate) + const char *vuid = IsExtEnabled(extensions.vk_khr_fragment_shading_rate) ? "VUID-VkRenderingAttachmentInfo-imageView-06144" : "VUID-VkRenderingAttachmentInfo-imageView-06139"; skip |= LogError(vuid, commandBuffer, attachment_loc.dot(Field::resolveImageLayout), @@ -3593,8 +3592,7 @@ bool CoreChecks::PreCallValidateCmdBeginRendering(VkCommandBuffer commandBuffer, "must not include VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT in a secondary command buffer."); } - if (!(IsExtEnabled(device_extensions.vk_amd_mixed_attachment_samples) || - IsExtEnabled(device_extensions.vk_nv_framebuffer_mixed_samples) || + if (!(IsExtEnabled(extensions.vk_amd_mixed_attachment_samples) || IsExtEnabled(extensions.vk_nv_framebuffer_mixed_samples) || (enabled_features.multisampledRenderToSingleSampled))) { uint32_t first_sample_count_attachment = VK_ATTACHMENT_UNUSED; for (uint32_t j = 0; j < pRenderingInfo->colorAttachmentCount; ++j) { @@ -4543,8 +4541,7 @@ bool CoreChecks::ValidateFrameBufferAttachments(const VkFramebufferCreateInfo &c "height: %" PRIu32 ", the ceiling value: %" PRIu32 "\n", subresource_range.baseMipLevel, i, i, mip_height, ceiling_height); } - if (view_state->normalized_subresource_range.layerCount != 1 && - !IsExtEnabled(device_extensions.vk_khr_multiview)) { + if (view_state->normalized_subresource_range.layerCount != 1 && !IsExtEnabled(extensions.vk_khr_multiview)) { LogObjectList objlist(create_info.renderPass, image_views[i], ivci.image); skip |= LogError("VUID-VkFramebufferCreateInfo-renderPass-02746", objlist, attachment_loc, "is referenced by " diff --git a/layers/core_checks/cc_shader_interface.cpp b/layers/core_checks/cc_shader_interface.cpp index bfc41e7b5f9..2e5ee060e51 100644 --- a/layers/core_checks/cc_shader_interface.cpp +++ b/layers/core_checks/cc_shader_interface.cpp @@ -345,7 +345,7 @@ bool CoreChecks::ValidateShaderStageInputOutputLimits(const spirv::Module &modul max_output_slot.Describe().c_str(), limits.maxTessellationEvaluationOutputComponents); } // Portability validation - if (IsExtEnabled(device_extensions.vk_khr_portability_subset)) { + if (IsExtEnabled(extensions.vk_khr_portability_subset)) { if (is_iso_lines && (VK_FALSE == enabled_features.tessellationIsolines)) { skip |= LogError("VUID-RuntimeSpirv-tessellationShader-06326", module_state.handle(), loc, "(portability error) SPIR-V (Tessellation evaluation stage)" @@ -452,7 +452,7 @@ bool CoreChecks::ValidateShaderStageInputOutputLimits(const spirv::Module &modul // // This limit was created from Vulkan 1.0, with the move to bindless, this limit has slowly become less relevant, if using // descriptor indexing, the limit should basically be UINT32_MAX - if (stage == VK_SHADER_STAGE_FRAGMENT_BIT && !IsExtEnabled(device_extensions.vk_ext_descriptor_indexing)) { + if (stage == VK_SHADER_STAGE_FRAGMENT_BIT && !IsExtEnabled(extensions.vk_ext_descriptor_indexing)) { // Variables can be aliased, so use Location to mark things as unique vvl::unordered_set color_attachments; for (const auto *variable : entrypoint.user_defined_interface_variables) { diff --git a/layers/core_checks/cc_spirv.cpp b/layers/core_checks/cc_spirv.cpp index eb1fbf0bc8c..ad3b9a83bc9 100644 --- a/layers/core_checks/cc_spirv.cpp +++ b/layers/core_checks/cc_spirv.cpp @@ -733,7 +733,7 @@ bool CoreChecks::ValidateCooperativeMatrix(const spirv::Module &module_state, co m.Describe().c_str(), print_properties().c_str(), print_flexible_properties().c_str()); } } - if (IsExtEnabled(device_extensions.vk_nv_cooperative_matrix2)) { + if (IsExtEnabled(extensions.vk_nv_cooperative_matrix2)) { if (m.rows > phys_dev_ext_props.cooperative_matrix_props2_nv.cooperativeMatrixFlexibleDimensionsMaxDimension || m.cols > phys_dev_ext_props.cooperative_matrix_props2_nv.cooperativeMatrixFlexibleDimensionsMaxDimension) { skip |= LogError( @@ -1210,7 +1210,7 @@ bool CoreChecks::ValidateShaderFloatControl(const spirv::Module &module_state, c bool skip = false; // Need to wrap otherwise phys_dev_props_core12 can be junk - if (!IsExtEnabled(device_extensions.vk_khr_shader_float_controls)) { + if (!IsExtEnabled(extensions.vk_khr_shader_float_controls)) { return skip; } @@ -1417,7 +1417,7 @@ bool CoreChecks::ValidateExecutionModes(const spirv::Module &module_state, const skip |= LogError("VUID-RuntimeSpirv-LocalSizeId-06434", module_state.handle(), loc, "SPIR-V OpExecutionMode LocalSizeId is used but maintenance4 feature was not enabled."); } - if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) { + if (!IsExtEnabled(extensions.vk_khr_maintenance4)) { skip |= LogError("VUID-RuntimeSpirv-LocalSizeId-06434", module_state.handle(), loc, "SPIR-V OpExecutionMode LocalSizeId is used but maintenance4 extension is not enabled and used " "Vulkan api version is 1.2 or less."); @@ -2321,7 +2321,7 @@ bool CoreChecks::ValidateShaderTileImage(const spirv::Module &module_state, cons const Location &loc) const { bool skip = false; - if ((stage != VK_SHADER_STAGE_FRAGMENT_BIT) || !IsExtEnabled(device_extensions.vk_ext_shader_tile_image)) { + if ((stage != VK_SHADER_STAGE_FRAGMENT_BIT) || !IsExtEnabled(extensions.vk_ext_shader_tile_image)) { return skip; } @@ -2419,7 +2419,7 @@ bool CoreChecks::ValidateShaderStage(const ShaderStageState &stage_state, const // If specialization-constant instructions are present in the shader, the specializations should be applied. if (module_state.static_data_.has_specialization_constants) { // setup the call back if the optimizer fails - spv_target_env spirv_environment = PickSpirvEnv(api_version, IsExtEnabled(device_extensions.vk_khr_spirv_1_4)); + spv_target_env spirv_environment = PickSpirvEnv(api_version, IsExtEnabled(extensions.vk_khr_spirv_1_4)); spvtools::Optimizer optimizer(spirv_environment); spvtools::MessageConsumer consumer = [&skip, &module_state, &stage, loc, this]( spv_message_level_t level, const char *source, const spv_position_t &position, @@ -2591,7 +2591,7 @@ bool CoreChecks::ValidateShaderStage(const ShaderStageState &stage_state, const if (enabled_features.primitiveFragmentShadingRate) { skip |= ValidatePrimitiveRateShaderState(module_state, entrypoint, *pipeline, stage, loc); } - if (IsExtEnabled(device_extensions.vk_qcom_render_pass_shader_resolve)) { + if (IsExtEnabled(extensions.vk_qcom_render_pass_shader_resolve)) { skip |= ValidateShaderResolveQCOM(module_state, stage, *pipeline, loc); } skip |= ValidatePointSizeShaderState(module_state, entrypoint, *pipeline, stage, loc); @@ -2747,7 +2747,7 @@ bool CoreChecks::RunSpirvValidation(spv_const_binary_t &binary, const Location & // Use SPIRV-Tools validator to try and catch any issues with the module itself. If specialization constants are present, // the default values will be used during validation. - spv_target_env spirv_environment = PickSpirvEnv(api_version, IsExtEnabled(device_extensions.vk_khr_spirv_1_4)); + spv_target_env spirv_environment = PickSpirvEnv(api_version, IsExtEnabled(extensions.vk_khr_spirv_1_4)); spv_context ctx = spvContextCreate(spirv_environment); spv_diagnostic diag = nullptr; const spv_result_t spv_valid = spvValidateWithOptions(ctx, spirv_val_options, &binary, &diag); @@ -2785,7 +2785,7 @@ bool CoreChecks::ValidateShaderModuleCreateInfo(const VkShaderModuleCreateInfo & if (!create_info.pCode) { return skip; // will be caught elsewhere } else if (create_info.pCode[0] != spv::MagicNumber) { - if (!IsExtEnabled(device_extensions.vk_nv_glsl_shader)) { + if (!IsExtEnabled(extensions.vk_nv_glsl_shader)) { skip |= LogError("VUID-VkShaderModuleCreateInfo-pCode-07912", device, create_info_loc.dot(Field::pCode), "doesn't point to a SPIR-V module (The first dword is not the SPIR-V MagicNumber 0x07230203)."); } diff --git a/layers/core_checks/cc_synchronization.cpp b/layers/core_checks/cc_synchronization.cpp index cf50bec1340..7afd7b49863 100644 --- a/layers/core_checks/cc_synchronization.cpp +++ b/layers/core_checks/cc_synchronization.cpp @@ -889,7 +889,7 @@ bool CoreChecks::ValidateRenderPassPipelineBarriers(const Location &outer_loc, c bool skip = false; const auto &rp_state = cb_state.activeRenderPass; RenderPassDepState state(*this, "VUID-vkCmdPipelineBarrier-None-07889", cb_state.GetActiveSubpass(), rp_state->VkHandle(), - enabled_features, device_extensions, rp_state->self_dependencies[cb_state.GetActiveSubpass()], + enabled_features, extensions, rp_state->self_dependencies[cb_state.GetActiveSubpass()], rp_state->create_info.pDependencies); if (state.self_dependencies.empty()) { skip |= LogError("VUID-vkCmdPipelineBarrier-None-07889", state.rp_handle, outer_loc, @@ -949,7 +949,7 @@ bool CoreChecks::ValidateRenderPassPipelineBarriers(const Location &outer_loc, c return skip; } RenderPassDepState state(*this, "VUID-vkCmdPipelineBarrier2-None-07889", cb_state.GetActiveSubpass(), rp_state->VkHandle(), - enabled_features, device_extensions, rp_state->self_dependencies[cb_state.GetActiveSubpass()], + enabled_features, extensions, rp_state->self_dependencies[cb_state.GetActiveSubpass()], rp_state->create_info.pDependencies); if (state.self_dependencies.empty()) { @@ -1053,11 +1053,11 @@ bool CoreChecks::ValidatePipelineStageFeatureEnables(const LogObjectList &objlis VkPipelineStageFlags2KHR stage_mask) const { bool skip = false; if (!enabled_features.synchronization2 && stage_mask == 0) { - const auto &vuid = sync_vuid_maps::GetBadFeatureVUID(stage_mask_loc, 0, device_extensions); + const auto &vuid = sync_vuid_maps::GetBadFeatureVUID(stage_mask_loc, 0, extensions); skip |= LogError(vuid, objlist, stage_mask_loc, "must not be 0 unless synchronization2 is enabled."); } - auto disabled_stages = sync_utils::DisabledPipelineStages(enabled_features, device_extensions); + auto disabled_stages = sync_utils::DisabledPipelineStages(enabled_features, extensions); auto bad_bits = stage_mask & disabled_stages; if (bad_bits == 0) { return skip; @@ -1065,7 +1065,7 @@ bool CoreChecks::ValidatePipelineStageFeatureEnables(const LogObjectList &objlis for (size_t i = 0; i < sizeof(bad_bits) * 8; i++) { VkPipelineStageFlags2KHR bit = 1ULL << i; if (bit & bad_bits) { - const auto &vuid = sync_vuid_maps::GetBadFeatureVUID(stage_mask_loc, bit, device_extensions); + const auto &vuid = sync_vuid_maps::GetBadFeatureVUID(stage_mask_loc, bit, extensions); skip |= LogError(vuid, objlist, stage_mask_loc, "includes %s when the device does not have %s feature enabled.", sync_utils::StringPipelineStageFlags(bit).c_str(), sync_vuid_maps::GetFeatureNameMap().at(bit).c_str()); @@ -1097,7 +1097,7 @@ bool CoreChecks::ValidateAccessMask(const LogObjectList &objlist, const Location const auto illegal_pipeline_stages = AllVkPipelineShaderStageBits2 & ~VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR; if (stage_mask & illegal_pipeline_stages) { // Select right vuid based on enabled extensions - const auto &vuid = sync_vuid_maps::GetAccessMaskRayQueryVUIDSelector(access_mask_loc, device_extensions); + const auto &vuid = sync_vuid_maps::GetAccessMaskRayQueryVUIDSelector(access_mask_loc, extensions); skip |= LogError(vuid, objlist, stage_mask_loc, "contains pipeline stages %s.", sync_utils::StringPipelineStageFlags(stage_mask).c_str()); } @@ -2251,7 +2251,7 @@ bool CoreChecks::ValidateBarrierQueueFamilies(const LogObjectList &objects, cons const auto src_queue_family = barrier.srcQueueFamilyIndex; const auto dst_queue_family = barrier.dstQueueFamilyIndex; - if (!IsExtEnabled(device_extensions.vk_khr_external_memory)) { + if (!IsExtEnabled(extensions.vk_khr_external_memory)) { if (src_queue_family == VK_QUEUE_FAMILY_EXTERNAL) { skip |= log_queue_family_error(QueueError::kSrcNoExternalExt, src_queue_family, "srcQueueFamilyIndex"); } else if (dst_queue_family == VK_QUEUE_FAMILY_EXTERNAL) { @@ -2277,7 +2277,7 @@ bool CoreChecks::ValidateBarrierQueueFamilies(const LogObjectList &objects, cons } } - if (!IsExtEnabled(device_extensions.vk_ext_queue_family_foreign)) { + if (!IsExtEnabled(extensions.vk_ext_queue_family_foreign)) { if (src_queue_family == VK_QUEUE_FAMILY_FOREIGN_EXT) { skip |= log_queue_family_error(QueueError::kSrcNoForeignExt, src_queue_family, "srcQueueFamilyIndex"); } else if (dst_queue_family == VK_QUEUE_FAMILY_FOREIGN_EXT) { diff --git a/layers/core_checks/cc_wsi.cpp b/layers/core_checks/cc_wsi.cpp index cd6bb193e00..5c789307f08 100644 --- a/layers/core_checks/cc_wsi.cpp +++ b/layers/core_checks/cc_wsi.cpp @@ -315,7 +315,7 @@ bool CoreChecks::ValidateCreateSwapchain(const VkSwapchainCreateInfoKHR &create_ // All physical devices and queue families are required to be able to present to any native window on Android; require the // application to have established support on any other platform. - if (!IsExtEnabled(instance_extensions.vk_khr_android_surface)) { + if (!IsExtEnabled(extensions.vk_khr_android_surface)) { // restrict search only to queue families of VkDeviceQueueCreateInfos, not the whole physical device const bool is_supported = AnyOf([this, surface_state](const vvl::Queue &queue_state) { return surface_state->GetQueueSupport(physical_device, queue_state.queue_family_index); @@ -355,7 +355,7 @@ bool CoreChecks::ValidateCreateSwapchain(const VkSwapchainCreateInfoKHR &create_ full_screen_info_copy.pNext = surface_info_pnext; surface_info_pnext = &full_screen_info_copy; - if (IsExtEnabled(device_extensions.vk_khr_win32_surface)) { + if (IsExtEnabled(extensions.vk_khr_win32_surface)) { const auto *win32_full_screen_info = vku::FindStructInPNextChain(create_info.pNext); if (!win32_full_screen_info) { @@ -476,9 +476,9 @@ bool CoreChecks::ValidateCreateSwapchain(const VkSwapchainCreateInfoKHR &create_ vvl::span formats{}; if (surface_state) { - formats = surface_state->GetFormats(IsExtEnabled(instance_extensions.vk_khr_get_surface_capabilities2), + formats = surface_state->GetFormats(IsExtEnabled(extensions.vk_khr_get_surface_capabilities2), physical_device_state->VkHandle(), surface_info_pnext, create_info_loc, this); - } else if (IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + } else if (IsExtEnabled(extensions.vk_google_surfaceless_query)) { formats = physical_device_state->surfaceless_query_state.formats; } for (const auto &format : formats) { @@ -514,7 +514,7 @@ bool CoreChecks::ValidateCreateSwapchain(const VkSwapchainCreateInfoKHR &create_ std::vector present_modes{}; if (surface_state) { present_modes = surface_state->GetPresentModes(physical_device, create_info_loc, this); - } else if (IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + } else if (IsExtEnabled(extensions.vk_google_surfaceless_query)) { present_modes = physical_device_state->surfaceless_query_state.present_modes; } @@ -528,7 +528,7 @@ bool CoreChecks::ValidateCreateSwapchain(const VkSwapchainCreateInfoKHR &create_ ss.str().c_str()); } - if (IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) { + if (IsExtEnabled(extensions.vk_ext_swapchain_maintenance1)) { skip |= ValidateSwapchainPresentModesCreateInfo(present_mode, create_info_loc, create_info, present_modes, surface_state); skip |= ValidateSwapchainPresentScalingCreateInfo(present_mode, create_info_loc, surface_caps, create_info, surface_state); } @@ -829,9 +829,8 @@ bool CoreChecks::PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentIn std::vector layouts; if (FindLayouts(*image_state, layouts)) { for (auto layout : layouts) { - if ((layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) && - (!IsExtEnabled(device_extensions.vk_khr_shared_presentable_image) || - (layout != VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR))) { + if ((layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR) && (!IsExtEnabled(extensions.vk_khr_shared_presentable_image) || + (layout != VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR))) { skip |= LogError("VUID-VkPresentInfoKHR-pImageIndices-01430", queue, swapchain_loc, "images passed to present must be in layout " "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or " @@ -861,7 +860,7 @@ bool CoreChecks::PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentIn } // All physical devices and queue families are required to be able to present to any native window on Android - if (!IsExtEnabled(instance_extensions.vk_khr_android_surface)) { + if (!IsExtEnabled(extensions.vk_khr_android_surface)) { auto surface_state = Get(swapchain_data->create_info.surface); if (surface_state && !surface_state->GetQueueSupport(physical_device, queue_state->queue_family_index)) { skip |= LogError("VUID-vkQueuePresentKHR-pSwapchains-01292", pPresentInfo->pSwapchains[i], swapchain_loc, @@ -1140,7 +1139,7 @@ bool CoreChecks::ValidateAcquireNextImage(VkDevice device, VkSwapchainKHR swapch VkSurfaceCapabilitiesKHR surface_caps{}; if (swapchain_data->surface) { surface_caps = swapchain_data->surface->GetSurfaceCapabilities(physical_device, nullptr); - } else if (IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + } else if (IsExtEnabled(extensions.vk_google_surfaceless_query)) { surface_caps = physical_device_state->surfaceless_query_state.capabilities.surfaceCapabilities; } auto min_image_count = surface_caps.minImageCount; @@ -1558,7 +1557,7 @@ bool CoreChecks::PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysi const auto surface_state = Get(pSurfaceInfo->surface); ASSERT_AND_RETURN_SKIP(surface_state); - if (IsExtEnabled(device_extensions.vk_ext_surface_maintenance1)) { + if (IsExtEnabled(extensions.vk_ext_surface_maintenance1)) { const auto *surface_present_mode = vku::FindStructInPNextChain(pSurfaceInfo->pNext); if (surface_present_mode) { VkPresentModeKHR present_mode = surface_present_mode->presentMode; @@ -1578,7 +1577,7 @@ bool CoreChecks::PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysi } #if defined(VK_USE_PLATFORM_WIN32_KHR) - if (IsExtEnabled(device_extensions.vk_khr_win32_surface) && IsExtEnabled(device_extensions.vk_ext_full_screen_exclusive)) { + if (IsExtEnabled(extensions.vk_khr_win32_surface) && IsExtEnabled(extensions.vk_ext_full_screen_exclusive)) { if (const auto *full_screen_info = vku::FindStructInPNextChain(pSurfaceInfo->pNext); full_screen_info && full_screen_info->fullScreenExclusive == VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT) { if (const auto *win32_full_screen_info = diff --git a/layers/drawdispatch/descriptor_validator.cpp b/layers/drawdispatch/descriptor_validator.cpp index b7b4fd9c84e..97effead27a 100644 --- a/layers/drawdispatch/descriptor_validator.cpp +++ b/layers/drawdispatch/descriptor_validator.cpp @@ -677,7 +677,7 @@ bool DescriptorValidator::ValidateDescriptor(const spirv::ResourceInterfaceVaria string_VkFormat(image_view_state->create_info.format)); } - if (IsExtEnabled(dev_state.device_extensions.vk_ext_filter_cubic)) { + if (IsExtEnabled(dev_state.extensions.vk_ext_filter_cubic)) { const auto reduction_mode_info = vku::FindStructInPNextChain(sampler_state->create_info.pNext); if (reduction_mode_info && @@ -709,7 +709,7 @@ bool DescriptorValidator::ValidateDescriptor(const spirv::ResourceInterfaceVaria } } - if (IsExtEnabled(dev_state.device_extensions.vk_img_filter_cubic)) { + if (IsExtEnabled(dev_state.extensions.vk_img_filter_cubic)) { if (image_view_state->create_info.viewType == VK_IMAGE_VIEW_TYPE_3D || image_view_state->create_info.viewType == VK_IMAGE_VIEW_TYPE_CUBE || image_view_state->create_info.viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) { @@ -1094,4 +1094,4 @@ bool DescriptorValidator::ValidateDescriptor(const spirv::ResourceInterfaceVaria descriptor.GetSamplerState()); } -} // namespace vvl \ No newline at end of file +} // namespace vvl diff --git a/layers/gpuav/core/gpuav_setup.cpp b/layers/gpuav/core/gpuav_setup.cpp index cb67f0c7391..8d00fceddb3 100644 --- a/layers/gpuav/core/gpuav_setup.cpp +++ b/layers/gpuav/core/gpuav_setup.cpp @@ -565,9 +565,9 @@ void Validator::InitSettings(const Location &loc) { } if (shader_instrumentation.buffer_device_address) { - const bool bda_validation_possible = ((IsExtEnabled(device_extensions.vk_ext_buffer_device_address) || - IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) && - enabled_features.shaderInt64 && enabled_features.bufferDeviceAddress); + const bool bda_validation_possible = + ((IsExtEnabled(extensions.vk_ext_buffer_device_address) || IsExtEnabled(extensions.vk_khr_buffer_device_address)) && + enabled_features.shaderInt64 && enabled_features.bufferDeviceAddress); if (!bda_validation_possible) { shader_instrumentation.buffer_device_address = false; if (!enabled_features.shaderInt64) { @@ -603,7 +603,7 @@ void Validator::InitSettings(const Location &loc) { } } - if (IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) { + if (IsExtEnabled(extensions.vk_ext_descriptor_buffer)) { InternalWarning( device, loc, "VK_EXT_descriptor_buffer is enabled, but GPU-AV does not currently support validation of descriptor buffers. " diff --git a/layers/gpuav/instrumentation/gpuav_shader_instrumentor.cpp b/layers/gpuav/instrumentation/gpuav_shader_instrumentor.cpp index e535feef57f..dfbb44ff5e2 100644 --- a/layers/gpuav/instrumentation/gpuav_shader_instrumentor.cpp +++ b/layers/gpuav/instrumentation/gpuav_shader_instrumentor.cpp @@ -1200,7 +1200,7 @@ bool GpuShaderInstrumentor::InstrumentShader(const vvl::span &in module_settings.output_buffer_descriptor_set = instrumentation_desc_set_bind_index_; module_settings.print_debug_info = gpuav_settings.debug_print_instrumentation_info; module_settings.max_instrumentations_count = gpuav_settings.debug_max_instrumentations_count; - module_settings.support_non_semantic_info = IsExtEnabled(device_extensions.vk_khr_shader_non_semantic_info); + module_settings.support_non_semantic_info = IsExtEnabled(extensions.vk_khr_shader_non_semantic_info); module_settings.has_bindless_descriptors = instrumentation_dsl.has_bindless_descriptors; spirv::Module module(input_spirv, debug_report, module_settings, enabled_features, @@ -1269,12 +1269,12 @@ bool GpuShaderInstrumentor::InstrumentShader(const vvl::span &in static_cast(out_instrumented_spirv.size() * sizeof(uint32_t))); } - spv_target_env target_env = PickSpirvEnv(api_version, IsExtEnabled(device_extensions.vk_khr_spirv_1_4)); + spv_target_env target_env = PickSpirvEnv(api_version, IsExtEnabled(extensions.vk_khr_spirv_1_4)); // (Maybe) validate the instrumented and linked shader if (gpuav_settings.debug_validate_instrumented_shaders) { std::string spirv_val_error; - if (!GpuValidateShader(out_instrumented_spirv, device_extensions.vk_khr_relaxed_block_layout, - device_extensions.vk_ext_scalar_block_layout, target_env, spirv_val_error)) { + if (!GpuValidateShader(out_instrumented_spirv, extensions.vk_khr_relaxed_block_layout, + extensions.vk_ext_scalar_block_layout, target_env, spirv_val_error)) { std::ostringstream strm; strm << "Instrumented shader (id " << unique_shader_id << ") is invalid, spirv-val error:\n" << spirv_val_error << " Proceeding with non instrumented shader."; diff --git a/layers/gpuav/validation_cmd/gpuav_copy_buffer_to_image.cpp b/layers/gpuav/validation_cmd/gpuav_copy_buffer_to_image.cpp index ed43e1cfd32..7d2b5f6f6a6 100644 --- a/layers/gpuav/validation_cmd/gpuav_copy_buffer_to_image.cpp +++ b/layers/gpuav/validation_cmd/gpuav_copy_buffer_to_image.cpp @@ -1,6 +1,6 @@ -/* Copyright (c) 2018-2024 The Khronos Group Inc. - * Copyright (c) 2018-2024 Valve Corporation - * Copyright (c) 2018-2024 LunarG, Inc. +/* Copyright (c) 2018-2025 The Khronos Group Inc. + * Copyright (c) 2018-2025 Valve Corporation + * Copyright (c) 2018-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. @@ -141,7 +141,7 @@ void InsertCopyBufferToImageValidation(Validator &gpuav, const Location &loc, Co } // No need to perform validation if VK_EXT_depth_range_unrestricted is enabled - if (IsExtEnabled(gpuav.device_extensions.vk_ext_depth_range_unrestricted)) { + if (IsExtEnabled(gpuav.extensions.vk_ext_depth_range_unrestricted)) { return; } diff --git a/layers/state_tracker/image_state.cpp b/layers/state_tracker/image_state.cpp index 7c4e083e93a..c02077e2f9e 100644 --- a/layers/state_tracker/image_state.cpp +++ b/layers/state_tracker/image_state.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. * Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. * Modifications Copyright (C) 2022 RasterGrid Kft. @@ -116,7 +116,7 @@ static vvl::Image::MemoryReqs GetMemoryRequirements(const ValidationStateTracker VkMemoryRequirements2 mem_reqs2 = vku::InitStructHelper(); image_plane_req.planeAspect = aspects[i]; - switch (dev_data.device_extensions.vk_khr_get_memory_requirements2) { + switch (dev_data.extensions.vk_khr_get_memory_requirements2) { case kEnabledByApiLevel: DispatchGetImageMemoryRequirements2(dev_data.device, &mem_req_info2, &mem_reqs2); break; diff --git a/layers/state_tracker/state_tracker.cpp b/layers/state_tracker/state_tracker.cpp index adea009a0cf..0a9a5ee28dc 100644 --- a/layers/state_tracker/state_tracker.cpp +++ b/layers/state_tracker/state_tracker.cpp @@ -233,13 +233,13 @@ void ValidationStateTracker::PostCallRecordCreateImage(VkDevice device, const Vk const RecordObject &record_obj) { if (VK_SUCCESS != record_obj.result) return; VkFormatFeatureFlags2KHR format_features = 0; - if (IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) { + if (IsExtEnabled(extensions.vk_android_external_memory_android_hardware_buffer)) { format_features = GetExternalFormatFeaturesANDROID(pCreateInfo->pNext); } if (format_features == 0) { - format_features = GetImageFormatFeatures(physical_device, has_format_feature2, - IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier), device, *pImage, - pCreateInfo->format, pCreateInfo->tiling); + format_features = + GetImageFormatFeatures(physical_device, has_format_feature2, IsExtEnabled(extensions.vk_ext_image_drm_format_modifier), + device, *pImage, pCreateInfo->format, pCreateInfo->tiling); } Add(CreateImageState(*pImage, pCreateInfo, format_features)); } @@ -457,14 +457,14 @@ void ValidationStateTracker::PostCallRecordCreateImageView(VkDevice device, cons // The ImageView uses same Image's format feature since they share same AHB format_features = image_state->format_features; } else { - format_features = GetImageFormatFeatures(physical_device, has_format_feature2, - IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier), device, - image_state->VkHandle(), pCreateInfo->format, image_state->create_info.tiling); + format_features = + GetImageFormatFeatures(physical_device, has_format_feature2, IsExtEnabled(extensions.vk_ext_image_drm_format_modifier), + device, image_state->VkHandle(), pCreateInfo->format, image_state->create_info.tiling); } // filter_cubic_props is used in CmdDraw validation. But it takes a lot of performance if it does in CmdDraw. VkFilterCubicImageViewImageFormatPropertiesEXT filter_cubic_props = vku::InitStructHelper(); - if (IsExtEnabled(device_extensions.vk_ext_filter_cubic)) { + if (IsExtEnabled(extensions.vk_ext_filter_cubic)) { VkPhysicalDeviceImageViewImageFormatInfoEXT imageview_format_info = vku::InitStructHelper(); imageview_format_info.imageViewType = pCreateInfo->viewType; VkPhysicalDeviceImageFormatInfo2 image_format_info = vku::InitStructHelper(&imageview_format_info); @@ -637,7 +637,7 @@ VkFormatFeatureFlags2KHR ValidationStateTracker::GetPotentialFormatFeatures(VkFo if (has_format_feature2) { VkDrmFormatModifierPropertiesList2EXT fmt_drm_props = vku::InitStructHelper(); auto fmt_props_3 = vku::InitStruct( - IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier) ? &fmt_drm_props : nullptr); + IsExtEnabled(extensions.vk_ext_image_drm_format_modifier) ? &fmt_drm_props : nullptr); VkFormatProperties2 fmt_props_2 = vku::InitStructHelper(&fmt_props_3); DispatchGetPhysicalDeviceFormatProperties2Helper(physical_device, format, &fmt_props_2); @@ -648,7 +648,7 @@ VkFormatFeatureFlags2KHR ValidationStateTracker::GetPotentialFormatFeatures(VkFo format_features |= fmt_props_3.linearTilingFeatures; format_features |= fmt_props_3.optimalTilingFeatures; - if (IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier)) { + if (IsExtEnabled(extensions.vk_ext_image_drm_format_modifier)) { std::vector drm_properties; drm_properties.resize(fmt_drm_props.drmFormatModifierCount); fmt_drm_props.pDrmFormatModifierProperties = drm_properties.data(); @@ -664,7 +664,7 @@ VkFormatFeatureFlags2KHR ValidationStateTracker::GetPotentialFormatFeatures(VkFo format_features |= format_properties.linearTilingFeatures; format_features |= format_properties.optimalTilingFeatures; - if (IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier)) { + if (IsExtEnabled(extensions.vk_ext_image_drm_format_modifier)) { VkDrmFormatModifierPropertiesListEXT fmt_drm_props = vku::InitStructHelper(); VkFormatProperties2 fmt_props_2 = vku::InitStructHelper(&fmt_drm_props); @@ -744,15 +744,15 @@ void ValidationStateTracker::PostCreateDevice(const VkDeviceCreateInfo *pCreateI // requires to have VK_KHR_get_physical_device_properties2 enabled or // Vulkan 1.1 (which made this core). has_format_feature2 = - (api_version >= VK_API_VERSION_1_1 || IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) && + (api_version >= VK_API_VERSION_1_1 || IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) && phys_dev_extensions.find(vvl::Extension::_VK_KHR_format_feature_flags2) != phys_dev_extensions.end(); // feature is required if 1.3 or extension is supported has_robust_image_access = - (api_version >= VK_API_VERSION_1_3 || IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) && + (api_version >= VK_API_VERSION_1_3 || IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) && phys_dev_extensions.find(vvl::Extension::_VK_EXT_image_robustness) != phys_dev_extensions.end(); - if (IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2) && + if (IsExtEnabled(extensions.vk_khr_get_physical_device_properties2) && phys_dev_extensions.find(vvl::Extension::_VK_EXT_robustness2) != phys_dev_extensions.end()) { VkPhysicalDeviceRobustness2FeaturesEXT robustness_2_features = vku::InitStructHelper(); VkPhysicalDeviceFeatures2 features2 = vku::InitStructHelper(&robustness_2_features); @@ -765,7 +765,7 @@ void ValidationStateTracker::PostCreateDevice(const VkDeviceCreateInfo *pCreateI } } - const auto &dev_ext = device_extensions; + const auto &dev_ext = extensions; auto *phys_dev_props = &phys_dev_ext_props; // Vulkan 1.1 and later can get properties from single struct. @@ -1211,7 +1211,7 @@ void ValidationStateTracker::PostCreateDevice(const VkDeviceCreateInfo *pCreateI } // Query queue family extension properties - if (IsExtEnabled(instance_extensions.vk_khr_get_physical_device_properties2)) { + if (IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) { uint32_t queue_family_count = (uint32_t)physical_device_state->queue_family_properties.size(); auto &ext_props = queue_family_ext_props; ext_props.resize(queue_family_count); @@ -3950,8 +3950,8 @@ void ValidationStateTracker::RecordCreateSwapchainState(VkResult result, const V const auto &image_ci = swapchain->image_create_info; for (uint32_t i = 0; i < swapchain_image_count; ++i) { auto format_features = GetImageFormatFeatures(physical_device, has_format_feature2, - IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier), - device, swapchain_images[i], image_ci.format, image_ci.tiling); + IsExtEnabled(extensions.vk_ext_image_drm_format_modifier), device, + swapchain_images[i], image_ci.format, image_ci.tiling); auto image_state = CreateImageState(swapchain_images[i], image_ci.ptr(), swapchain->VkHandle(), i, format_features); image_state->SetSwapchain(swapchain, i); image_state->SetInitialLayoutMap(); @@ -4332,7 +4332,7 @@ void ValidationStateTracker::PostCallRecordGetPhysicalDeviceSurfaceCapabilities2 ASSERT_AND_RETURN(surface_state); if (!pSurfaceInfo->pNext) { surface_state->UpdateCapabilitiesCache(physicalDevice, pSurfaceCapabilities->surfaceCapabilities); - } else if (IsExtEnabled(device_extensions.vk_ext_surface_maintenance1)) { + } else if (IsExtEnabled(extensions.vk_ext_surface_maintenance1)) { const auto *surface_present_mode = vku::FindStructInPNextChain(pSurfaceInfo->pNext); if (surface_present_mode) { // The surface caps caching should take into account pSurfaceInfo->pNext chain structure, @@ -4345,7 +4345,7 @@ void ValidationStateTracker::PostCallRecordGetPhysicalDeviceSurfaceCapabilities2 } } } - } else if (IsExtEnabled(instance_extensions.vk_google_surfaceless_query) && + } else if (IsExtEnabled(extensions.vk_google_surfaceless_query) && vku::FindStructInPNextChain(pSurfaceCapabilities->pNext)) { auto pd_state = Get(physicalDevice); ASSERT_AND_RETURN(pd_state); @@ -4391,7 +4391,7 @@ void ValidationStateTracker::PostCallRecordGetPhysicalDeviceSurfacePresentModesK auto surface_state = Get(surface); ASSERT_AND_RETURN(surface_state); surface_state->SetPresentModes(physicalDevice, vvl::span(pPresentModes, *pPresentModeCount)); - } else if (IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + } else if (IsExtEnabled(extensions.vk_google_surfaceless_query)) { auto pd_state = Get(physicalDevice); ASSERT_AND_RETURN(pd_state); pd_state->surfaceless_query_state.present_modes = @@ -4415,7 +4415,7 @@ void ValidationStateTracker::PostCallRecordGetPhysicalDeviceSurfaceFormatsKHR(Vk auto surface_state = Get(surface); ASSERT_AND_RETURN(surface_state); surface_state->SetFormats(physicalDevice, std::move(formats2)); - } else if (IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + } else if (IsExtEnabled(extensions.vk_google_surfaceless_query)) { auto pd_state = Get(physicalDevice); ASSERT_AND_RETURN(pd_state); pd_state->surfaceless_query_state.formats = std::move(formats2); @@ -4439,7 +4439,7 @@ void ValidationStateTracker::PostCallRecordGetPhysicalDeviceSurfaceFormats2KHR(V formats2[surface_format_index].initialize(&pSurfaceFormats[surface_format_index]); } surface_state->SetFormats(physicalDevice, std::move(formats2)); - } else if (IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + } else if (IsExtEnabled(extensions.vk_google_surfaceless_query)) { auto pd_state = Get(physicalDevice); ASSERT_AND_RETURN(pd_state); pd_state->surfaceless_query_state.formats.clear(); @@ -4691,7 +4691,7 @@ void ValidationStateTracker::PostCallRecordCreateSamplerYcbcrConversion(VkDevice if (pCreateInfo->format != VK_FORMAT_UNDEFINED) { format_features = GetPotentialFormatFeatures(pCreateInfo->format); - } else if (IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) { + } else if (IsExtEnabled(extensions.vk_android_external_memory_android_hardware_buffer)) { // If format is VK_FORMAT_UNDEFINED, format_features will be set by external AHB features format_features = GetExternalFormatFeaturesANDROID(pCreateInfo->pNext); } @@ -5030,7 +5030,7 @@ void ValidationStateTracker::PreCallRecordCreateShaderModule(VkDevice device, co chassis_state.module_state = std::make_shared(pCreateInfo->codeSize, pCreateInfo->pCode, &chassis_state.stateless_data); if (chassis_state.module_state && chassis_state.stateless_data.has_group_decoration) { - spv_target_env spirv_environment = PickSpirvEnv(api_version, IsExtEnabled(device_extensions.vk_khr_spirv_1_4)); + spv_target_env spirv_environment = PickSpirvEnv(api_version, IsExtEnabled(extensions.vk_khr_spirv_1_4)); spvtools::Optimizer optimizer(spirv_environment); optimizer.RegisterPass(spvtools::CreateFlattenDecorationPass()); std::vector optimized_binary; diff --git a/layers/stateless/sl_buffer.cpp b/layers/stateless/sl_buffer.cpp index e64f9441ff7..bee64419eac 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 |= context.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 stateless::Context &context) 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", context.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..cc509e271a0 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 stateless::Context &context) const { + return ValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, context.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 stateless::Context &context) const { + return ValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { + return ValidateCmdPushConstants(commandBuffer, offset, size, context.error_obj.location); } bool StatelessValidation::manual_PreCallValidateCmdPushConstants2(VkCommandBuffer commandBuffer, const VkPushConstantsInfo *pPushConstantsInfo, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 stateless::Context &context) const { + return ValidateWriteDescriptorSet(context, context.error_obj.location, descriptorWriteCount, pDescriptorWrites); } bool StatelessValidation::manual_PreCallValidateCmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo *pPushDescriptorSetInfo, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; - skip |= ValidateWriteDescriptorSet(error_obj.location, pPushDescriptorSetInfo->descriptorWriteCount, + const auto &error_obj = context.error_obj; + skip |= ValidateWriteDescriptorSet(context, error_obj.location, pPushDescriptorSetInfo->descriptorWriteCount, pPushDescriptorSetInfo->pDescriptorWrites); if (pPushDescriptorSetInfo->layout == VK_NULL_HANDLE) { if (!enabled_features.dynamicPipelineLayout) { @@ -603,7 +622,7 @@ bool StatelessValidation::ValidateViewport(const VkViewport &viewport, VkCommand // height bool height_healthy = true; const bool negative_height_enabled = - IsExtEnabled(device_extensions.vk_khr_maintenance1) || IsExtEnabled(device_extensions.vk_amd_negative_viewport_height); + IsExtEnabled(extensions.vk_khr_maintenance1) || IsExtEnabled(extensions.vk_amd_negative_viewport_height); const auto max_h = device_limits.maxViewportDimensions[1]; if (!negative_height_enabled && !(viewport.height > 0.0f)) { @@ -666,7 +685,7 @@ bool StatelessValidation::ValidateViewport(const VkViewport &viewport, VkCommand } } - if (!IsExtEnabled(device_extensions.vk_ext_depth_range_unrestricted)) { + if (!IsExtEnabled(extensions.vk_ext_depth_range_unrestricted)) { // minDepth if (!(viewport.minDepth >= 0.0) || !(viewport.minDepth <= 1.0)) { skip |= LogError("VUID-VkViewport-minDepth-01234", object, loc.dot(Field::minDepth), "is %f.", viewport.minDepth); @@ -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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, 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 |= context.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 |= context.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 |= context.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 |= context.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..236a9ada4d3 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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..f9f0bacbfbb 100644 --- a/layers/stateless/sl_descriptor.cpp +++ b/layers/stateless/sl_descriptor.cpp @@ -135,7 +135,7 @@ bool StatelessValidation::ValidateSamplerFilterMinMax(const VkSamplerCreateInfo create_info_loc.pNext(Struct::VkSamplerReductionModeCreateInfo, Field::reductionMode), "is %s but samplerFilterMinmax feature was not enabled.", string_VkSamplerReductionMode(sampler_reduction->reductionMode)); - } else if ((api_version < VK_API_VERSION_1_2) && !IsExtEnabled(device_extensions.vk_ext_sampler_filter_minmax)) { + } else if ((api_version < VK_API_VERSION_1_2) && !IsExtEnabled(extensions.vk_ext_sampler_filter_minmax)) { // NOTE: technically this VUID is only if the corresponding _feature_ is not enabled, and only if on api_version // >= 1.2, but there doesn't appear to be a similar VUID for when api_version < 1.2 skip |= @@ -162,7 +162,7 @@ bool StatelessValidation::ValidateSamplerFilterMinMax(const VkSamplerCreateInfo // This VU is the one feature difference between the IMG and EXT version of the extension if (create_info.magFilter == VK_FILTER_CUBIC_IMG || create_info.minFilter == VK_FILTER_CUBIC_IMG) { - if (!IsExtEnabled(device_extensions.vk_ext_filter_cubic)) { + if (!IsExtEnabled(extensions.vk_ext_filter_cubic)) { skip |= LogError("VUID-VkSamplerCreateInfo-magFilter-07911", device, create_info_loc.pNext(Struct::VkSamplerReductionModeCreateInfo, Field::reductionMode), "is %s, magFilter is %s and minFilter is %s, but " @@ -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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 |= context.ValidateRangedEnum(create_info_loc.dot(Field::borderColor), vvl::Enum::VkBorderColor, + pCreateInfo->borderColor, "VUID-VkSamplerCreateInfo-addressModeU-01078"); } if (enabled_features.samplerMirrorClampToEdge == VK_FALSE) { @@ -426,7 +427,7 @@ bool StatelessValidation::manual_PreCallValidateCreateSampler(VkDevice device, c } // Checks for the IMG cubic filtering extension - if (IsExtEnabled(device_extensions.vk_img_filter_cubic)) { + if (IsExtEnabled(extensions.vk_img_filter_cubic)) { if ((pCreateInfo->anisotropyEnable == VK_TRUE) && ((pCreateInfo->minFilter == VK_FILTER_CUBIC_IMG) || (pCreateInfo->magFilter == VK_FILTER_CUBIC_IMG))) { skip |= LogError("VUID-VkSamplerCreateInfo-magFilter-01081", device, create_info_loc.dot(Field::anisotropyEnable), @@ -695,8 +696,9 @@ bool StatelessValidation::manual_PreCallValidateCreateDescriptorSetLayout(VkDevi const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { + const auto &error_obj = context.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 context.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 stateless::Context &context, 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 |= context.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 |= context.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 stateless::Context &context) const { + const auto &error_obj = context.error_obj; + return ValidateWriteDescriptorSet(context, 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, *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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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..deba53a2a86 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 stateless::Context& context, + 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(context, pipeline_info, pipeline_info_loc); return skip; } -bool StatelessValidation::ValidateIndirectExecutionSetShaderInfo(const VkIndirectExecutionSetShaderInfoEXT& shader_info, +bool StatelessValidation::ValidateIndirectExecutionSetShaderInfo(const stateless::Context& context, + const VkIndirectExecutionSetShaderInfoEXT& shader_info, const Location& shader_info_loc) const { bool skip = false; @@ -77,30 +79,31 @@ 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 |= context.ValidateStructType(shader_info_loc, &shader_info, VK_STRUCTURE_TYPE_INDIRECT_EXECUTION_SET_SHADER_INFO_EXT, + false, kVUIDUndefined, "VUID-VkIndirectExecutionSetShaderInfoEXT-sType-sType"); + skip |= context.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 |= context.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 |= + context.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 |= context.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 +112,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 stateless::Context& context) const { bool skip = false; + const auto& error_obj = context.error_obj; + if (!enabled_features.deviceGeneratedCommands) { skip |= LogError("VUID-vkCreateIndirectExecutionSetEXT-deviceGeneratedCommands-11013", device, error_obj.location, "deviceGeneratedCommands feature was not enabled."); @@ -125,7 +130,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(context, *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 +151,22 @@ 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(context, *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 stateless::Context& context, 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 |= context.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 +176,16 @@ bool StatelessValidation::ValidateIndirectCommandsPushConstantToken( } return skip; -}; +} -bool StatelessValidation::ValidateIndirectCommandsIndexBufferToken(const VkIndirectCommandsIndexBufferTokenEXT& index_buffer_token, +bool StatelessValidation::ValidateIndirectCommandsIndexBufferToken(const stateless::Context& context, + 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 |= context.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 +195,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 stateless::Context& context, + 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 |= context.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 |= context.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 +222,10 @@ bool StatelessValidation::ValidateIndirectCommandsExecutionSetToken(const VkIndi } return skip; -}; +} -bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const VkIndirectCommandsLayoutTokenEXT& token, +bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const stateless::Context& context, + const VkIndirectCommandsLayoutTokenEXT& token, const Location& token_loc) const { bool skip = false; @@ -228,7 +238,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(context, *token.data.pPushConstant, token.type, data_loc.dot(Field::pPushConstant)); } break; @@ -244,7 +254,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(context, *token.data.pIndexBuffer, data_loc.dot(Field::pIndexBuffer)); } break; case VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT: @@ -253,7 +264,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(context, *token.data.pExecutionSet, + data_loc.dot(Field::pExecutionSet)); } break; default: @@ -308,7 +320,8 @@ bool StatelessValidation::ValidateIndirectCommandsLayoutToken(const VkIndirectCo return skip; } -bool StatelessValidation::ValidateIndirectCommandsLayoutStage(const VkIndirectCommandsLayoutTokenEXT& token, +bool StatelessValidation::ValidateIndirectCommandsLayoutStage(const stateless::Context& context, + 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 +385,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 stateless::Context& context) const { bool skip = false; + const auto& error_obj = context.error_obj; if (!enabled_features.deviceGeneratedCommands) { skip |= LogError("VUID-vkCreateIndirectCommandsLayoutEXT-deviceGeneratedCommands-11089", device, error_obj.location, @@ -447,8 +461,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(context, token, token_loc); + skip |= ValidateIndirectCommandsLayoutStage(context, 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 +515,9 @@ bool StatelessValidation::ValidateGeneratedCommandsInfo(VkCommandBuffer command_ bool StatelessValidation::manual_PreCallValidateCmdPreprocessGeneratedCommandsEXT( VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, VkCommandBuffer stateCommandBuffer, - const ErrorObject& error_obj) const { + const stateless::Context& context) const { bool skip = false; + const auto& error_obj = context.error_obj; if (!enabled_features.deviceGeneratedCommands) { skip |= LogError("VUID-vkCmdPreprocessGeneratedCommandsEXT-deviceGeneratedCommands-11087", device, error_obj.location, "deviceGeneratedCommands feature was not enabled."); @@ -526,8 +541,9 @@ bool StatelessValidation::manual_PreCallValidateCmdPreprocessGeneratedCommandsEX bool StatelessValidation::manual_PreCallValidateCmdExecuteGeneratedCommandsEXT( VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, - const ErrorObject& error_obj) const { + const stateless::Context& context) const { bool skip = false; + const auto& error_obj = context.error_obj; if (!enabled_features.deviceGeneratedCommands) { skip |= LogError("VUID-vkCmdExecuteGeneratedCommandsEXT-deviceGeneratedCommands-11059", device, error_obj.location, @@ -548,4 +564,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..1c0389931f0 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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..dcb13bbdc8f 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 stateless::Context &context) 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 = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { return ValidateExternalFenceHandleType(pGetFdInfo->fence, "VUID-VkFenceGetFdInfoKHR-handleType-01456", - error_obj.location.dot(Field::pGetFdInfo).dot(Field::handleType), pGetFdInfo->handleType, - kFenceFdHandleTypes); + context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) 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), + context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { return ValidateExternalSemaphoreHandleType(info->semaphore, "VUID-VkSemaphoreGetWin32HandleInfoKHR-handleType-01131", - error_obj.location.dot(Field::pGetWin32HandleInfo).dot(Field::handleType), + context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { + const auto &error_obj = context.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..e194828ef0e 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 stateless::Context &context) 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 = context.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 |= context.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..1deeabfe51f 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.ValidateNotZero(pCreateInfo->extent.width == 0, "VUID-VkImageCreateInfo-extent-00944", + create_info_loc.dot(Field::extent).dot(Field::width)); + skip |= context.ValidateNotZero(pCreateInfo->extent.height == 0, "VUID-VkImageCreateInfo-extent-00945", + create_info_loc.dot(Field::extent).dot(Field::height)); + skip |= context.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 |= context.ValidateNotZero(pCreateInfo->mipLevels == 0, "VUID-VkImageCreateInfo-mipLevels-00947", + create_info_loc.dot(Field::mipLevels)); + skip |= context.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(context, *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 stateless::Context &context, + 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 |= context.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) { @@ -719,7 +721,7 @@ bool StatelessValidation::ValidateCreateImageDrmFormatModifiers(const VkImageCre const Location &create_info_loc, std::vector &image_create_drm_format_modifiers) const { bool skip = false; - if (!IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier)) return skip; + if (!IsExtEnabled(extensions.vk_ext_image_drm_format_modifier)) return skip; const auto drm_format_mod_list = vku::FindStructInPNextChain(create_info.pNext); const auto drm_format_mod_explict = @@ -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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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..366b1332490 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 instance_extensions(local_api_version, pCreateInfo); + DeviceExtensions device_extensions(instance_extensions, local_api_version); + stateless::Context context(*this, error_obj, device_extensions); + + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); + } + skip |= context.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,24 +150,88 @@ 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 |= context.ValidateFlags(create_info_loc.dot(Field::flags), vvl::FlagBitmask::VkInstanceCreateFlagBits, + AllVkInstanceCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkInstanceCreateInfo-flags-parameter"); + + skip |= context.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 |= context.ValidateStructPnext(pApplicationInfo_loc, pCreateInfo->pApplicationInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkApplicationInfo-pNext-pNext", kVUIDUndefined, + true); + } + + skip |= context.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 |= context.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]); - skip |= ValidateExtensionReqs(local_instance_extensions, "VUID-vkCreateInstance-ppEnabledExtensionNames-01388", "instance", + skip |= ValidateExtensionReqs(instance_extensions, "VUID-vkCreateInstance-ppEnabledExtensionNames-01388", "instance", extension, create_info_loc.dot(Field::ppEnabledExtensionNames, i)); } if (pCreateInfo->flags & VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR && - !local_instance_extensions.vk_khr_portability_enumeration) { + !instance_extensions.vk_khr_portability_enumeration) { skip |= LogError("VUID-VkInstanceCreateInfo-flags-06559", instance, create_info_loc.dot(Field::flags), "has VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR set, but " "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 && !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 && !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 && !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 && !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."); - } - -#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 + 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}; -// 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 |= context.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(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); } } } @@ -327,7 +357,7 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe DispatchGetPhysicalDeviceProperties(physicalDevice, &device_properties); memcpy(&stateless_validation->device_limits, &device_properties.limits, sizeof(VkPhysicalDeviceLimits)); - if (IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) { + if (IsExtEnabled(extensions.vk_nv_shading_rate_image)) { // Get the needed shading rate image limits VkPhysicalDeviceShadingRateImagePropertiesNV shading_rate_image_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&shading_rate_image_props); @@ -335,7 +365,7 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe phys_dev_ext_props.shading_rate_image_props = shading_rate_image_props; } - if (IsExtEnabled(device_extensions.vk_nv_mesh_shader)) { + if (IsExtEnabled(extensions.vk_nv_mesh_shader)) { // Get the needed mesh shader limits VkPhysicalDeviceMeshShaderPropertiesNV mesh_shader_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&mesh_shader_props); @@ -343,7 +373,7 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe phys_dev_ext_props.mesh_shader_props_nv = mesh_shader_props; } - if (IsExtEnabled(device_extensions.vk_ext_mesh_shader)) { + if (IsExtEnabled(extensions.vk_ext_mesh_shader)) { // Get the needed mesh shader EXT limits VkPhysicalDeviceMeshShaderPropertiesEXT mesh_shader_props_ext = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&mesh_shader_props_ext); @@ -351,7 +381,7 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe phys_dev_ext_props.mesh_shader_props_ext = mesh_shader_props_ext; } - if (IsExtEnabled(device_extensions.vk_nv_ray_tracing)) { + if (IsExtEnabled(extensions.vk_nv_ray_tracing)) { // Get the needed ray tracing limits VkPhysicalDeviceRayTracingPropertiesNV ray_tracing_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&ray_tracing_props); @@ -359,7 +389,7 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe phys_dev_ext_props.ray_tracing_props_nv = ray_tracing_props; } - if (IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) { + if (IsExtEnabled(extensions.vk_khr_ray_tracing_pipeline)) { // Get the needed ray tracing limits VkPhysicalDeviceRayTracingPipelinePropertiesKHR ray_tracing_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&ray_tracing_props); @@ -367,7 +397,7 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe phys_dev_ext_props.ray_tracing_props_khr = ray_tracing_props; } - if (IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) { + if (IsExtEnabled(extensions.vk_khr_acceleration_structure)) { // Get the needed ray tracing acc structure limits VkPhysicalDeviceAccelerationStructurePropertiesKHR acc_structure_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&acc_structure_props); @@ -375,7 +405,7 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe phys_dev_ext_props.acc_structure_props = acc_structure_props; } - if (IsExtEnabled(device_extensions.vk_ext_transform_feedback)) { + if (IsExtEnabled(extensions.vk_ext_transform_feedback)) { // Get the needed transform feedback limits VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&transform_feedback_props); @@ -383,13 +413,13 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe phys_dev_ext_props.transform_feedback_props = transform_feedback_props; } - if (IsExtEnabled(device_extensions.vk_khr_vertex_attribute_divisor)) { + if (IsExtEnabled(extensions.vk_khr_vertex_attribute_divisor)) { // Get the needed vertex attribute divisor limits VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR vertex_attribute_divisor_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&vertex_attribute_divisor_props); DispatchGetPhysicalDeviceProperties2Helper(physicalDevice, &prop2); phys_dev_ext_props.vertex_attribute_divisor_props = vertex_attribute_divisor_props; - } else if (IsExtEnabled(device_extensions.vk_ext_vertex_attribute_divisor)) { + } else if (IsExtEnabled(extensions.vk_ext_vertex_attribute_divisor)) { // Get the needed vertex attribute divisor limits VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT vertex_attribute_divisor_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&vertex_attribute_divisor_props); @@ -399,35 +429,35 @@ void StatelessValidation::PostCallRecordCreateDevice(VkPhysicalDevice physicalDe vertex_attribute_divisor_props.maxVertexAttribDivisor; } - if (IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate)) { + if (IsExtEnabled(extensions.vk_khr_fragment_shading_rate)) { VkPhysicalDeviceFragmentShadingRatePropertiesKHR fragment_shading_rate_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&fragment_shading_rate_props); DispatchGetPhysicalDeviceProperties2Helper(physicalDevice, &prop2); phys_dev_ext_props.fragment_shading_rate_props = fragment_shading_rate_props; } - if (IsExtEnabled(device_extensions.vk_khr_depth_stencil_resolve)) { + if (IsExtEnabled(extensions.vk_khr_depth_stencil_resolve)) { VkPhysicalDeviceDepthStencilResolveProperties depth_stencil_resolve_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&depth_stencil_resolve_props); DispatchGetPhysicalDeviceProperties2Helper(physicalDevice, &prop2); phys_dev_ext_props.depth_stencil_resolve_props = depth_stencil_resolve_props; } - if (IsExtEnabled(device_extensions.vk_ext_external_memory_host)) { + if (IsExtEnabled(extensions.vk_ext_external_memory_host)) { VkPhysicalDeviceExternalMemoryHostPropertiesEXT external_memory_host_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&external_memory_host_props); DispatchGetPhysicalDeviceProperties2Helper(physicalDevice, &prop2); phys_dev_ext_props.external_memory_host_props = external_memory_host_props; } - if (IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) { + if (IsExtEnabled(extensions.vk_ext_device_generated_commands)) { VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT device_generated_commands_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&device_generated_commands_props); DispatchGetPhysicalDeviceProperties2Helper(physicalDevice, &prop2); phys_dev_ext_props.device_generated_commands_props = device_generated_commands_props; } - if (IsExtEnabled(device_extensions.vk_arm_render_pass_striped)) { + if (IsExtEnabled(extensions.vk_arm_render_pass_striped)) { VkPhysicalDeviceRenderPassStripedPropertiesARM renderpass_striped_props = vku::InitStructHelper(); VkPhysicalDeviceProperties2 prop2 = vku::InitStructHelper(&renderpass_striped_props); DispatchGetPhysicalDeviceProperties2Helper(physicalDevice, &prop2); @@ -441,18 +471,20 @@ 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= + context.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,10 +492,10 @@ 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 |= ValidateExtensionReqs(device_extensions, "VUID-vkCreateDevice-ppEnabledExtensionNames-01387", "device", extension, + skip |= context.ValidateString(create_info_loc.dot(Field::ppEnabledExtensionNames), + "VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-parameter", + pCreateInfo->ppEnabledExtensionNames[i]); + skip |= ValidateExtensionReqs(extensions, "VUID-vkCreateDevice-ppEnabledExtensionNames-01387", "device", extension, create_info_loc.dot(Field::ppEnabledExtensionNames, i)); if (extension == vvl::Extension::_VK_KHR_portability_subset) { portability_requested = true; @@ -479,8 +511,8 @@ bool StatelessValidation::manual_PreCallValidateCreateDevice(VkPhysicalDevice ph FormatHandle(physicalDevice).c_str()); } - if (IsExtEnabledByCreateinfo(ExtensionStateByName(device_extensions, vvl::Extension::_VK_AMD_negative_viewport_height))) { - const bool maint1 = IsExtEnabledByCreateinfo(ExtensionStateByName(device_extensions, vvl::Extension::_VK_KHR_maintenance1)); + if (IsExtEnabledByCreateinfo(ExtensionStateByName(extensions, vvl::Extension::_VK_AMD_negative_viewport_height))) { + const bool maint1 = IsExtEnabledByCreateinfo(ExtensionStateByName(extensions, vvl::Extension::_VK_KHR_maintenance1)); // Only need to check for VK_KHR_MAINTENANCE_1_EXTENSION_NAME if api version is 1.0, otherwise it's deprecated due to // integration into api version 1.1 if (api_version >= VK_API_VERSION_1_1) { @@ -507,9 +539,9 @@ bool StatelessValidation::manual_PreCallValidateCreateDevice(VkPhysicalDevice ph { const bool khr_bda = - IsExtEnabledByCreateinfo(ExtensionStateByName(device_extensions, vvl::Extension::_VK_KHR_buffer_device_address)); + IsExtEnabledByCreateinfo(ExtensionStateByName(extensions, vvl::Extension::_VK_KHR_buffer_device_address)); const bool ext_bda = - IsExtEnabledByCreateinfo(ExtensionStateByName(device_extensions, vvl::Extension::_VK_EXT_buffer_device_address)); + IsExtEnabledByCreateinfo(ExtensionStateByName(extensions, vvl::Extension::_VK_EXT_buffer_device_address)); if (khr_bda && ext_bda) { skip |= LogError("VUID-VkDeviceCreateInfo-ppEnabledExtensionNames-03328", physicalDevice, create_info_loc.dot(Field::ppEnabledExtensionNames), @@ -646,7 +678,7 @@ bool StatelessValidation::manual_PreCallValidateCreateDevice(VkPhysicalDevice ph } if (vulkan_12_features->bufferDeviceAddress == VK_TRUE) { - if (IsExtEnabledByCreateinfo(ExtensionStateByName(device_extensions, vvl::Extension::_VK_EXT_buffer_device_address))) { + if (IsExtEnabledByCreateinfo(ExtensionStateByName(extensions, vvl::Extension::_VK_EXT_buffer_device_address))) { skip |= LogError("VUID-VkDeviceCreateInfo-pNext-04748", physicalDevice, create_info_loc.dot(Field::pNext), "chain includes VkPhysicalDeviceVulkan12Features with bufferDeviceAddress " "set to VK_TRUE and ppEnabledExtensionNames contains VK_EXT_buffer_device_address"); @@ -936,8 +968,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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; if (pImageFormatInfo != nullptr) { const Location format_info_loc = error_obj.location.dot(Field::pImageFormatInfo); @@ -1026,8 +1059,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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; if (tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { skip |= LogError("VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-02248", physicalDevice, @@ -1039,8 +1073,9 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceImageFormatProp bool StatelessValidation::manual_PreCallValidateSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 +1096,9 @@ bool StatelessValidation::manual_PreCallValidateSetDebugUtilsObjectNameEXT(VkDev bool StatelessValidation::manual_PreCallValidateSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 +1108,9 @@ bool StatelessValidation::manual_PreCallValidateSetDebugUtilsObjectTagEXT(VkDevi bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 08edb9f99f0..3b9c75cab05 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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) { @@ -49,7 +53,7 @@ bool StatelessValidation::manual_PreCallValidateCreatePipelineLayout(VkDevice de pCreateInfo->setLayoutCount, device_limits.maxBoundDescriptorSets); } - if (!IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library)) { + if (!IsExtEnabled(extensions.vk_ext_graphics_pipeline_library)) { for (uint32_t i = 0; i < pCreateInfo->setLayoutCount; ++i) { if (!pCreateInfo->pSetLayouts[i]) { // TODO - Combine with other check in CoreChecks @@ -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 stateless::Context &context, + 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 |= context.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 stateless::Context &context, + 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 |= context.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 |= context.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 |= context.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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, + create_info.flags, kOptionalFlags, "VUID-VkGraphicsPipelineCreateInfo-None-09497"); } skip |= ValidateCreateGraphicsPipelinesFlags(flags, flags_loc); @@ -418,24 +425,24 @@ 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(context, *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 |= context.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"); } } } } - if (!IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library)) { + if (!IsExtEnabled(extensions.vk_ext_graphics_pipeline_library)) { if (create_info.stageCount == 0) { // Because not using GPL, this will always have a complete state and require a shader skip |= @@ -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 |= context.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 |= context.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 |= context.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 |= context.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(context, create_info.pStages[stage_index], stage_loc); + skip |= ValidatePipelineShaderStageCreateInfoCommon(context, 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(context, *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(context, *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(context, *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(context, *create_info.pViewportState, viewport_loc); const auto *exclusive_scissor_struct = vku::FindStructInPNextChain(viewport_state.pNext); @@ -858,7 +866,7 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( } if (viewport_state.scissorCount != viewport_state.viewportCount) { - if (!IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state) || + if (!IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || (!has_dynamic_viewport_with_count && !has_dynamic_scissor_with_count)) { skip |= LogError("VUID-VkPipelineViewportStateCreateInfo-scissorCount-04134", device, viewport_loc, "scissorCount (%" PRIu32 ") is different to viewportCount (%" PRIu32 ").", @@ -992,7 +1000,7 @@ bool StatelessValidation::manual_PreCallValidateCreateGraphicsPipelines( } } } else if ((!has_dynamic_viewport_with_count || !has_dynamic_scissor_with_count || - !IsExtEnabled(device_extensions.vk_ext_extended_dynamic_state3)) && + !IsExtEnabled(extensions.vk_ext_extended_dynamic_state3)) && (vvl::Contains(dynamic_state_map, VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE) || (!vvl::Contains(dynamic_state_map, VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE) && !create_info.pRasterizationState->rasterizerDiscardEnable))) { @@ -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(context, *create_info.pMultisampleState, ms_loc); if (create_info.pMultisampleState->sampleShadingEnable == VK_TRUE) { if (!enabled_features.sampleRateShading) { @@ -1044,18 +1052,19 @@ 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(context, 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(context, 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 |= + context.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 +1074,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 |= context.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,9 +1091,9 @@ 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(context, *create_info.pRasterizationState, rasterization_loc); - if (!IsExtEnabled(device_extensions.vk_nv_fill_rectangle)) { + if (!IsExtEnabled(extensions.vk_nv_fill_rectangle)) { if (create_info.pRasterizationState->polygonMode == VK_POLYGON_MODE_FILL_RECTANGLE_NV) { skip |= LogError("VUID-VkPipelineRasterizationStateCreateInfo-polygonMode-01414", device, rasterization_loc.dot(Field::polygonMode), @@ -1307,18 +1316,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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 +1345,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 |= context.ValidateFlags(flags_loc, vvl::FlagBitmask::VkPipelineCreateFlagBits, AllVkPipelineCreateFlagBits, + create_info.flags, kOptionalFlags, "VUID-VkComputePipelineCreateInfo-None-09497"); } skip |= ValidateCreateComputePipelinesFlags(flags, flags_loc); @@ -1365,7 +1374,7 @@ bool StatelessValidation::manual_PreCallValidateCreateComputePipelines(VkDevice } } - skip |= ValidatePipelineShaderStageCreateInfoCommon(create_info.stage, create_info_loc.dot(Field::stage)); + skip |= ValidatePipelineShaderStageCreateInfoCommon(context, create_info.stage, create_info_loc.dot(Field::stage)); skip |= ValidatePipelineBinaryInfo(create_info.pNext, create_info.flags, pipelineCache, create_info_loc); } @@ -1380,7 +1389,7 @@ bool StatelessValidation::ValidateDepthClampRange(const VkDepthClampRangeEXT &de "(%f) is greater than maxDepthClamp (%f).", depth_clamp_range.minDepthClamp, depth_clamp_range.maxDepthClamp); } - if (!IsExtEnabled(device_extensions.vk_ext_depth_range_unrestricted)) { + if (!IsExtEnabled(extensions.vk_ext_depth_range_unrestricted)) { if (depth_clamp_range.minDepthClamp < 0.0) { skip |= LogError("VUID-VkDepthClampRangeEXT-pDepthClampRange-09648", device, loc.dot(Field::minDepth), "(%f) is below 0.0 (and VK_EXT_depth_range_unrestricted is not enabled).", @@ -1398,8 +1407,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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; const bool has_externally_sync = (pCreateInfo->flags & VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT) != 0; const bool has_internally_sync = (pCreateInfo->flags & VK_PIPELINE_CACHE_CREATE_INTERNALLY_SYNCHRONIZED_MERGE_BIT_KHR) != 0; @@ -1427,8 +1437,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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; if (pSrcCaches) { for (uint32_t index0 = 0; index0 < srcCacheCount; ++index0) { if (pSrcCaches[index0] == dstCache) { @@ -1443,8 +1454,9 @@ bool StatelessValidation::manual_PreCallValidateMergePipelineCaches(VkDevice dev bool StatelessValidation::manual_PreCallValidateGetPipelinePropertiesEXT(VkDevice device, const VkPipelineInfoEXT *pPipelineInfo, VkBaseOutStructure *pPipelineProperties, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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..dfe58b4acef 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 stateless::Context &context, + 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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; if (pInfo != nullptr) { - skip |= ValidateAccelerationStructureInfoNV(*pInfo, dst, error_obj.location); + skip |= ValidateAccelerationStructureInfoNV(context, *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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, 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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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(context, create_info.pStages[stage_index], stage_loc); const auto stage = create_info.pStages[stage_index].stage; if ((stage & kShaderStageAllRayTracing) == 0) { @@ -578,7 +587,7 @@ bool StatelessValidation::manual_PreCallValidateCreateRayTracingPipelinesKHR( } } - const bool library_enabled = IsExtEnabled(device_extensions.vk_khr_pipeline_library); + const bool library_enabled = IsExtEnabled(extensions.vk_khr_pipeline_library); if (!library_enabled) { if (create_info.pLibraryInfo) { skip |= LogError("VUID-VkRayTracingPipelineCreateInfoKHR-pLibraryInfo-03595", device, @@ -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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context, + 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 |= context.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(context, 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(context, 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(context, 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, *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 |= context.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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, 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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, *info, error_obj.handle, error_obj.location); - skip |= ValidateRangedEnum(info_loc.dot(Field::mode), vvl::Enum::VkBuildAccelerationStructureModeKHR, info->mode, - "VUID-vkBuildAccelerationStructuresKHR-mode-04628"); + skip |= context.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 |= context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, *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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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..210559a8a57 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 stateless::Context &context) 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, context.error_obj); } bool StatelessValidation::manual_PreCallValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkRenderPass *pRenderPass, const ErrorObject &error_obj) const { + VkRenderPass *pRenderPass, + const stateless::Context &context) 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, context.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 stateless::Context &context) const { + return ValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, context.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 stateless::Context &context) const { + return ValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; const Location rendering_info_loc = error_obj.location.dot(Field::pRenderingInfo); if (!enabled_features.dynamicRendering) { @@ -686,7 +688,7 @@ bool StatelessValidation::ValidateBeginRenderingColorAttachment(VkCommandBuffer } } - if (IsExtEnabled(device_extensions.vk_khr_maintenance2)) { + if (IsExtEnabled(extensions.vk_khr_maintenance2)) { if (image_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL || image_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL) { skip |= LogError("VUID-VkRenderingInfo-colorAttachmentCount-06096", commandBuffer, @@ -751,7 +753,7 @@ bool StatelessValidation::ValidateBeginRenderingDepthAttachment(VkCommandBuffer string_VkImageLayout(resolve_layout), string_VkResolveModeFlagBits(depth_attachment.resolveMode)); } - if (IsExtEnabled(device_extensions.vk_khr_maintenance2) && + if (IsExtEnabled(extensions.vk_khr_maintenance2) && resolve_layout == VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL) { skip |= LogError("VUID-VkRenderingInfo-pDepthAttachment-06098", commandBuffer, attachment_loc.dot(Field::resolveImageLayout), @@ -799,7 +801,7 @@ bool StatelessValidation::ValidateBeginRenderingStencilAttachment(VkCommandBuffe string_VkImageLayout(resolve_layout), string_VkResolveModeFlagBits(stencil_attachment.resolveMode)); } - if (IsExtEnabled(device_extensions.vk_khr_maintenance2) && + if (IsExtEnabled(extensions.vk_khr_maintenance2) && resolve_layout == VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL) { skip |= LogError("VUID-VkRenderingInfo-pStencilAttachment-06099", commandBuffer, attachment_loc.dot(Field::resolveImageLayout), diff --git a/layers/stateless/sl_shader_object.cpp b/layers/stateless/sl_shader_object.cpp index 0e5a6edb658..9c8636c1ab0 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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..457fbd4d858 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 stateless::Context &context) 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", context.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 stateless::Context &context) 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", context.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..89ba570b102 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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 5bb1d854b32..4945e204996 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; if (pAcquireInfo->semaphore == VK_NULL_HANDLE && pAcquireInfo->fence == VK_NULL_HANDLE) { skip |= LogError("VUID-VkAcquireNextImageInfoKHR-semaphore-01782", pAcquireInfo->swapchain, @@ -87,7 +90,8 @@ bool StatelessValidation::ValidateSwapchainCreateInfoMaintenance1(const VkSwapch return skip; } -bool StatelessValidation::ValidateSwapchainCreateInfo(const VkSwapchainCreateInfoKHR &create_info, const Location &loc) const { +bool StatelessValidation::ValidateSwapchainCreateInfo(const stateless::Context &context, + 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 @@ -107,8 +111,8 @@ bool StatelessValidation::ValidateSwapchainCreateInfo(const VkSwapchainCreateInf } } - skip |= ValidateNotZero(create_info.imageArrayLayers == 0, "VUID-VkSwapchainCreateInfoKHR-imageArrayLayers-01275", - loc.dot(Field::imageArrayLayers)); + skip |= context.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); @@ -169,9 +173,10 @@ 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); - const bool is_required_ext_enabled = IsExtEnabled(instance_extensions.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(extensions.vk_khr_surface_protected_capabilities); if (is_required_ext_supported && !is_required_ext_enabled) { skip |= LogError("VUID-VkSwapchainCreateInfoKHR-flags-03187", device, loc.dot(Field::flags), @@ -200,11 +205,11 @@ bool StatelessValidation::ValidateSwapchainCreateInfo(const VkSwapchainCreateInf bool StatelessValidation::manual_PreCallValidateReleaseSwapchainImagesEXT(VkDevice device, const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo, - const ErrorObject &error_obj) const { + const Context &context) const { bool skip = false; if (!enabled_features.swapchainMaintenance1) { - skip |= LogError("VUID-vkReleaseSwapchainImagesEXT-swapchainMaintenance1-10159", device, error_obj.location, + skip |= LogError("VUID-vkReleaseSwapchainImagesEXT-swapchainMaintenance1-10159", device, context.error_obj.location, "swapchainMaintenance1 is not enabled"); } @@ -213,9 +218,12 @@ bool StatelessValidation::manual_PreCallValidateReleaseSwapchainImagesEXT(VkDevi bool StatelessValidation::manual_PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkSwapchainKHR *pSwapchain, const ErrorObject &error_obj) const { + VkSwapchainKHR *pSwapchain, + const stateless::Context &context) const { bool skip = false; - skip |= ValidateSwapchainCreateInfo(*pCreateInfo, error_obj.location.dot(Field::pCreateInfo)); + const auto &error_obj = context.error_obj; + + skip |= ValidateSwapchainCreateInfo(context, *pCreateInfo, error_obj.location.dot(Field::pCreateInfo)); return skip; } @@ -223,19 +231,21 @@ bool StatelessValidation::manual_PreCallValidateCreateSharedSwapchainsKHR(VkDevi const VkSwapchainCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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(context, 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; if (!pPresentInfo) return skip; if (const auto *present_regions = vku::FindStructInPNextChain(pPresentInfo->pNext)) { @@ -270,19 +280,22 @@ 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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 |= context.ValidateNotZero(display_mode_parameters.visibleRegion.width == 0, "VUID-VkDisplayModeParametersKHR-width-01990", + param_loc.dot(Field::visibleRegion).dot(Field::width)); + skip |= + context.ValidateNotZero(display_mode_parameters.visibleRegion.height == 0, "VUID-VkDisplayModeParametersKHR-height-01991", + param_loc.dot(Field::visibleRegion).dot(Field::width)); + skip |= context.ValidateNotZero(display_mode_parameters.refreshRate == 0, "VUID-VkDisplayModeParametersKHR-refreshRate-01992", + param_loc.dot(Field::refreshRate)); return skip; } @@ -291,9 +304,10 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfaceFormatsK VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; - if (surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + const auto &error_obj = context.error_obj; + if (surface == VK_NULL_HANDLE && !IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfaceFormatsKHR-surface-06524", physicalDevice, error_obj.location.dot(Field::surface), "is VK_NULL_HANDLE and VK_GOOGLE_surfaceless_query is not enabled."); @@ -305,9 +319,10 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfacePresentM VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; - if (surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + const auto &error_obj = context.error_obj; + if (surface == VK_NULL_HANDLE && !IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfacePresentModesKHR-surface-06524", physicalDevice, error_obj.location.dot(Field::surface), "is VK_NULL_HANDLE and VK_GOOGLE_surfaceless_query is not enabled."); @@ -317,9 +332,10 @@ bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfacePresentM bool StatelessValidation::manual_PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, - VkSurfaceCapabilities2KHR *pSurfaceCapabilities, const ErrorObject &error_obj) const { + VkSurfaceCapabilities2KHR *pSurfaceCapabilities, const stateless::Context &context) const { bool skip = false; - if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + const auto &error_obj = context.error_obj; + if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-pSurfaceInfo-06521", physicalDevice, error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), "is VK_NULL_HANDLE and VK_GOOGLE_surfaceless_query is not enabled."); @@ -376,9 +392,10 @@ 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 stateless::Context &context) const { bool skip = false; - if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + const auto &error_obj = context.error_obj; + if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-pSurfaceInfo-06521", physicalDevice, error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), "is VK_NULL_HANDLE and VK_GOOGLE_surfaceless_query is not enabled."); @@ -398,9 +415,10 @@ 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 stateless::Context &context) const { bool skip = false; - if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + const auto &error_obj = context.error_obj; + if (pSurfaceInfo && pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-06521", physicalDevice, error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), "is VK_NULL_HANDLE and VK_GOOGLE_surfaceless_query is not enabled."); @@ -411,8 +429,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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; if (pCreateInfo->hwnd == nullptr) { skip |= LogError("VUID-VkWin32SurfaceCreateInfoKHR-hwnd-01308", instance, error_obj.location, "pCreateInfo->hwnd is NULL."); @@ -426,22 +446,23 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(V VkDeviceGroupPresentModeFlagsKHR *pModes, const ErrorObject &error_obj) const { bool skip = false; - if (!IsExtEnabled(device_extensions.vk_khr_swapchain)) + stateless::Context context(*this, error_obj, extensions); + if (!IsExtEnabled(extensions.vk_khr_swapchain)) skip |= OutputExtensionError(error_obj.location, {vvl::Extension::_VK_KHR_swapchain}); - if (!IsExtEnabled(device_extensions.vk_khr_get_surface_capabilities2)) + if (!IsExtEnabled(extensions.vk_khr_get_surface_capabilities2)) skip |= OutputExtensionError(error_obj.location, {vvl::Extension::_VK_KHR_get_surface_capabilities2}); - if (!IsExtEnabled(device_extensions.vk_khr_surface)) + if (!IsExtEnabled(extensions.vk_khr_surface)) skip |= OutputExtensionError(error_obj.location, {vvl::Extension::_VK_KHR_surface}); - if (!IsExtEnabled(device_extensions.vk_khr_get_physical_device_properties2)) + if (!IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(error_obj.location, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); - if (!IsExtEnabled(device_extensions.vk_ext_full_screen_exclusive)) + if (!IsExtEnabled(extensions.vk_ext_full_screen_exclusive)) skip |= OutputExtensionError(error_obj.location, {vvl::Extension::_VK_EXT_full_screen_exclusive}); if (!pModes) { skip |= LogError("VUID-vkGetDeviceGroupSurfacePresentModes2EXT-pModes-parameter", device, error_obj.location.dot(Field::pModes), "is NULL."); } - skip |= ValidateStructType( + skip |= context.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) { @@ -449,18 +470,19 @@ 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 |= context.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)) { + if (pSurfaceInfo->surface == VK_NULL_HANDLE && !IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= LogError("VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-06521", device, error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), "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 |= + context.ValidateRequiredHandle(error_obj.location.dot(Field::pSurfaceInfo).dot(Field::surface), pSurfaceInfo->surface); } return skip; } @@ -471,8 +493,9 @@ bool StatelessValidation::manual_PreCallValidateCreateWaylandSurfaceKHR(VkInstan const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; const auto display = pCreateInfo->display; const auto surface = pCreateInfo->surface; @@ -495,8 +518,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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; const auto connection = pCreateInfo->connection; const auto window = pCreateInfo->window; @@ -506,8 +530,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 |= context.ValidateNotZero(window == 0, "VUID-VkXcbSurfaceCreateInfoKHR-window-01311", + error_obj.location.dot(Field::pCreateInfo).dot(Field::window)); return skip; } @@ -517,8 +541,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 stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.error_obj; const auto display = pCreateInfo->dpy; const auto window = pCreateInfo->window; @@ -528,8 +554,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 |= context.ValidateNotZero(window == 0, "VUID-VkXlibSurfaceCreateInfoKHR-window-01314", + error_obj.location.dot(Field::pCreateInfo).dot(Field::window)); return skip; } @@ -540,8 +566,9 @@ bool StatelessValidation::manual_PreCallValidateCreateAndroidSurfaceKHR(VkInstan const VkAndroidSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface, - const ErrorObject &error_obj) const { + const stateless::Context &context) const { bool skip = false; + const auto &error_obj = context.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 61d11c6f90a..9fcb71b22e1 100644 --- a/layers/stateless/stateless_validation.h +++ b/layers/stateless/stateless_validation.h @@ -26,63 +26,25 @@ #include "chassis/validation_object.h" #include "generated/device_features.h" -class StatelessValidation : public ValidationObject { - using BaseClass = ValidationObject; +enum FlagType { kRequiredFlags, kOptionalFlags, kRequiredSingleBit, kOptionalSingleBit }; + +namespace stateless { +// Per-call information needed to check enums, flags and pNext contents +class Context { 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 &extensions; + // Used to control the VK_KHR_maintenance5 behavior of VkPhysicalDevice calls + // where unknown enum values are allowed. + 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; + Context(const Logger &log_, const ErrorObject &err_, const DeviceExtensions &exts_, bool ignore_unknown_enums_ = false) + : log(log_), error_obj(err_), extensions(exts_), ignore_unknown_enums(ignore_unknown_enums_) {} bool ValidateNotZero(bool is_zero, const char *vuid, const Location &loc) const; @@ -97,12 +59,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 +79,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 +96,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 +118,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 +140,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 +158,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 +173,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 +190,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 +199,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 +223,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 +259,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 +278,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 +301,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 + +class StatelessValidation : public ValidationObject { + using BaseClass = ValidationObject; + using Func = vvl::Func; + using Struct = vvl::Struct; + using Field = vvl::Field; + using Context = stateless::Context; // temporary alias to reduce churn + + 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 +404,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,12 +411,12 @@ 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 ValidateAccelerationStructureInfoNV(const Context &context, const VkAccelerationStructureInfoNV &info, + VkAccelerationStructureNV object_handle, const Location &loc) const; bool ValidateSwapchainCreateInfoMaintenance1(const VkSwapchainCreateInfoKHR &create_info, const Location &loc) const; - bool ValidateSwapchainCreateInfo(const VkSwapchainCreateInfoKHR &create_info, const Location &loc) const; + bool ValidateSwapchainCreateInfo(const Context &context, const VkSwapchainCreateInfoKHR &create_info, const Location &loc) const; bool manual_PreCallValidateReleaseSwapchainImagesEXT(VkDevice device, const VkReleaseSwapchainImagesInfoEXT *pReleaseInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool OutputExtensionError(const Location &loc, const vvl::Extensions &exentsions) const; @@ -409,30 +425,34 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 *pProperties, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkQueryPool *pQueryPool, - const ErrorObject &error_obj) const; + const Context &context) const; - bool manual_PreCallValidateCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, - VkInstance *pInstance, const ErrorObject &error_obj) const; + // vkCreateInstance is completely overridden because there are specific VUs for + // pNext contents which need to supercede the automatic checking which produces + // generic 'pNext-pNext' errors + 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 Context &context) const; bool manual_PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context, 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; @@ -441,36 +461,38 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImageView *pView, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetDeviceImageSubresourceLayout(VkDevice device, const VkDeviceImageSubresourceInfo *pInfo, - VkSubresourceLayout2 *pLayout, const ErrorObject &error_obj) const; + VkSubresourceLayout2 *pLayout, const Context &context) 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 Context &context) const; bool manual_PreCallValidateCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context, + 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 Context &context, 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 Context &context) 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 Context &context) 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; @@ -478,7 +500,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 Context &context) const; bool ValidateMutableDescriptorTypeCreateInfo(const VkDescriptorSetLayoutCreateInfo &create_info, const VkMutableDescriptorTypeCreateInfoEXT &mutable_create_info, const Location &loc) const; @@ -486,298 +508,297 @@ 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 Context &context) const; bool manual_PreCallValidateGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, VkDescriptorSetLayoutSupport *pSupport, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateBufferView(VkDevice device, const VkBufferViewCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBufferView *pBufferView, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context, 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 Context &context) const; bool manual_PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, - const VkDescriptorSet *pDescriptorSets, const ErrorObject &error_obj) const; + const VkDescriptorSet *pDescriptorSets, const Context &context) const; bool manual_PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2 *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkRenderPass *pRenderPass, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, - const VkCommandBuffer *pCommandBuffers, const ErrorObject &error_obj) const; + const VkCommandBuffer *pCommandBuffers, const Context &context) const; bool manual_PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, - const VkViewport *pViewports, const ErrorObject &error_obj) const; + const VkViewport *pViewports, const Context &context) 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 Context &context) const; + bool manual_PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth, const Context &context) 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 Context &context) const; bool manual_PreCallValidateGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, - uint32_t regionCount, const VkBufferCopy *pRegions, - const ErrorObject &error_obj) const; + uint32_t regionCount, const VkBufferCopy *pRegions, const Context &context) const; bool manual_PreCallValidateCmdCopyBuffer2(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 *pCopyBufferInfo, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdBindDescriptorBuffersEXT(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT *pBindingInfos, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetPhysicalDeviceExternalBufferProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo *pExternalBufferInfo, - VkExternalBufferProperties *pExternalBufferProperties, const ErrorObject &error_obj) const; + VkExternalBufferProperties *pExternalBufferProperties, const Context &context) const; bool manual_PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchain, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDisplayModeKHR *pMode, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) 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 Context &context) 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 Context &context) 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 Context &context) 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 Context &context) 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdPushDescriptorSet2(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfo *pPushDescriptorSetInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D *pExclusiveScissors, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV *pShadingRatePalettes, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV *pCustomSampleOrders, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureNV *pAccelerationStructure, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkAccelerationStructureKHR *pAccelerationStructure, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks *pAllocator, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) const; bool manual_PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, - size_t dataSize, void *pData, const ErrorObject &error_obj) const; + size_t dataSize, void *pData, const Context &context) 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 Context &context) 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetDepthClampRangeEXT(VkCommandBuffer commandBuffer, VkDepthClampModeEXT depthClampMode, const VkDepthClampRangeEXT *pDepthClampRange, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) const; bool manual_PreCallValidateGetShaderBinaryDataEXT(VkDevice device, VkShaderEXT shader, size_t *pDataSize, void *pData, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, - uint16_t lineStipplePattern, const ErrorObject &error_obj) const; + uint16_t lineStipplePattern, const Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, - VkDeviceSize size, VkIndexType indexType, const ErrorObject &error_obj) const; + VkDeviceSize size, VkIndexType indexType, const Context &context) const; bool manual_PreCallValidateCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer *pBuffers, const VkDeviceSize *pOffsets, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, - uint32_t *pImageIndex, const ErrorObject &error_obj) const; + uint32_t *pImageIndex, const Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer *pCounterBuffers, const VkDeviceSize *pCounterBufferOffsets, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) const; bool manual_PreCallValidateCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSamplerYcbcrConversion *pYcbcrConversion, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetDescriptorEXT(VkDevice device, const VkDescriptorGetInfoEXT *pDescriptorInfo, size_t dataSize, - void *pDescriptor, const ErrorObject &error_obj) const; + void *pDescriptor, const Context &context) const; bool manual_PreCallValidateCmdSetDescriptorBufferOffsets2EXT( VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT *pSetDescriptorBufferOffsetsInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers2EXT( VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT *pBindDescriptorBufferEmbeddedSamplersInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdPushDescriptorSetWithTemplate2( VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdBindDescriptorSets2(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfoKHR *pBindDescriptorSetsInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR *pGetFdInfo, int *pFd, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetMemoryFdPropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR *pMemoryFdProperties, - const ErrorObject &error_obj) const; + const Context &context) const; bool ValidateExternalSemaphoreHandleType(VkSemaphore semaphore, const char *vuid, const Location &handle_type_loc, VkExternalSemaphoreHandleTypeFlagBits handle_type, VkExternalSemaphoreHandleTypeFlags allowed_types) const; @@ -785,56 +806,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 Context &context) const; bool manual_PreCallValidateGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR *pGetFdInfo, int *pFd, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR *pImportFenceFdInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR *pGetFdInfo, int *pFd, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void *pHostPointer, VkMemoryHostPointerPropertiesEXT *pMemoryHostPointerProperties, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) const; bool manual_PreCallValidateGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR *pMemoryWin32HandleProperties, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateImportSemaphoreWin32HandleKHR( VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR *pImportSemaphoreWin32HandleInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR *pGetWin32HandleInfo, - HANDLE *pHandle, const ErrorObject &error_obj) const; + HANDLE *pHandle, const Context &context) const; bool manual_PreCallValidateImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR *pImportFenceWin32HandleInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR *pGetWin32HandleInfo, - HANDLE *pHandle, const ErrorObject &error_obj) const; + HANDLE *pHandle, const Context &context) const; #endif bool manual_PreCallValidateCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool ValidateCopyAccelerationStructureInfoKHR(const VkCopyAccelerationStructureInfoKHR &as_info, const VulkanTypedHandle &handle, const Location &info_loc) const; bool ValidateCopyMemoryToAccelerationStructureInfoKHR(const VkCopyMemoryToAccelerationStructureInfoKHR &as_info, @@ -842,63 +863,64 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR *pInfo, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) 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 Context &context) 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateGetDeviceAccelerationStructureCompatibilityKHR( VkDevice device, const VkAccelerationStructureVersionInfoKHR *pVersionInfo, - VkAccelerationStructureCompatibilityKHR *pCompatibility, const ErrorObject &error_obj) const; + VkAccelerationStructureCompatibilityKHR *pCompatibility, const Context &context) const; bool manual_PreCallValidateCmdSetViewportWithCount(VkCommandBuffer commandBuffer, uint32_t viewportCount, - const VkViewport *pViewports, const ErrorObject &error_obj) const; + const VkViewport *pViewports, const Context &context) const; bool manual_PreCallValidateCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, - const VkRect2D *pScissors, const ErrorObject &error_obj) const; + const VkRect2D *pScissors, const Context &context) 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 Context &context) 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 Context &context, + 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo, const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool ValidateTraceRaysRaygenShaderBindingTable(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR &raygen_shader_binding_table, @@ -918,54 +940,53 @@ 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetVertexInputEXT(VkCommandBuffer commandBuffer, uint32_t vertexBindingDescriptionCount, const VkVertexInputBindingDescription2EXT *pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT *pVertexAttributeDescriptions, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineCache *pPipelineCache, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, - const VkPipelineCache *pSrcCaches, const ErrorObject &error_obj) const; + const VkPipelineCache *pSrcCaches, const Context &context) const; bool manual_PreCallValidateGetPipelinePropertiesEXT(VkDevice device, const VkPipelineInfoEXT *pPipelineInfo, - VkBaseOutStructure *pPipelineProperties, - const ErrorObject &error_obj) const; + VkBaseOutStructure *pPipelineProperties, const Context &context) 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *pRenderPassBegin, - const VkSubpassBeginInfo *, const ErrorObject &error_obj) const; + const VkSubpassBeginInfo *, const Context &context) const; bool manual_PreCallValidateCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo *pRenderingInfo, - const ErrorObject &error_obj) const; + const Context &context) const; bool ValidateBeginRenderingColorAttachment(VkCommandBuffer commandBuffer, const VkRenderingInfo &rendering_info, const Location &rendering_info_loc) const; @@ -980,13 +1001,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 Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT *pConditionalRenderingBegin, - const ErrorObject &error_obj) const; + const Context &context) const; bool ValidateDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements &memory_requirements, const Location &loc) const; @@ -994,167 +1015,145 @@ class StatelessValidation : public ValidationObject { bool manual_PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetDiscardRectangleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetDiscardRectangleModeEXT(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateCmdSetExclusiveScissorEnableNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32 *pExclusiveScissorEnables, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateSetDeviceMemoryPriorityEXT(VkDevice device, VkDeviceMemory memory, float priority, - const ErrorObject &error_obj) const; + const Context &context) 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 Context &context) const; #endif // VK_USE_PLATFORM_WIN32_KHR bool manual_PreCallValidateGetDeviceImageMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, VkMemoryRequirements2 *pMemoryRequirements, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateGetDeviceImageSparseMemoryRequirements(VkDevice device, const VkDeviceImageMemoryRequirements *pInfo, uint32_t *pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 *pSparseMemoryRequirements, - const ErrorObject &error_obj) const; + const Context &context) const; bool manual_PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, - VkFence fence, const ErrorObject &error_obj) const; + VkFence fence, const Context &context) const; - bool ValidateIndirectExecutionSetPipelineInfo(const VkIndirectExecutionSetPipelineInfoEXT &pipeline_info, + bool ValidateIndirectExecutionSetPipelineInfo(const Context &context, + const VkIndirectExecutionSetPipelineInfoEXT &pipeline_info, const Location &pipeline_info_loc) const; - bool ValidateIndirectExecutionSetShaderInfo(const VkIndirectExecutionSetShaderInfoEXT &shader_info, + bool ValidateIndirectExecutionSetShaderInfo(const Context &context, 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 Context &context) const; + bool ValidateIndirectCommandsPushConstantToken(const Context &context, + 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 Context &context, + const VkIndirectCommandsIndexBufferTokenEXT &index_buffer_token, const Location &index_buffer_token_loc) const; - bool ValidateIndirectCommandsExecutionSetToken(const VkIndirectCommandsExecutionSetTokenEXT &exe_set_token, + bool ValidateIndirectCommandsExecutionSetToken(const Context &context, + 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 Context &context, const VkIndirectCommandsLayoutTokenEXT &token, + const Location &token_loc) const; + bool ValidateIndirectCommandsLayoutStage(const Context &context, 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 Context &context) 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 Context &context) const; bool manual_PreCallValidateCmdExecuteGeneratedCommandsEXT(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoEXT *pGeneratedCommandsInfo, - const ErrorObject &error_obj) const; + const Context &context) const; + + bool manual_PreCallValidateCreateMicromapEXT(VkDevice device, const VkMicromapCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkMicromapEXT *pMicromap, + const Context &context) const; + + bool manual_PreCallValidateDestroyMicromapEXT(VkDevice device, VkMicromapEXT micromap, const VkAllocationCallbacks *pAllocator, + const Context &context) const; + + bool manual_PreCallValidateCmdBuildMicromapsEXT(VkCommandBuffer commandBuffer, uint32_t infoCount, + const VkMicromapBuildInfoEXT *pInfos, const Context &context) const; + + bool manual_PreCallValidateBuildMicromapsEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, + const VkMicromapBuildInfoEXT *pInfos, const Context &context) const; + + bool manual_PreCallValidateCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMicromapInfoEXT *pInfo, const Context &context) const; + + bool manual_PreCallValidateCopyMicromapToMemoryEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMicromapToMemoryInfoEXT *pInfo, + const Context &context) const; + + bool manual_PreCallValidateCopyMemoryToMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, + const VkCopyMemoryToMicromapInfoEXT *pInfo, + const Context &context) const; + + bool manual_PreCallValidateWriteMicromapsPropertiesEXT(VkDevice device, uint32_t micromapCount, const VkMicromapEXT *pMicromaps, + VkQueryType queryType, size_t dataSize, void *pData, size_t stride, + const Context &context) const; + + bool manual_PreCallValidateCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT *pInfo, + const Context &context) const; + + bool manual_PreCallValidateCmdCopyMicromapToMemoryEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT *pInfo, + const Context &context) const; + + bool manual_PreCallValidateCmdCopyMemoryToMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT *pInfo, + const Context &context) const; + + bool manual_PreCallValidateCmdWriteMicromapsPropertiesEXT(VkCommandBuffer commandBuffer, uint32_t micromapCount, + const VkMicromapEXT *pMicromaps, VkQueryType queryType, + VkQueryPool queryPool, uint32_t firstQuery, + const Context &context) const; + + bool manual_PreCallValidateGetDeviceMicromapCompatibilityEXT(VkDevice device, const VkMicromapVersionInfoEXT *pVersionInfo, + VkAccelerationStructureCompatibilityKHR *pCompatibility, + const Context &context) 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 Context &context) const; bool ValidateAllocateMemoryExternal(VkDevice device, const VkMemoryAllocateInfo &allocate_info, VkMemoryAllocateFlags flags, const Location &allocate_info_loc) const; diff --git a/layers/sync/sync_reporting.cpp b/layers/sync/sync_reporting.cpp index 57401df778a..8fbdeea91d9 100644 --- a/layers/sync/sync_reporting.cpp +++ b/layers/sync/sync_reporting.cpp @@ -398,7 +398,7 @@ static std::string FormatHazardState(const HazardResult::HazardState &hazard, Vk std::string CommandExecutionContext::FormatHazard(const HazardResult &hazard, ReportKeyValues &key_values) const { std::stringstream out; assert(hazard.IsHazard()); - out << FormatHazardState(hazard.State(), queue_flags_, sync_state_.enabled_features, sync_state_.device_extensions, key_values); + out << FormatHazardState(hazard.State(), queue_flags_, sync_state_.enabled_features, sync_state_.extensions, key_values); out << ", " << FormatUsage(hazard.TagEx()) << ")"; return out.str(); } diff --git a/layers/vulkan/generated/object_tracker.cpp b/layers/vulkan/generated/object_tracker.cpp index 6e64617b1a0..7758989914e 100644 --- a/layers/vulkan/generated/object_tracker.cpp +++ b/layers/vulkan/generated/object_tracker.cpp @@ -4064,7 +4064,7 @@ bool ObjectLifetimes::PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(Vk // Checked by chassis: physicalDevice: "VUID-vkGetPhysicalDeviceSurfaceCapabilities2KHR-physicalDevice-parameter" if (pSurfaceInfo) { [[maybe_unused]] const Location pSurfaceInfo_loc = error_obj.location.dot(Field::pSurfaceInfo); - if (!IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + if (!IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= ValidateObject(pSurfaceInfo->surface, kVulkanObjectTypeSurfaceKHR, true, "VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-07919", kVUIDUndefined, pSurfaceInfo_loc.dot(Field::surface)); @@ -4083,7 +4083,7 @@ bool ObjectLifetimes::PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(VkPhysi // Checked by chassis: physicalDevice: "VUID-vkGetPhysicalDeviceSurfaceFormats2KHR-physicalDevice-parameter" if (pSurfaceInfo) { [[maybe_unused]] const Location pSurfaceInfo_loc = error_obj.location.dot(Field::pSurfaceInfo); - if (!IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + if (!IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= ValidateObject(pSurfaceInfo->surface, kVulkanObjectTypeSurfaceKHR, true, "VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-07919", kVUIDUndefined, pSurfaceInfo_loc.dot(Field::surface)); @@ -6055,7 +6055,7 @@ bool ObjectLifetimes::PreCallValidateGetPhysicalDeviceSurfacePresentModes2EXT(Vk // Checked by chassis: physicalDevice: "VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-physicalDevice-parameter" if (pSurfaceInfo) { [[maybe_unused]] const Location pSurfaceInfo_loc = error_obj.location.dot(Field::pSurfaceInfo); - if (!IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + if (!IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= ValidateObject(pSurfaceInfo->surface, kVulkanObjectTypeSurfaceKHR, true, "VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-07919", kVUIDUndefined, pSurfaceInfo_loc.dot(Field::surface)); @@ -6095,7 +6095,7 @@ bool ObjectLifetimes::PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(VkDev // Checked by chassis: device: "VUID-vkGetDeviceGroupSurfacePresentModes2EXT-device-parameter" if (pSurfaceInfo) { [[maybe_unused]] const Location pSurfaceInfo_loc = error_obj.location.dot(Field::pSurfaceInfo); - if (!IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) { + if (!IsExtEnabled(extensions.vk_google_surfaceless_query)) { skip |= ValidateObject(pSurfaceInfo->surface, kVulkanObjectTypeSurfaceKHR, true, "VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-07919", kVUIDUndefined, pSurfaceInfo_loc.dot(Field::surface)); diff --git a/layers/vulkan/generated/spirv_validation_helper.cpp b/layers/vulkan/generated/spirv_validation_helper.cpp index ffcdfd0cce4..a4886cd0b75 100644 --- a/layers/vulkan/generated/spirv_validation_helper.cpp +++ b/layers/vulkan/generated/spirv_validation_helper.cpp @@ -1155,7 +1155,7 @@ bool CoreChecks::ValidateShaderCapabilitiesAndExtensions(const spirv::Instructio } else if (it->second.extension) { // kEnabledByApiLevel is not valid as some extension are promoted with feature bits to be used. // If the new Api Level gives support, it will be caught in the "it->second.version" check instead. - if (IsExtEnabledByCreateinfo(device_extensions.*(it->second.extension))) { + if (IsExtEnabledByCreateinfo(extensions.*(it->second.extension))) { has_support = true; } } else if (it->second.property) { @@ -1231,7 +1231,7 @@ bool CoreChecks::ValidateShaderCapabilitiesAndExtensions(const spirv::Instructio } // Portability checks - if (IsExtEnabled(device_extensions.vk_khr_portability_subset)) { + if (IsExtEnabled(extensions.vk_khr_portability_subset)) { if ((VK_FALSE == enabled_features.shaderSampleRateInterpolationFunctions) && (spv::CapabilityInterpolationFunction == insn.Word(1))) { skip |= LogError("VUID-RuntimeSpirv-shaderSampleRateInterpolationFunctions-06325", device, loc, @@ -1277,7 +1277,7 @@ bool CoreChecks::ValidateShaderCapabilitiesAndExtensions(const spirv::Instructio has_support = true; } } else if (it->second.extension) { - if (IsExtEnabled(device_extensions.*(it->second.extension))) { + if (IsExtEnabled(extensions.*(it->second.extension))) { has_support = true; } } diff --git a/layers/vulkan/generated/stateless_validation_helper.cpp b/layers/vulkan/generated/stateless_validation_helper.cpp index ef7e2aa7123..9e692572907 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 stateless::Context::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(extensions.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(extensions.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(extensions.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 (extensions.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(extensions.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(extensions.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 (extensions.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(extensions.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 (extensions.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(extensions.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 (extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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 (extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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 (extensions.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(extensions.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(extensions.vk_ext_global_priority_query)) && (!IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_ext_line_rasterization)) && (!IsExtEnabled(extensions.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,16 @@ 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(extensions.vk_ext_vertex_attribute_divisor)) && + (!IsExtEnabled(extensions.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 +1102,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(extensions.vk_ext_index_type_uint8)) && (!IsExtEnabled(extensions.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 +1119,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(extensions.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 +1136,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(extensions.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 +1155,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(extensions.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 +1172,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(extensions.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 +1191,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(extensions.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 +1208,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(extensions.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 +1224,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(extensions.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 +1245,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(extensions.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 +1296,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(extensions.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 +1315,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(extensions.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 +1338,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(extensions.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 +1356,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(extensions.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 +1373,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(extensions.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 +1393,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(extensions.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 +1410,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(extensions.vk_khr_fragment_shader_barycentric)) && + (!IsExtEnabled(extensions.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 +1430,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(extensions.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 +1451,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(extensions.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 +1481,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(extensions.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 +1503,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(extensions.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 +1523,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(extensions.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 +1542,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(extensions.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 +1559,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(extensions.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 +1580,17 @@ 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(extensions.vk_khr_compute_shader_derivatives)) && + (!IsExtEnabled(extensions.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 +1602,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(extensions.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 +1619,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(extensions.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 +1637,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(extensions.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 +1657,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(extensions.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 +1678,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(extensions.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 +1695,15 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceMaintenance8FeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceMaintenance8FeaturesKHR-sType-sType + + if (!IsExtEnabled(extensions.vk_khr_maintenance8)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR), but its parent extension " + "VK_KHR_maintenance8 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceMaintenance8FeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance8)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceMaintenance8FeaturesKHR, but when creating VkDevice, " - "the parent extension " - "(VK_KHR_maintenance8) was not included in ppEnabledExtensionNames."); - } VkPhysicalDeviceMaintenance8FeaturesKHR* structure = (VkPhysicalDeviceMaintenance8FeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::maintenance8), structure->maintenance8); } @@ -1995,16 +1712,17 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDeviceDepthClampZeroOneFeaturesKHR structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_KHR: { // Covers // VUID-VkPhysicalDeviceDepthClampZeroOneFeaturesKHR-sType-sType + + if ((!IsExtEnabled(extensions.vk_ext_depth_clamp_zero_one)) && + (!IsExtEnabled(extensions.vk_khr_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_KHR), but its parent extension " + "VK_EXT_depth_clamp_zero_one, or VK_KHR_depth_clamp_zero_one has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDeviceDepthClampZeroOneFeaturesKHR); - if (!IsExtEnabled(device_extensions.vk_khr_depth_clamp_zero_one) && - !IsExtEnabled(device_extensions.vk_ext_depth_clamp_zero_one)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDeviceDepthClampZeroOneFeaturesKHR, but when creating " - "VkDevice, the parent extension " - "(VK_KHR_depth_clamp_zero_one or VK_EXT_depth_clamp_zero_one) was not included in " - "ppEnabledExtensionNames."); - } VkPhysicalDeviceDepthClampZeroOneFeaturesKHR* structure = (VkPhysicalDeviceDepthClampZeroOneFeaturesKHR*)header; skip |= ValidateBool32(pNext_loc.dot(Field::depthClampZeroOne), structure->depthClampZeroOne); } @@ -2013,14 +1731,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(extensions.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); @@ -2031,14 +1751,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(extensions.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); } @@ -2047,14 +1769,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(extensions.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); } @@ -2063,14 +1786,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(extensions.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); @@ -2083,14 +1808,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(extensions.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); } @@ -2099,14 +1825,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(extensions.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); @@ -2117,14 +1845,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 (is_const_param) { + + if (!IsExtEnabled(extensions.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); @@ -2136,14 +1865,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(extensions.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), @@ -2154,14 +1885,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 (!IsExtEnabled(extensions.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); - 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."); - } VkPhysicalDeviceShaderSMBuiltinsFeaturesNV* structure = (VkPhysicalDeviceShaderSMBuiltinsFeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::shaderSMBuiltins), structure->shaderSMBuiltins); } @@ -2170,14 +1902,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(extensions.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); @@ -2188,14 +1921,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(extensions.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); @@ -2205,14 +1940,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(extensions.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); @@ -2223,14 +1959,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(extensions.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); } @@ -2239,14 +1977,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(extensions.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); } @@ -2255,14 +1994,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(extensions.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); @@ -2272,14 +2013,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(extensions.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); @@ -2293,14 +2036,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(extensions.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); } @@ -2309,14 +2053,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(extensions.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); @@ -2328,14 +2074,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(extensions.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); } @@ -2344,15 +2091,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(extensions.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), @@ -2363,14 +2112,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(extensions.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); @@ -2385,14 +2136,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(extensions.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); @@ -2404,14 +2156,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(extensions.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); @@ -2421,14 +2175,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(extensions.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 |= @@ -2444,14 +2200,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(extensions.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); } @@ -2460,14 +2218,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(extensions.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); @@ -2479,14 +2238,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(extensions.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); @@ -2517,14 +2278,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(extensions.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); @@ -2534,14 +2297,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(extensions.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); @@ -2554,14 +2318,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(extensions.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); @@ -2600,14 +2366,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(extensions.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); @@ -2617,14 +2385,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(extensions.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); @@ -2634,14 +2404,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(extensions.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); @@ -2651,14 +2423,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(extensions.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); @@ -2668,14 +2442,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(extensions.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); @@ -2691,14 +2467,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(extensions.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); } @@ -2707,14 +2485,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(extensions.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); @@ -2727,14 +2506,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(extensions.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); @@ -2746,14 +2527,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(extensions.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); } @@ -2762,14 +2544,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(extensions.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); } @@ -2778,14 +2561,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(extensions.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); } @@ -2794,14 +2578,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(extensions.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); @@ -2819,14 +2604,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(extensions.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); @@ -2836,15 +2623,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(extensions.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), @@ -2855,14 +2644,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(extensions.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); @@ -2878,14 +2669,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(extensions.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); @@ -2897,14 +2690,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(extensions.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); @@ -2914,14 +2709,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(extensions.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); } @@ -2930,14 +2727,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(extensions.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); @@ -2947,15 +2746,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(extensions.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); @@ -2965,14 +2766,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(extensions.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); @@ -2982,14 +2784,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(extensions.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); @@ -3000,17 +2803,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(extensions.vk_arm_rasterization_order_attachment_access)) && + (!IsExtEnabled(extensions.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), @@ -3027,14 +2832,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(extensions.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); @@ -3044,16 +2850,17 @@ 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(extensions.vk_ext_mutable_descriptor_type)) && + (!IsExtEnabled(extensions.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); @@ -3063,14 +2870,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(extensions.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); @@ -3080,14 +2889,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(extensions.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); @@ -3097,14 +2908,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(extensions.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); } @@ -3113,15 +2926,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(extensions.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); @@ -3134,15 +2949,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(extensions.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); @@ -3152,14 +2969,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(extensions.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); } @@ -3168,14 +2987,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(extensions.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); } @@ -3184,14 +3005,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(extensions.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); } @@ -3200,14 +3023,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(extensions.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); } @@ -3216,14 +3041,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(extensions.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); } @@ -3232,15 +3058,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(extensions.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), @@ -3251,14 +3079,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 (is_const_param) { + + if (!IsExtEnabled(extensions.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); @@ -3273,14 +3103,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(extensions.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); } @@ -3289,14 +3121,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(extensions.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); @@ -3312,14 +3146,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(extensions.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); } @@ -3328,14 +3164,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(extensions.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); } @@ -3344,14 +3181,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(extensions.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); @@ -3362,14 +3201,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(extensions.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); @@ -3385,14 +3225,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(extensions.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); @@ -3406,14 +3247,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(extensions.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); } @@ -3423,14 +3266,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(extensions.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); @@ -3443,14 +3288,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(extensions.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); @@ -3461,14 +3308,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(extensions.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); @@ -3478,14 +3327,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(extensions.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); } @@ -3494,14 +3345,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(extensions.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); } @@ -3510,15 +3363,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(extensions.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); @@ -3528,14 +3383,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(extensions.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); } @@ -3544,14 +3401,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(extensions.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); } @@ -3560,14 +3419,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(extensions.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); @@ -3577,14 +3438,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(extensions.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); } @@ -3593,14 +3456,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(extensions.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); } @@ -3609,15 +3474,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(extensions.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); @@ -3633,14 +3500,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(extensions.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); @@ -3650,15 +3519,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(extensions.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), @@ -3669,14 +3540,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(extensions.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); @@ -3689,14 +3561,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(extensions.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); @@ -3710,14 +3584,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(extensions.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), @@ -3818,14 +3694,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(extensions.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); @@ -3835,14 +3713,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(extensions.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); @@ -3852,14 +3732,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(extensions.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); } @@ -3868,14 +3749,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(extensions.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); } @@ -3885,14 +3767,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(extensions.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); @@ -3903,14 +3787,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(extensions.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); } @@ -3919,14 +3804,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(extensions.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); } @@ -3935,14 +3821,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(extensions.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); } @@ -3951,14 +3838,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(extensions.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); } @@ -3967,15 +3855,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(extensions.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); @@ -3985,15 +3875,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(extensions.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); @@ -4003,14 +3895,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(extensions.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); @@ -4020,14 +3914,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(extensions.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); @@ -4037,14 +3933,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(extensions.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); } @@ -4053,15 +3951,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(extensions.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); @@ -4071,15 +3971,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(extensions.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), @@ -4090,15 +3992,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(extensions.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); @@ -4108,14 +4012,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(extensions.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); @@ -4127,14 +4033,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(extensions.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); } @@ -4143,14 +4051,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(extensions.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); } @@ -4159,14 +4068,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(extensions.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); } @@ -4175,14 +4085,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(extensions.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); } @@ -4191,16 +4102,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(extensions.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), @@ -4212,15 +4124,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(extensions.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); @@ -4231,15 +4145,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(extensions.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); @@ -4249,14 +4165,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(extensions.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); } @@ -4265,14 +4182,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(extensions.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); @@ -4282,14 +4201,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(extensions.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); @@ -4299,15 +4220,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(extensions.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); @@ -4317,14 +4240,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(extensions.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); } @@ -4333,14 +4258,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(extensions.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); @@ -4353,14 +4280,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(extensions.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); @@ -4370,14 +4299,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(extensions.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); } @@ -4386,14 +4317,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(extensions.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); } @@ -4402,14 +4334,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 (!IsExtEnabled(extensions.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); - 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."); - } VkPhysicalDeviceCooperativeMatrix2FeaturesNV* structure = (VkPhysicalDeviceCooperativeMatrix2FeaturesNV*)header; skip |= ValidateBool32(pNext_loc.dot(Field::cooperativeMatrixWorkgroupScope), structure->cooperativeMatrixWorkgroupScope); @@ -4434,14 +4368,16 @@ bool StatelessValidation::ValidatePnextFeatureStructContents(const Location& loc // Validation code for VkPhysicalDevicePipelineOpacityMicromapFeaturesARM structure members case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_OPACITY_MICROMAP_FEATURES_ARM: { // Covers // VUID-VkPhysicalDevicePipelineOpacityMicromapFeaturesARM-sType-sType + + if (!IsExtEnabled(extensions.vk_arm_pipeline_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_PIPELINE_OPACITY_MICROMAP_FEATURES_ARM), but its parent extension " + "VK_ARM_pipeline_opacity_micromap has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkPhysicalDevicePipelineOpacityMicromapFeaturesARM); - if (!IsExtEnabled(device_extensions.vk_arm_pipeline_opacity_micromap)) { - skip |= LogError(pnext_vuid, instance, pNext_loc, - "includes a pointer to a VkPhysicalDevicePipelineOpacityMicromapFeaturesARM, but when " - "creating VkDevice, the parent extension " - "(VK_ARM_pipeline_opacity_micromap) was not included in ppEnabledExtensionNames."); - } VkPhysicalDevicePipelineOpacityMicromapFeaturesARM* structure = (VkPhysicalDevicePipelineOpacityMicromapFeaturesARM*)header; skip |= ValidateBool32(pNext_loc.dot(Field::pipelineOpacityMicromap), structure->pipelineOpacityMicromap); @@ -4451,14 +4387,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(extensions.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); @@ -4468,14 +4406,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(extensions.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); @@ -4497,14 +4437,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(extensions.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); @@ -4524,14 +4466,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(extensions.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); } @@ -4540,14 +4483,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(extensions.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); @@ -4568,27 +4512,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 stateless::Context::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 (extensions.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(extensions.api_version).c_str()); } } break; @@ -4596,12 +4533,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(extensions.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; @@ -4609,12 +4545,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(extensions.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; @@ -4622,32 +4557,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 (extensions.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(extensions.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(extensions.vk_khr_external_fence_capabilities)) && + (!IsExtEnabled(extensions.vk_khr_external_memory_capabilities)) && + (!IsExtEnabled(extensions.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; @@ -4655,12 +4585,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(extensions.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; @@ -4668,18 +4597,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 (extensions.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(extensions.api_version).c_str()); } } break; @@ -4687,30 +4611,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 (extensions.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(extensions.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(extensions.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; @@ -4718,12 +4636,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(extensions.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; @@ -4731,12 +4648,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(extensions.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; @@ -4744,9 +4660,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(extensions.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."); @@ -4757,9 +4673,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(extensions.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."); @@ -4770,12 +4686,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(extensions.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; @@ -4783,18 +4698,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 (extensions.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(extensions.api_version).c_str()); } } break; @@ -4802,9 +4712,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(extensions.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."); @@ -4815,9 +4725,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(extensions.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."); @@ -4828,13 +4738,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(extensions.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; @@ -4842,9 +4751,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(extensions.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."); @@ -4855,12 +4764,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(extensions.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; @@ -4868,18 +4776,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 (extensions.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(extensions.api_version).c_str()); } } break; @@ -4887,14 +4790,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(extensions.vk_ext_line_rasterization)) && (!IsExtEnabled(extensions.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; @@ -4902,13 +4802,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(extensions.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; @@ -4916,12 +4815,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(extensions.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; @@ -4929,12 +4827,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(extensions.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; @@ -4942,12 +4839,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(extensions.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; @@ -4955,12 +4851,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(extensions.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; @@ -4968,48 +4863,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(extensions.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(extensions.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(extensions.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(extensions.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; - // No Validation code for VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR-sType-sType + // Validation code for VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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); @@ -5026,104 +4959,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(extensions.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(extensions.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; + + // Validation code for VkPhysicalDeviceMaintenance7PropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceMaintenance7PropertiesKHR-sType-sType + + if (!IsExtEnabled(extensions.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; + + // 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 VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceMaintenance7PropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceMaintenance7PropertiesKHR-sType-sType + // Validation code for VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX: { // Covers + // VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType - // No Validation code for VkPhysicalDeviceTransformFeedbackPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceTransformFeedbackPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX structure members -- Covers - // VUID-VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX-sType-sType + // Validation code for VkPhysicalDeviceDiscardRectanglePropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceDiscardRectanglePropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDiscardRectanglePropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; + + // 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(extensions.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(extensions.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 + + if (!IsExtEnabled(extensions.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; + + // Validation code for VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType + + if (!IsExtEnabled(extensions.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; + + // Validation code for VkPhysicalDeviceShaderSMBuiltinsPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceShaderSMBuiltinsPropertiesNV-sType-sType + + if (!IsExtEnabled(extensions.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; + + // Validation code for VkPhysicalDeviceShadingRateImagePropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceShadingRateImagePropertiesNV-sType-sType + + if (!IsExtEnabled(extensions.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; + + // Validation code for VkPhysicalDeviceRayTracingPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceRayTracingPropertiesNV-sType-sType + + if (!IsExtEnabled(extensions.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; + + // Validation code for VkPhysicalDeviceExternalMemoryHostPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType + + if (!IsExtEnabled(extensions.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; + + // Validation code for VkPhysicalDeviceShaderCorePropertiesAMD structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD: { // Covers + // VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType + + if (!IsExtEnabled(extensions.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; + + // Validation code for VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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; + + // 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 VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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 VkPhysicalDeviceShaderSMBuiltinsPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceShaderSMBuiltinsPropertiesNV-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 VkPhysicalDeviceShadingRateImagePropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceShadingRateImagePropertiesNV-sType-sType + if (!IsExtEnabled(extensions.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 VkPhysicalDeviceRayTracingPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceRayTracingPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceShaderCoreProperties2AMD structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD: { // Covers + // VUID-VkPhysicalDeviceShaderCoreProperties2AMD-sType-sType - // No Validation code for VkPhysicalDeviceExternalMemoryHostPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceExternalMemoryHostPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceShaderCorePropertiesAMD structure members -- Covers - // VUID-VkPhysicalDeviceShaderCorePropertiesAMD-sType-sType + // Validation code for VkPhysicalDeviceCooperativeMatrixPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceCooperativeMatrixPropertiesNV-sType-sType - // No Validation code for VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceMeshShaderPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceMeshShaderPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceProvokingVertexPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceProvokingVertexPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDevicePCIBusInfoPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDevicePCIBusInfoPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceFragmentDensityMapPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceFragmentDensityMapPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceMapMemoryPlacedPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAP_MEMORY_PLACED_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceMapMemoryPlacedPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceShaderCoreProperties2AMD structure members -- Covers - // VUID-VkPhysicalDeviceShaderCoreProperties2AMD-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceCooperativeMatrixPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceCooperativeMatrixPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV-sType-sType - // No Validation code for VkPhysicalDeviceProvokingVertexPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceProvokingVertexPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceMapMemoryPlacedPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceMapMemoryPlacedPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceRobustness2PropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceRobustness2PropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceRobustness2PropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceRobustness2PropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceCustomBorderColorPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceCustomBorderColorPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceCustomBorderColorPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceCustomBorderColorPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceCudaKernelLaunchPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceCudaKernelLaunchPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceCudaKernelLaunchPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceCudaKernelLaunchPropertiesNV-sType-sType - // No Validation code for VkPhysicalDeviceDescriptorBufferPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDescriptorBufferPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceDescriptorBufferPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceDescriptorBufferPropertiesEXT-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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(extensions.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), @@ -5137,97 +5356,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(extensions.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(extensions.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(extensions.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; + + // Validation code for VkPhysicalDeviceSubpassShadingPropertiesHUAWEI structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI: { // Covers + // VUID-VkPhysicalDeviceSubpassShadingPropertiesHUAWEI-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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 VkPhysicalDeviceSubpassShadingPropertiesHUAWEI structure members -- Covers - // VUID-VkPhysicalDeviceSubpassShadingPropertiesHUAWEI-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 VkPhysicalDeviceMultiDrawPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceMultiDrawPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceShaderTileImagePropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceShaderTileImagePropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceOpacityMicromapPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceOpacityMicromapPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceOpacityMicromapPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceOpacityMicromapPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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(extensions.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(extensions.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; - // No Validation code for VkPhysicalDeviceShaderCorePropertiesARM structure members -- Covers - // VUID-VkPhysicalDeviceShaderCorePropertiesARM-sType-sType + // Validation code for VkPhysicalDeviceShaderCorePropertiesARM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM: { // Covers + // VUID-VkPhysicalDeviceShaderCorePropertiesARM-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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 + + if (!IsExtEnabled(extensions.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; + + // 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 VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM structure members -- Covers - // VUID-VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM-sType-sType + if (!IsExtEnabled(extensions.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(extensions.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; + + // Validation code for VkPhysicalDeviceMemoryDecompressionPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceMemoryDecompressionPropertiesNV-sType-sType + + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceCopyMemoryIndirectPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceCopyMemoryIndirectPropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceImageProcessingPropertiesQCOM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM: { // Covers + // VUID-VkPhysicalDeviceImageProcessingPropertiesQCOM-sType-sType - // No Validation code for VkPhysicalDeviceMemoryDecompressionPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceMemoryDecompressionPropertiesNV-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceImageProcessingPropertiesQCOM structure members -- Covers - // VUID-VkPhysicalDeviceImageProcessingPropertiesQCOM-sType-sType + // Validation code for VkPhysicalDeviceNestedCommandBufferPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceNestedCommandBufferPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceNestedCommandBufferPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceNestedCommandBufferPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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(extensions.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), @@ -5235,67 +5612,217 @@ bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& lo } } break; - // No Validation code for VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT-sType-sType - - // No Validation code for VkPhysicalDeviceOpticalFlowPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceOpticalFlowPropertiesNV-sType-sType -#ifdef VK_USE_PLATFORM_ANDROID_KHR + // Validation code for VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT-sType-sType + + if (!IsExtEnabled(extensions.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; + + // Validation code for VkPhysicalDeviceOpticalFlowPropertiesNV structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV: { // Covers + // VUID-VkPhysicalDeviceOpticalFlowPropertiesNV-sType-sType + + if (!IsExtEnabled(extensions.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 + + // Validation code for VkPhysicalDeviceExternalFormatResolvePropertiesANDROID structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID: { // Covers + // VUID-VkPhysicalDeviceExternalFormatResolvePropertiesANDROID-sType-sType + + if (!IsExtEnabled(extensions.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 + + // Validation code for VkPhysicalDeviceShaderObjectPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceShaderObjectPropertiesEXT-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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; + + // 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(extensions.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(extensions.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); + VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT* structure = + (VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT*)header; + skip |= ValidateBool32(pNext_loc.dot(Field::nativeUnalignedPerformance), structure->nativeUnalignedPerformance); + } + } break; + + // Validation code for VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM: { // Covers + // VUID-VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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 VkPhysicalDeviceExternalFormatResolvePropertiesANDROID structure members -- Covers - // VUID-VkPhysicalDeviceExternalFormatResolvePropertiesANDROID-sType-sType -#endif // VK_USE_PLATFORM_ANDROID_KHR + if (!IsExtEnabled(extensions.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 VkPhysicalDeviceShaderObjectPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceShaderObjectPropertiesEXT-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 VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV-sType-sType + if (!IsExtEnabled(extensions.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 VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceImageAlignmentControlPropertiesMESA structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA: { // Covers + // VUID-VkPhysicalDeviceImageAlignmentControlPropertiesMESA-sType-sType - // Validation code for VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT structure members - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT: { // Covers - // VUID-VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT-sType-sType - 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); + if (!IsExtEnabled(extensions.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 VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM structure members -- Covers - // VUID-VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM-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 VkPhysicalDeviceImageProcessing2PropertiesQCOM structure members -- Covers - // VUID-VkPhysicalDeviceImageProcessing2PropertiesQCOM-sType-sType - - // No Validation code for VkPhysicalDeviceLayeredDriverPropertiesMSFT structure members -- Covers - // VUID-VkPhysicalDeviceLayeredDriverPropertiesMSFT-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT-sType-sType + // Validation code for VkPhysicalDeviceAccelerationStructurePropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceAccelerationStructurePropertiesKHR-sType-sType - // No Validation code for VkPhysicalDeviceImageAlignmentControlPropertiesMESA structure members -- Covers - // VUID-VkPhysicalDeviceImageAlignmentControlPropertiesMESA-sType-sType + if (!IsExtEnabled(extensions.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 VkPhysicalDeviceCooperativeMatrix2PropertiesNV structure members -- Covers - // VUID-VkPhysicalDeviceCooperativeMatrix2PropertiesNV-sType-sType + // Validation code for VkPhysicalDeviceRayTracingPipelinePropertiesKHR structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR: { // Covers + // VUID-VkPhysicalDeviceRayTracingPipelinePropertiesKHR-sType-sType - // No Validation code for VkPhysicalDeviceAccelerationStructurePropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceAccelerationStructurePropertiesKHR-sType-sType + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceRayTracingPipelinePropertiesKHR structure members -- Covers - // VUID-VkPhysicalDeviceRayTracingPipelinePropertiesKHR-sType-sType + // Validation code for VkPhysicalDeviceMeshShaderPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceMeshShaderPropertiesEXT-sType-sType - // No Validation code for VkPhysicalDeviceMeshShaderPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceMeshShaderPropertiesEXT-sType-sType + if (!IsExtEnabled(extensions.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; @@ -5304,10 +5831,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 stateless::Context::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 @@ -5329,7 +5855,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), @@ -5344,7 +5870,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"); } } @@ -5354,46 +5880,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(extensions.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(extensions.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(extensions.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; @@ -5401,19 +5920,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(extensions.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, @@ -5425,31 +5939,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(extensions.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(extensions.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, @@ -5469,31 +5977,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(extensions.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(extensions.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, @@ -5504,19 +6006,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(extensions.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, @@ -5532,11 +6029,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(extensions.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); @@ -5550,11 +6047,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(extensions.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); @@ -5690,19 +6187,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(extensions.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, @@ -5714,11 +6207,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"); } } } @@ -5727,23 +6220,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(extensions.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; @@ -5752,43 +6239,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(extensions.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(extensions.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, @@ -5807,17 +6285,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 (extensions.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(extensions.api_version).c_str()); } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkProtectedSubmitInfo); @@ -5829,19 +6302,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(extensions.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); } @@ -5850,22 +6318,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(extensions.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"); } @@ -5875,22 +6338,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(extensions.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"); } @@ -5900,9 +6358,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(extensions.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."); @@ -5913,51 +6371,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(extensions.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(extensions.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(extensions.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; @@ -5965,22 +6418,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(extensions.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; @@ -5988,22 +6436,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(extensions.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; @@ -6011,22 +6454,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(extensions.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; @@ -6034,42 +6472,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(extensions.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(extensions.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, @@ -6081,19 +6509,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(extensions.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, @@ -6106,20 +6530,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(extensions.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), @@ -6132,10 +6551,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(extensions.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."); @@ -6146,19 +6564,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(extensions.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), @@ -6176,11 +6589,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; @@ -6188,22 +6601,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(extensions.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"); } @@ -6212,42 +6620,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(extensions.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(extensions.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), @@ -6261,20 +6659,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), @@ -6291,19 +6689,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(extensions.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, @@ -6314,22 +6707,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(extensions.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; @@ -6337,62 +6725,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(extensions.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(extensions.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(extensions.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; @@ -6400,12 +6776,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(extensions.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; @@ -6413,12 +6788,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(extensions.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; @@ -6426,19 +6800,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(extensions.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, @@ -6463,47 +6832,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(extensions.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(extensions.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; @@ -6511,13 +6874,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(extensions.vk_ext_shader_object)) && (!IsExtEnabled(extensions.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; @@ -6525,19 +6887,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(extensions.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, @@ -6550,9 +6907,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(extensions.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."); @@ -6562,12 +6919,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(extensions.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; @@ -6575,39 +6931,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(extensions.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; @@ -6615,10 +6966,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(extensions.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."); } @@ -6628,26 +6978,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(extensions.vk_ext_global_priority)) && (!IsExtEnabled(extensions.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; @@ -6655,14 +6997,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(extensions.vk_ext_global_priority_query)) && (!IsExtEnabled(extensions.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; @@ -6670,28 +7009,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(extensions.vk_ext_line_rasterization)) && (!IsExtEnabled(extensions.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); } @@ -6701,23 +7030,16 @@ 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(extensions.vk_ext_vertex_attribute_divisor)) && + (!IsExtEnabled(extensions.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, @@ -6737,22 +7059,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(extensions.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"); } @@ -6761,36 +7078,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(extensions.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(extensions.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; @@ -6798,31 +7109,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(extensions.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(extensions.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"); @@ -6832,47 +7137,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(extensions.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(extensions.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; @@ -6880,26 +7177,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(extensions.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(extensions.vk_khr_device_group)) && (!IsExtEnabled(extensions.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(extensions.vk_khr_device_group)) && (!IsExtEnabled(extensions.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); } @@ -6907,19 +7214,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(extensions.vk_khr_device_group)) && (!IsExtEnabled(extensions.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"); } @@ -6928,15 +7238,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(extensions.vk_khr_device_group)) && (!IsExtEnabled(extensions.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"); } @@ -6944,52 +7257,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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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; @@ -7004,53 +7352,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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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; @@ -7058,12 +7445,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(extensions.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(extensions.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 = @@ -7078,6 +7483,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(extensions.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; @@ -7087,11 +7500,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(extensions.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(extensions.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; @@ -7109,8 +7539,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, @@ -7127,6 +7556,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(extensions.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; @@ -7135,17 +7571,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(extensions.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(extensions.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; @@ -7153,6 +7604,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(extensions.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; @@ -7167,6 +7625,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(extensions.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; @@ -7174,12 +7639,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(extensions.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(extensions.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; @@ -7187,15 +7667,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(extensions.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(extensions.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(extensions.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 = @@ -7210,6 +7717,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(extensions.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; @@ -7221,11 +7736,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(extensions.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(extensions.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; @@ -7245,7 +7777,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), @@ -7261,6 +7793,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(extensions.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; @@ -7269,17 +7808,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(extensions.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(extensions.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; @@ -7287,6 +7841,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(extensions.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; @@ -7301,6 +7862,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(extensions.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; @@ -7310,22 +7878,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(extensions.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(extensions.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(extensions.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; @@ -7342,6 +7933,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(extensions.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 = @@ -7368,6 +7967,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(extensions.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; @@ -7383,6 +7989,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(extensions.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; @@ -7394,35 +8007,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(extensions.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(extensions.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(extensions.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 @@ -7430,12 +8057,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(extensions.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, @@ -7459,20 +8089,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(extensions.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(extensions.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(extensions.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, @@ -7494,23 +8145,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(extensions.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(extensions.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(extensions.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, @@ -7519,18 +8190,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(extensions.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(extensions.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(extensions.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(extensions.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; @@ -7551,6 +8254,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(extensions.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 = @@ -7582,6 +8293,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(extensions.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; @@ -7597,6 +8315,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(extensions.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; @@ -7608,12 +8333,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(extensions.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), @@ -7631,46 +8359,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(extensions.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(extensions.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(extensions.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(extensions.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, @@ -7680,11 +8432,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(extensions.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), @@ -7693,44 +8449,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(extensions.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(extensions.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(extensions.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(extensions.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; @@ -7740,7 +8524,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, @@ -7761,24 +8545,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(extensions.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(extensions.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); } @@ -7786,12 +8582,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(extensions.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, @@ -7801,6 +8600,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(extensions.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; @@ -7808,12 +8614,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(extensions.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(extensions.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; @@ -7824,6 +8646,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(extensions.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; @@ -7844,6 +8673,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(extensions.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; @@ -7852,15 +8688,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(extensions.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(extensions.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(extensions.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; @@ -7871,6 +8731,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(extensions.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; @@ -7881,16 +8749,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(extensions.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"); @@ -7903,6 +8778,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(extensions.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; @@ -7911,12 +8793,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(extensions.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(extensions.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; @@ -7927,11 +8824,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(extensions.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; @@ -7939,6 +8843,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(extensions.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; @@ -7950,53 +8861,162 @@ 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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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 VkMemoryBarrierAccessFlags3KHR structure members case VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR: { // Covers VUID-VkMemoryBarrierAccessFlags3KHR-sType-sType + + if (!IsExtEnabled(extensions.vk_khr_maintenance8)) { + skip |= log.LogError(pnext_vuid, error_obj.handle, loc.dot(Field::pNext), + "includes a pointer to a VkStructureType " + "(VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR), but its parent extension " + "VK_KHR_maintenance8 has not been enabled."); + } if (is_const_param) { [[maybe_unused]] const Location pNext_loc = loc.pNext(Struct::VkMemoryBarrierAccessFlags3KHR); - if (!IsExtEnabled(device_extensions.vk_khr_maintenance8)) { - skip |= - LogError(pnext_vuid, instance, pNext_loc, "extended struct requires the extensions VK_KHR_maintenance8"); - } VkMemoryBarrierAccessFlags3KHR* structure = (VkMemoryBarrierAccessFlags3KHR*)header; skip |= ValidateFlags(pNext_loc.dot(Field::srcAccessMask3), vvl::FlagBitmask::VkAccessFlagBits3KHR, - AllVkAccessFlagBits3KHR, structure->srcAccessMask3, kOptionalFlags, VK_NULL_HANDLE, + AllVkAccessFlagBits3KHR, structure->srcAccessMask3, kOptionalFlags, "VUID-VkMemoryBarrierAccessFlags3KHR-srcAccessMask3-parameter"); skip |= ValidateFlags(pNext_loc.dot(Field::dstAccessMask3), vvl::FlagBitmask::VkAccessFlagBits3KHR, - AllVkAccessFlagBits3KHR, structure->dstAccessMask3, kOptionalFlags, VK_NULL_HANDLE, + AllVkAccessFlagBits3KHR, structure->dstAccessMask3, kOptionalFlags, "VUID-VkMemoryBarrierAccessFlags3KHR-dstAccessMask3-parameter"); } } break; @@ -8004,11 +9024,18 @@ bool StatelessValidation::ValidatePnextStructContents(const Location& loc, const // Validation code for VkDebugReportCallbackCreateInfoEXT structure members case VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: { // Covers // VUID-VkDebugReportCallbackCreateInfoEXT-sType-sType + + if (!IsExtEnabled(extensions.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), @@ -8020,29 +9047,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(extensions.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(extensions.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); } @@ -8051,29 +9085,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(extensions.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(extensions.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(extensions.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, @@ -8084,78 +9134,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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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, @@ -8182,6 +9264,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(extensions.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; @@ -8195,28 +9284,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(extensions.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(extensions.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); @@ -8226,12 +9322,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(extensions.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); @@ -8243,27 +9343,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(extensions.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(extensions.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", @@ -8280,12 +9386,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(extensions.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); @@ -8297,12 +9406,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(extensions.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"); @@ -8318,19 +9430,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"); } } } @@ -8339,33 +9451,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(extensions.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(extensions.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, @@ -8374,20 +9493,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(extensions.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, @@ -8399,17 +9521,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(extensions.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(extensions.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; @@ -8419,11 +9555,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"); @@ -8434,49 +9570,111 @@ 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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_amd_mixed_attachment_samples)) && + (!IsExtEnabled(extensions.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(extensions.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, @@ -8495,12 +9693,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(extensions.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), @@ -8588,12 +9789,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(extensions.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); @@ -8619,32 +9824,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(extensions.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(extensions.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"); @@ -8656,54 +9869,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(extensions.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(extensions.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(extensions.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(extensions.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, @@ -8715,12 +9946,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(extensions.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, @@ -8737,18 +9972,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(extensions.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(extensions.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); } @@ -8757,12 +10004,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(extensions.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); @@ -8772,17 +10023,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(extensions.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), @@ -8797,7 +10052,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), @@ -8822,11 +10077,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(extensions.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), @@ -8839,13 +10098,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(extensions.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), @@ -8856,34 +10119,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(extensions.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(extensions.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(extensions.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, @@ -8894,12 +10174,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(extensions.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"); @@ -8909,62 +10192,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(extensions.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 -#endif // VK_USE_PLATFORM_GGP + // Validation code for VkPresentFrameTokenGGP structure members + case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: { // Covers VUID-VkPresentFrameTokenGGP-sType-sType + + if (!IsExtEnabled(extensions.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 + + // 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(extensions.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 - // No Validation code for VkPipelineViewportExclusiveScissorStateCreateInfoNV structure members -- Covers - // VUID-VkPipelineViewportExclusiveScissorStateCreateInfoNV-sType-sType + if (!IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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); } @@ -8973,48 +10309,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(extensions.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(extensions.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; + + // Validation code for VkPhysicalDeviceMemoryBudgetPropertiesEXT structure members + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT: { // Covers + // VUID-VkPhysicalDeviceMemoryBudgetPropertiesEXT-sType-sType + + if (!IsExtEnabled(extensions.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; - // No Validation code for VkPhysicalDeviceMemoryBudgetPropertiesEXT structure members -- Covers - // VUID-VkPhysicalDeviceMemoryBudgetPropertiesEXT-sType-sType + // Validation code for VkMemoryPriorityAllocateInfoEXT structure members + case VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT: { // Covers VUID-VkMemoryPriorityAllocateInfoEXT-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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(extensions.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; @@ -9035,38 +10411,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(extensions.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(extensions.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 @@ -9074,52 +10457,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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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; - // No Validation code for VkSurfacePresentScalingCapabilitiesEXT structure members -- Covers - // VUID-VkSurfacePresentScalingCapabilitiesEXT-sType-sType + // Validation code for VkSurfacePresentScalingCapabilitiesEXT structure members + case VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT: { // Covers + // VUID-VkSurfacePresentScalingCapabilitiesEXT-sType-sType - // No Validation code for VkSurfacePresentModeCompatibilityEXT structure members -- Covers - // VUID-VkSurfacePresentModeCompatibilityEXT-sType-sType + if (!IsExtEnabled(extensions.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; + + // Validation code for VkSurfacePresentModeCompatibilityEXT structure members + case VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT: { // Covers + // VUID-VkSurfacePresentModeCompatibilityEXT-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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, @@ -9131,12 +10572,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(extensions.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), @@ -9148,12 +10592,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(extensions.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, @@ -9165,23 +10612,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(extensions.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; @@ -9189,12 +10639,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(extensions.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, @@ -9205,9 +10658,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, @@ -9229,23 +10682,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), @@ -9293,37 +10746,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(extensions.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(extensions.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(extensions.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(extensions.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); } @@ -9332,12 +10810,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(extensions.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"); @@ -9354,30 +10835,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(extensions.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(extensions.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(extensions.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); } @@ -9386,26 +10882,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(extensions.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(extensions.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"); @@ -9415,30 +10918,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(extensions.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(extensions.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(extensions.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); } @@ -9446,85 +10963,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(extensions.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(extensions.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(extensions.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"); - } 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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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); @@ -9534,12 +11099,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(extensions.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, @@ -9550,61 +11118,113 @@ 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(extensions.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(extensions.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(extensions.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(extensions.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 + + if (!IsExtEnabled(extensions.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(extensions.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; - // No Validation code for VkImageCompressionControlEXT structure members -- Covers - // VUID-VkImageCompressionControlEXT-sType-sType + // 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(extensions.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(extensions.vk_ext_mutable_descriptor_type)) && + (!IsExtEnabled(extensions.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, @@ -9631,32 +11251,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(extensions.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(extensions.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); @@ -9667,28 +11294,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(extensions.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(extensions.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); } @@ -9697,12 +11330,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(extensions.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); } @@ -9711,12 +11347,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(extensions.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); } @@ -9726,12 +11365,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(extensions.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); } @@ -9739,37 +11381,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(extensions.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(extensions.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(extensions.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"); } @@ -9777,12 +11434,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(extensions.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, @@ -9790,23 +11450,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(extensions.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(extensions.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) { @@ -9826,29 +11497,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(extensions.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) { @@ -9868,13 +11540,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(extensions.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); @@ -9884,44 +11560,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(extensions.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 + + if (!IsExtEnabled(extensions.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 - // No Validation code for VkImageViewSlicedCreateInfoEXT structure members -- Covers - // VUID-VkImageViewSlicedCreateInfoEXT-sType-sType + if (!IsExtEnabled(extensions.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(extensions.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, @@ -9934,7 +11635,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); } } } @@ -9942,12 +11643,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(extensions.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, @@ -9961,10 +11665,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); @@ -9972,7 +11675,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"); } } } @@ -9981,12 +11684,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(extensions.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, @@ -10003,21 +11710,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(extensions.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(extensions.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(extensions.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); } @@ -10025,12 +11753,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(extensions.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); } @@ -10039,12 +11770,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(extensions.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"); @@ -10054,12 +11788,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(extensions.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"); @@ -10068,11 +11805,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(extensions.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, @@ -10093,12 +11837,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(extensions.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), @@ -10109,14 +11857,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(extensions.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"); } @@ -10125,11 +11877,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(extensions.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"); @@ -10137,40 +11894,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(extensions.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 - // No Validation code for VkLatencySubmissionPresentIdNV structure members -- Covers - // VUID-VkLatencySubmissionPresentIdNV-sType-sType + if (!IsExtEnabled(extensions.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; + + // Validation code for VkLatencySubmissionPresentIdNV structure members + case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: { // Covers VUID-VkLatencySubmissionPresentIdNV-sType-sType + + if (!IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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 |= @@ -10183,60 +11982,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(extensions.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(extensions.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(extensions.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(extensions.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); @@ -10246,39 +12056,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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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); } @@ -10286,12 +12138,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(extensions.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, @@ -10299,34 +12154,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(extensions.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(extensions.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(extensions.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, @@ -10338,12 +12209,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(extensions.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), @@ -10359,68 +12234,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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -10429,11 +12250,12 @@ bool StatelessValidation::PreCallValidateEnumeratePhysicalDevices(VkInstance ins VkPhysicalDevice* pPhysicalDevices, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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; } @@ -10441,8 +12263,12 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFeatures(VkPhysicalDev VkPhysicalDeviceFeatures* pFeatures, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.ValidateRequiredPointer(loc.dot(Field::pFeatures), pFeatures, + "VUID-vkGetPhysicalDeviceFeatures-pFeatures-parameter"); return skip; } @@ -10450,11 +12276,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFormatProperties(VkPhy VkFormatProperties* pFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceFormatProperties-format-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pFormatProperties), pFormatProperties, + "VUID-vkGetPhysicalDeviceFormatProperties-pFormatProperties-parameter"); return skip; } @@ -10464,23 +12293,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); + stateless::Context context(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); + [[maybe_unused]] const Location loc = error_obj.location; + skip |= context.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceImageFormatProperties-format-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, + "VUID-vkGetPhysicalDeviceImageFormatProperties-type-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, + "VUID-vkGetPhysicalDeviceImageFormatProperties-tiling-parameter"); + skip |= context.ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, + kRequiredFlags, "VUID-vkGetPhysicalDeviceImageFormatProperties-usage-parameter", + "VUID-vkGetPhysicalDeviceImageFormatProperties-usage-requiredbitmask"); + skip |= context.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, flags, + kOptionalFlags, "VUID-vkGetPhysicalDeviceImageFormatProperties-flags-parameter"); + skip |= context.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, context); return skip; } @@ -10488,9 +12320,12 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceProperties(VkPhysicalD VkPhysicalDeviceProperties* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.ValidateRequiredPointer(loc.dot(Field::pProperties), pProperties, + "VUID-vkGetPhysicalDeviceProperties-pProperties-parameter"); return skip; } @@ -10499,11 +12334,15 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceQueueFamilyProperties( VkQueueFamilyProperties* pQueueFamilyProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.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) { @@ -10519,9 +12358,12 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceMemoryProperties(VkPhy VkPhysicalDeviceMemoryProperties* pMemoryProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.ValidateRequiredPointer(loc.dot(Field::pMemoryProperties), pMemoryProperties, + "VUID-vkGetPhysicalDeviceMemoryProperties-pMemoryProperties-parameter"); return skip; } @@ -10529,9 +12371,10 @@ bool StatelessValidation::PreCallValidateCreateDevice(VkPhysicalDevice physicalD const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[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 |= context.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 = { @@ -10750,15 +12593,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 |= context.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 |= context.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkDeviceCreateInfo-flags-zerobitmask"); - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -10773,50 +12615,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 |= context.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 |= ValidateFlags(pQueueCreateInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkDeviceQueueCreateFlagBits, - AllVkDeviceQueueCreateFlagBits, pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].flags, - kOptionalFlags, VK_NULL_HANDLE, "VUID-VkDeviceQueueCreateInfo-flags-parameter"); + skip |= context.ValidateFlags(pQueueCreateInfos_loc.dot(Field::flags), + vvl::FlagBitmask::VkDeviceQueueCreateFlagBits, AllVkDeviceQueueCreateFlagBits, + pCreateInfo->pQueueCreateInfos[queueCreateInfoIndex].flags, kOptionalFlags, + "VUID-VkDeviceQueueCreateInfo-flags-parameter"); - 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"); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pDevice), pDevice, "VUID-vkCreateDevice-pDevice-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice, context); return skip; } bool StatelessValidation::PreCallValidateDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -10824,18 +12669,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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredPointer(loc.dot(Field::pQueue), pQueue, "VUID-vkGetDeviceQueue-pQueue-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.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); @@ -10850,26 +12697,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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; @@ -10877,6 +12724,7 @@ bool StatelessValidation::PreCallValidateQueueSubmit(VkQueue queue, uint32_t sub bool StatelessValidation::PreCallValidateQueueWaitIdle(VkQueue queue, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -10884,6 +12732,7 @@ bool StatelessValidation::PreCallValidateQueueWaitIdle(VkQueue queue, const Erro bool StatelessValidation::PreCallValidateDeviceWaitIdle(VkDevice device, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -10893,9 +12742,10 @@ bool StatelessValidation::PreCallValidateAllocateMemory(VkDevice device, const V const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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, @@ -10918,27 +12768,28 @@ 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 |= + context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pMemory), pMemory, "VUID-vkAllocateMemory-pMemory-parameter"); + if (!skip) skip |= manual_PreCallValidateAllocateMemory(device, pAllocateInfo, pAllocator, pMemory, context); return skip; } bool StatelessValidation::PreCallValidateFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -10946,18 +12797,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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= context.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkMemoryMapFlagBits, AllVkMemoryMapFlagBits, flags, + kOptionalFlags, "VUID-vkMapMemory-flags-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= context.ValidateRequiredHandle(loc.dot(Field::memory), memory); return skip; } @@ -10965,19 +12818,20 @@ bool StatelessValidation::PreCallValidateFlushMappedMemoryRanges(VkDevice device const VkMappedMemoryRange* pMemoryRanges, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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 |= context.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 |= context.ValidateRequiredHandle(pMemoryRanges_loc.dot(Field::memory), pMemoryRanges[memoryRangeIndex].memory); } } return skip; @@ -10987,20 +12841,21 @@ bool StatelessValidation::PreCallValidateInvalidateMappedMemoryRanges(VkDevice d const VkMappedMemoryRange* pMemoryRanges, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pMemoryRanges_loc.dot(Field::memory), pMemoryRanges[memoryRangeIndex].memory); } } return skip; @@ -11010,28 +12865,31 @@ bool StatelessValidation::PreCallValidateGetDeviceMemoryCommitment(VkDevice devi VkDeviceSize* pCommittedMemoryInBytes, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::image), image); - skip |= ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= context.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= context.ValidateRequiredHandle(loc.dot(Field::memory), memory); return skip; } @@ -11039,10 +12897,11 @@ bool StatelessValidation::PreCallValidateGetBufferMemoryRequirements(VkDevice de VkMemoryRequirements* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, + "VUID-vkGetBufferMemoryRequirements-pMemoryRequirements-parameter"); return skip; } @@ -11050,10 +12909,11 @@ bool StatelessValidation::PreCallValidateGetImageMemoryRequirements(VkDevice dev VkMemoryRequirements* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, + "VUID-vkGetImageMemoryRequirements-pMemoryRequirements-parameter"); return skip; } @@ -11061,12 +12921,14 @@ bool StatelessValidation::PreCallValidateGetImageSparseMemoryRequirements( VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= + context.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) { @@ -11083,23 +12945,27 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSparseImageFormatPrope VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter", physicalDevice); - skip |= ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, - "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-parameter", physicalDevice); + skip |= context.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-format-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-type-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"); + context.ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, samples, + kRequiredSingleBit, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-parameter", + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-samples-parameter"); + skip |= context.ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, + kRequiredFlags, "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-parameter", + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-usage-requiredbitmask"); + skip |= context.ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, + "VUID-vkGetPhysicalDeviceSparseImageFormatProperties-tiling-parameter"); + skip |= context.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); @@ -11112,10 +12978,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; + stateless::Context context(*this, error_obj, 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 |= context.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); @@ -11123,122 +12990,127 @@ 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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= + context.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, context); return skip; } @@ -11246,37 +13118,39 @@ bool StatelessValidation::PreCallValidateCreateFence(VkDevice device, const VkFe const VkAllocationCallbacks* pAllocator, VkFence* pFence, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkCreateFence-pFence-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11284,26 +13158,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; + stateless::Context context(*this, error_obj, 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 |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::fence), fence); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateHandleArray(loc.dot(Field::fenceCount), loc.dot(Field::pFences), fenceCount, pFences, true, true, + "VUID-vkWaitForFences-fenceCount-arraylength"); + skip |= context.ValidateBool32(loc.dot(Field::waitAll), waitAll); return skip; } @@ -11311,9 +13188,10 @@ bool StatelessValidation::PreCallValidateCreateSemaphore(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 = { @@ -11321,20 +13199,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 |= + context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pSemaphore), pSemaphore, "VUID-vkCreateSemaphore-pSemaphore-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateSemaphore(device, pCreateInfo, pAllocator, pSemaphore, context); return skip; } @@ -11342,10 +13220,11 @@ bool StatelessValidation::PreCallValidateDestroySemaphore(VkDevice device, VkSem const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11354,60 +13233,65 @@ bool StatelessValidation::PreCallValidateCreateEvent(VkDevice device, const VkEv const VkAllocationCallbacks* pAllocator, VkEvent* pEvent, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pEvent), pEvent, "VUID-vkCreateEvent-pEvent-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateEvent(device, pCreateInfo, pAllocator, pEvent, context); return skip; } bool StatelessValidation::PreCallValidateDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } bool StatelessValidation::PreCallValidateGetEventStatus(VkDevice device, VkEvent event, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= context.ValidateRequiredHandle(loc.dot(Field::event), event); return skip; } bool StatelessValidation::PreCallValidateSetEvent(VkDevice device, VkEvent event, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= context.ValidateRequiredHandle(loc.dot(Field::event), event); return skip; } bool StatelessValidation::PreCallValidateResetEvent(VkDevice device, VkEvent event, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= context.ValidateRequiredHandle(loc.dot(Field::event), event); return skip; } @@ -11415,9 +13299,10 @@ bool StatelessValidation::PreCallValidateCreateQueryPool(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 = { @@ -11434,23 +13319,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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pQueryPool), pQueryPool, "VUID-vkCreateQueryPool-pQueryPool-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateQueryPool(device, pCreateInfo, pAllocator, pQueryPool, context); return skip; } @@ -11458,10 +13343,11 @@ bool StatelessValidation::PreCallValidateDestroyQueryPool(VkDevice device, VkQue const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11470,15 +13356,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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= context.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkGetQueryPoolResults-dataSize-arraylength", "VUID-vkGetQueryPoolResults-pData-parameter"); + skip |= context.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); + context); return skip; } @@ -11486,9 +13373,10 @@ bool StatelessValidation::PreCallValidateCreateBuffer(VkDevice device, const VkB const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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, @@ -11500,34 +13388,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pBuffer), pBuffer, "VUID-vkCreateBuffer-pBuffer-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateBuffer(device, pCreateInfo, pAllocator, pBuffer, context); return skip; } bool StatelessValidation::PreCallValidateDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11536,33 +13424,34 @@ bool StatelessValidation::PreCallValidateCreateBufferView(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkBufferView* pView, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkBufferViewCreateInfo-flags-zerobitmask"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::buffer), pCreateInfo->buffer); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pView), pView, "VUID-vkCreateBufferView-pView-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateBufferView(device, pCreateInfo, pAllocator, pView, context); return skip; } @@ -11570,10 +13459,11 @@ bool StatelessValidation::PreCallValidateDestroyBufferView(VkDevice device, VkBu const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11582,9 +13472,10 @@ bool StatelessValidation::PreCallValidateCreateImage(VkDevice device, const VkIm const VkAllocationCallbacks* pAllocator, VkImage* pImage, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 = { @@ -11608,55 +13499,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pImage), pImage, "VUID-vkCreateImage-pImage-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateImage(device, pCreateInfo, pAllocator, pImage, context); return skip; } bool StatelessValidation::PreCallValidateDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11666,17 +13558,19 @@ bool StatelessValidation::PreCallValidateGetImageSubresourceLayout(VkDevice devi VkSubresourceLayout* pLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pLayout), pLayout, "VUID-vkGetImageSubresourceLayout-pLayout-parameter"); return skip; } @@ -11684,9 +13578,10 @@ bool StatelessValidation::PreCallValidateCreateImageView(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkImageView* pView, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 = { @@ -11699,46 +13594,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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pView), pView, "VUID-vkCreateImageView-pView-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateImageView(device, pCreateInfo, pAllocator, pView, context); return skip; } @@ -11746,10 +13641,11 @@ bool StatelessValidation::PreCallValidateDestroyImageView(VkDevice device, VkIma const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11758,25 +13654,27 @@ bool StatelessValidation::PreCallValidateCreateShaderModule(VkDevice device, con const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pShaderModule), pShaderModule, + "VUID-vkCreateShaderModule-pShaderModule-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule, context); return skip; } @@ -11784,10 +13682,11 @@ bool StatelessValidation::PreCallValidateDestroyShaderModule(VkDevice device, Vk const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11796,29 +13695,31 @@ bool StatelessValidation::PreCallValidateCreatePipelineCache(VkDevice device, co const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pPipelineCache), pPipelineCache, + "VUID-vkCreatePipelineCache-pPipelineCache-parameter"); + if (!skip) skip |= manual_PreCallValidateCreatePipelineCache(device, pCreateInfo, pAllocator, pPipelineCache, context); return skip; } @@ -11826,10 +13727,11 @@ bool StatelessValidation::PreCallValidateDestroyPipelineCache(VkDevice device, V const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -11837,11 +13739,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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::pipelineCache), pipelineCache); + skip |= context.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; } @@ -11849,11 +13752,12 @@ bool StatelessValidation::PreCallValidateMergePipelineCaches(VkDevice device, Vk const VkPipelineCache* pSrcCaches, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::dstCache), dstCache); + skip |= context.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, context); return skip; } @@ -11863,8 +13767,9 @@ bool StatelessValidation::PreCallValidateCreateGraphicsPipelines(VkDevice device const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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"); @@ -11891,45 +13796,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -11939,8 +13843,9 @@ bool StatelessValidation::PreCallValidateCreateComputePipelines(VkDevice device, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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"); @@ -11953,15 +13858,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 |= context.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 |= context.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, @@ -11972,31 +13876,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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; @@ -12007,25 +13910,26 @@ 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 |= + context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -12033,10 +13937,11 @@ bool StatelessValidation::PreCallValidateDestroyPipeline(VkDevice device, VkPipe const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12046,38 +13951,41 @@ bool StatelessValidation::PreCallValidateCreatePipelineLayout(VkDevice device, c VkPipelineLayout* pPipelineLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pPipelineLayout), pPipelineLayout, + "VUID-vkCreatePipelineLayout-pPipelineLayout-parameter"); + if (!skip) skip |= manual_PreCallValidateCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout, context); return skip; } @@ -12085,10 +13993,11 @@ bool StatelessValidation::PreCallValidateDestroyPipelineLayout(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12097,9 +14006,10 @@ bool StatelessValidation::PreCallValidateCreateSampler(VkDevice device, const Vk const VkAllocationCallbacks* pAllocator, VkSampler* pSampler, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 = { @@ -12111,55 +14021,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateBool32(pCreateInfo_loc.dot(Field::anisotropyEnable), pCreateInfo->anisotropyEnable); - skip |= ValidateBool32(pCreateInfo_loc.dot(Field::compareEnable), pCreateInfo->compareEnable); + skip |= context.ValidateBool32(pCreateInfo_loc.dot(Field::compareEnable), pCreateInfo->compareEnable); - skip |= ValidateBool32(pCreateInfo_loc.dot(Field::unnormalizedCoordinates), pCreateInfo->unnormalizedCoordinates); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pSampler), pSampler, "VUID-vkCreateSampler-pSampler-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateSampler(device, pCreateInfo, pAllocator, pSampler, context); return skip; } bool StatelessValidation::PreCallValidateDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12170,45 +14080,46 @@ bool StatelessValidation::PreCallValidateCreateDescriptorSetLayout(VkDevice devi VkDescriptorSetLayout* pSetLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pSetLayout), pSetLayout, + "VUID-vkCreateDescriptorSetLayout-pSetLayout-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateDescriptorSetLayout(device, pCreateInfo, pAllocator, pSetLayout, context); return skip; } @@ -12216,10 +14127,11 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorSetLayout(VkDevice dev const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12229,44 +14141,46 @@ bool StatelessValidation::PreCallValidateCreateDescriptorPool(VkDevice device, c VkDescriptorPool* pDescriptorPool, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pDescriptorPool), pDescriptorPool, + "VUID-vkCreateDescriptorPool-pDescriptorPool-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateDescriptorPool(device, pCreateInfo, pAllocator, pDescriptorPool, context); return skip; } @@ -12274,10 +14188,11 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorPool(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12285,9 +14200,10 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorPool(VkDevice device, bool StatelessValidation::PreCallValidateResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::descriptorPool), descriptorPool); + skip |= context.ValidateReservedFlags(loc.dot(Field::flags), flags, "VUID-vkResetDescriptorPool-flags-zerobitmask"); return skip; } @@ -12295,31 +14211,33 @@ bool StatelessValidation::PreCallValidateAllocateDescriptorSets(VkDevice device, VkDescriptorSet* pDescriptorSets, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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; } @@ -12328,12 +14246,13 @@ bool StatelessValidation::PreCallValidateFreeDescriptorSets(VkDevice device, VkD uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + skip |= context.ValidateRequiredHandle(loc.dot(Field::descriptorPool), descriptorPool); + skip |= context.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 |= manual_PreCallValidateFreeDescriptorSets(device, descriptorPool, descriptorSetCount, pDescriptorSets, context); return skip; } @@ -12343,11 +14262,12 @@ bool StatelessValidation::PreCallValidateUpdateDescriptorSets(VkDevice device, u const VkCopyDescriptorSet* pDescriptorCopies, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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); @@ -12356,40 +14276,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pDescriptorCopies_loc.dot(Field::srcSet), + pDescriptorCopies[descriptorCopyIndex].srcSet); - skip |= ValidateRequiredHandle(pDescriptorCopies_loc.dot(Field::dstSet), pDescriptorCopies[descriptorCopyIndex].dstSet); + skip |= context.ValidateRequiredHandle(pDescriptorCopies_loc.dot(Field::dstSet), + pDescriptorCopies[descriptorCopyIndex].dstSet); } } if (!skip) skip |= manual_PreCallValidateUpdateDescriptorSets(device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, - pDescriptorCopies, error_obj); + pDescriptorCopies, context); return skip; } @@ -12397,30 +14319,33 @@ bool StatelessValidation::PreCallValidateCreateFramebuffer(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pFramebuffer), pFramebuffer, + "VUID-vkCreateFramebuffer-pFramebuffer-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer, context); return skip; } @@ -12428,10 +14353,11 @@ bool StatelessValidation::PreCallValidateDestroyFramebuffer(VkDevice device, VkF const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12440,90 +14366,92 @@ bool StatelessValidation::PreCallValidateCreateRenderPass(VkDevice device, const const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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; @@ -12531,17 +14459,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 |= context.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 |= context.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; @@ -12549,10 +14478,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 |= context.ValidateRangedEnum( + pColorAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pColorAttachments[colorAttachmentIndex].layout, + "VUID-VkAttachmentReference-layout-parameter"); } } @@ -12562,64 +14491,65 @@ bool StatelessValidation::PreCallValidateCreateRenderPass(VkDevice device, const ++colorAttachmentIndex) { [[maybe_unused]] const Location pResolveAttachments_loc = pSubpasses_loc.dot(Field::pResolveAttachments, colorAttachmentIndex); - skip |= ValidateRangedEnum( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.ValidateRequiredPointer(loc.dot(Field::pRenderPass), pRenderPass, "VUID-vkCreateRenderPass-pRenderPass-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateRenderPass(device, pCreateInfo, pAllocator, pRenderPass, context); return skip; } @@ -12627,10 +14557,11 @@ bool StatelessValidation::PreCallValidateDestroyRenderPass(VkDevice device, VkRe const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12638,10 +14569,11 @@ bool StatelessValidation::PreCallValidateDestroyRenderPass(VkDevice device, VkRe bool StatelessValidation::PreCallValidateGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::renderPass), renderPass); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pGranularity), pGranularity, + "VUID-vkGetRenderAreaGranularity-pGranularity-parameter"); return skip; } @@ -12649,23 +14581,26 @@ bool StatelessValidation::PreCallValidateCreateCommandPool(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= + context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pCommandPool), pCommandPool, "VUID-vkCreateCommandPool-pCommandPool-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pCommandPool), pCommandPool, + "VUID-vkCreateCommandPool-pCommandPool-parameter"); return skip; } @@ -12673,10 +14608,11 @@ bool StatelessValidation::PreCallValidateDestroyCommandPool(VkDevice device, VkC const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -12684,10 +14620,11 @@ bool StatelessValidation::PreCallValidateDestroyCommandPool(VkDevice device, VkC bool StatelessValidation::PreCallValidateResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); + skip |= context.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkCommandPoolResetFlagBits, + AllVkCommandPoolResetFlagBits, flags, kOptionalFlags, "VUID-vkResetCommandPool-flags-parameter"); return skip; } @@ -12695,25 +14632,26 @@ bool StatelessValidation::PreCallValidateAllocateCommandBuffers(VkDevice device, VkCommandBuffer* pCommandBuffers, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pAllocateInfo_loc, pAllocateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCommandBufferAllocateInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pAllocateInfo_loc.dot(Field::commandPool), pAllocateInfo->commandPool); + skip |= context.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 |= context.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 |= context.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; } @@ -12722,12 +14660,12 @@ bool StatelessValidation::PreCallValidateFreeCommandBuffers(VkDevice device, VkC const VkCommandBuffer* pCommandBuffers, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); + skip |= context.ValidateArray(loc.dot(Field::commandBufferCount), loc, commandBufferCount, &pCommandBuffers, true, false, + "VUID-vkFreeCommandBuffers-commandBufferCount-arraylength", kVUIDUndefined); + if (!skip) skip |= manual_PreCallValidateFreeCommandBuffers(device, commandPool, commandBufferCount, pCommandBuffers, context); return skip; } @@ -12735,28 +14673,31 @@ bool StatelessValidation::PreCallValidateBeginCommandBuffer(VkCommandBuffer comm const VkCommandBufferBeginInfo* pBeginInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= + context.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 |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateEndCommandBuffer(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12765,19 +14706,22 @@ bool StatelessValidation::PreCallValidateEndCommandBuffer(VkCommandBuffer comman bool StatelessValidation::PreCallValidateResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= + context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdBindPipeline-pipelineBindPoint-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); return skip; } @@ -12785,35 +14729,38 @@ bool StatelessValidation::PreCallValidateCmdSetViewport(VkCommandBuffer commandB uint32_t viewportCount, const VkViewport* pViewports, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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, context); return skip; } @@ -12821,6 +14768,7 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBias(VkCommandBuffer command float depthBiasClamp, float depthBiasSlopeFactor, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12829,6 +14777,7 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBias(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4], const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12837,6 +14786,7 @@ bool StatelessValidation::PreCallValidateCmdSetBlendConstants(VkCommandBuffer co bool StatelessValidation::PreCallValidateCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12845,30 +14795,33 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBounds(VkCommandBuffer comma bool StatelessValidation::PreCallValidateCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, + faceMask, kRequiredFlags, "VUID-vkCmdSetStencilReference-faceMask-parameter", + "VUID-vkCmdSetStencilReference-faceMask-requiredbitmask"); return skip; } @@ -12878,25 +14831,28 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorSets(VkCommandBuffer c uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdBindDescriptorSets-pipelineBindPoint-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= context.ValidateArray(loc.dot(Field::descriptorSetCount), loc.dot(Field::pDescriptorSets), descriptorSetCount, + &pDescriptorSets, true, false, "VUID-vkCmdBindDescriptorSets-descriptorSetCount-arraylength", + "VUID-vkCmdBindDescriptorSets-pDescriptorSets-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRangedEnum(loc.dot(Field::indexType), vvl::Enum::VkIndexType, indexType, + "VUID-vkCmdBindIndexBuffer-indexType-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdBindIndexBuffer(commandBuffer, buffer, offset, indexType, context); return skip; } @@ -12904,20 +14860,23 @@ bool StatelessValidation::PreCallValidateCmdBindVertexBuffers(VkCommandBuffer co uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateArray(loc.dot(Field::bindingCount), loc.dot(Field::pBuffers), bindingCount, &pBuffers, true, false, + "VUID-vkCmdBindVertexBuffers-bindingCount-arraylength", + "VUID-vkCmdBindVertexBuffers-pBuffers-parameter"); + skip |= context.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, context); 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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12927,6 +14886,7 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexed(VkCommandBuffer commandB uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12935,8 +14895,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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } @@ -12944,14 +14905,16 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer uint32_t drawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -12960,8 +14923,9 @@ bool StatelessValidation::PreCallValidateCmdDispatch(VkCommandBuffer commandBuff bool StatelessValidation::PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } @@ -12969,18 +14933,19 @@ bool StatelessValidation::PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBu uint32_t regionCount, const VkBufferCopy* pRegions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::srcBuffer), srcBuffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= context.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, context); return skip; } @@ -12988,29 +14953,30 @@ bool StatelessValidation::PreCallValidateCmdCopyImage(VkCommandBuffer commandBuf VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, + "VUID-vkCmdCopyImage-srcImageLayout-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdCopyImage-dstImageLayout-parameter"); + skip |= context.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 |= context.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 |= context.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 @@ -13025,31 +14991,31 @@ bool StatelessValidation::PreCallValidateCmdBlitImage(VkCommandBuffer commandBuf const VkImageBlit* pRegions, VkFilter filter, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, + "VUID-vkCmdBlitImage-srcImageLayout-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdBlitImage-dstImageLayout-parameter"); + skip |= context.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 |= context.ValidateFlags(pRegions_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRegions[regionIndex].srcSubresource.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); + + skip |= context.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 |= context.ValidateRangedEnum(loc.dot(Field::filter), vvl::Enum::VkFilter, filter, "VUID-vkCmdBlitImage-filter-parameter"); return skip; } @@ -13058,20 +15024,22 @@ bool StatelessValidation::PreCallValidateCmdCopyBufferToImage(VkCommandBuffer co const VkBufferImageCopy* pRegions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::srcBuffer), srcBuffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdCopyBufferToImage-dstImageLayout-parameter"); + skip |= context.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 |= context.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 @@ -13086,20 +15054,22 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer co uint32_t regionCount, const VkBufferImageCopy* pRegions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, + "VUID-vkCmdCopyImageToBuffer-srcImageLayout-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= context.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 |= context.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 @@ -13113,20 +15083,22 @@ bool StatelessValidation::PreCallValidateCmdUpdateBuffer(VkCommandBuffer command VkDeviceSize dataSize, const void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + if (!skip) skip |= manual_PreCallValidateCmdFillBuffer(commandBuffer, dstBuffer, dstOffset, size, data, context); return skip; } @@ -13135,23 +15107,25 @@ bool StatelessValidation::PreCallValidateCmdClearColorImage(VkCommandBuffer comm const VkImageSubresourceRange* pRanges, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= context.ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, + "VUID-vkCmdClearColorImage-imageLayout-parameter"); + skip |= + context.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 |= context.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, context); return skip; } @@ -13161,22 +15135,23 @@ bool StatelessValidation::PreCallValidateCmdClearDepthStencilImage(VkCommandBuff uint32_t rangeCount, const VkImageSubresourceRange* pRanges, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= context.ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, + "VUID-vkCmdClearDepthStencilImage-imageLayout-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pDepthStencil), pDepthStencil, + "VUID-vkCmdClearDepthStencilImage-pDepthStencil-parameter"); + skip |= context.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 |= context.ValidateFlags(pRanges_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pRanges[rangeIndex].aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceRange-aspectMask-parameter", + "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } return skip; @@ -13186,21 +15161,23 @@ bool StatelessValidation::PreCallValidateCmdClearAttachments(VkCommandBuffer com const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= + context.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); @@ -13210,8 +15187,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, context); return skip; } @@ -13220,29 +15196,30 @@ bool StatelessValidation::PreCallValidateCmdResolveImage(VkCommandBuffer command VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::srcImage), srcImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::srcImageLayout), vvl::Enum::VkImageLayout, srcImageLayout, + "VUID-vkCmdResolveImage-srcImageLayout-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdResolveImage-dstImageLayout-parameter"); + skip |= context.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 |= context.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 |= context.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 @@ -13255,20 +15232,22 @@ bool StatelessValidation::PreCallValidateCmdResolveImage(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= context.ValidateFlags(loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + stageMask, kOptionalFlags, "VUID-vkCmdResetEvent-stageMask-parameter"); return skip; } @@ -13278,37 +15257,40 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents( uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[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 |= context.ValidateHandleArray(loc.dot(Field::eventCount), loc.dot(Field::pEvents), eventCount, pEvents, true, true, + "VUID-vkCmdWaitEvents-eventCount-arraylength"); + skip |= + context.ValidateFlags(loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + srcStageMask, kOptionalFlags, "VUID-vkCmdWaitEvents-srcStageMask-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); + context.ValidateFlags(loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + dstStageMask, kOptionalFlags, "VUID-vkCmdWaitEvents-dstStageMask-parameter"); + skip |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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) { @@ -13316,19 +15298,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 |= context.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 |= context.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 |= context.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 = @@ -13336,25 +15319,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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), + pImageMemoryBarriers[imageMemoryBarrierIndex].image); - skip |= ValidateFlags( + skip |= context.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"); } } @@ -13367,37 +15351,40 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier( uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[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); + context.ValidateFlags(loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + srcStageMask, kOptionalFlags, "VUID-vkCmdPipelineBarrier-srcStageMask-parameter"); + skip |= + context.ValidateFlags(loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + dstStageMask, kOptionalFlags, "VUID-vkCmdPipelineBarrier-dstStageMask-parameter"); + skip |= context.ValidateFlags(loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, AllVkDependencyFlagBits, + dependencyFlags, kOptionalFlags, "VUID-vkCmdPipelineBarrier-dependencyFlags-parameter"); + skip |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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) { @@ -13405,19 +15392,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 |= context.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 |= context.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 |= context.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 = @@ -13425,25 +15413,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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), + pImageMemoryBarriers[imageMemoryBarrierIndex].image); - skip |= ValidateFlags( + skip |= context.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"); } } @@ -13453,18 +15442,20 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier( bool StatelessValidation::PreCallValidateCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } @@ -13472,8 +15463,9 @@ bool StatelessValidation::PreCallValidateCmdResetQueryPool(VkCommandBuffer comma uint32_t firstQuery, uint32_t queryCount, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } @@ -13481,11 +15473,12 @@ bool StatelessValidation::PreCallValidateCmdWriteTimestamp(VkCommandBuffer comma VkQueryPool queryPool, uint32_t query, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateFlags( + loc.dot(Field::pipelineStage), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, pipelineStage, + kRequiredSingleBit, "VUID-vkCmdWriteTimestamp-pipelineStage-parameter", "VUID-vkCmdWriteTimestamp-pipelineStage-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } @@ -13494,11 +15487,12 @@ bool StatelessValidation::PreCallValidateCmdCopyQueryPoolResults(VkCommandBuffer VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); + skip |= context.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkQueryResultFlagBits, AllVkQueryResultFlagBits, flags, + kOptionalFlags, "VUID-vkCmdCopyQueryPoolResults-flags-parameter"); return skip; } @@ -13506,14 +15500,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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= context.ValidateFlags(loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, + stageFlags, kRequiredFlags, "VUID-vkCmdPushConstants-stageFlags-parameter", + "VUID-vkCmdPushConstants-stageFlags-requiredbitmask"); + skip |= context.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, context); return skip; } @@ -13521,9 +15516,11 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderPass(VkCommandBuffer comm const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 = { @@ -13534,36 +15531,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 |= + context.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 |= context.ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::renderPass), pRenderPassBegin->renderPass); - skip |= ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::framebuffer), pRenderPassBegin->framebuffer); + skip |= context.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 |= context.ValidateRangedEnum(loc.dot(Field::contents), vvl::Enum::VkSubpassContents, contents, + "VUID-vkCmdBeginRenderPass-contents-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents, context); return skip; } bool StatelessValidation::PreCallValidateCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -13573,9 +15572,10 @@ bool StatelessValidation::PreCallValidateCmdExecuteCommands(VkCommandBuffer comm const VkCommandBuffer* pCommandBuffers, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateHandleArray(loc.dot(Field::commandBufferCount), loc.dot(Field::pCommandBuffers), commandBufferCount, + pCommandBuffers, true, true, "VUID-vkCmdExecuteCommands-commandBufferCount-arraylength"); return skip; } @@ -13583,25 +15583,26 @@ bool StatelessValidation::PreCallValidateBindBufferMemory2(VkDevice device, uint const VkBindBufferMemoryInfo* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pBindInfos_loc.dot(Field::buffer), pBindInfos[bindInfoIndex].buffer); - skip |= ValidateRequiredHandle(pBindInfos_loc.dot(Field::memory), pBindInfos[bindInfoIndex].memory); + skip |= context.ValidateRequiredHandle(pBindInfos_loc.dot(Field::memory), pBindInfos[bindInfoIndex].memory); } } return skip; @@ -13611,11 +15612,12 @@ bool StatelessValidation::PreCallValidateBindImageMemory2(VkDevice device, uint3 const VkBindImageMemoryInfo* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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); @@ -13623,12 +15625,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 |= context.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 |= context.ValidateRequiredHandle(pBindInfos_loc.dot(Field::image), pBindInfos[bindInfoIndex].image); } } return skip; @@ -13639,15 +15641,17 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupPeerMemoryFeatures(VkDevi VkPeerMemoryFeatureFlags* pPeerMemoryFeatures, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredPointer(loc.dot(Field::pPeerMemoryFeatures), pPeerMemoryFeatures, - "VUID-vkGetDeviceGroupPeerMemoryFeatures-pPeerMemoryFeatures-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -13657,6 +15661,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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -13666,24 +15671,24 @@ bool StatelessValidation::PreCallValidateEnumeratePhysicalDeviceGroups( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext( + pPhysicalDeviceGroupProperties_loc, pPhysicalDeviceGroupProperties[pPhysicalDeviceGroupIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceGroupProperties-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -13693,33 +15698,34 @@ bool StatelessValidation::PreCallValidateGetImageMemoryRequirements2(VkDevice de VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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; } @@ -13728,28 +15734,29 @@ bool StatelessValidation::PreCallValidateGetBufferMemoryRequirements2(VkDevice d VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferMemoryRequirementsInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); + skip |= context.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 |= context.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 |= context.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; } @@ -13758,18 +15765,19 @@ bool StatelessValidation::PreCallValidateGetImageSparseMemoryRequirements2( VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageSparseMemoryRequirementsInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); } - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -13779,10 +15787,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 |= context.ValidateStructPnext( + pSparseMemoryRequirements_loc, pSparseMemoryRequirements[pSparseMemoryRequirementIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSparseImageMemoryRequirements2-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -13792,13 +15799,16 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFeatures2(VkPhysicalDe VkPhysicalDeviceFeatures2* pFeatures, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.ValidateStructType(loc.dot(Field::pFeatures), pFeatures, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, true, + "VUID-vkGetPhysicalDeviceFeatures2-pFeatures-parameter", + "VUID-VkPhysicalDeviceFeatures2-sType-sType"); return skip; } @@ -13806,13 +15816,16 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceProperties2(VkPhysical VkPhysicalDeviceProperties2* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.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 = { @@ -13915,12 +15928,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 |= context.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, context); return skip; } @@ -13928,25 +15941,28 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFormatProperties2(VkPh VkFormatProperties2* pFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceFormatProperties2-format-parameter"); + skip |= context.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 |= + context.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; } @@ -13955,14 +15971,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); + stateless::Context context(*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 |= context.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 = { @@ -13975,34 +15994,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 = { @@ -14014,14 +16032,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 |= context.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, context); return skip; } @@ -14030,15 +16048,18 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceQueueFamilyProperties2 VkQueueFamilyProperties2* pQueueFamilyProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.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) { @@ -14050,11 +16071,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 |= context.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; @@ -14064,24 +16085,26 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceMemoryProperties2(VkPh VkPhysicalDeviceMemoryProperties2* pMemoryProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.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 |= context.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; } @@ -14090,49 +16113,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); + stateless::Context context(*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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pFormatInfo_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, pFormatInfo->tiling, + "VUID-VkPhysicalDeviceSparseImageFormatInfo2-tiling-parameter"); } - skip |= ValidateStructTypeArray( + skip |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSparseImageFormatProperties2-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -14141,28 +16166,30 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSparseImageFormatPrope bool StatelessValidation::PreCallValidateTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::commandPool), commandPool); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pQueue), pQueue, "VUID-vkGetDeviceQueue2-pQueue-parameter"); return skip; } @@ -14172,64 +16199,65 @@ bool StatelessValidation::PreCallValidateCreateSamplerYcbcrConversion(VkDevice d VkSamplerYcbcrConversion* pYcbcrConversion, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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); + skip |= context.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); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pYcbcrConversion), pYcbcrConversion, - "VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pYcbcrConversion), pYcbcrConversion, + "VUID-vkCreateSamplerYcbcrConversion-pYcbcrConversion-parameter"); if (!skip) - skip |= manual_PreCallValidateCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion, error_obj); + skip |= manual_PreCallValidateCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion, context); return skip; } @@ -14237,10 +16265,11 @@ bool StatelessValidation::PreCallValidateDestroySamplerYcbcrConversion(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -14251,45 +16280,47 @@ bool StatelessValidation::PreCallValidateCreateDescriptorUpdateTemplate(VkDevice VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pDescriptorUpdateTemplate), pDescriptorUpdateTemplate, - "VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pDescriptorUpdateTemplate), pDescriptorUpdateTemplate, + "VUID-vkCreateDescriptorUpdateTemplate-pDescriptorUpdateTemplate-parameter"); return skip; } @@ -14298,10 +16329,11 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorUpdateTemplate(VkDevic const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -14310,9 +16342,10 @@ bool StatelessValidation::PreCallValidateUpdateDescriptorSetWithTemplate(VkDevic VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorSet), descriptorSet); - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorUpdateTemplate), descriptorUpdateTemplate); + skip |= context.ValidateRequiredHandle(loc.dot(Field::descriptorSet), descriptorSet); + skip |= context.ValidateRequiredHandle(loc.dot(Field::descriptorUpdateTemplate), descriptorUpdateTemplate); return skip; } @@ -14320,47 +16353,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); + stateless::Context context(*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 |= context.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 |= context.ValidateStructPnext( + pExternalBufferInfo_loc, pExternalBufferInfo->pNext, allowed_structs_VkPhysicalDeviceExternalBufferInfo.size(), + allowed_structs_VkPhysicalDeviceExternalBufferInfo.data(), GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceExternalBufferInfo-pNext-pNext", "VUID-VkPhysicalDeviceExternalBufferInfo-sType-unique", true); + + skip |= context.ValidateFlags(pExternalBufferInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkBufferCreateFlagBits, + AllVkBufferCreateFlagBits, pExternalBufferInfo->flags, kOptionalFlags, + "VUID-VkPhysicalDeviceExternalBufferInfo-flags-parameter"); + + skip |= context.ValidateFlags(pExternalBufferInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, AllVkExternalMemoryHandleTypeFlagBits, + pExternalBufferInfo->handleType, kRequiredSingleBit, + "VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter", + "VUID-VkPhysicalDeviceExternalBufferInfo-handleType-parameter"); + } + skip |= context.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 |= context.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, context); return skip; } @@ -14368,33 +16404,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); + stateless::Context context(*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 |= context.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 |= + context.ValidateStructPnext(pExternalFenceInfo_loc, pExternalFenceInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceExternalFenceInfo-pNext-pNext", kVUIDUndefined, true); + + skip |= context.ValidateFlags(pExternalFenceInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalFenceHandleTypeFlagBits, AllVkExternalFenceHandleTypeFlagBits, + pExternalFenceInfo->handleType, kRequiredSingleBit, + "VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter", + "VUID-VkPhysicalDeviceExternalFenceInfo-handleType-parameter"); + } + skip |= context.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 |= context.ValidateStructPnext(pExternalFenceProperties_loc, pExternalFenceProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkExternalFenceProperties-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -14403,39 +16444,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); + stateless::Context context(*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 |= context.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 |= context.ValidateStructPnext(pExternalSemaphoreInfo_loc, pExternalSemaphoreInfo->pNext, + allowed_structs_VkPhysicalDeviceExternalSemaphoreInfo.size(), + allowed_structs_VkPhysicalDeviceExternalSemaphoreInfo.data(), + GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceExternalSemaphoreInfo-pNext-pNext", + "VUID-VkPhysicalDeviceExternalSemaphoreInfo-sType-unique", true); + + skip |= context.ValidateFlags(pExternalSemaphoreInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, + AllVkExternalSemaphoreHandleTypeFlagBits, pExternalSemaphoreInfo->handleType, + kRequiredSingleBit, "VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter", + "VUID-VkPhysicalDeviceExternalSemaphoreInfo-handleType-parameter"); + } + skip |= context.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 |= context.ValidateStructPnext(pExternalSemaphoreProperties_loc, pExternalSemaphoreProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkExternalSemaphoreProperties-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -14445,52 +16489,53 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutSupport(VkDevice VkDescriptorSetLayoutSupport* pSupport, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -14499,9 +16544,10 @@ bool StatelessValidation::PreCallValidateCmdDrawIndirectCount(VkCommandBuffer co uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); return skip; } @@ -14510,9 +16556,10 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBu VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); - skip |= ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); return skip; } @@ -14520,25 +16567,27 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= + context.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 |= context.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 |= context.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkRenderPassCreateFlagBits, + AllVkRenderPassCreateFlagBits, pCreateInfo->flags, kOptionalFlags, + "VUID-VkRenderPassCreateInfo2-flags-parameter"); - skip |= ValidateStructTypeArray( + skip |= context.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); @@ -14549,52 +16598,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pAttachments_loc.dot(Field::finalLayout), vvl::Enum::VkImageLayout, + pCreateInfo->pAttachments[attachmentIndex].finalLayout, + "VUID-VkAttachmentDescription2-finalLayout-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= context.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"); @@ -14609,20 +16658,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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pSubpasses_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pCreateInfo->pSubpasses[subpassIndex].pipelineBindPoint, + "VUID-VkSubpassDescription2-pipelineBindPoint-parameter"); - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -14638,21 +16687,21 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentReference2 = { VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT}; - skip |= ValidateStructPnext( + skip |= context.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 |= context.ValidateRangedEnum( + pInputAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pInputAttachments[inputAttachmentIndex].layout, + "VUID-VkAttachmentReference2-layout-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -14668,21 +16717,21 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentReference2 = { VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT}; - skip |= ValidateStructPnext( + skip |= context.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 |= context.ValidateRangedEnum( + pColorAttachments_loc.dot(Field::layout), vvl::Enum::VkImageLayout, + pCreateInfo->pSubpasses[subpassIndex].pColorAttachments[colorAttachmentIndex].layout, + "VUID-VkAttachmentReference2-layout-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -14697,21 +16746,21 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentReference2 = { VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT}; - skip |= ValidateStructPnext( + skip |= context.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 |= context.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 |= context.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"); @@ -14722,26 +16771,26 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2(VkDevice device, cons constexpr std::array allowed_structs_VkAttachmentReference2 = { VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT}; - skip |= ValidateStructPnext( + skip |= context.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 |= context.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 |= context.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 |= context.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); @@ -14751,52 +16800,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 |= context.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 |= + context.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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.ValidateRequiredPointer(loc.dot(Field::pRenderPass), pRenderPass, "VUID-vkCreateRenderPass2-pRenderPass-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateRenderPass2(device, pCreateInfo, pAllocator, pRenderPass, context); return skip; } @@ -14805,9 +16858,11 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderPass2(VkCommandBuffer com const VkSubpassBeginInfo* pSubpassBeginInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 = { @@ -14818,30 +16873,32 @@ 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 |= + context.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 |= context.ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::renderPass), pRenderPassBegin->renderPass); - skip |= ValidateRequiredHandle(pRenderPassBegin_loc.dot(Field::framebuffer), pRenderPassBegin->framebuffer); + skip |= context.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 |= + context.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 |= + context.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 |= context.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, context); return skip; } @@ -14849,28 +16906,30 @@ bool StatelessValidation::PreCallValidateCmdNextSubpass2(VkCommandBuffer command const VkSubpassEndInfo* pSubpassEndInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= + context.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 |= + context.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 |= context.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 |= context.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 |= context.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; } @@ -14878,18 +16937,18 @@ bool StatelessValidation::PreCallValidateCmdNextSubpass2(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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; } @@ -14897,42 +16956,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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::semaphore), semaphore); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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; } @@ -14940,15 +17003,16 @@ bool StatelessValidation::PreCallValidateWaitSemaphores(VkDevice device, const V bool StatelessValidation::PreCallValidateSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pSignalInfo_loc, pSignalInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSemaphoreSignalInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pSignalInfo_loc.dot(Field::semaphore), pSignalInfo->semaphore); + skip |= context.ValidateRequiredHandle(pSignalInfo_loc.dot(Field::semaphore), pSignalInfo->semaphore); } return skip; } @@ -14956,15 +17020,17 @@ bool StatelessValidation::PreCallValidateSignalSemaphore(VkDevice device, const bool StatelessValidation::PreCallValidateGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= + context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferDeviceAddressInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); } return skip; } @@ -14972,16 +17038,17 @@ bool StatelessValidation::PreCallValidateGetBufferDeviceAddress(VkDevice device, bool StatelessValidation::PreCallValidateGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferDeviceAddressInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); } return skip; } @@ -14990,17 +17057,17 @@ bool StatelessValidation::PreCallValidateGetDeviceMemoryOpaqueCaptureAddress(VkD const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceMemoryOpaqueCaptureAddressInfo-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::memory), pInfo->memory); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::memory), pInfo->memory); } return skip; } @@ -15009,20 +17076,23 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceToolProperties(VkPhysi VkPhysicalDeviceToolProperties* pToolProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.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 |= context.ValidateStructPnext(pToolProperties_loc, pToolProperties[pToolIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPhysicalDeviceToolProperties-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -15033,24 +17103,25 @@ bool StatelessValidation::PreCallValidateCreatePrivateDataSlot(VkDevice device, VkPrivateDataSlot* pPrivateDataSlot, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pPrivateDataSlot), pPrivateDataSlot, - "VUID-vkCreatePrivateDataSlot-pPrivateDataSlot-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pPrivateDataSlot), pPrivateDataSlot, + "VUID-vkCreatePrivateDataSlot-pPrivateDataSlot-parameter"); return skip; } @@ -15058,10 +17129,11 @@ bool StatelessValidation::PreCallValidateDestroyPrivateDataSlot(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -15070,10 +17142,11 @@ bool StatelessValidation::PreCallValidateSetPrivateData(VkDevice device, VkObjec VkPrivateDataSlot privateDataSlot, uint64_t data, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkObjectType, objectType, + "VUID-vkSetPrivateData-objectType-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::privateDataSlot), privateDataSlot); return skip; } @@ -15081,31 +17154,33 @@ bool StatelessValidation::PreCallValidateGetPrivateData(VkDevice device, VkObjec VkPrivateDataSlot privateDataSlot, uint64_t* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkObjectType, objectType, + "VUID-vkGetPrivateData-objectType-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::privateDataSlot), privateDataSlot); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= context.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 |= context.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 |= context.ValidateFlags(pDependencyInfo_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, + AllVkDependencyFlagBits, pDependencyInfo->dependencyFlags, kOptionalFlags, + "VUID-VkDependencyInfo-dependencyFlags-parameter"); - skip |= ValidateStructTypeArray( + skip |= context.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); @@ -15114,27 +17189,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 |= context.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"); + context.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 |= context.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"); + context.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15148,38 +17225,38 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2(VkCommandBuffer commandBuf constexpr std::array allowed_structs_VkBufferMemoryBarrier2 = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR}; - skip |= ValidateStructPnext( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); } } - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15194,48 +17271,48 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2(VkCommandBuffer commandBuf VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}; - skip |= ValidateStructPnext( + skip |= context.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); - - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, kOptionalFlags, - VK_NULL_HANDLE, "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 |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, kOptionalFlags, - VK_NULL_HANDLE, "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 |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, - "VUID-VkImageMemoryBarrier2-oldLayout-parameter", VK_NULL_HANDLE); - - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, - "VUID-VkImageMemoryBarrier2-newLayout-parameter", VK_NULL_HANDLE); - - skip |= 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"); + "VUID-VkImageMemoryBarrier2-sType-unique", true); + + skip |= context.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); + + skip |= context.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); + + skip |= context.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); + + skip |= context.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); + + skip |= context.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, + "VUID-VkImageMemoryBarrier2-oldLayout-parameter"); + + skip |= context.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, + "VUID-VkImageMemoryBarrier2-newLayout-parameter"); + + skip |= context.ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].image); + + skip |= context.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceRange-aspectMask-parameter", "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } } @@ -15245,10 +17322,12 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2(VkCommandBuffer commandBuf bool StatelessValidation::PreCallValidateCmdResetEvent2(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::event), event); + skip |= + context.ValidateFlags(loc.dot(Field::stageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + stageMask, kOptionalFlags, "VUID-vkCmdResetEvent2-stageMask-parameter"); return skip; } @@ -15256,25 +17335,26 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB const VkDependencyInfo* pDependencyInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateHandleArray(loc.dot(Field::eventCount), loc.dot(Field::pEvents), eventCount, pEvents, true, true, + "VUID-vkCmdWaitEvents2-eventCount-arraylength"); + skip |= context.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 |= context.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 |= context.ValidateFlags(pDependencyInfos_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, + AllVkDependencyFlagBits, pDependencyInfos[eventIndex].dependencyFlags, kOptionalFlags, + "VUID-VkDependencyInfo-dependencyFlags-parameter"); - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15285,29 +17365,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 |= context.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-srcStageMask-parameter"); + + skip |= context.ValidateFlags(pMemoryBarriers_loc.dot(Field::srcAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-srcAccessMask-parameter"); + + skip |= context.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-dstStageMask-parameter"); + + skip |= context.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pMemoryBarriers[memoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15322,42 +17402,44 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR}; - 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle( + pBufferMemoryBarriers_loc.dot(Field::buffer), + pDependencyInfos[eventIndex].pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); } } - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15372,49 +17454,55 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}; - skip |= ValidateStructPnext( + skip |= context.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); - - 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 |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, - "VUID-VkImageMemoryBarrier2-newLayout-parameter", VK_NULL_HANDLE); - - skip |= - ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), - pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].image); - - skip |= ValidateFlags( + "VUID-VkImageMemoryBarrier2-sType-unique", true); + + skip |= context.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, + AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, kOptionalFlags, + "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); + + skip |= context.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::srcAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, kOptionalFlags, + "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); + + skip |= context.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, + AllVkPipelineStageFlagBits2, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, kOptionalFlags, + "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); + + skip |= context.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, kOptionalFlags, + "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); + + skip |= context.ValidateRangedEnum( + pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, + "VUID-VkImageMemoryBarrier2-oldLayout-parameter"); + + skip |= context.ValidateRangedEnum( + pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, + "VUID-VkImageMemoryBarrier2-newLayout-parameter"); + + skip |= context.ValidateRequiredHandle( + pImageMemoryBarriers_loc.dot(Field::image), + pDependencyInfos[eventIndex].pImageMemoryBarriers[imageMemoryBarrierIndex].image); + + skip |= context.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"); } } @@ -15426,19 +17514,20 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2(VkCommandBuffer commandB bool StatelessValidation::PreCallValidateCmdPipelineBarrier2(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.ValidateFlags(pDependencyInfo_loc.dot(Field::dependencyFlags), vvl::FlagBitmask::VkDependencyFlagBits, + AllVkDependencyFlagBits, pDependencyInfo->dependencyFlags, kOptionalFlags, + "VUID-VkDependencyInfo-dependencyFlags-parameter"); - skip |= ValidateStructTypeArray( + skip |= context.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); @@ -15447,27 +17536,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 |= context.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"); + context.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 |= context.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"); + context.ValidateFlags(pMemoryBarriers_loc.dot(Field::dstAccessMask), vvl::FlagBitmask::VkAccessFlagBits2, + AllVkAccessFlagBits2, pDependencyInfo->pMemoryBarriers[memoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkMemoryBarrier2-dstAccessMask-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15481,38 +17572,38 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier2(VkCommandBuffer com constexpr std::array allowed_structs_VkBufferMemoryBarrier2 = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR}; - skip |= ValidateStructPnext( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pBufferMemoryBarriers_loc.dot(Field::buffer), + pDependencyInfo->pBufferMemoryBarriers[bufferMemoryBarrierIndex].buffer); } } - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15527,48 +17618,48 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier2(VkCommandBuffer com VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT, VK_STRUCTURE_TYPE_MEMORY_BARRIER_ACCESS_FLAGS_3_KHR, VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT}; - skip |= ValidateStructPnext( + skip |= context.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); - - skip |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, kOptionalFlags, - VK_NULL_HANDLE, "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 |= ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), vvl::FlagBitmask::VkPipelineStageFlagBits2, - AllVkPipelineStageFlagBits2, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, kOptionalFlags, - VK_NULL_HANDLE, "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 |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, - "VUID-VkImageMemoryBarrier2-oldLayout-parameter", VK_NULL_HANDLE); - - skip |= ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, - pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, - "VUID-VkImageMemoryBarrier2-newLayout-parameter", VK_NULL_HANDLE); - - skip |= 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"); + "VUID-VkImageMemoryBarrier2-sType-unique", true); + + skip |= context.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcStageMask-parameter"); + + skip |= context.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::srcAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].srcAccessMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-srcAccessMask-parameter"); + + skip |= context.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstStageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstStageMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstStageMask-parameter"); + + skip |= context.ValidateFlags(pImageMemoryBarriers_loc.dot(Field::dstAccessMask), + vvl::FlagBitmask::VkAccessFlagBits2, AllVkAccessFlagBits2, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].dstAccessMask, + kOptionalFlags, "VUID-VkImageMemoryBarrier2-dstAccessMask-parameter"); + + skip |= context.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::oldLayout), vvl::Enum::VkImageLayout, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].oldLayout, + "VUID-VkImageMemoryBarrier2-oldLayout-parameter"); + + skip |= context.ValidateRangedEnum(pImageMemoryBarriers_loc.dot(Field::newLayout), vvl::Enum::VkImageLayout, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].newLayout, + "VUID-VkImageMemoryBarrier2-newLayout-parameter"); + + skip |= context.ValidateRequiredHandle(pImageMemoryBarriers_loc.dot(Field::image), + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].image); + + skip |= context.ValidateFlags( + pImageMemoryBarriers_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, + pDependencyInfo->pImageMemoryBarriers[imageMemoryBarrierIndex].subresourceRange.aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceRange-aspectMask-parameter", "VUID-VkImageSubresourceRange-aspectMask-requiredbitmask"); } } } @@ -15579,20 +17670,22 @@ bool StatelessValidation::PreCallValidateCmdWriteTimestamp2(VkCommandBuffer comm VkQueryPool queryPool, uint32_t query, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateFlags(loc.dot(Field::stage), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + stage, kOptionalFlags, "VUID-vkCmdWriteTimestamp2-stage-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.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); @@ -15601,15 +17694,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 |= context.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 |= context.ValidateFlags(pSubmits_loc.dot(Field::flags), vvl::FlagBitmask::VkSubmitFlagBits, AllVkSubmitFlagBits, + pSubmits[submitIndex].flags, kOptionalFlags, "VUID-VkSubmitInfo2-flags-parameter"); - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15620,22 +17712,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 |= context.ValidateStructPnext( + pWaitSemaphoreInfos_loc, pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreSubmitInfo-pNext-pNext", kVUIDUndefined, true); + + skip |= + context.ValidateRequiredHandle(pWaitSemaphoreInfos_loc.dot(Field::semaphore), + pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].semaphore); + + skip |= context.ValidateFlags(pWaitSemaphoreInfos_loc.dot(Field::stageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pSubmits[submitIndex].pWaitSemaphoreInfos[waitSemaphoreInfoIndex].stageMask, + kOptionalFlags, "VUID-VkSemaphoreSubmitInfo-stageMask-parameter"); } } - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15649,18 +17741,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 |= context.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 |= context.ValidateRequiredHandle( + pCommandBufferInfos_loc.dot(Field::commandBuffer), + pSubmits[submitIndex].pCommandBufferInfos[commandBufferInfoIndex].commandBuffer); } } - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -15671,18 +17764,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 |= context.ValidateStructPnext( + pSignalSemaphoreInfos_loc, pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreSubmitInfo-pNext-pNext", kVUIDUndefined, true); + + skip |= context.ValidateRequiredHandle( + pSignalSemaphoreInfos_loc.dot(Field::semaphore), + pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].semaphore); + + skip |= context.ValidateFlags(pSignalSemaphoreInfos_loc.dot(Field::stageMask), + vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + pSubmits[submitIndex].pSignalSemaphoreInfos[signalSemaphoreInfoIndex].stageMask, + kOptionalFlags, "VUID-VkSemaphoreSubmitInfo-stageMask-parameter"); } } } @@ -15693,82 +17786,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; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pCopyBufferInfo_loc, pCopyBufferInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyBufferInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCopyBufferInfo_loc.dot(Field::srcBuffer), pCopyBufferInfo->srcBuffer); + skip |= context.ValidateRequiredHandle(pCopyBufferInfo_loc.dot(Field::srcBuffer), pCopyBufferInfo->srcBuffer); - skip |= ValidateRequiredHandle(pCopyBufferInfo_loc.dot(Field::dstBuffer), pCopyBufferInfo->dstBuffer); + skip |= context.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 |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdCopyImage2(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pCopyImageInfo_loc, pCopyImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyImageInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCopyImageInfo_loc.dot(Field::srcImage), pCopyImageInfo->srcImage); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= + context.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 @@ -15783,45 +17878,46 @@ bool StatelessValidation::PreCallValidateCmdCopyBufferToImage2(VkCommandBuffer c const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= context.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 |= context.ValidateStructPnext(pCopyBufferToImageInfo_loc, pCopyBufferToImageInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCopyBufferToImageInfo2-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCopyBufferToImageInfo_loc.dot(Field::srcBuffer), pCopyBufferToImageInfo->srcBuffer); + skip |= context.ValidateRequiredHandle(pCopyBufferToImageInfo_loc.dot(Field::srcBuffer), pCopyBufferToImageInfo->srcBuffer); - skip |= ValidateRequiredHandle(pCopyBufferToImageInfo_loc.dot(Field::dstImage), pCopyBufferToImageInfo->dstImage); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 @@ -15836,45 +17932,46 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer2(VkCommandBuffer c const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= context.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 |= context.ValidateStructPnext(pCopyImageToBufferInfo_loc, pCopyImageToBufferInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCopyImageToBufferInfo2-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCopyImageToBufferInfo_loc.dot(Field::srcImage), pCopyImageToBufferInfo->srcImage); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 @@ -15888,59 +17985,59 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer2(VkCommandBuffer c bool StatelessValidation::PreCallValidateCmdBlitImage2(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= + context.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 |= context.ValidateRangedEnum(pBlitImageInfo_loc.dot(Field::filter), vvl::Enum::VkFilter, pBlitImageInfo->filter, + "VUID-VkBlitImageInfo2-filter-parameter"); } return skip; } @@ -15949,50 +18046,53 @@ bool StatelessValidation::PreCallValidateCmdResolveImage2(VkCommandBuffer comman const VkResolveImageInfo2* pResolveImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= + context.ValidateStructPnext(pResolveImageInfo_loc, pResolveImageInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkResolveImageInfo2-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pResolveImageInfo_loc.dot(Field::srcImage), pResolveImageInfo->srcImage); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 @@ -16006,9 +18106,10 @@ bool StatelessValidation::PreCallValidateCmdResolveImage2(VkCommandBuffer comman bool StatelessValidation::PreCallValidateCmdBeginRendering(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 = { @@ -16020,129 +18121,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdEndRendering(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; // No xml-driven validation return skip; @@ -16151,18 +18256,20 @@ bool StatelessValidation::PreCallValidateCmdEndRendering(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdSetCullMode(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRangedEnum(loc.dot(Field::frontFace), vvl::Enum::VkFrontFace, frontFace, + "VUID-vkCmdSetFrontFace-frontFace-parameter"); return skip; } @@ -16170,37 +18277,40 @@ bool StatelessValidation::PreCallValidateCmdSetPrimitiveTopology(VkCommandBuffer VkPrimitiveTopology primitiveTopology, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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; + stateless::Context context(*this, error_obj, 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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdSetScissorWithCount(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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, context); return skip; } @@ -16209,52 +18319,58 @@ bool StatelessValidation::PreCallValidateCmdBindVertexBuffers2(VkCommandBuffer c const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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, context); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthTestEnable(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::depthTestEnable), depthTestEnable); + skip |= context.ValidateBool32(loc.dot(Field::depthTestEnable), depthTestEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthWriteEnable(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::depthWriteEnable), depthWriteEnable); + skip |= context.ValidateBool32(loc.dot(Field::depthWriteEnable), depthWriteEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthCompareOp(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::depthBoundsTestEnable), depthBoundsTestEnable); + skip |= context.ValidateBool32(loc.dot(Field::depthBoundsTestEnable), depthBoundsTestEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetStencilTestEnable(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::stencilTestEnable), stencilTestEnable); + skip |= context.ValidateBool32(loc.dot(Field::stencilTestEnable), stencilTestEnable); return skip; } @@ -16262,18 +18378,19 @@ bool StatelessValidation::PreCallValidateCmdSetStencilOp(VkCommandBuffer command VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateFlags(loc.dot(Field::faceMask), vvl::FlagBitmask::VkStencilFaceFlagBits, AllVkStencilFaceFlagBits, + faceMask, kRequiredFlags, "VUID-vkCmdSetStencilOp-faceMask-parameter", + "VUID-vkCmdSetStencilOp-faceMask-requiredbitmask"); + skip |= context.ValidateRangedEnum(loc.dot(Field::failOp), vvl::Enum::VkStencilOp, failOp, + "VUID-vkCmdSetStencilOp-failOp-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::passOp), vvl::Enum::VkStencilOp, passOp, + "VUID-vkCmdSetStencilOp-passOp-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::depthFailOp), vvl::Enum::VkStencilOp, depthFailOp, + "VUID-vkCmdSetStencilOp-depthFailOp-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::compareOp), vvl::Enum::VkCompareOp, compareOp, + "VUID-vkCmdSetStencilOp-compareOp-parameter"); return skip; } @@ -16281,16 +18398,18 @@ bool StatelessValidation::PreCallValidateCmdSetRasterizerDiscardEnable(VkCommand VkBool32 rasterizerDiscardEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::rasterizerDiscardEnable), rasterizerDiscardEnable); + skip |= context.ValidateBool32(loc.dot(Field::rasterizerDiscardEnable), rasterizerDiscardEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetDepthBiasEnable(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::depthBiasEnable), depthBiasEnable); + skip |= context.ValidateBool32(loc.dot(Field::depthBiasEnable), depthBiasEnable); return skip; } @@ -16298,8 +18417,9 @@ bool StatelessValidation::PreCallValidateCmdSetPrimitiveRestartEnable(VkCommandB VkBool32 primitiveRestartEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateBool32(loc.dot(Field::primitiveRestartEnable), primitiveRestartEnable); + skip |= context.ValidateBool32(loc.dot(Field::primitiveRestartEnable), primitiveRestartEnable); return skip; } @@ -16308,18 +18428,19 @@ bool StatelessValidation::PreCallValidateGetDeviceBufferMemoryRequirements(VkDev VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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); @@ -16333,31 +18454,30 @@ 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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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; } @@ -16367,18 +18487,19 @@ bool StatelessValidation::PreCallValidateGetDeviceImageMemoryRequirements(VkDevi VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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); @@ -16403,60 +18524,58 @@ 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 |= - ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, - pInfo->pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-flags-parameter"); + context.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 |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, pInfo->pCreateInfo->imageType, - "VUID-VkImageCreateInfo-imageType-parameter", VK_NULL_HANDLE); + skip |= context.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, + AllVkImageCreateFlagBits, pInfo->pCreateInfo->flags, kOptionalFlags, + "VUID-VkImageCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pInfo->pCreateInfo->format, - "VUID-VkImageCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= context.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, + pInfo->pCreateInfo->imageType, "VUID-VkImageCreateInfo-imageType-parameter"); + + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -16464,18 +18583,19 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSparseMemoryRequirements( VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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); @@ -16500,48 +18620,46 @@ 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 |= - ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, - pInfo->pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-flags-parameter"); + context.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 |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, pInfo->pCreateInfo->imageType, - "VUID-VkImageCreateInfo-imageType-parameter", VK_NULL_HANDLE); + skip |= context.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, + AllVkImageCreateFlagBits, pInfo->pCreateInfo->flags, kOptionalFlags, + "VUID-VkImageCreateInfo-flags-parameter"); - skip |= ValidateRangedEnum(pCreateInfo_loc.dot(Field::format), vvl::Enum::VkFormat, pInfo->pCreateInfo->format, - "VUID-VkImageCreateInfo-format-parameter", VK_NULL_HANDLE); + skip |= context.ValidateRangedEnum(pCreateInfo_loc.dot(Field::imageType), vvl::Enum::VkImageType, + pInfo->pCreateInfo->imageType, "VUID-VkImageCreateInfo-imageType-parameter"); + + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateFlags(pInfo_loc.dot(Field::planeAspect), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pInfo->planeAspect, kOptionalSingleBit, + "VUID-VkDeviceImageMemoryRequirements-planeAspect-parameter"); } - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -16551,66 +18669,70 @@ 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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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, context); return skip; } bool StatelessValidation::PreCallValidateMapMemory2(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pMemoryMapInfo_loc.dot(Field::memory), pMemoryMapInfo->memory); } - skip |= ValidateRequiredPointer(loc.dot(Field::ppData), ppData, "VUID-vkMapMemory2-ppData-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, 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 |= + context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pMemoryUnmapInfo_loc.dot(Field::memory), pMemoryUnmapInfo->memory); } return skip; } @@ -16619,27 +18741,30 @@ bool StatelessValidation::PreCallValidateCmdBindIndexBuffer2(VkCommandBuffer com VkDeviceSize size, VkIndexType indexType, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRangedEnum(loc.dot(Field::indexType), vvl::Enum::VkIndexType, indexType, + "VUID-vkCmdBindIndexBuffer2-indexType-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdBindIndexBuffer2(commandBuffer, buffer, offset, size, indexType, context); return skip; } bool StatelessValidation::PreCallValidateGetRenderingAreaGranularity(VkDevice device, const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= + context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pGranularity), pGranularity, + "VUID-vkGetRenderingAreaGranularity-pGranularity-parameter"); return skip; } @@ -16647,17 +18772,19 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSubresourceLayout(VkDevic VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.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); @@ -16682,71 +18809,70 @@ 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 |= - ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, - pInfo->pCreateInfo->flags, kOptionalFlags, VK_NULL_HANDLE, "VUID-VkImageCreateInfo-flags-parameter"); + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -16755,30 +18881,33 @@ bool StatelessValidation::PreCallValidateGetImageSubresourceLayout2(VkDevice dev VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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; } @@ -16788,11 +18917,12 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSet(VkCommandBuffer co const VkWriteDescriptorSet* pDescriptorWrites, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdPushDescriptorSet-pipelineBindPoint-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= context.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"); @@ -16804,24 +18934,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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -16830,9 +18960,10 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetWithTemplate(VkComm VkPipelineLayout layout, uint32_t set, const void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateRequiredHandle(loc.dot(Field::descriptorUpdateTemplate), descriptorUpdateTemplate); - skip |= ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= context.ValidateRequiredHandle(loc.dot(Field::descriptorUpdateTemplate), descriptorUpdateTemplate); + skip |= context.ValidateRequiredHandle(loc.dot(Field::layout), layout); return skip; } @@ -16840,10 +18971,11 @@ bool StatelessValidation::PreCallValidateCmdSetRenderingAttachmentLocations(VkCo const VkRenderingAttachmentLocationInfo* pLocationInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.ValidateStructType( + loc.dot(Field::pLocationInfo), pLocationInfo, VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO, true, + "VUID-vkCmdSetRenderingAttachmentLocations-pLocationInfo-parameter", "VUID-VkRenderingAttachmentLocationInfo-sType-sType"); return skip; } @@ -16851,11 +18983,12 @@ bool StatelessValidation::PreCallValidateCmdSetRenderingInputAttachmentIndices( VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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; } @@ -16863,30 +18996,31 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorSets2(VkCommandBuffer const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -16894,28 +19028,30 @@ bool StatelessValidation::PreCallValidateCmdPushConstants2(VkCommandBuffer comma const VkPushConstantsInfo* pPushConstantsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.ValidateStructPnext(pPushConstantsInfo_loc, pPushConstantsInfo->pNext, + allowed_structs_VkPushConstantsInfo.size(), allowed_structs_VkPushConstantsInfo.data(), + GeneratedVulkanHeaderVersion, "VUID-VkPushConstantsInfo-pNext-pNext", + "VUID-VkPushConstantsInfo-sType-unique", 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"); + skip |= context.ValidateFlags(pPushConstantsInfo_loc.dot(Field::stageFlags), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pPushConstantsInfo->stageFlags, kRequiredFlags, + "VUID-VkPushConstantsInfo-stageFlags-parameter", + "VUID-VkPushConstantsInfo-stageFlags-requiredbitmask"); - 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 |= context.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, context); return skip; } @@ -16923,30 +19059,31 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSet2(VkCommandBuffer c const VkPushDescriptorSetInfo* pPushDescriptorSetInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.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; @@ -16958,24 +19095,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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -16983,79 +19120,80 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetWithTemplate2( VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pPushDescriptorSetWithTemplateInfo_loc.dot(Field::descriptorUpdateTemplate), + pPushDescriptorSetWithTemplateInfo->descriptorUpdateTemplate); - skip |= ValidateRequiredPointer(pPushDescriptorSetWithTemplateInfo_loc.dot(Field::pData), - pPushDescriptorSetWithTemplateInfo->pData, - "VUID-VkPushDescriptorSetWithTemplateInfo-pData-parameter"); + skip |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCopyMemoryToImage(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 @@ -17069,48 +19207,49 @@ bool StatelessValidation::PreCallValidateCopyMemoryToImage(VkDevice device, cons bool StatelessValidation::PreCallValidateCopyImageToMemory(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 @@ -17124,58 +19263,59 @@ bool StatelessValidation::PreCallValidateCopyImageToMemory(VkDevice device, cons bool StatelessValidation::PreCallValidateCopyImageToImage(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateStructPnext(pRegions_loc, pCopyImageToImageInfo->pRegions[regionIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImageCopy2-pNext-pNext", kVUIDUndefined, + 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"); + skip |= context.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 |= context.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 @@ -17190,32 +19330,33 @@ bool StatelessValidation::PreCallValidateTransitionImageLayout(VkDevice device, const VkHostImageLayoutTransitionInfo* pTransitions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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; @@ -17225,11 +19366,12 @@ bool StatelessValidation::PreCallValidateDestroySurfaceKHR(VkInstance instance, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -17239,11 +19381,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceSupportKHR(VkPh VkBool32* pSupported, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSupported), pSupported, + "VUID-vkGetPhysicalDeviceSurfaceSupportKHR-pSupported-parameter"); return skip; } @@ -17252,11 +19397,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceCapabilitiesKHR VkSurfaceCapabilitiesKHR* pSurfaceCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurfaceCapabilities), pSurfaceCapabilities, + "VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-pSurfaceCapabilities-parameter"); return skip; } @@ -17265,12 +19413,15 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPh VkSurfaceFormatKHR* pSurfaceFormats, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); + skip |= context.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); @@ -17279,7 +19430,7 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPh } if (!skip) skip |= manual_PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, pSurfaceFormatCount, - pSurfaceFormats, error_obj); + pSurfaceFormats, context); return skip; } @@ -17288,15 +19439,18 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR VkPresentModeKHR* pPresentModes, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_surface}); + skip |= context.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, context); return skip; } @@ -17304,10 +19458,12 @@ bool StatelessValidation::PreCallValidateCreateSwapchainKHR(VkDevice device, con const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); + skip |= + context.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 = { @@ -17323,56 +19479,56 @@ 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.ValidateRequiredPointer(loc.dot(Field::pSwapchain), pSwapchain, "VUID-vkCreateSwapchainKHR-pSwapchain-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain, context); return skip; } @@ -17380,11 +19536,12 @@ bool StatelessValidation::PreCallValidateDestroySwapchainKHR(VkDevice device, Vk const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -17393,13 +19550,14 @@ bool StatelessValidation::PreCallValidateGetSwapchainImagesKHR(VkDevice device, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.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; } @@ -17407,22 +19565,25 @@ bool StatelessValidation::PreCallValidateAcquireNextImageKHR(VkDevice device, Vk VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pImageIndex), pImageIndex, + "VUID-vkAcquireNextImageKHR-pImageIndex-parameter"); if (!skip) - skip |= manual_PreCallValidateAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex, error_obj); + skip |= manual_PreCallValidateAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex, context); return skip; } bool StatelessValidation::PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_swapchain}); + skip |= context.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, @@ -17435,46 +19596,48 @@ 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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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, context); return skip; } bool StatelessValidation::PreCallValidateGetDeviceGroupPresentCapabilitiesKHR( VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!(IsExtEnabled(device_extensions.vk_khr_swapchain) || IsExtEnabled(device_extensions.vk_khr_device_group))) + if (!(IsExtEnabled(extensions.vk_khr_swapchain) || IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pDeviceGroupPresentCapabilities_loc, pDeviceGroupPresentCapabilities->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkDeviceGroupPresentCapabilitiesKHR-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -17483,11 +19646,13 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupSurfacePresentModesKHR(Vk VkDeviceGroupPresentModeFlagsKHR* pModes, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!(IsExtEnabled(device_extensions.vk_khr_swapchain) || IsExtEnabled(device_extensions.vk_khr_device_group))) + if (!(IsExtEnabled(extensions.vk_khr_swapchain) || IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pModes), pModes, + "VUID-vkGetDeviceGroupSurfacePresentModesKHR-pModes-parameter"); return skip; } @@ -17496,31 +19661,37 @@ bool StatelessValidation::PreCallValidateGetPhysicalDevicePresentRectanglesKHR(V VkRect2D* pRects, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!(IsExtEnabled(device_extensions.vk_khr_swapchain) || IsExtEnabled(device_extensions.vk_khr_device_group))) + if (!(IsExtEnabled(extensions.vk_khr_swapchain) || IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pAcquireInfo_loc, pAcquireInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAcquireNextImageInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pAcquireInfo_loc.dot(Field::swapchain), pAcquireInfo->swapchain); + skip |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pImageIndex), pImageIndex, + "VUID-vkAcquireNextImage2KHR-pImageIndex-parameter"); + if (!skip) skip |= manual_PreCallValidateAcquireNextImage2KHR(device, pAcquireInfo, pImageIndex, context); return skip; } @@ -17529,11 +19700,15 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDisplayPropertiesKHR(V VkDisplayPropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); + skip |= + context.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); @@ -17548,11 +19723,15 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDisplayPlaneProperties VkDisplayPlanePropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); + skip |= context.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); @@ -17566,11 +19745,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); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); + skip |= context.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; } @@ -17579,12 +19761,15 @@ bool StatelessValidation::PreCallValidateGetDisplayModePropertiesKHR(VkPhysicalD VkDisplayModePropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= context.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); @@ -17599,28 +19784,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); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pMode), pMode, "VUID-vkCreateDisplayModeKHR-pMode-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateDisplayModeKHR(physicalDevice, display, pCreateInfo, pAllocator, pMode, context); return skip; } @@ -17629,11 +19817,14 @@ bool StatelessValidation::PreCallValidateGetDisplayPlaneCapabilitiesKHR(VkPhysic VkDisplayPlaneCapabilitiesKHR* pCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::mode), mode); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pCapabilities), pCapabilities, + "VUID-vkGetDisplayPlaneCapabilitiesKHR-pCapabilities-parameter"); return skip; } @@ -17642,43 +19833,45 @@ bool StatelessValidation::PreCallValidateCreateDisplayPlaneSurfaceKHR(VkInstance const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display}); + skip |= context.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 |= context.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 |= context.ValidateReservedFlags(pCreateInfo_loc.dot(Field::flags), pCreateInfo->flags, + "VUID-VkDisplaySurfaceCreateInfoKHR-flags-zerobitmask"); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::displayMode), pCreateInfo->displayMode); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, + "VUID-vkCreateDisplayPlaneSurfaceKHR-pSurface-parameter"); return skip; } @@ -17688,10 +19881,11 @@ bool StatelessValidation::PreCallValidateCreateSharedSwapchainsKHR(VkDevice devi VkSwapchainKHR* pSwapchains, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_display_swapchain)) + if (!IsExtEnabled(extensions.vk_khr_display_swapchain)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_display_swapchain}); - skip |= ValidateStructTypeArray( + skip |= context.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"); @@ -17711,63 +19905,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -17776,25 +19970,26 @@ bool StatelessValidation::PreCallValidateCreateXlibSurfaceKHR(VkInstance instanc const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_xlib_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_xlib_surface}); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateXlibSurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateXlibSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, context); return skip; } @@ -17803,10 +19998,13 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceXlibPresentationSuppor VisualID visualID, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_xlib_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_xlib_surface}); + skip |= context.ValidateRequiredPointer(loc.dot(Field::dpy), dpy, + "VUID-vkGetPhysicalDeviceXlibPresentationSupportKHR-dpy-parameter"); return skip; } #endif // VK_USE_PLATFORM_XLIB_KHR @@ -17816,25 +20014,26 @@ bool StatelessValidation::PreCallValidateCreateXcbSurfaceKHR(VkInstance instance const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_xcb_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_xcb_surface}); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateXcbSurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateXcbSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, context); return skip; } @@ -17844,11 +20043,13 @@ 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); + stateless::Context context(*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"); + if (!IsExtEnabled(extensions.vk_khr_xcb_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_xcb_surface}); + skip |= context.ValidateRequiredPointer(loc.dot(Field::connection), connection, + "VUID-vkGetPhysicalDeviceXcbPresentationSupportKHR-connection-parameter"); return skip; } #endif // VK_USE_PLATFORM_XCB_KHR @@ -17859,26 +20060,28 @@ bool StatelessValidation::PreCallValidateCreateWaylandSurfaceKHR(VkInstance inst const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(instance_extensions.vk_khr_wayland_surface)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateWaylandSurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateWaylandSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, context); return skip; } @@ -17887,11 +20090,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); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::display), display, + "VUID-vkGetPhysicalDeviceWaylandPresentationSupportKHR-display-parameter"); return skip; } #endif // VK_USE_PLATFORM_WAYLAND_KHR @@ -17902,26 +20108,28 @@ bool StatelessValidation::PreCallValidateCreateAndroidSurfaceKHR(VkInstance inst const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(instance_extensions.vk_khr_android_surface)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateAndroidSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, context); return skip; } #endif // VK_USE_PLATFORM_ANDROID_KHR @@ -17931,26 +20139,26 @@ bool StatelessValidation::PreCallValidateCreateWin32SurfaceKHR(VkInstance instan const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_win32_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_win32_surface}); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateWin32SurfaceKHR-pSurface-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateWin32SurfaceKHR(instance, pCreateInfo, pAllocator, pSurface, context); return skip; } @@ -17958,9 +20166,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceWin32PresentationSuppo uint32_t queueFamilyIndex, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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}); + if (!IsExtEnabled(extensions.vk_khr_win32_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_win32_surface}); // No xml-driven validation return skip; } @@ -17971,35 +20181,39 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceVideoCapabilitiesKHR(V VkVideoCapabilitiesKHR* pCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.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 |= - 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"); + skip |= context.ValidateFlags( + pVideoProfile_loc.dot(Field::videoCodecOperation), vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, + AllVkVideoCodecOperationFlagBitsKHR, pVideoProfile->videoCodecOperation, kRequiredSingleBit, + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); + + skip |= context.ValidateFlags(pVideoProfile_loc.dot(Field::chromaSubsampling), + vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, AllVkVideoChromaSubsamplingFlagBitsKHR, + pVideoProfile->chromaSubsampling, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); + + skip |= context.ValidateFlags( + pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pVideoProfile->lumaBitDepth, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); + + skip |= context.ValidateFlags(pVideoProfile_loc.dot(Field::chromaBitDepth), + vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, AllVkVideoComponentBitDepthFlagBitsKHR, + pVideoProfile->chromaBitDepth, kOptionalFlags, + "VUID-VkVideoProfileInfoKHR-chromaBitDepth-parameter"); + } + skip |= context.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 = { @@ -18016,10 +20230,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 |= context.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; } @@ -18028,27 +20242,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); + stateless::Context context(*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 |= context.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 |= context.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 |= context.ValidateFlags(pVideoFormatInfo_loc.dot(Field::imageUsage), vvl::FlagBitmask::VkImageUsageFlagBits, + AllVkImageUsageFlagBits, pVideoFormatInfo->imageUsage, kRequiredFlags, + "VUID-VkPhysicalDeviceVideoFormatInfoKHR-imageUsage-parameter", + "VUID-VkPhysicalDeviceVideoFormatInfoKHR-imageUsage-requiredbitmask"); } - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -18063,11 +20279,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 |= context.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; @@ -18078,74 +20294,74 @@ bool StatelessValidation::PreCallValidateCreateVideoSessionKHR(VkDevice device, VkVideoSessionKHR* pVideoSession, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); + skip |= context.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 |= context.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 |= context.ValidateFlags(pCreateInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoSessionCreateFlagBitsKHR, + AllVkVideoSessionCreateFlagBitsKHR, pCreateInfo->flags, kOptionalFlags, + "VUID-VkVideoSessionCreateInfoKHR-flags-parameter"); - skip |= ValidateStructType( + skip |= context.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 |= context.ValidateFlags(pVideoProfile_loc.dot(Field::videoCodecOperation), + vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, AllVkVideoCodecOperationFlagBitsKHR, + pCreateInfo->pVideoProfile->videoCodecOperation, kRequiredSingleBit, + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); + + skip |= context.ValidateFlags(pVideoProfile_loc.dot(Field::chromaSubsampling), + vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, + AllVkVideoChromaSubsamplingFlagBitsKHR, pCreateInfo->pVideoProfile->chromaSubsampling, + kRequiredFlags, "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); + + skip |= context.ValidateFlags( + pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pCreateInfo->pVideoProfile->lumaBitDepth, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); + + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pVideoSession), pVideoSession, - "VUID-vkCreateVideoSessionKHR-pVideoSession-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pVideoSession), pVideoSession, + "VUID-vkCreateVideoSessionKHR-pVideoSession-parameter"); return skip; } @@ -18153,12 +20369,12 @@ bool StatelessValidation::PreCallValidateDestroyVideoSessionKHR(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -18167,11 +20383,11 @@ bool StatelessValidation::PreCallValidateGetVideoSessionMemoryRequirementsKHR( VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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( + if (!IsExtEnabled(extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::videoSession), videoSession); + skip |= context.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, @@ -18180,9 +20396,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 |= context.ValidateStructPnext(pMemoryRequirements_loc, pMemoryRequirements[pMemoryRequirementsIndex].pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkVideoSessionMemoryRequirementsKHR-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -18193,11 +20409,11 @@ bool StatelessValidation::PreCallValidateBindVideoSessionMemoryKHR(VkDevice devi const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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( + if (!IsExtEnabled(extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::videoSession), videoSession); + skip |= context.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", @@ -18207,12 +20423,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 |= context.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 |= context.ValidateRequiredHandle(pBindSessionMemoryInfos_loc.dot(Field::memory), + pBindSessionMemoryInfos[bindSessionMemoryInfoIndex].memory); } } return skip; @@ -18224,12 +20440,12 @@ bool StatelessValidation::PreCallValidateCreateVideoSessionParametersKHR(VkDevic VkVideoSessionParametersKHR* pVideoSessionParameters, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); + skip |= context.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 = { @@ -18242,24 +20458,25 @@ 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 |= context.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 |= + context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pVideoSessionParameters), pVideoSessionParameters, - "VUID-vkCreateVideoSessionParametersKHR-pVideoSessionParameters-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pVideoSessionParameters), pVideoSessionParameters, + "VUID-vkCreateVideoSessionParametersKHR-pVideoSessionParameters-parameter"); return skip; } @@ -18268,13 +20485,13 @@ bool StatelessValidation::PreCallValidateUpdateVideoSessionParametersKHR(VkDevic const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::videoSessionParameters), videoSessionParameters); + skip |= context.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 = { @@ -18283,11 +20500,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 |= context.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; } @@ -18297,12 +20514,12 @@ bool StatelessValidation::PreCallValidateDestroyVideoSessionParametersKHR(VkDevi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -18311,11 +20528,12 @@ bool StatelessValidation::PreCallValidateCmdBeginVideoCodingKHR(VkCommandBuffer const VkVideoBeginCodingInfoKHR* pBeginInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); + skip |= context.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 = { @@ -18327,21 +20545,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 |= context.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 |= context.ValidateReservedFlags(pBeginInfo_loc.dot(Field::flags), pBeginInfo->flags, + "VUID-VkVideoBeginCodingInfoKHR-flags-zerobitmask"); - skip |= ValidateRequiredHandle(pBeginInfo_loc.dot(Field::videoSession), pBeginInfo->videoSession); + skip |= context.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 |= context.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) { @@ -18352,32 +20570,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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle( + pPictureResource_loc.dot(Field::imageViewBinding), + pBeginInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); } } } @@ -18389,18 +20606,19 @@ bool StatelessValidation::PreCallValidateCmdEndVideoCodingKHR(VkCommandBuffer co const VkVideoEndCodingInfoKHR* pEndCodingInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); + skip |= context.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 |= context.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 |= context.ValidateReservedFlags(pEndCodingInfo_loc.dot(Field::flags), pEndCodingInfo->flags, + "VUID-VkVideoEndCodingInfoKHR-flags-zerobitmask"); } return skip; } @@ -18409,10 +20627,10 @@ bool StatelessValidation::PreCallValidateCmdControlVideoCodingKHR(VkCommandBuffe const VkVideoCodingControlInfoKHR* pCodingControlInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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( + if (!IsExtEnabled(extensions.vk_khr_video_queue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_video_queue}); + skip |= context.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) { @@ -18422,15 +20640,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 |= context.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 |= context.ValidateFlags(pCodingControlInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkVideoCodingControlFlagBitsKHR, + AllVkVideoCodingControlFlagBitsKHR, pCodingControlInfo->flags, kRequiredFlags, + "VUID-VkVideoCodingControlInfoKHR-flags-parameter", + "VUID-VkVideoCodingControlInfoKHR-flags-requiredbitmask"); } return skip; } @@ -18438,46 +20656,47 @@ bool StatelessValidation::PreCallValidateCmdControlVideoCodingKHR(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdDecodeVideoKHR(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR* pDecodeInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_video_decode_queue)) + if (!IsExtEnabled(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 |= context.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 |= + context.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 |= context.ValidateReservedFlags(pDecodeInfo_loc.dot(Field::flags), pDecodeInfo->flags, + "VUID-VkVideoDecodeInfoKHR-flags-zerobitmask"); - skip |= ValidateRequiredHandle(pDecodeInfo_loc.dot(Field::srcBuffer), pDecodeInfo->srcBuffer); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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); @@ -18486,37 +20705,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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) { @@ -18527,32 +20746,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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle( + pPictureResource_loc.dot(Field::imageViewBinding), + pDecodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); } } } @@ -18563,8 +20781,9 @@ bool StatelessValidation::PreCallValidateCmdDecodeVideoKHR(VkCommandBuffer comma bool StatelessValidation::PreCallValidateCmdBeginRenderingKHR(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering)) + if (!IsExtEnabled(extensions.vk_khr_dynamic_rendering)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_dynamic_rendering}); skip |= PreCallValidateCmdBeginRendering(commandBuffer, pRenderingInfo, error_obj); return skip; @@ -18572,8 +20791,9 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderingKHR(VkCommandBuffer co bool StatelessValidation::PreCallValidateCmdEndRenderingKHR(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering)) + if (!IsExtEnabled(extensions.vk_khr_dynamic_rendering)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_dynamic_rendering}); skip |= PreCallValidateCmdEndRendering(commandBuffer, error_obj); return skip; @@ -18583,8 +20803,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFeatures2KHR(VkPhysica VkPhysicalDeviceFeatures2* pFeatures, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); skip |= PreCallValidateGetPhysicalDeviceFeatures2(physicalDevice, pFeatures, error_obj); return skip; @@ -18594,8 +20817,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceProperties2KHR(VkPhysi VkPhysicalDeviceProperties2* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); skip |= PreCallValidateGetPhysicalDeviceProperties2(physicalDevice, pProperties, error_obj); return skip; @@ -18605,8 +20831,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceFormatProperties2KHR(V VkFormatProperties2* pFormatProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); skip |= PreCallValidateGetPhysicalDeviceFormatProperties2(physicalDevice, format, pFormatProperties, error_obj); return skip; @@ -18616,8 +20845,11 @@ 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); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); skip |= PreCallValidateGetPhysicalDeviceImageFormatProperties2(physicalDevice, pImageFormatInfo, pImageFormatProperties, error_obj); @@ -18628,8 +20860,11 @@ 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); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); skip |= PreCallValidateGetPhysicalDeviceQueueFamilyProperties2(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties, error_obj); @@ -18640,8 +20875,11 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceMemoryProperties2KHR(V VkPhysicalDeviceMemoryProperties2* pMemoryProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); skip |= PreCallValidateGetPhysicalDeviceMemoryProperties2(physicalDevice, pMemoryProperties, error_obj); return skip; @@ -18651,8 +20889,11 @@ 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); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_get_physical_device_properties2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_physical_device_properties2}); skip |= PreCallValidateGetPhysicalDeviceSparseImageFormatProperties2(physicalDevice, pFormatInfo, pPropertyCount, pProperties, error_obj); @@ -18664,9 +20905,9 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupPeerMemoryFeaturesKHR(VkD VkPeerMemoryFeatureFlags* pPeerMemoryFeatures, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_khr_device_group)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_device_group}); skip |= PreCallValidateGetDeviceGroupPeerMemoryFeatures(device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures, error_obj); return skip; @@ -18675,9 +20916,9 @@ bool StatelessValidation::PreCallValidateGetDeviceGroupPeerMemoryFeaturesKHR(VkD bool StatelessValidation::PreCallValidateCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_khr_device_group)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_device_group}); skip |= PreCallValidateCmdSetDeviceMask(commandBuffer, deviceMask, error_obj); return skip; } @@ -18686,9 +20927,9 @@ 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; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_khr_device_group)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_device_group}); skip |= PreCallValidateCmdDispatchBase(commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ, error_obj); return skip; @@ -18697,9 +20938,9 @@ bool StatelessValidation::PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer comm bool StatelessValidation::PreCallValidateTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance1)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance1}); + if (!IsExtEnabled(extensions.vk_khr_maintenance1)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance1}); skip |= PreCallValidateTrimCommandPool(device, commandPool, flags, error_obj); return skip; } @@ -18708,8 +20949,9 @@ bool StatelessValidation::PreCallValidateEnumeratePhysicalDeviceGroupsKHR( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(instance_extensions.vk_khr_device_group_creation)) + if (!IsExtEnabled(extensions.vk_khr_device_group_creation)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_device_group_creation}); skip |= PreCallValidateEnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties, error_obj); @@ -18720,8 +20962,11 @@ 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); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_external_memory_capabilities)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_memory_capabilities}); skip |= PreCallValidateGetPhysicalDeviceExternalBufferProperties(physicalDevice, pExternalBufferInfo, pExternalBufferProperties, error_obj); @@ -18733,26 +20978,28 @@ bool StatelessValidation::PreCallValidateGetMemoryWin32HandleKHR(VkDevice device const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_memory_win32)) + if (!IsExtEnabled(extensions.vk_khr_external_memory_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_memory_win32}); - skip |= ValidateStructType( + skip |= context.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 |= context.ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryGetWin32HandleInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::memory), pGetWin32HandleInfo->memory); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetMemoryWin32HandleKHR-pHandle-parameter"); + if (!skip) skip |= manual_PreCallValidateGetMemoryWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, context); return skip; } @@ -18760,26 +21007,27 @@ bool StatelessValidation::PreCallValidateGetMemoryWin32HandlePropertiesKHR( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_memory_win32)) + if (!IsExtEnabled(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 |= context.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, + "VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter", + "VUID-vkGetMemoryWin32HandlePropertiesKHR-handleType-parameter"); + skip |= context.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 |= context.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); + context); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -18787,24 +21035,26 @@ bool StatelessValidation::PreCallValidateGetMemoryWin32HandlePropertiesKHR( bool StatelessValidation::PreCallValidateGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_memory_fd)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMemoryGetFdInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::memory), pGetFdInfo->memory); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetMemoryFdKHR-pFd-parameter"); + if (!skip) skip |= manual_PreCallValidateGetMemoryFdKHR(device, pGetFdInfo, pFd, context); return skip; } @@ -18812,22 +21062,24 @@ bool StatelessValidation::PreCallValidateGetMemoryFdPropertiesKHR(VkDevice devic int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_memory_fd)) + if (!IsExtEnabled(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 |= context.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, + "VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter", + "VUID-vkGetMemoryFdPropertiesKHR-handleType-parameter"); + skip |= context.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 |= context.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, context); return skip; } @@ -18835,8 +21087,11 @@ 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); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_external_semaphore_capabilities)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_semaphore_capabilities}); skip |= PreCallValidateGetPhysicalDeviceExternalSemaphoreProperties(physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties, error_obj); @@ -18848,27 +21103,29 @@ bool StatelessValidation::PreCallValidateImportSemaphoreWin32HandleKHR( VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore_win32)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pImportSemaphoreWin32HandleInfo_loc, pImportSemaphoreWin32HandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImportSemaphoreWin32HandleInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportSemaphoreWin32HandleInfo_loc.dot(Field::semaphore), - pImportSemaphoreWin32HandleInfo->semaphore); + skip |= context.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 |= context.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, context); return skip; } @@ -18876,27 +21133,30 @@ bool StatelessValidation::PreCallValidateGetSemaphoreWin32HandleKHR(VkDevice dev const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore_win32)) + if (!IsExtEnabled(extensions.vk_khr_external_semaphore_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_semaphore_win32}); - skip |= ValidateStructType( + skip |= context.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 |= context.ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreGetWin32HandleInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::semaphore), pGetWin32HandleInfo->semaphore); + skip |= context.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 |= context.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 |= + context.ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetSemaphoreWin32HandleKHR-pHandle-parameter"); + if (!skip) skip |= manual_PreCallValidateGetSemaphoreWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, context); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -18905,55 +21165,57 @@ bool StatelessValidation::PreCallValidateImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore_fd)) + if (!IsExtEnabled(extensions.vk_khr_external_semaphore_fd)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_semaphore_fd}); - skip |= ValidateStructType( + skip |= context.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 |= context.ValidateStructPnext(pImportSemaphoreFdInfo_loc, pImportSemaphoreFdInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImportSemaphoreFdInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportSemaphoreFdInfo_loc.dot(Field::semaphore), pImportSemaphoreFdInfo->semaphore); + skip |= context.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 |= context.ValidateFlags(pImportSemaphoreFdInfo_loc.dot(Field::flags), vvl::FlagBitmask::VkSemaphoreImportFlagBits, + AllVkSemaphoreImportFlagBits, pImportSemaphoreFdInfo->flags, kOptionalFlags, + "VUID-VkImportSemaphoreFdInfoKHR-flags-parameter"); - skip |= ValidateFlags( + skip |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_semaphore_fd)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSemaphoreGetFdInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::semaphore), pGetFdInfo->semaphore); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetSemaphoreFdKHR-pFd-parameter"); + if (!skip) skip |= manual_PreCallValidateGetSemaphoreFdKHR(device, pGetFdInfo, pFd, context); return skip; } @@ -18963,8 +21225,9 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetKHR(VkCommandBuffer const VkWriteDescriptorSet* pDescriptorWrites, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_push_descriptor)) + if (!IsExtEnabled(extensions.vk_khr_push_descriptor)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_push_descriptor}); skip |= PreCallValidateCmdPushDescriptorSet(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites, error_obj); @@ -18977,9 +21240,9 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetWithTemplateKHR(VkC const void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_khr_push_descriptor) || IsExtEnabled(extensions.vk_khr_descriptor_update_template))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_push_descriptor, vvl::Extension::_VK_KHR_descriptor_update_template}); skip |= PreCallValidateCmdPushDescriptorSetWithTemplate(commandBuffer, descriptorUpdateTemplate, layout, set, pData, error_obj); @@ -18992,8 +21255,9 @@ bool StatelessValidation::PreCallValidateCreateDescriptorUpdateTemplateKHR(VkDev VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_descriptor_update_template)) + if (!IsExtEnabled(extensions.vk_khr_descriptor_update_template)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_descriptor_update_template}); skip |= PreCallValidateCreateDescriptorUpdateTemplate(device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate, error_obj); return skip; @@ -19004,8 +21268,9 @@ bool StatelessValidation::PreCallValidateDestroyDescriptorUpdateTemplateKHR(VkDe const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_descriptor_update_template)) + if (!IsExtEnabled(extensions.vk_khr_descriptor_update_template)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_descriptor_update_template}); skip |= PreCallValidateDestroyDescriptorUpdateTemplate(device, descriptorUpdateTemplate, pAllocator, error_obj); return skip; @@ -19015,8 +21280,9 @@ bool StatelessValidation::PreCallValidateUpdateDescriptorSetWithTemplateKHR(VkDe VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_descriptor_update_template)) + if (!IsExtEnabled(extensions.vk_khr_descriptor_update_template)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_descriptor_update_template}); skip |= PreCallValidateUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData, error_obj); return skip; @@ -19026,8 +21292,9 @@ bool StatelessValidation::PreCallValidateCreateRenderPass2KHR(VkDevice device, c const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_create_renderpass2)) + if (!IsExtEnabled(extensions.vk_khr_create_renderpass2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_create_renderpass2}); skip |= PreCallValidateCreateRenderPass2(device, pCreateInfo, pAllocator, pRenderPass, error_obj); return skip; @@ -19038,8 +21305,9 @@ bool StatelessValidation::PreCallValidateCmdBeginRenderPass2KHR(VkCommandBuffer const VkSubpassBeginInfo* pSubpassBeginInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_create_renderpass2)) + if (!IsExtEnabled(extensions.vk_khr_create_renderpass2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_create_renderpass2}); skip |= PreCallValidateCmdBeginRenderPass2(commandBuffer, pRenderPassBegin, pSubpassBeginInfo, error_obj); return skip; @@ -19050,8 +21318,9 @@ bool StatelessValidation::PreCallValidateCmdNextSubpass2KHR(VkCommandBuffer comm const VkSubpassEndInfo* pSubpassEndInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_create_renderpass2)) + if (!IsExtEnabled(extensions.vk_khr_create_renderpass2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_create_renderpass2}); skip |= PreCallValidateCmdNextSubpass2(commandBuffer, pSubpassBeginInfo, pSubpassEndInfo, error_obj); return skip; @@ -19061,8 +21330,9 @@ bool StatelessValidation::PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer co const VkSubpassEndInfo* pSubpassEndInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_create_renderpass2)) + if (!IsExtEnabled(extensions.vk_khr_create_renderpass2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_create_renderpass2}); skip |= PreCallValidateCmdEndRenderPass2(commandBuffer, pSubpassEndInfo, error_obj); return skip; @@ -19071,10 +21341,11 @@ bool StatelessValidation::PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer co bool StatelessValidation::PreCallValidateGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_shared_presentable_image)) + if (!IsExtEnabled(extensions.vk_khr_shared_presentable_image)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_shared_presentable_image}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); return skip; } @@ -19082,8 +21353,11 @@ 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); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_khr_external_fence_capabilities)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_fence_capabilities}); skip |= PreCallValidateGetPhysicalDeviceExternalFenceProperties(physicalDevice, pExternalFenceInfo, pExternalFenceProperties, error_obj); @@ -19094,26 +21368,28 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceExternalFencePropertie bool StatelessValidation::PreCallValidateImportFenceWin32HandleKHR( VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_fence_win32)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pImportFenceWin32HandleInfo_loc, pImportFenceWin32HandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImportFenceWin32HandleInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportFenceWin32HandleInfo_loc.dot(Field::fence), pImportFenceWin32HandleInfo->fence); + skip |= + context.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 |= context.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, context); return skip; } @@ -19121,26 +21397,28 @@ bool StatelessValidation::PreCallValidateGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_fence_win32)) + if (!IsExtEnabled(extensions.vk_khr_external_fence_win32)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_external_fence_win32}); - skip |= ValidateStructType( + skip |= context.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 |= context.ValidateStructPnext(pGetWin32HandleInfo_loc, pGetWin32HandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkFenceGetWin32HandleInfoKHR-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetWin32HandleInfo_loc.dot(Field::fence), pGetWin32HandleInfo->fence); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetFenceWin32HandleKHR-pHandle-parameter"); + if (!skip) skip |= manual_PreCallValidateGetFenceWin32HandleKHR(device, pGetWin32HandleInfo, pHandle, context); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -19148,53 +21426,57 @@ bool StatelessValidation::PreCallValidateGetFenceWin32HandleKHR(VkDevice device, bool StatelessValidation::PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_fence_fd)) + if (!IsExtEnabled(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 |= context.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 |= + context.ValidateStructPnext(pImportFenceFdInfo_loc, pImportFenceFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImportFenceFdInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportFenceFdInfo_loc.dot(Field::fence), pImportFenceFdInfo->fence); + skip |= context.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 |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_external_fence_fd)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pGetFdInfo_loc, pGetFdInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkFenceGetFdInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetFdInfo_loc.dot(Field::fence), pGetFdInfo->fence); + skip |= context.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 |= + context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pFd), pFd, "VUID-vkGetFenceFdKHR-pFd-parameter"); + if (!skip) skip |= manual_PreCallValidateGetFenceFdKHR(device, pGetFdInfo, pFd, context); return skip; } @@ -19202,29 +21484,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); + stateless::Context context(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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 |= + context.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 |= context.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 |= context.ValidateStructPnext(pCounterDescriptions_loc, pCounterDescriptions[pIndexerIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPerformanceCounterDescriptionKHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19234,47 +21520,54 @@ 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); + stateless::Context context(*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 |= context.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 |= context.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 |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_performance_query)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_performance_query)) + if (!IsExtEnabled(extensions.vk_khr_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_performance_query}); // No xml-driven validation return skip; @@ -19284,27 +21577,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); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= + context.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 |= context.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 |= context.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 = { @@ -19317,14 +21614,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KH VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT, VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR}; - skip |= ValidateStructPnext( + skip |= context.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); + context); return skip; } @@ -19334,41 +21631,44 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(VkP VkSurfaceFormat2KHR* pSurfaceFormats, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -19377,19 +21677,22 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDisplayProperties2KHR( VkDisplayProperties2KHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkDisplayProperties2KHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19400,19 +21703,22 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceDisplayPlaneProperties VkDisplayPlaneProperties2KHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkDisplayPlaneProperties2KHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19423,25 +21729,27 @@ bool StatelessValidation::PreCallValidateGetDisplayModeProperties2KHR(VkPhysical VkDisplayModeProperties2KHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= context.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 |= context.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; @@ -19452,26 +21760,30 @@ bool StatelessValidation::PreCallValidateGetDisplayPlaneCapabilities2KHR(VkPhysi VkDisplayPlaneCapabilities2KHR* pCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.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 |= + context.ValidateStructPnext(pDisplayPlaneInfo_loc, pDisplayPlaneInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDisplayPlaneInfo2KHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pDisplayPlaneInfo_loc.dot(Field::mode), pDisplayPlaneInfo->mode); + skip |= context.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 |= context.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 |= context.ValidateStructPnext(pCapabilities_loc, pCapabilities->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDisplayPlaneCapabilities2KHR-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -19481,8 +21793,9 @@ bool StatelessValidation::PreCallValidateGetImageMemoryRequirements2KHR(VkDevice VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_get_memory_requirements2)) + if (!IsExtEnabled(extensions.vk_khr_get_memory_requirements2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_memory_requirements2}); skip |= PreCallValidateGetImageMemoryRequirements2(device, pInfo, pMemoryRequirements, error_obj); return skip; @@ -19493,8 +21806,9 @@ bool StatelessValidation::PreCallValidateGetBufferMemoryRequirements2KHR(VkDevic VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_get_memory_requirements2)) + if (!IsExtEnabled(extensions.vk_khr_get_memory_requirements2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_memory_requirements2}); skip |= PreCallValidateGetBufferMemoryRequirements2(device, pInfo, pMemoryRequirements, error_obj); return skip; @@ -19504,8 +21818,9 @@ bool StatelessValidation::PreCallValidateGetImageSparseMemoryRequirements2KHR( VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_get_memory_requirements2)) + if (!IsExtEnabled(extensions.vk_khr_get_memory_requirements2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_get_memory_requirements2}); skip |= PreCallValidateGetImageSparseMemoryRequirements2(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements, error_obj); @@ -19518,8 +21833,9 @@ bool StatelessValidation::PreCallValidateCreateSamplerYcbcrConversionKHR(VkDevic VkSamplerYcbcrConversion* pYcbcrConversion, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) + if (!IsExtEnabled(extensions.vk_khr_sampler_ycbcr_conversion)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}); skip |= PreCallValidateCreateSamplerYcbcrConversion(device, pCreateInfo, pAllocator, pYcbcrConversion, error_obj); return skip; @@ -19529,8 +21845,9 @@ bool StatelessValidation::PreCallValidateDestroySamplerYcbcrConversionKHR(VkDevi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_sampler_ycbcr_conversion)) + if (!IsExtEnabled(extensions.vk_khr_sampler_ycbcr_conversion)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}); skip |= PreCallValidateDestroySamplerYcbcrConversion(device, ycbcrConversion, pAllocator, error_obj); return skip; @@ -19540,9 +21857,9 @@ bool StatelessValidation::PreCallValidateBindBufferMemory2KHR(VkDevice device, u const VkBindBufferMemoryInfo* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_khr_bind_memory2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_bind_memory2}); skip |= PreCallValidateBindBufferMemory2(device, bindInfoCount, pBindInfos, error_obj); return skip; } @@ -19551,9 +21868,9 @@ bool StatelessValidation::PreCallValidateBindImageMemory2KHR(VkDevice device, ui const VkBindImageMemoryInfo* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_khr_bind_memory2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_bind_memory2}); skip |= PreCallValidateBindImageMemory2(device, bindInfoCount, pBindInfos, error_obj); return skip; } @@ -19563,9 +21880,9 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutSupportKHR(VkDevi VkDescriptorSetLayoutSupport* pSupport, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance3)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance3}); + if (!IsExtEnabled(extensions.vk_khr_maintenance3)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance3}); skip |= PreCallValidateGetDescriptorSetLayoutSupport(device, pCreateInfo, pSupport, error_obj); return skip; } @@ -19575,8 +21892,9 @@ bool StatelessValidation::PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_draw_indirect_count)) + if (!IsExtEnabled(extensions.vk_khr_draw_indirect_count)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_draw_indirect_count}); skip |= PreCallValidateCmdDrawIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride, error_obj); @@ -19588,8 +21906,9 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirectCountKHR(VkComman VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_draw_indirect_count)) + if (!IsExtEnabled(extensions.vk_khr_draw_indirect_count)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_draw_indirect_count}); skip |= PreCallValidateCmdDrawIndexedIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride, error_obj); @@ -19599,8 +21918,9 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirectCountKHR(VkComman bool StatelessValidation::PreCallValidateGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_timeline_semaphore)) + if (!IsExtEnabled(extensions.vk_khr_timeline_semaphore)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_timeline_semaphore}); skip |= PreCallValidateGetSemaphoreCounterValue(device, semaphore, pValue, error_obj); return skip; @@ -19609,8 +21929,9 @@ bool StatelessValidation::PreCallValidateGetSemaphoreCounterValueKHR(VkDevice de bool StatelessValidation::PreCallValidateWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_timeline_semaphore)) + if (!IsExtEnabled(extensions.vk_khr_timeline_semaphore)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_timeline_semaphore}); skip |= PreCallValidateWaitSemaphores(device, pWaitInfo, timeout, error_obj); return skip; @@ -19619,8 +21940,9 @@ bool StatelessValidation::PreCallValidateWaitSemaphoresKHR(VkDevice device, cons bool StatelessValidation::PreCallValidateSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_timeline_semaphore)) + if (!IsExtEnabled(extensions.vk_khr_timeline_semaphore)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_timeline_semaphore}); skip |= PreCallValidateSignalSemaphore(device, pSignalInfo, error_obj); return skip; @@ -19630,8 +21952,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); + stateless::Context context(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -19641,10 +21966,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 |= context.ValidateStructPnext(pFragmentShadingRates_loc, pFragmentShadingRates[pFragmentShadingRateIndex].pNext, + 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPhysicalDeviceFragmentShadingRateKHR-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -19655,21 +21979,24 @@ bool StatelessValidation::PreCallValidateCmdSetFragmentShadingRateKHR(VkCommandB const VkFragmentShadingRateCombinerOpKHR combinerOps[2], const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_fragment_shading_rate)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::pFragmentSize), pFragmentSize, + "VUID-vkCmdSetFragmentShadingRateKHR-pFragmentSize-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read)) + if (!IsExtEnabled(extensions.vk_khr_dynamic_rendering_local_read)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_dynamic_rendering_local_read}); skip |= PreCallValidateCmdSetRenderingAttachmentLocations(commandBuffer, pLocationInfo, error_obj); return skip; @@ -19679,8 +22006,9 @@ bool StatelessValidation::PreCallValidateCmdSetRenderingInputAttachmentIndicesKH VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_dynamic_rendering_local_read)) + if (!IsExtEnabled(extensions.vk_khr_dynamic_rendering_local_read)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_dynamic_rendering_local_read}); skip |= PreCallValidateCmdSetRenderingInputAttachmentIndices(commandBuffer, pInputAttachmentIndexInfo, error_obj); return skip; @@ -19689,18 +22017,19 @@ bool StatelessValidation::PreCallValidateCmdSetRenderingInputAttachmentIndicesKH bool StatelessValidation::PreCallValidateWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, uint64_t timeout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_khr_present_wait)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_present_wait}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); return skip; } bool StatelessValidation::PreCallValidateGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) + if (!IsExtEnabled(extensions.vk_khr_buffer_device_address)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_buffer_device_address}); skip |= PreCallValidateGetBufferDeviceAddress(device, pInfo, error_obj); return skip; @@ -19709,8 +22038,9 @@ bool StatelessValidation::PreCallValidateGetBufferDeviceAddressKHR(VkDevice devi bool StatelessValidation::PreCallValidateGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) + if (!IsExtEnabled(extensions.vk_khr_buffer_device_address)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_buffer_device_address}); skip |= PreCallValidateGetBufferOpaqueCaptureAddress(device, pInfo, error_obj); return skip; @@ -19720,8 +22050,9 @@ bool StatelessValidation::PreCallValidateGetDeviceMemoryOpaqueCaptureAddressKHR( const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_buffer_device_address)) + if (!IsExtEnabled(extensions.vk_khr_buffer_device_address)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_buffer_device_address}); skip |= PreCallValidateGetDeviceMemoryOpaqueCaptureAddress(device, pInfo, error_obj); return skip; @@ -19731,15 +22062,16 @@ bool StatelessValidation::PreCallValidateCreateDeferredOperationKHR(VkDevice dev VkDeferredOperationKHR* pDeferredOperation, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pDeferredOperation), pDeferredOperation, - "VUID-vkCreateDeferredOperationKHR-pDeferredOperation-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pDeferredOperation), pDeferredOperation, + "VUID-vkCreateDeferredOperationKHR-pDeferredOperation-parameter"); return skip; } @@ -19747,12 +22079,13 @@ bool StatelessValidation::PreCallValidateDestroyDeferredOperationKHR(VkDevice de const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -19760,30 +22093,33 @@ bool StatelessValidation::PreCallValidateDestroyDeferredOperationKHR(VkDevice de bool StatelessValidation::PreCallValidateGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) + if (!IsExtEnabled(extensions.vk_khr_deferred_host_operations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_deferred_host_operations}); - skip |= ValidateRequiredHandle(loc.dot(Field::operation), operation); + skip |= context.ValidateRequiredHandle(loc.dot(Field::operation), operation); return skip; } bool StatelessValidation::PreCallValidateGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) + if (!IsExtEnabled(extensions.vk_khr_deferred_host_operations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_deferred_host_operations}); - skip |= ValidateRequiredHandle(loc.dot(Field::operation), operation); + skip |= context.ValidateRequiredHandle(loc.dot(Field::operation), operation); return skip; } bool StatelessValidation::PreCallValidateDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_deferred_host_operations)) + if (!IsExtEnabled(extensions.vk_khr_deferred_host_operations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_deferred_host_operations}); - skip |= ValidateRequiredHandle(loc.dot(Field::operation), operation); + skip |= context.ValidateRequiredHandle(loc.dot(Field::operation), operation); return skip; } @@ -19792,29 +22128,30 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutablePropertiesKHR(VkDe VkPipelineExecutablePropertiesKHR* pProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_executable_properties)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pPipelineInfo_loc, pPipelineInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pPipelineInfo_loc.dot(Field::pipeline), pPipelineInfo->pipeline); + skip |= context.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 |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties[pExecutableIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineExecutablePropertiesKHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19826,29 +22163,30 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutableStatisticsKHR(VkDe VkPipelineExecutableStatisticKHR* pStatistics, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_executable_properties)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pExecutableInfo_loc, pExecutableInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineExecutableInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pExecutableInfo_loc.dot(Field::pipeline), pExecutableInfo->pipeline); + skip |= context.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 |= context.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 |= context.ValidateStructPnext(pStatistics_loc, pStatistics[pStatisticIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineExecutableStatisticKHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -19858,20 +22196,22 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutableInternalRepresenta VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_executable_properties)) + if (!IsExtEnabled(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 |= + context.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 |= context.ValidateStructPnext(pExecutableInfo_loc, pExecutableInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineExecutableInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pExecutableInfo_loc.dot(Field::pipeline), pExecutableInfo->pipeline); + skip |= context.ValidateRequiredHandle(pExecutableInfo_loc.dot(Field::pipeline), pExecutableInfo->pipeline); } - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -19881,10 +22221,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 |= context.ValidateStructPnext( + pInternalRepresentations_loc, pInternalRepresentations[pInternalRepresentationIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkPipelineExecutableInternalRepresentationKHR-pNext-pNext", kVUIDUndefined, + false); } } return skip; @@ -19893,9 +22233,9 @@ bool StatelessValidation::PreCallValidateGetPipelineExecutableInternalRepresenta bool StatelessValidation::PreCallValidateMapMemory2KHR(VkDevice device, const VkMemoryMapInfo* pMemoryMapInfo, void** ppData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_khr_map_memory2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_map_memory2}); skip |= PreCallValidateMapMemory2(device, pMemoryMapInfo, ppData, error_obj); return skip; } @@ -19903,9 +22243,9 @@ bool StatelessValidation::PreCallValidateMapMemory2KHR(VkDevice device, const Vk bool StatelessValidation::PreCallValidateUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfo* pMemoryUnmapInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_khr_map_memory2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_map_memory2}); skip |= PreCallValidateUnmapMemory2(device, pMemoryUnmapInfo, error_obj); return skip; } @@ -19914,51 +22254,55 @@ 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); + stateless::Context context(*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 |= context.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 |= + context.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 |= context.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 |= context.ValidateFlags(pVideoProfile_loc.dot(Field::videoCodecOperation), + vvl::FlagBitmask::VkVideoCodecOperationFlagBitsKHR, AllVkVideoCodecOperationFlagBitsKHR, + pQualityLevelInfo->pVideoProfile->videoCodecOperation, kRequiredSingleBit, + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter", + "VUID-VkVideoProfileInfoKHR-videoCodecOperation-parameter"); + + skip |= context.ValidateFlags( + pVideoProfile_loc.dot(Field::chromaSubsampling), vvl::FlagBitmask::VkVideoChromaSubsamplingFlagBitsKHR, + AllVkVideoChromaSubsamplingFlagBitsKHR, pQualityLevelInfo->pVideoProfile->chromaSubsampling, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-parameter", + "VUID-VkVideoProfileInfoKHR-chromaSubsampling-requiredbitmask"); + + skip |= context.ValidateFlags( + pVideoProfile_loc.dot(Field::lumaBitDepth), vvl::FlagBitmask::VkVideoComponentBitDepthFlagBitsKHR, + AllVkVideoComponentBitDepthFlagBitsKHR, pQualityLevelInfo->pVideoProfile->lumaBitDepth, kRequiredFlags, + "VUID-VkVideoProfileInfoKHR-lumaBitDepth-parameter", "VUID-VkVideoProfileInfoKHR-lumaBitDepth-requiredbitmask"); + + skip |= context.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 |= + context.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 = { @@ -19966,11 +22310,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 |= context.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; } @@ -19980,58 +22324,61 @@ bool StatelessValidation::PreCallValidateGetEncodedVideoSessionParametersKHR( VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo, size_t* pDataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) + if (!IsExtEnabled(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 |= context.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 |= 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 |= + context.ValidateStructPnext(pVideoSessionParametersInfo_loc, pVideoSessionParametersInfo->pNext, + allowed_structs_VkVideoEncodeSessionParametersGetInfoKHR.size(), + allowed_structs_VkVideoEncodeSessionParametersGetInfoKHR.data(), + GeneratedVulkanHeaderVersion, "VUID-VkVideoEncodeSessionParametersGetInfoKHR-pNext-pNext", + "VUID-VkVideoEncodeSessionParametersGetInfoKHR-sType-unique", true); + + skip |= context.ValidateRequiredHandle(pVideoSessionParametersInfo_loc.dot(Field::videoSessionParameters), + pVideoSessionParametersInfo->videoSessionParameters); + } + skip |= context.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 |= context.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 |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_video_encode_queue)) + if (!IsExtEnabled(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 |= context.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 = { @@ -20039,36 +22386,36 @@ 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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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); @@ -20077,37 +22424,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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) { @@ -20118,32 +22465,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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle( + pPictureResource_loc.dot(Field::imageViewBinding), + pEncodeInfo->pReferenceSlots[referenceSlotIndex].pPictureResource->imageViewBinding); } } } @@ -20155,8 +22501,9 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2KHR(VkCommandBuffer command const VkDependencyInfo* pDependencyInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) + if (!IsExtEnabled(extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); skip |= PreCallValidateCmdSetEvent2(commandBuffer, event, pDependencyInfo, error_obj); return skip; @@ -20165,8 +22512,9 @@ bool StatelessValidation::PreCallValidateCmdSetEvent2KHR(VkCommandBuffer command bool StatelessValidation::PreCallValidateCmdResetEvent2KHR(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) + if (!IsExtEnabled(extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); skip |= PreCallValidateCmdResetEvent2(commandBuffer, event, stageMask, error_obj); return skip; @@ -20176,8 +22524,9 @@ bool StatelessValidation::PreCallValidateCmdWaitEvents2KHR(VkCommandBuffer comma const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) + if (!IsExtEnabled(extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); skip |= PreCallValidateCmdWaitEvents2(commandBuffer, eventCount, pEvents, pDependencyInfos, error_obj); return skip; @@ -20187,8 +22536,9 @@ bool StatelessValidation::PreCallValidateCmdPipelineBarrier2KHR(VkCommandBuffer const VkDependencyInfo* pDependencyInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) + if (!IsExtEnabled(extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); skip |= PreCallValidateCmdPipelineBarrier2(commandBuffer, pDependencyInfo, error_obj); return skip; @@ -20198,8 +22548,9 @@ bool StatelessValidation::PreCallValidateCmdWriteTimestamp2KHR(VkCommandBuffer c VkQueryPool queryPool, uint32_t query, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) + if (!IsExtEnabled(extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); skip |= PreCallValidateCmdWriteTimestamp2(commandBuffer, stage, queryPool, query, error_obj); return skip; @@ -20208,8 +22559,9 @@ 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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_synchronization2)) + if (!IsExtEnabled(extensions.vk_khr_synchronization2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_synchronization2}); skip |= PreCallValidateQueueSubmit2(queue, submitCount, pSubmits, fence, error_obj); return skip; @@ -20218,8 +22570,9 @@ bool StatelessValidation::PreCallValidateQueueSubmit2KHR(VkQueue queue, uint32_t bool StatelessValidation::PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) + if (!IsExtEnabled(extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); skip |= PreCallValidateCmdCopyBuffer2(commandBuffer, pCopyBufferInfo, error_obj); return skip; @@ -20228,8 +22581,9 @@ bool StatelessValidation::PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer comma bool StatelessValidation::PreCallValidateCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) + if (!IsExtEnabled(extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); skip |= PreCallValidateCmdCopyImage2(commandBuffer, pCopyImageInfo, error_obj); return skip; @@ -20239,8 +22593,9 @@ bool StatelessValidation::PreCallValidateCmdCopyBufferToImage2KHR(VkCommandBuffe const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) + if (!IsExtEnabled(extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); skip |= PreCallValidateCmdCopyBufferToImage2(commandBuffer, pCopyBufferToImageInfo, error_obj); return skip; @@ -20250,8 +22605,9 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer2KHR(VkCommandBuffe const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) + if (!IsExtEnabled(extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); skip |= PreCallValidateCmdCopyImageToBuffer2(commandBuffer, pCopyImageToBufferInfo, error_obj); return skip; @@ -20260,8 +22616,9 @@ bool StatelessValidation::PreCallValidateCmdCopyImageToBuffer2KHR(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) + if (!IsExtEnabled(extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); skip |= PreCallValidateCmdBlitImage2(commandBuffer, pBlitImageInfo, error_obj); return skip; @@ -20271,8 +22628,9 @@ bool StatelessValidation::PreCallValidateCmdResolveImage2KHR(VkCommandBuffer com const VkResolveImageInfo2* pResolveImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_copy_commands2)) + if (!IsExtEnabled(extensions.vk_khr_copy_commands2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_copy_commands2}); skip |= PreCallValidateCmdResolveImage2(commandBuffer, pResolveImageInfo, error_obj); return skip; @@ -20282,11 +22640,12 @@ bool StatelessValidation::PreCallValidateCmdTraceRaysIndirect2KHR(VkCommandBuffe VkDeviceAddress indirectDeviceAddress, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_maintenance1)) + if (!IsExtEnabled(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, context); return skip; } @@ -20295,9 +22654,9 @@ bool StatelessValidation::PreCallValidateGetDeviceBufferMemoryRequirementsKHR(Vk VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); + if (!IsExtEnabled(extensions.vk_khr_maintenance4)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); skip |= PreCallValidateGetDeviceBufferMemoryRequirements(device, pInfo, pMemoryRequirements, error_obj); return skip; } @@ -20307,9 +22666,9 @@ bool StatelessValidation::PreCallValidateGetDeviceImageMemoryRequirementsKHR(VkD VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); + if (!IsExtEnabled(extensions.vk_khr_maintenance4)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); skip |= PreCallValidateGetDeviceImageMemoryRequirements(device, pInfo, pMemoryRequirements, error_obj); return skip; } @@ -20318,9 +22677,9 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSparseMemoryRequirementsK VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance4)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); + if (!IsExtEnabled(extensions.vk_khr_maintenance4)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance4}); skip |= PreCallValidateGetDeviceImageSparseMemoryRequirements(device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements, error_obj); return skip; @@ -20330,9 +22689,9 @@ bool StatelessValidation::PreCallValidateCmdBindIndexBuffer2KHR(VkCommandBuffer VkDeviceSize size, VkIndexType indexType, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); + if (!IsExtEnabled(extensions.vk_khr_maintenance5)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); skip |= PreCallValidateCmdBindIndexBuffer2(commandBuffer, buffer, offset, size, indexType, error_obj); return skip; } @@ -20342,9 +22701,9 @@ bool StatelessValidation::PreCallValidateGetRenderingAreaGranularityKHR(VkDevice VkExtent2D* pGranularity, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); + if (!IsExtEnabled(extensions.vk_khr_maintenance5)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); skip |= PreCallValidateGetRenderingAreaGranularity(device, pRenderingAreaInfo, pGranularity, error_obj); return skip; } @@ -20354,9 +22713,9 @@ bool StatelessValidation::PreCallValidateGetDeviceImageSubresourceLayoutKHR(VkDe VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); + if (!IsExtEnabled(extensions.vk_khr_maintenance5)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); skip |= PreCallValidateGetDeviceImageSubresourceLayout(device, pInfo, pLayout, error_obj); return skip; } @@ -20366,9 +22725,9 @@ bool StatelessValidation::PreCallValidateGetImageSubresourceLayout2KHR(VkDevice VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance5)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); + if (!IsExtEnabled(extensions.vk_khr_maintenance5)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance5}); skip |= PreCallValidateGetImageSubresourceLayout2(device, image, pSubresource, pLayout, error_obj); return skip; } @@ -20379,20 +22738,21 @@ bool StatelessValidation::PreCallValidateCreatePipelineBinariesKHR(VkDevice devi VkPipelineBinaryHandlesInfoKHR* pBinaries, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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", @@ -20403,48 +22763,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateStructPnext(pBinaries_loc, pBinaries->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineBinaryHandlesInfoKHR-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -20453,12 +22812,13 @@ bool StatelessValidation::PreCallValidateDestroyPipelineBinaryKHR(VkDevice devic const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -20467,18 +22827,20 @@ bool StatelessValidation::PreCallValidateGetPipelineKeyKHR(VkDevice device, cons VkPipelineBinaryKeyKHR* pPipelineKey, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) + if (!IsExtEnabled(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 |= context.ValidateStructType( + loc.dot(Field::pPipelineCreateInfo), pPipelineCreateInfo, VK_STRUCTURE_TYPE_PIPELINE_CREATE_INFO_KHR, false, + "VUID-vkGetPipelineKeyKHR-pPipelineCreateInfo-parameter", "VUID-VkPipelineCreateInfoKHR-sType-sType"); + skip |= + context.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 |= context.ValidateStructPnext(pPipelineKey_loc, pPipelineKey->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineBinaryKeyKHR-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -20488,30 +22850,33 @@ bool StatelessValidation::PreCallValidateGetPipelineBinaryDataKHR(VkDevice devic size_t* pPipelineBinaryDataSize, void* pPipelineBinaryData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPipelineBinaryDataInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::pipelineBinary), pInfo->pipelineBinary); + skip |= context.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 |= context.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 |= + context.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 |= context.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; } @@ -20520,22 +22885,23 @@ bool StatelessValidation::PreCallValidateReleaseCapturedPipelineDataKHR(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkReleaseCapturedPipelineDataInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::pipeline), pInfo->pipeline); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -20544,18 +22910,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); + stateless::Context context(*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 |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCooperativeMatrixPropertiesKHR-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -20564,8 +22933,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCooperativeMatrixPrope bool StatelessValidation::PreCallValidateCmdSetLineStippleKHR(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_line_rasterization)) + if (!IsExtEnabled(extensions.vk_khr_line_rasterization)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_line_rasterization}); skip |= PreCallValidateCmdSetLineStipple(commandBuffer, lineStippleFactor, lineStipplePattern, error_obj); return skip; @@ -20576,11 +22946,14 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCalibrateableTimeDomai VkTimeDomainKHR* pTimeDomains, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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 |= context.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; } @@ -20589,31 +22962,32 @@ bool StatelessValidation::PreCallValidateGetCalibratedTimestampsKHR(VkDevice dev uint64_t* pTimestamps, uint64_t* pMaxDeviation, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_calibrated_timestamps) && loc.function == vvl::Func::vkGetCalibratedTimestampsKHR) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateArray(loc.dot(Field::timestampCount), loc.dot(Field::pTimestamps), timestampCount, &pTimestamps, true, + true, "VUID-vkGetCalibratedTimestampsKHR-timestampCount-arraylength", + "VUID-vkGetCalibratedTimestampsKHR-pTimestamps-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pMaxDeviation), pMaxDeviation, + "VUID-vkGetCalibratedTimestampsKHR-pMaxDeviation-parameter"); return skip; } @@ -20621,9 +22995,9 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorSets2KHR(VkCommandBuff const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); + if (!IsExtEnabled(extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); skip |= PreCallValidateCmdBindDescriptorSets2(commandBuffer, pBindDescriptorSetsInfo, error_obj); return skip; } @@ -20632,9 +23006,9 @@ bool StatelessValidation::PreCallValidateCmdPushConstants2KHR(VkCommandBuffer co const VkPushConstantsInfo* pPushConstantsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); + if (!IsExtEnabled(extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); skip |= PreCallValidateCmdPushConstants2(commandBuffer, pPushConstantsInfo, error_obj); return skip; } @@ -20643,9 +23017,9 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSet2KHR(VkCommandBuffe const VkPushDescriptorSetInfo* pPushDescriptorSetInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); + if (!IsExtEnabled(extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); skip |= PreCallValidateCmdPushDescriptorSet2(commandBuffer, pPushDescriptorSetInfo, error_obj); return skip; } @@ -20654,9 +23028,9 @@ bool StatelessValidation::PreCallValidateCmdPushDescriptorSetWithTemplate2KHR( VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_maintenance6)) - skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); + if (!IsExtEnabled(extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); skip |= PreCallValidateCmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo, error_obj); return skip; } @@ -20665,42 +23039,43 @@ bool StatelessValidation::PreCallValidateCmdSetDescriptorBufferOffsets2EXT( VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); + skip |= context.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 |= context.ValidateStructPnext(pSetDescriptorBufferOffsetsInfo_loc, pSetDescriptorBufferOffsetsInfo->pNext, + allowed_structs_VkSetDescriptorBufferOffsetsInfoEXT.size(), + allowed_structs_VkSetDescriptorBufferOffsetsInfoEXT.data(), + GeneratedVulkanHeaderVersion, "VUID-VkSetDescriptorBufferOffsetsInfoEXT-pNext-pNext", + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-sType-unique", true); + + skip |= context.ValidateFlags(pSetDescriptorBufferOffsetsInfo_loc.dot(Field::stageFlags), + vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, + pSetDescriptorBufferOffsetsInfo->stageFlags, kRequiredFlags, + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-stageFlags-parameter", + "VUID-VkSetDescriptorBufferOffsetsInfoEXT-stageFlags-requiredbitmask"); + + skip |= context.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 |= context.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, context); return skip; } @@ -20708,35 +23083,36 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_khr_maintenance6)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_maintenance6}); + skip |= context.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 |= context.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 |= context.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); + commandBuffer, pBindDescriptorBufferEmbeddedSamplersInfo, context); return skip; } @@ -20746,28 +23122,28 @@ bool StatelessValidation::PreCallValidateCreateDebugReportCallbackEXT(VkInstance VkDebugReportCallbackEXT* pCallback, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_report)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_report}); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pCallback), pCallback, "VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pCallback), pCallback, + "VUID-vkCreateDebugReportCallbackEXT-pCallback-parameter"); return skip; } @@ -20775,12 +23151,12 @@ bool StatelessValidation::PreCallValidateDestroyDebugReportCallbackEXT(VkInstanc const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -20790,40 +23166,40 @@ 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; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_report)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_report}); + skip |= context.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkDebugReportFlagBitsEXT, AllVkDebugReportFlagBitsEXT, + flags, kRequiredFlags, "VUID-vkDebugReportMessageEXT-flags-parameter", + "VUID-vkDebugReportMessageEXT-flags-requiredbitmask"); + skip |= context.ValidateRangedEnum(loc.dot(Field::objectType), vvl::Enum::VkDebugReportObjectTypeEXT, objectType, + "VUID-vkDebugReportMessageEXT-objectType-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pLayerPrefix), pLayerPrefix, + "VUID-vkDebugReportMessageEXT-pLayerPrefix-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); + skip |= context.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 |= context.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 |= context.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 |= context.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; } @@ -20832,23 +23208,22 @@ bool StatelessValidation::PreCallValidateDebugMarkerSetObjectNameEXT(VkDevice de const VkDebugMarkerObjectNameInfoEXT* pNameInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(pNameInfo_loc.dot(Field::pObjectName), pNameInfo->pObjectName, + "VUID-VkDebugMarkerObjectNameInfoEXT-pObjectName-parameter"); } return skip; } @@ -20857,28 +23232,28 @@ bool StatelessValidation::PreCallValidateCmdDebugMarkerBeginEXT(VkCommandBuffer const VkDebugMarkerMarkerInfoEXT* pMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); + skip |= context.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 |= context.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 |= context.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; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); // No xml-driven validation return skip; } @@ -20887,19 +23262,19 @@ bool StatelessValidation::PreCallValidateCmdDebugMarkerInsertEXT(VkCommandBuffer const VkDebugMarkerMarkerInfoEXT* pMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_marker}); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(pMarkerInfo_loc.dot(Field::pMarkerName), pMarkerInfo->pMarkerName, + "VUID-VkDebugMarkerMarkerInfoEXT-pMarkerName-parameter"); } return skip; } @@ -20910,19 +23285,20 @@ bool StatelessValidation::PreCallValidateCmdBindTransformFeedbackBuffersEXT(VkCo const VkDeviceSize* pSizes, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) + if (!IsExtEnabled(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 |= context.ValidateHandleArray(loc.dot(Field::bindingCount), loc.dot(Field::pBuffers), bindingCount, pBuffers, true, true, + "VUID-vkCmdBindTransformFeedbackBuffersEXT-bindingCount-arraylength"); + skip |= context.ValidateArray(loc.dot(Field::bindingCount), loc.dot(Field::pOffsets), bindingCount, &pOffsets, true, true, + "VUID-vkCmdBindTransformFeedbackBuffersEXT-bindingCount-arraylength", + "VUID-vkCmdBindTransformFeedbackBuffersEXT-pOffsets-parameter"); + skip |= context.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, context); return skip; } @@ -20931,13 +23307,14 @@ bool StatelessValidation::PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandB const VkDeviceSize* pCounterBufferOffsets, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) + if (!IsExtEnabled(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, context); return skip; } @@ -20946,13 +23323,14 @@ bool StatelessValidation::PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuf const VkDeviceSize* pCounterBufferOffsets, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) + if (!IsExtEnabled(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, context); return skip; } @@ -20960,22 +23338,24 @@ bool StatelessValidation::PreCallValidateCmdBeginQueryIndexedEXT(VkCommandBuffer uint32_t query, VkQueryControlFlags flags, uint32_t index, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) + if (!IsExtEnabled(extensions.vk_ext_transform_feedback)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_transform_feedback}); - skip |= ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); + skip |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); return skip; } @@ -20984,10 +23364,11 @@ bool StatelessValidation::PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBu VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_transform_feedback)) + if (!IsExtEnabled(extensions.vk_ext_transform_feedback)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_transform_feedback}); - skip |= ValidateRequiredHandle(loc.dot(Field::counterBuffer), counterBuffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::counterBuffer), counterBuffer); return skip; } @@ -20995,28 +23376,30 @@ bool StatelessValidation::PreCallValidateCreateCuModuleNVX(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkCuModuleNVX* pModule, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); + skip |= + context.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 |= context.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 |= + context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pModule), pModule, "VUID-vkCreateCuModuleNVX-pModule-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pModule), pModule, "VUID-vkCreateCuModuleNVX-pModule-parameter"); return skip; } @@ -21024,26 +23407,27 @@ bool StatelessValidation::PreCallValidateCreateCuFunctionNVX(VkDevice device, co const VkAllocationCallbacks* pAllocator, VkCuFunctionNVX* pFunction, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); + skip |= context.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 |= context.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCuFunctionCreateInfoNVX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::module), pCreateInfo->module); + skip |= context.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::module), pCreateInfo->module); - skip |= ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pName), pCreateInfo->pName, - "VUID-VkCuFunctionCreateInfoNVX-pName-parameter"); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFunction), pFunction, "VUID-vkCreateCuFunctionNVX-pFunction-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pFunction), pFunction, "VUID-vkCreateCuFunctionNVX-pFunction-parameter"); return skip; } @@ -21051,13 +23435,13 @@ bool StatelessValidation::PreCallValidateDestroyCuModuleNVX(VkDevice device, VkC const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -21066,13 +23450,13 @@ bool StatelessValidation::PreCallValidateDestroyCuFunctionNVX(VkDevice device, V const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -21080,23 +23464,25 @@ bool StatelessValidation::PreCallValidateDestroyCuFunctionNVX(VkDevice device, V bool StatelessValidation::PreCallValidateCmdCuLaunchKernelNVX(VkCommandBuffer commandBuffer, const VkCuLaunchInfoNVX* pLaunchInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nvx_binary_import)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NVX_binary_import}); + skip |= context.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 |= context.ValidateStructPnext(pLaunchInfo_loc, pLaunchInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCuLaunchInfoNVX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pLaunchInfo_loc.dot(Field::function), pLaunchInfo->function); + skip |= context.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 |= context.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 |= context.ValidateArray(pLaunchInfo_loc.dot(Field::extraCount), pLaunchInfo_loc.dot(Field::pExtras), + pLaunchInfo->extraCount, &pLaunchInfo->pExtras, false, true, kVUIDUndefined, + "VUID-VkCuLaunchInfoNVX-pExtras-parameter"); } return skip; } @@ -21104,20 +23490,21 @@ bool StatelessValidation::PreCallValidateCmdCuLaunchKernelNVX(VkCommandBuffer co bool StatelessValidation::PreCallValidateGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nvx_image_view_handle)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageViewHandleInfoNVX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); + skip |= context.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 |= context.ValidateRangedEnum(pInfo_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, pInfo->descriptorType, + "VUID-VkImageViewHandleInfoNVX-descriptorType-parameter"); } return skip; } @@ -21125,20 +23512,22 @@ bool StatelessValidation::PreCallValidateGetImageViewHandleNVX(VkDevice device, bool StatelessValidation::PreCallValidateGetImageViewHandle64NVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nvx_image_view_handle)) + if (!IsExtEnabled(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 |= + context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageViewHandleInfoNVX-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); + skip |= context.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 |= context.ValidateRangedEnum(pInfo_loc.dot(Field::descriptorType), vvl::Enum::VkDescriptorType, pInfo->descriptorType, + "VUID-VkImageViewHandleInfoNVX-descriptorType-parameter"); } return skip; } @@ -21147,17 +23536,18 @@ bool StatelessValidation::PreCallValidateGetImageViewAddressNVX(VkDevice device, VkImageViewAddressPropertiesNVX* pProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nvx_image_view_handle)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::imageView), imageView); + skip |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageViewAddressPropertiesNVX-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -21167,8 +23557,9 @@ bool StatelessValidation::PreCallValidateCmdDrawIndirectCountAMD(VkCommandBuffer VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amd_draw_indirect_count)) + if (!IsExtEnabled(extensions.vk_amd_draw_indirect_count)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_draw_indirect_count}); skip |= PreCallValidateCmdDrawIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride, error_obj); @@ -21180,8 +23571,9 @@ bool StatelessValidation::PreCallValidateCmdDrawIndexedIndirectCountAMD(VkComman VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amd_draw_indirect_count)) + if (!IsExtEnabled(extensions.vk_amd_draw_indirect_count)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_draw_indirect_count}); skip |= PreCallValidateCmdDrawIndexedIndirectCount(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride, error_obj); @@ -21192,18 +23584,18 @@ bool StatelessValidation::PreCallValidateGetShaderInfoAMD(VkDevice device, VkPip VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_amd_shader_info)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_shader_info}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= context.ValidateFlags(loc.dot(Field::shaderStage), vvl::FlagBitmask::VkShaderStageFlagBits, AllVkShaderStageFlagBits, + shaderStage, kRequiredSingleBit, "VUID-vkGetShaderInfoAMD-shaderStage-parameter", + "VUID-vkGetShaderInfoAMD-shaderStage-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::infoType), vvl::Enum::VkShaderInfoTypeAMD, infoType, + "VUID-vkGetShaderInfoAMD-infoType-parameter"); + skip |= context.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; } @@ -21214,27 +23606,27 @@ bool StatelessValidation::PreCallValidateCreateStreamDescriptorSurfaceGGP(VkInst VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(instance_extensions.vk_ggp_stream_descriptor_surface)) + if (!IsExtEnabled(extensions.vk_ggp_stream_descriptor_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_GGP_stream_descriptor_surface}); - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateStreamDescriptorSurfaceGGP-pSurface-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, + "VUID-vkCreateStreamDescriptorSurfaceGGP-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_GGP @@ -21244,27 +23636,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); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::format), vvl::Enum::VkFormat, format, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-format-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::type), vvl::Enum::VkImageType, type, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-type-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::tiling), vvl::Enum::VkImageTiling, tiling, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-tiling-parameter"); + skip |= context.ValidateFlags(loc.dot(Field::usage), vvl::FlagBitmask::VkImageUsageFlagBits, AllVkImageUsageFlagBits, usage, + kRequiredFlags, "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-parameter", + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-usage-requiredbitmask"); + skip |= context.ValidateFlags(loc.dot(Field::flags), vvl::FlagBitmask::VkImageCreateFlagBits, AllVkImageCreateFlagBits, flags, + kOptionalFlags, "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-flags-parameter"); + skip |= context.ValidateFlags(loc.dot(Field::externalHandleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, + AllVkExternalMemoryHandleTypeFlagBitsNV, externalHandleType, kOptionalFlags, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-externalHandleType-parameter"); + skip |= context.ValidateRequiredPointer( + loc.dot(Field::pExternalImageFormatProperties), pExternalImageFormatProperties, + "VUID-vkGetPhysicalDeviceExternalImageFormatPropertiesNV-pExternalImageFormatProperties-parameter"); return skip; } @@ -21273,15 +23667,16 @@ bool StatelessValidation::PreCallValidateGetMemoryWin32HandleNV(VkDevice device, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_external_memory_win32)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::memory), memory); + skip |= context.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBitsNV, + AllVkExternalMemoryHandleTypeFlagBitsNV, handleType, kRequiredFlags, + "VUID-vkGetMemoryWin32HandleNV-handleType-parameter", + "VUID-vkGetMemoryWin32HandleNV-handleType-requiredbitmask"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pHandle), pHandle, "VUID-vkGetMemoryWin32HandleNV-pHandle-parameter"); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -21291,23 +23686,25 @@ bool StatelessValidation::PreCallValidateCreateViSurfaceNN(VkInstance instance, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nn_vi_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NN_vi_surface}); + skip |= + context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateViSurfaceNN-pSurface-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateViSurfaceNN-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_VI_NN @@ -21316,34 +23713,38 @@ bool StatelessValidation::PreCallValidateCmdBeginConditionalRenderingEXT( VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pConditionalRenderingBegin_loc, pConditionalRenderingBegin->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkConditionalRenderingBeginInfoEXT-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pConditionalRenderingBegin_loc.dot(Field::buffer), pConditionalRenderingBegin->buffer); + skip |= + context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_conditional_rendering)) + if (!IsExtEnabled(extensions.vk_ext_conditional_rendering)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_conditional_rendering}); // No xml-driven validation return skip; @@ -21354,12 +23755,13 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffe const VkViewportWScalingNV* pViewportWScalings, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_clip_space_w_scaling)) + if (!IsExtEnabled(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 |= context.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); @@ -21368,17 +23770,20 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffe } if (!skip) skip |= manual_PreCallValidateCmdSetViewportWScalingNV(commandBuffer, firstViewport, viewportCount, pViewportWScalings, - error_obj); + context); 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); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_ext_direct_mode_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_direct_mode_display}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= context.ValidateRequiredHandle(loc.dot(Field::display), display); return skip; } @@ -21386,22 +23791,29 @@ 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); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::dpy), dpy, "VUID-vkAcquireXlibDisplayEXT-dpy-parameter"); + skip |= context.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); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::dpy), dpy, "VUID-vkGetRandROutputDisplayEXT-dpy-parameter"); + skip |= + context.ValidateRequiredPointer(loc.dot(Field::pDisplay), pDisplay, "VUID-vkGetRandROutputDisplayEXT-pDisplay-parameter"); return skip; } #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT @@ -21411,18 +23823,22 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceSurfaceCapabilities2EX VkSurfaceCapabilities2EXT* pSurfaceCapabilities, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::surface), surface); + skip |= context.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 |= context.ValidateStructPnext(pSurfaceCapabilities_loc, pSurfaceCapabilities->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSurfaceCapabilities2EXT-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -21431,21 +23847,22 @@ bool StatelessValidation::PreCallValidateDisplayPowerControlEXT(VkDevice device, const VkDisplayPowerInfoEXT* pDisplayPowerInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_display_control)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= context.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 |= - ValidateRangedEnum(pDisplayPowerInfo_loc.dot(Field::powerState), vvl::Enum::VkDisplayPowerStateEXT, - pDisplayPowerInfo->powerState, "VUID-VkDisplayPowerInfoEXT-powerState-parameter", VK_NULL_HANDLE); + context.ValidateStructPnext(pDisplayPowerInfo_loc, pDisplayPowerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDisplayPowerInfoEXT-pNext-pNext", kVUIDUndefined, true); + + skip |= context.ValidateRangedEnum(pDisplayPowerInfo_loc.dot(Field::powerState), vvl::Enum::VkDisplayPowerStateEXT, + pDisplayPowerInfo->powerState, "VUID-VkDisplayPowerInfoEXT-powerState-parameter"); } return skip; } @@ -21454,25 +23871,26 @@ bool StatelessValidation::PreCallValidateRegisterDeviceEventEXT(VkDevice device, const VkAllocationCallbacks* pAllocator, VkFence* pFence, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_display_control)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkRegisterDeviceEventEXT-pFence-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkRegisterDeviceEventEXT-pFence-parameter"); return skip; } @@ -21481,27 +23899,28 @@ bool StatelessValidation::PreCallValidateRegisterDisplayEventEXT(VkDevice device const VkAllocationCallbacks* pAllocator, VkFence* pFence, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_display_control)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= context.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 |= + context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkRegisterDisplayEventEXT-pFence-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pFence), pFence, "VUID-vkRegisterDisplayEventEXT-pFence-parameter"); return skip; } @@ -21509,15 +23928,16 @@ bool StatelessValidation::PreCallValidateGetSwapchainCounterEXT(VkDevice device, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_display_control)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.ValidateFlags( + loc.dot(Field::counter), vvl::FlagBitmask::VkSurfaceCounterFlagBitsEXT, AllVkSurfaceCounterFlagBitsEXT, counter, + kRequiredSingleBit, "VUID-vkGetSwapchainCounterEXT-counter-parameter", "VUID-vkGetSwapchainCounterEXT-counter-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pCounterValue), pCounterValue, + "VUID-vkGetSwapchainCounterEXT-pCounterValue-parameter"); return skip; } @@ -21525,12 +23945,13 @@ bool StatelessValidation::PreCallValidateGetRefreshCycleDurationGOOGLE(VkDevice VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_google_display_timing)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pDisplayTimingProperties), pDisplayTimingProperties, + "VUID-vkGetRefreshCycleDurationGOOGLE-pDisplayTimingProperties-parameter"); return skip; } @@ -21539,14 +23960,15 @@ bool StatelessValidation::PreCallValidateGetPastPresentationTimingGOOGLE(VkDevic VkPastPresentationTimingGOOGLE* pPresentationTimings, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_google_display_timing)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.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) { @@ -21563,15 +23985,17 @@ bool StatelessValidation::PreCallValidateCmdSetDiscardRectangleEXT(VkCommandBuff const VkRect2D* pDiscardRectangles, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_discard_rectangles)) + if (!IsExtEnabled(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 |= + context.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, context); return skip; } @@ -21579,11 +24003,12 @@ bool StatelessValidation::PreCallValidateCmdSetDiscardRectangleEnableEXT(VkComma VkBool32 discardRectangleEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_discard_rectangles)) + if (!IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::discardRectangleEnable), discardRectangleEnable); + if (!skip) skip |= manual_PreCallValidateCmdSetDiscardRectangleEnableEXT(commandBuffer, discardRectangleEnable, context); return skip; } @@ -21591,12 +24016,13 @@ bool StatelessValidation::PreCallValidateCmdSetDiscardRectangleModeEXT(VkCommand VkDiscardRectangleModeEXT discardRectangleMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_discard_rectangles)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::discardRectangleMode), vvl::Enum::VkDiscardRectangleModeEXT, + discardRectangleMode, "VUID-vkCmdSetDiscardRectangleModeEXT-discardRectangleMode-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdSetDiscardRectangleModeEXT(commandBuffer, discardRectangleMode, context); return skip; } @@ -21604,24 +24030,24 @@ bool StatelessValidation::PreCallValidateSetHdrMetadataEXT(VkDevice device, uint const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_hdr_metadata)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_hdr_metadata}); + skip |= context.ValidateHandleArray(loc.dot(Field::swapchainCount), loc.dot(Field::pSwapchains), swapchainCount, pSwapchains, + true, true, "VUID-vkSetHdrMetadataEXT-swapchainCount-arraylength"); + skip |= context.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 |= + context.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; @@ -21632,24 +24058,25 @@ bool StatelessValidation::PreCallValidateCreateIOSSurfaceMVK(VkInstance instance const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_mvk_ios_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_MVK_ios_surface}); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateIOSSurfaceMVK-pSurface-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateIOSSurfaceMVK-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_IOS_MVK @@ -21659,25 +24086,25 @@ bool StatelessValidation::PreCallValidateCreateMacOSSurfaceMVK(VkInstance instan const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_mvk_macos_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_MVK_macos_surface}); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateMacOSSurfaceMVK-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_MACOS_MVK @@ -21685,70 +24112,71 @@ bool StatelessValidation::PreCallValidateCreateMacOSSurfaceMVK(VkInstance instan bool StatelessValidation::PreCallValidateSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); + skip |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); + skip |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); + skip |= context.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 |= context.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 |= context.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; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); // No xml-driven validation return skip; } @@ -21756,19 +24184,19 @@ bool StatelessValidation::PreCallValidateQueueEndDebugUtilsLabelEXT(VkQueue queu bool StatelessValidation::PreCallValidateQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } return skip; } @@ -21777,18 +24205,19 @@ bool StatelessValidation::PreCallValidateCmdBeginDebugUtilsLabelEXT(VkCommandBuf const VkDebugUtilsLabelEXT* pLabelInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } return skip; } @@ -21796,9 +24225,9 @@ bool StatelessValidation::PreCallValidateCmdBeginDebugUtilsLabelEXT(VkCommandBuf bool StatelessValidation::PreCallValidateCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); // No xml-driven validation return skip; } @@ -21807,18 +24236,19 @@ bool StatelessValidation::PreCallValidateCmdInsertDebugUtilsLabelEXT(VkCommandBu const VkDebugUtilsLabelEXT* pLabelInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(pLabelInfo_loc.dot(Field::pLabelName), pLabelInfo->pLabelName, + "VUID-VkDebugUtilsLabelEXT-pLabelName-parameter"); } return skip; } @@ -21829,37 +24259,38 @@ bool StatelessValidation::PreCallValidateCreateDebugUtilsMessengerEXT(VkInstance VkDebugUtilsMessengerEXT* pMessenger, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pMessenger), pMessenger, "VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pMessenger), pMessenger, + "VUID-vkCreateDebugUtilsMessengerEXT-pMessenger-parameter"); return skip; } @@ -21867,12 +24298,12 @@ bool StatelessValidation::PreCallValidateDestroyDebugUtilsMessengerEXT(VkInstanc const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -21883,18 +24314,18 @@ bool StatelessValidation::PreCallValidateSubmitDebugUtilsMessageEXT(VkInstance i const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, const ErrorObject& error_obj) const { bool skip = false; - [[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( + stateless::Context context(*this, error_obj, extensions); + [[maybe_unused]] const Location loc = error_obj.location; + if (!IsExtEnabled(extensions.vk_ext_debug_utils)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_debug_utils}); + skip |= context.ValidateFlags(loc.dot(Field::messageSeverity), vvl::FlagBitmask::VkDebugUtilsMessageSeverityFlagBitsEXT, + AllVkDebugUtilsMessageSeverityFlagBitsEXT, messageSeverity, kRequiredSingleBit, + "VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter", + "VUID-vkSubmitDebugUtilsMessageEXT-messageSeverity-parameter"); + skip |= context.ValidateFlags(loc.dot(Field::messageTypes), vvl::FlagBitmask::VkDebugUtilsMessageTypeFlagBitsEXT, + AllVkDebugUtilsMessageTypeFlagBitsEXT, messageTypes, kRequiredFlags, + "VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-parameter", + "VUID-vkSubmitDebugUtilsMessageEXT-messageTypes-requiredbitmask"); + skip |= context.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) { @@ -21902,65 +24333,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pObjects_loc.dot(Field::objectType), vvl::Enum::VkObjectType, + pCallbackData->pObjects[objectIndex].objectType, + "VUID-VkDebugUtilsObjectNameInfoEXT-objectType-parameter"); } } } @@ -21972,15 +24403,16 @@ bool StatelessValidation::PreCallValidateGetAndroidHardwareBufferPropertiesANDRO VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::buffer), buffer, + "VUID-vkGetAndroidHardwareBufferPropertiesANDROID-buffer-parameter"); + skip |= context.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 = { @@ -21988,11 +24420,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 |= context.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; } @@ -22001,22 +24433,23 @@ bool StatelessValidation::PreCallValidateGetMemoryAndroidHardwareBufferANDROID( VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_android_external_memory_android_hardware_buffer)) + if (!IsExtEnabled(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 |= + context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMemoryGetAndroidHardwareBufferInfoANDROID-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::memory), pInfo->memory); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::memory), pInfo->memory); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pBuffer), pBuffer, "VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pBuffer), pBuffer, + "VUID-vkGetMemoryAndroidHardwareBufferANDROID-pBuffer-parameter"); return skip; } #endif // VK_USE_PLATFORM_ANDROID_KHR @@ -22027,14 +24460,15 @@ bool StatelessValidation::PreCallValidateCreateExecutionGraphPipelinesAMDX( const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) + if (!IsExtEnabled(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 |= context.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); @@ -22042,16 +24476,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 |= + context.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 |= + context.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) { @@ -22065,34 +24501,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 |= context.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 |= ValidateFlags(pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, - pCreateInfos[createInfoIndex].pStages[stageIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + skip |= context.ValidateFlags( + pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].flags, + kOptionalFlags, "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 |= context.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 |= ValidateRequiredPointer(pStages_loc.dot(Field::pName), - pCreateInfos[createInfoIndex].pStages[stageIndex].pName, - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + skip |= context.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 |= context.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; @@ -22105,38 +24541,39 @@ 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 |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateArray(loc.dot(Field::createInfoCount), loc.dot(Field::pPipelines), createInfoCount, &pPipelines, true, + true, "VUID-vkCreateExecutionGraphPipelinesAMDX-createInfoCount-arraylength", + "VUID-vkCreateExecutionGraphPipelinesAMDX-pPipelines-parameter"); return skip; } @@ -22144,13 +24581,15 @@ bool StatelessValidation::PreCallValidateGetExecutionGraphPipelineScratchSizeAMD VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); + skip |= context.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; } @@ -22158,15 +24597,17 @@ bool StatelessValidation::PreCallValidateGetExecutionGraphPipelineNodeIndexAMDX( VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); + skip |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pNodeIndex), pNodeIndex, + "VUID-vkGetExecutionGraphPipelineNodeIndexAMDX-pNodeIndex-parameter"); return skip; } @@ -22175,10 +24616,11 @@ bool StatelessValidation::PreCallValidateCmdInitializeGraphScratchMemoryAMDX(VkC VkDeviceSize scratchSize, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) + if (!IsExtEnabled(extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); - skip |= ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); + skip |= context.ValidateRequiredHandle(loc.dot(Field::executionGraph), executionGraph); return skip; } @@ -22187,10 +24629,12 @@ bool StatelessValidation::PreCallValidateCmdDispatchGraphAMDX(VkCommandBuffer co const VkDispatchGraphCountInfoAMDX* pCountInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) + if (!IsExtEnabled(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 |= + context.ValidateRequiredPointer(loc.dot(Field::pCountInfo), pCountInfo, "VUID-vkCmdDispatchGraphAMDX-pCountInfo-parameter"); return skip; } @@ -22199,11 +24643,12 @@ bool StatelessValidation::PreCallValidateCmdDispatchGraphIndirectAMDX(VkCommandB const VkDispatchGraphCountInfoAMDX* pCountInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::pCountInfo), pCountInfo, + "VUID-vkCmdDispatchGraphIndirectAMDX-pCountInfo-parameter"); return skip; } @@ -22211,8 +24656,9 @@ bool StatelessValidation::PreCallValidateCmdDispatchGraphIndirectCountAMDX(VkCom VkDeviceSize scratchSize, VkDeviceAddress countInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amdx_shader_enqueue)) + if (!IsExtEnabled(extensions.vk_amdx_shader_enqueue)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMDX_shader_enqueue}); // No xml-driven validation return skip; @@ -22223,20 +24669,21 @@ bool StatelessValidation::PreCallValidateCmdSetSampleLocationsEXT(VkCommandBuffe const VkSampleLocationsInfoEXT* pSampleLocationsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_sample_locations)) + if (!IsExtEnabled(extensions.vk_ext_sample_locations)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_sample_locations}); - skip |= ValidateStructType( + skip |= context.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 |= context.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; @@ -22254,19 +24701,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); + stateless::Context context(*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 |= context.ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, + samples, kRequiredSingleBit, "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter", + "VUID-vkGetPhysicalDeviceMultisamplePropertiesEXT-samples-parameter"); + skip |= context.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 |= context.ValidateStructPnext(pMultisampleProperties_loc, pMultisampleProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMultisamplePropertiesEXT-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -22275,18 +24725,19 @@ bool StatelessValidation::PreCallValidateGetImageDrmFormatModifierPropertiesEXT( VkImageDrmFormatModifierPropertiesEXT* pProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_image_drm_format_modifier)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::image), image); + skip |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageDrmFormatModifierPropertiesEXT-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -22297,30 +24748,31 @@ bool StatelessValidation::PreCallValidateCreateValidationCacheEXT(VkDevice devic VkValidationCacheEXT* pValidationCache, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pValidationCache), pValidationCache, - "VUID-vkCreateValidationCacheEXT-pValidationCache-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pValidationCache), pValidationCache, + "VUID-vkCreateValidationCacheEXT-pValidationCache-parameter"); return skip; } @@ -22328,12 +24780,13 @@ bool StatelessValidation::PreCallValidateDestroyValidationCacheEXT(VkDevice devi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -22342,12 +24795,13 @@ bool StatelessValidation::PreCallValidateMergeValidationCachesEXT(VkDevice devic uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::dstCache), dstCache); + skip |= context.ValidateHandleArray(loc.dot(Field::srcCacheCount), loc.dot(Field::pSrcCaches), srcCacheCount, pSrcCaches, true, + true, "VUID-vkMergeValidationCachesEXT-srcCacheCount-arraylength"); return skip; } @@ -22355,24 +24809,26 @@ bool StatelessValidation::PreCallValidateGetValidationCacheDataEXT(VkDevice devi size_t* pDataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_validation_cache)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::validationCache), validationCache); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, + "VUID-vkCmdBindShadingRateImageNV-imageLayout-parameter"); return skip; } @@ -22381,27 +24837,29 @@ bool StatelessValidation::PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCo const VkShadingRatePaletteNV* pShadingRatePalettes, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) + if (!IsExtEnabled(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 |= context.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 |= context.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, context); return skip; } @@ -22411,27 +24869,28 @@ bool StatelessValidation::PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuff const VkCoarseSampleOrderCustomNV* pCustomSampleOrders, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_shading_rate_image)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::sampleOrderType), vvl::Enum::VkCoarseSampleOrderTypeNV, sampleOrderType, + "VUID-vkCmdSetCoarseSampleOrderNV-sampleOrderType-parameter"); + skip |= context.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 |= context.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 |= context.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; @@ -22445,7 +24904,7 @@ bool StatelessValidation::PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuff } if (!skip) skip |= manual_PreCallValidateCmdSetCoarseSampleOrderNV(commandBuffer, sampleOrderType, customSampleOrderCount, - pCustomSampleOrders, error_obj); + pCustomSampleOrders, context); return skip; } @@ -22455,83 +24914,84 @@ bool StatelessValidation::PreCallValidateCreateAccelerationStructureNV(VkDevice VkAccelerationStructureNV* pAccelerationStructure, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pCreateInfo->info.pGeometries[geometryIndex].geometryType, + "VUID-VkGeometryNV-geometryType-parameter"); - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pGeometries_loc.dot(Field::indexType), vvl::Enum::VkIndexType, + pCreateInfo->info.pGeometries[geometryIndex].geometry.triangles.indexType, + "VUID-VkGeometryTrianglesNV-indexType-parameter"); - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pAccelerationStructure), pAccelerationStructure, - "VUID-vkCreateAccelerationStructureNV-pAccelerationStructure-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pAccelerationStructure), pAccelerationStructure, + "VUID-vkCreateAccelerationStructureNV-pAccelerationStructure-parameter"); if (!skip) skip |= - manual_PreCallValidateCreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure, error_obj); + manual_PreCallValidateCreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure, context); return skip; } @@ -22540,11 +25000,12 @@ bool StatelessValidation::PreCallValidateDestroyAccelerationStructureNV(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -22553,25 +25014,26 @@ bool StatelessValidation::PreCallValidateGetAccelerationStructureMemoryRequireme VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.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 |= - ValidateRangedEnum(pInfo_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureMemoryRequirementsTypeNV, pInfo->type, - "VUID-VkAccelerationStructureMemoryRequirementsInfoNV-type-parameter", VK_NULL_HANDLE); + context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureMemoryRequirementsInfoNV-pNext-pNext", kVUIDUndefined, true); + + skip |= context.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 |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::accelerationStructure), pInfo->accelerationStructure); } - skip |= ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, - "VUID-vkGetAccelerationStructureMemoryRequirementsNV-pMemoryRequirements-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pMemoryRequirements), pMemoryRequirements, + "VUID-vkGetAccelerationStructureMemoryRequirementsNV-pMemoryRequirements-parameter"); return skip; } @@ -22579,28 +25041,30 @@ bool StatelessValidation::PreCallValidateBindAccelerationStructureMemoryNV( VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.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 |= context.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 |= context.ValidateRequiredHandle(pBindInfos_loc.dot(Field::accelerationStructure), + pBindInfos[bindInfoIndex].accelerationStructure); - skip |= ValidateRequiredHandle(pBindInfos_loc.dot(Field::memory), pBindInfos[bindInfoIndex].memory); + skip |= context.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 |= context.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; @@ -22611,68 +25075,69 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructureNV( VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pGeometries_loc.dot(Field::geometryType), vvl::Enum::VkGeometryTypeKHR, + pInfo->pGeometries[geometryIndex].geometryType, + "VUID-VkGeometryNV-geometryType-parameter"); - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateBool32(loc.dot(Field::update), update); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dst), dst); + skip |= context.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, context); return skip; } @@ -22682,12 +25147,13 @@ bool StatelessValidation::PreCallValidateCmdCopyAccelerationStructureNV(VkComman VkCopyAccelerationStructureModeKHR mode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dst), dst); + skip |= context.ValidateRequiredHandle(loc.dot(Field::src), src); + skip |= context.ValidateRangedEnum(loc.dot(Field::mode), vvl::Enum::VkCopyAccelerationStructureModeKHR, mode, + "VUID-vkCmdCopyAccelerationStructureNV-mode-parameter"); return skip; } @@ -22698,9 +25164,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; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::raygenShaderBindingTableBuffer), raygenShaderBindingTableBuffer); return skip; } @@ -22710,31 +25177,31 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesNV(VkDevice de const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.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 |= context.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 |= context.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) { @@ -22748,34 +25215,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 |= context.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 |= ValidateFlags(pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, - pCreateInfos[createInfoIndex].pStages[stageIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + skip |= context.ValidateFlags( + pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].flags, + kOptionalFlags, "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 |= context.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 |= ValidateRequiredPointer(pStages_loc.dot(Field::pName), - pCreateInfos[createInfoIndex].pStages[stageIndex].pName, - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + skip |= context.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 |= context.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; @@ -22788,49 +25255,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -22839,14 +25305,14 @@ bool StatelessValidation::PreCallValidateGetRayTracingShaderGroupHandlesKHR(VkDe size_t dataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline) && - loc.function == vvl::Func::vkGetRayTracingShaderGroupHandlesKHR) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= context.ValidateArray(loc.dot(Field::dataSize), loc.dot(Field::pData), dataSize, &pData, true, true, + "VUID-vkGetRayTracingShaderGroupHandlesKHR-dataSize-arraylength", + "VUID-vkGetRayTracingShaderGroupHandlesKHR-pData-parameter"); return skip; } @@ -22855,8 +25321,9 @@ bool StatelessValidation::PreCallValidateGetRayTracingShaderGroupHandlesNV(VkDev size_t dataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); skip |= PreCallValidateGetRayTracingShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount, dataSize, pData, error_obj); return skip; } @@ -22866,14 +25333,15 @@ bool StatelessValidation::PreCallValidateGetAccelerationStructureHandleNV(VkDevi size_t dataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::accelerationStructure), accelerationStructure); + skip |= context.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, context); return skip; } @@ -22881,26 +25349,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; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), + accelerationStructureCount, pAccelerationStructures, true, true, + "VUID-vkCmdWriteAccelerationStructuresPropertiesNV-accelerationStructureCount-arraylength"); + skip |= context.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkCmdWriteAccelerationStructuresPropertiesNV-queryType-parameter"); + skip |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nv_ray_tracing)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_ray_tracing}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); return skip; } @@ -22908,28 +25378,29 @@ bool StatelessValidation::PreCallValidateGetMemoryHostPointerPropertiesEXT( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_external_memory_host)) + if (!IsExtEnabled(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 |= context.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, + "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter", + "VUID-vkGetMemoryHostPointerPropertiesEXT-handleType-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pHostPointer), pHostPointer, + "VUID-vkGetMemoryHostPointerPropertiesEXT-pHostPointer-parameter"); + skip |= context.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 |= context.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, context); return skip; } @@ -22938,13 +25409,13 @@ bool StatelessValidation::PreCallValidateCmdWriteBufferMarkerAMD(VkCommandBuffer VkDeviceSize dstOffset, uint32_t marker, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(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); + context.ValidateFlags(loc.dot(Field::pipelineStage), vvl::FlagBitmask::VkPipelineStageFlagBits, AllVkPipelineStageFlagBits, + pipelineStage, kOptionalSingleBit, "VUID-vkCmdWriteBufferMarkerAMD-pipelineStage-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); return skip; } @@ -22952,12 +25423,12 @@ bool StatelessValidation::PreCallValidateCmdWriteBufferMarker2AMD(VkCommandBuffe VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_amd_buffer_marker)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_buffer_marker}); + skip |= context.ValidateFlags(loc.dot(Field::stage), vvl::FlagBitmask::VkPipelineStageFlagBits2, AllVkPipelineStageFlagBits2, + stage, kOptionalFlags, "VUID-vkCmdWriteBufferMarker2AMD-stage-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::dstBuffer), dstBuffer); return skip; } @@ -22966,6 +25437,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceCalibrateableTimeDomai VkTimeDomainKHR* pTimeDomains, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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; @@ -22976,8 +25450,9 @@ bool StatelessValidation::PreCallValidateGetCalibratedTimestampsEXT(VkDevice dev uint64_t* pTimestamps, uint64_t* pMaxDeviation, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_calibrated_timestamps)) + if (!IsExtEnabled(extensions.vk_ext_calibrated_timestamps)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_calibrated_timestamps}); skip |= PreCallValidateGetCalibratedTimestampsKHR(device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation, error_obj); @@ -22987,8 +25462,9 @@ bool StatelessValidation::PreCallValidateGetCalibratedTimestampsEXT(VkDevice dev bool StatelessValidation::PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_nv_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_mesh_shader}); // No xml-driven validation return skip; } @@ -22997,9 +25473,10 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuf VkDeviceSize offset, uint32_t drawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nv_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_mesh_shader}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } @@ -23008,10 +25485,11 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkComma VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nv_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_mesh_shader}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); return skip; } @@ -23021,16 +25499,17 @@ bool StatelessValidation::PreCallValidateCmdSetExclusiveScissorEnableNV(VkComman const VkBool32* pExclusiveScissorEnables, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_scissor_exclusive)) + if (!IsExtEnabled(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 |= context.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, context); return skip; } @@ -23039,23 +25518,26 @@ bool StatelessValidation::PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffe const VkRect2D* pExclusiveScissors, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_scissor_exclusive)) + if (!IsExtEnabled(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 |= + context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_diagnostic_checkpoints)) + if (!IsExtEnabled(extensions.vk_nv_device_diagnostic_checkpoints)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_diagnostic_checkpoints}); // No xml-driven validation return skip; @@ -23065,19 +25547,20 @@ bool StatelessValidation::PreCallValidateGetQueueCheckpointDataNV(VkQueue queue, VkCheckpointDataNV* pCheckpointData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_diagnostic_checkpoints)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pCheckpointData_loc, pCheckpointData[pCheckpointDataIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCheckpointDataNV-pNext-pNext", kVUIDUndefined, + false); } } return skip; @@ -23087,19 +25570,20 @@ bool StatelessValidation::PreCallValidateGetQueueCheckpointData2NV(VkQueue queue VkCheckpointData2NV* pCheckpointData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_diagnostic_checkpoints)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pCheckpointData_loc, pCheckpointData[pCheckpointDataIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCheckpointData2NV-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -23109,24 +25593,26 @@ bool StatelessValidation::PreCallValidateInitializePerformanceApiINTEL(VkDevice const VkInitializePerformanceApiInfoINTEL* pInitializeInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateStructType( + skip |= context.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 |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); // No xml-driven validation return skip; @@ -23136,16 +25622,17 @@ bool StatelessValidation::PreCallValidateCmdSetPerformanceMarkerINTEL(VkCommandB const VkPerformanceMarkerInfoINTEL* pMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPerformanceMarkerInfoINTEL-pNext-pNext", kVUIDUndefined, true); } return skip; } @@ -23154,16 +25641,17 @@ bool StatelessValidation::PreCallValidateCmdSetPerformanceStreamMarkerINTEL(VkCo const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pMarkerInfo_loc, pMarkerInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkPerformanceStreamMarkerInfoINTEL-pNext-pNext", kVUIDUndefined, true); } return skip; } @@ -23172,21 +25660,22 @@ bool StatelessValidation::PreCallValidateCmdSetPerformanceOverrideINTEL(VkComman const VkPerformanceOverrideInfoINTEL* pOverrideInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateBool32(pOverrideInfo_loc.dot(Field::enable), pOverrideInfo->enable); } return skip; } @@ -23195,25 +25684,24 @@ bool StatelessValidation::PreCallValidateAcquirePerformanceConfigurationINTEL( VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pConfiguration), pConfiguration, + "VUID-vkAcquirePerformanceConfigurationINTEL-pConfiguration-parameter"); return skip; } @@ -23221,8 +25709,9 @@ bool StatelessValidation::PreCallValidateReleasePerformanceConfigurationINTEL(Vk VkPerformanceConfigurationINTEL configuration, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); // No xml-driven validation return skip; @@ -23232,10 +25721,11 @@ bool StatelessValidation::PreCallValidateQueueSetPerformanceConfigurationINTEL(V VkPerformanceConfigurationINTEL configuration, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(extensions.vk_intel_performance_query)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_INTEL_performance_query}); - skip |= ValidateRequiredHandle(loc.dot(Field::configuration), configuration); + skip |= context.ValidateRequiredHandle(loc.dot(Field::configuration), configuration); return skip; } @@ -23243,23 +25733,25 @@ bool StatelessValidation::PreCallValidateGetPerformanceParameterINTEL(VkDevice d VkPerformanceValueINTEL* pValue, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_intel_performance_query)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::parameter), vvl::Enum::VkPerformanceParameterTypeINTEL, parameter, + "VUID-vkGetPerformanceParameterINTEL-parameter-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_amd_display_native_hdr)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::swapChain), swapChain); + skip |= context.ValidateBool32(loc.dot(Field::localDimmingEnable), localDimmingEnable); return skip; } @@ -23269,25 +25761,27 @@ bool StatelessValidation::PreCallValidateCreateImagePipeSurfaceFUCHSIA(VkInstanc const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(instance_extensions.vk_fuchsia_imagepipe_surface)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateImagePipeSurfaceFUCHSIA-pSurface-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, + "VUID-vkCreateImagePipeSurfaceFUCHSIA-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_FUCHSIA @@ -23297,25 +25791,25 @@ bool StatelessValidation::PreCallValidateCreateMetalSurfaceEXT(VkInstance instan const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_metal_surface)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_metal_surface}); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateMetalSurfaceEXT-pSurface-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateMetalSurfaceEXT-pSurface-parameter"); return skip; } #endif // VK_USE_PLATFORM_METAL_EXT @@ -23323,8 +25817,9 @@ bool StatelessValidation::PreCallValidateCreateMetalSurfaceEXT(VkInstance instan bool StatelessValidation::PreCallValidateGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_buffer_device_address)) + if (!IsExtEnabled(extensions.vk_ext_buffer_device_address)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_buffer_device_address}); skip |= PreCallValidateGetBufferDeviceAddress(device, pInfo, error_obj); return skip; @@ -23334,6 +25829,9 @@ bool StatelessValidation::PreCallValidateGetPhysicalDeviceToolPropertiesEXT(VkPh VkPhysicalDeviceToolProperties* pToolProperties, const ErrorObject& error_obj) const { bool skip = false; + + const auto& physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*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; @@ -23343,17 +25841,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); + stateless::Context context(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkCooperativeMatrixPropertiesNV-pNext-pNext", + kVUIDUndefined, false); } } return skip; @@ -23363,8 +25864,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); + stateless::Context context(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -23372,9 +25876,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 |= context.ValidateStructPnext(pCombinations_loc, pCombinations[pCombinationIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, + "VUID-VkFramebufferMixedSamplesCombinationNV-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -23385,48 +25889,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); + stateless::Context context(*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 |= + context.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 |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_full_screen_exclusive)) + if (!IsExtEnabled(extensions.vk_ext_full_screen_exclusive)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_full_screen_exclusive}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); return skip; } bool StatelessValidation::PreCallValidateReleaseFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_full_screen_exclusive)) + if (!IsExtEnabled(extensions.vk_ext_full_screen_exclusive)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_full_screen_exclusive}); - skip |= ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -23436,33 +25946,36 @@ bool StatelessValidation::PreCallValidateCreateHeadlessSurfaceEXT(VkInstance ins const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(instance_extensions.vk_ext_headless_surface)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateHeadlessSurfaceEXT-pSurface-parameter"); + skip |= + context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_line_rasterization)) + if (!IsExtEnabled(extensions.vk_ext_line_rasterization)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_line_rasterization}); skip |= PreCallValidateCmdSetLineStipple(commandBuffer, lineStippleFactor, lineStipplePattern, error_obj); return skip; @@ -23471,8 +25984,9 @@ 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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_host_query_reset)) + if (!IsExtEnabled(extensions.vk_ext_host_query_reset)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_query_reset}); skip |= PreCallValidateResetQueryPool(device, queryPool, firstQuery, queryCount, error_obj); return skip; @@ -23481,8 +25995,9 @@ bool StatelessValidation::PreCallValidateResetQueryPoolEXT(VkDevice device, VkQu bool StatelessValidation::PreCallValidateCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetCullMode(commandBuffer, cullMode, error_obj); return skip; @@ -23491,8 +26006,9 @@ bool StatelessValidation::PreCallValidateCmdSetCullModeEXT(VkCommandBuffer comma bool StatelessValidation::PreCallValidateCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetFrontFace(commandBuffer, frontFace, error_obj); return skip; @@ -23502,8 +26018,9 @@ bool StatelessValidation::PreCallValidateCmdSetPrimitiveTopologyEXT(VkCommandBuf VkPrimitiveTopology primitiveTopology, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetPrimitiveTopology(commandBuffer, primitiveTopology, error_obj); return skip; @@ -23513,8 +26030,9 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWithCountEXT(VkCommandBuf const VkViewport* pViewports, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetViewportWithCount(commandBuffer, viewportCount, pViewports, error_obj); return skip; @@ -23523,8 +26041,9 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWithCountEXT(VkCommandBuf bool StatelessValidation::PreCallValidateCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetScissorWithCount(commandBuffer, scissorCount, pScissors, error_obj); return skip; @@ -23536,8 +26055,9 @@ bool StatelessValidation::PreCallValidateCmdBindVertexBuffers2EXT(VkCommandBuffe const VkDeviceSize* pStrides, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdBindVertexBuffers2(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes, pStrides, error_obj); @@ -23547,8 +26067,9 @@ bool StatelessValidation::PreCallValidateCmdBindVertexBuffers2EXT(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetDepthTestEnable(commandBuffer, depthTestEnable, error_obj); return skip; @@ -23557,8 +26078,9 @@ bool StatelessValidation::PreCallValidateCmdSetDepthTestEnableEXT(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetDepthWriteEnable(commandBuffer, depthWriteEnable, error_obj); return skip; @@ -23567,8 +26089,9 @@ bool StatelessValidation::PreCallValidateCmdSetDepthWriteEnableEXT(VkCommandBuff bool StatelessValidation::PreCallValidateCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetDepthCompareOp(commandBuffer, depthCompareOp, error_obj); return skip; @@ -23578,8 +26101,9 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBoundsTestEnableEXT(VkComman VkBool32 depthBoundsTestEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetDepthBoundsTestEnable(commandBuffer, depthBoundsTestEnable, error_obj); return skip; @@ -23588,8 +26112,9 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBoundsTestEnableEXT(VkComman bool StatelessValidation::PreCallValidateCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetStencilTestEnable(commandBuffer, stencilTestEnable, error_obj); return skip; @@ -23599,8 +26124,9 @@ bool StatelessValidation::PreCallValidateCmdSetStencilOpEXT(VkCommandBuffer comm VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetStencilOp(commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp, error_obj); return skip; @@ -23610,8 +26136,9 @@ bool StatelessValidation::PreCallValidateCopyMemoryToImageEXT(VkDevice device, const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) + if (!IsExtEnabled(extensions.vk_ext_host_image_copy)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy}); skip |= PreCallValidateCopyMemoryToImage(device, pCopyMemoryToImageInfo, error_obj); return skip; @@ -23621,8 +26148,9 @@ bool StatelessValidation::PreCallValidateCopyImageToMemoryEXT(VkDevice device, const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) + if (!IsExtEnabled(extensions.vk_ext_host_image_copy)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy}); skip |= PreCallValidateCopyImageToMemory(device, pCopyImageToMemoryInfo, error_obj); return skip; @@ -23631,8 +26159,9 @@ bool StatelessValidation::PreCallValidateCopyImageToMemoryEXT(VkDevice device, bool StatelessValidation::PreCallValidateCopyImageToImageEXT(VkDevice device, const VkCopyImageToImageInfo* pCopyImageToImageInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) + if (!IsExtEnabled(extensions.vk_ext_host_image_copy)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy}); skip |= PreCallValidateCopyImageToImage(device, pCopyImageToImageInfo, error_obj); return skip; @@ -23642,8 +26171,9 @@ bool StatelessValidation::PreCallValidateTransitionImageLayoutEXT(VkDevice devic const VkHostImageLayoutTransitionInfo* pTransitions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_host_image_copy)) + if (!IsExtEnabled(extensions.vk_ext_host_image_copy)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy}); skip |= PreCallValidateTransitionImageLayout(device, transitionCount, pTransitions, error_obj); return skip; @@ -23654,9 +26184,9 @@ bool StatelessValidation::PreCallValidateGetImageSubresourceLayout2EXT(VkDevice VkSubresourceLayout2* pLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_host_image_copy) || IsExtEnabled(extensions.vk_ext_image_compression_control))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_host_image_copy, vvl::Extension::_VK_EXT_image_compression_control}); skip |= PreCallValidateGetImageSubresourceLayout2(device, image, pSubresource, pLayout, error_obj); @@ -23667,25 +26197,26 @@ bool StatelessValidation::PreCallValidateReleaseSwapchainImagesEXT(VkDevice devi const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_swapchain_maintenance1)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pReleaseInfo_loc, pReleaseInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkReleaseSwapchainImagesInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pReleaseInfo_loc.dot(Field::swapchain), pReleaseInfo->swapchain); + skip |= context.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 |= context.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"); } - if (!skip) skip |= manual_PreCallValidateReleaseSwapchainImagesEXT(device, pReleaseInfo, error_obj); + if (!skip) skip |= manual_PreCallValidateReleaseSwapchainImagesEXT(device, pReleaseInfo, context); return skip; } @@ -23693,35 +26224,36 @@ bool StatelessValidation::PreCallValidateGetGeneratedCommandsMemoryRequirementsN VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) + if (!IsExtEnabled(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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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; } @@ -23730,40 +26262,41 @@ bool StatelessValidation::PreCallValidateCmdPreprocessGeneratedCommandsNV(VkComm const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) + if (!IsExtEnabled(extensions.vk_nv_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_device_generated_commands}); - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pStreams_loc.dot(Field::buffer), + pGeneratedCommandsInfo->pStreams[streamIndex].buffer); } } - skip |= ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::preprocessBuffer), - pGeneratedCommandsInfo->preprocessBuffer); + skip |= context.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::preprocessBuffer), + pGeneratedCommandsInfo->preprocessBuffer); } return skip; } @@ -23772,41 +26305,42 @@ bool StatelessValidation::PreCallValidateCmdExecuteGeneratedCommandsNV(VkCommand const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) + if (!IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::isPreprocessed), isPreprocessed); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pStreams_loc.dot(Field::buffer), + pGeneratedCommandsInfo->pStreams[streamIndex].buffer); } } - skip |= ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::preprocessBuffer), - pGeneratedCommandsInfo->preprocessBuffer); + skip |= context.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::preprocessBuffer), + pGeneratedCommandsInfo->preprocessBuffer); } return skip; } @@ -23815,12 +26349,13 @@ bool StatelessValidation::PreCallValidateCmdBindPipelineShaderGroupNV(VkCommandB VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdBindPipelineShaderGroupNV-pipelineBindPoint-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); return skip; } @@ -23830,26 +26365,27 @@ bool StatelessValidation::PreCallValidateCreateIndirectCommandsLayoutNV(VkDevice VkIndirectCommandsLayoutNV* pIndirectCommandsLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pCreateInfo_loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, + pCreateInfo->pipelineBindPoint, + "VUID-VkIndirectCommandsLayoutCreateInfoNV-pipelineBindPoint-parameter"); - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -23858,50 +26394,50 @@ 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 |= context.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 |= context.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 |= context.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 |= context.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"); + context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pIndirectCommandsLayout), pIndirectCommandsLayout, - "VUID-vkCreateIndirectCommandsLayoutNV-pIndirectCommandsLayout-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pIndirectCommandsLayout), pIndirectCommandsLayout, + "VUID-vkCreateIndirectCommandsLayoutNV-pIndirectCommandsLayout-parameter"); return skip; } @@ -23910,12 +26446,13 @@ bool StatelessValidation::PreCallValidateDestroyIndirectCommandsLayoutNV(VkDevic const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -23924,19 +26461,20 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBias2EXT(VkCommandBuffer com const VkDepthBiasInfoEXT* pDepthBiasInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_depth_bias_control)) + if (!IsExtEnabled(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 |= + context.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 |= context.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; } @@ -23944,20 +26482,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); + stateless::Context context(*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)) + if (!IsExtEnabled(extensions.vk_ext_acquire_drm_display)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_acquire_drm_display}); - skip |= ValidateRequiredHandle(loc.dot(Field::display), display); + skip |= context.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); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::display), display, "VUID-vkGetDrmDisplayEXT-display-parameter"); return skip; } @@ -23966,9 +26510,9 @@ bool StatelessValidation::PreCallValidateCreatePrivateDataSlotEXT(VkDevice devic VkPrivateDataSlot* pPrivateDataSlot, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_ext_private_data)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_private_data}); skip |= PreCallValidateCreatePrivateDataSlot(device, pCreateInfo, pAllocator, pPrivateDataSlot, error_obj); return skip; } @@ -23977,9 +26521,9 @@ bool StatelessValidation::PreCallValidateDestroyPrivateDataSlotEXT(VkDevice devi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_ext_private_data)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_private_data}); skip |= PreCallValidateDestroyPrivateDataSlot(device, privateDataSlot, pAllocator, error_obj); return skip; } @@ -23988,9 +26532,9 @@ bool StatelessValidation::PreCallValidateSetPrivateDataEXT(VkDevice device, VkOb VkPrivateDataSlot privateDataSlot, uint64_t data, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_ext_private_data)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_private_data}); skip |= PreCallValidateSetPrivateData(device, objectType, objectHandle, privateDataSlot, data, error_obj); return skip; } @@ -23999,9 +26543,9 @@ bool StatelessValidation::PreCallValidateGetPrivateDataEXT(VkDevice device, VkOb VkPrivateDataSlot privateDataSlot, uint64_t* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_ext_private_data)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_private_data}); skip |= PreCallValidateGetPrivateData(device, objectType, objectHandle, privateDataSlot, pData, error_obj); return skip; } @@ -24010,38 +26554,41 @@ bool StatelessValidation::PreCallValidateCreateCudaModuleNV(VkDevice device, con const VkAllocationCallbacks* pAllocator, VkCudaModuleNV* pModule, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) + if (!IsExtEnabled(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 |= + context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pModule), pModule, "VUID-vkCreateCudaModuleNV-pModule-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::module), module); + skip |= context.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; } @@ -24049,26 +26596,29 @@ bool StatelessValidation::PreCallValidateCreateCudaFunctionNV(VkDevice device, c const VkAllocationCallbacks* pAllocator, VkCudaFunctionNV* pFunction, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pCreateInfo_loc, pCreateInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCudaFunctionCreateInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pCreateInfo_loc.dot(Field::module), pCreateInfo->module); + skip |= context.ValidateRequiredHandle(pCreateInfo_loc.dot(Field::module), pCreateInfo->module); - skip |= ValidateRequiredPointer(pCreateInfo_loc.dot(Field::pName), pCreateInfo->pName, - "VUID-VkCudaFunctionCreateInfoNV-pName-parameter"); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pFunction), pFunction, "VUID-vkCreateCudaFunctionNV-pFunction-parameter"); + skip |= + context.ValidateRequiredPointer(loc.dot(Field::pFunction), pFunction, "VUID-vkCreateCudaFunctionNV-pFunction-parameter"); return skip; } @@ -24076,13 +26626,14 @@ bool StatelessValidation::PreCallValidateDestroyCudaModuleNV(VkDevice device, Vk const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) + if (!IsExtEnabled(extensions.vk_nv_cuda_kernel_launch)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_cuda_kernel_launch}); - skip |= ValidateRequiredHandle(loc.dot(Field::module), module); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -24091,13 +26642,14 @@ bool StatelessValidation::PreCallValidateDestroyCudaFunctionNV(VkDevice device, const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) + if (!IsExtEnabled(extensions.vk_nv_cuda_kernel_launch)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_cuda_kernel_launch}); - skip |= ValidateRequiredHandle(loc.dot(Field::function), function); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -24105,17 +26657,18 @@ bool StatelessValidation::PreCallValidateDestroyCudaFunctionNV(VkDevice device, bool StatelessValidation::PreCallValidateCmdCudaLaunchKernelNV(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV* pLaunchInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_cuda_kernel_launch)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pLaunchInfo_loc, pLaunchInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCudaLaunchInfoNV-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pLaunchInfo_loc.dot(Field::function), pLaunchInfo->function); + skip |= context.ValidateRequiredHandle(pLaunchInfo_loc.dot(Field::function), pLaunchInfo->function); } return skip; } @@ -24124,10 +26677,10 @@ bool StatelessValidation::PreCallValidateCmdCudaLaunchKernelNV(VkCommandBuffer c bool StatelessValidation::PreCallValidateExportMetalObjectsEXT(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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( + if (!IsExtEnabled(extensions.vk_ext_metal_objects)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_metal_objects}); + skip |= context.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) { @@ -24137,10 +26690,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 |= context.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; } @@ -24150,12 +26703,13 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutSizeEXT(VkDevice VkDeviceSize* pLayoutSizeInBytes, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pLayoutSizeInBytes), pLayoutSizeInBytes, + "VUID-vkGetDescriptorSetLayoutSizeEXT-pLayoutSizeInBytes-parameter"); return skip; } @@ -24163,34 +26717,37 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutBindingOffsetEXT( uint32_t binding, VkDeviceSize* pOffset, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -24198,10 +26755,11 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorBuffersEXT(VkCommandBu const VkDescriptorBufferBindingInfoEXT* pBindingInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(extensions.vk_ext_descriptor_buffer)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_descriptor_buffer}); - skip |= ValidateStructTypeArray( + skip |= context.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"); @@ -24212,14 +26770,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 |= context.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, context); return skip; } @@ -24227,18 +26784,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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pipelineBindPoint-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::layout), layout); + skip |= context.ValidateArray(loc.dot(Field::setCount), loc.dot(Field::pBufferIndices), setCount, &pBufferIndices, true, true, + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-setCount-arraylength", + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pBufferIndices-parameter"); + skip |= context.ValidateArray(loc.dot(Field::setCount), loc.dot(Field::pOffsets), setCount, &pOffsets, true, true, + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-setCount-arraylength", + "VUID-vkCmdSetDescriptorBufferOffsetsEXT-pOffsets-parameter"); return skip; } @@ -24247,12 +26805,13 @@ bool StatelessValidation::PreCallValidateCmdBindDescriptorBufferEmbeddedSamplers VkPipelineLayout layout, uint32_t set, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdBindDescriptorBufferEmbeddedSamplersEXT-pipelineBindPoint-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::layout), layout); return skip; } @@ -24260,20 +26819,22 @@ bool StatelessValidation::PreCallValidateGetBufferOpaqueCaptureDescriptorDataEXT const VkBufferCaptureDescriptorDataInfoEXT* pInfo, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::buffer), pInfo->buffer); } - skip |= ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pData), pData, + "VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-pData-parameter"); return skip; } @@ -24281,63 +26842,66 @@ bool StatelessValidation::PreCallValidateGetImageOpaqueCaptureDescriptorDataEXT( const VkImageCaptureDescriptorDataInfoEXT* pInfo, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::image), pInfo->image); } - skip |= ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetImageOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImageViewCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::imageView), pInfo->imageView); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetImageViewOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkSamplerCaptureDescriptorDataInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::sampler), pInfo->sampler); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::sampler), pInfo->sampler); } - skip |= - ValidateRequiredPointer(loc.dot(Field::pData), pData, "VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-pData-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pData), pData, + "VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-pData-parameter"); return skip; } @@ -24345,21 +26909,22 @@ bool StatelessValidation::PreCallValidateGetAccelerationStructureOpaqueCaptureDe VkDevice device, const VkAccelerationStructureCaptureDescriptorDataInfoEXT* pInfo, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_descriptor_buffer)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pData), pData, + "VUID-vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT-pData-parameter"); return skip; } @@ -24368,13 +26933,15 @@ bool StatelessValidation::PreCallValidateCmdSetFragmentShadingRateEnumNV(VkComma const VkFragmentShadingRateCombinerOpKHR combinerOps[2], const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_fragment_shading_rate_enums)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::shadingRate), vvl::Enum::VkFragmentShadingRateNV, shadingRate, + "VUID-vkCmdSetFragmentShadingRateEnumNV-shadingRate-parameter"); + skip |= context.ValidateRangedEnumArray(loc, loc.dot(Field::combinerOps), vvl::Enum::VkFragmentShadingRateCombinerOpKHR, 2, + combinerOps, false, true, kVUIDUndefined, + "VUID-vkCmdSetFragmentShadingRateEnumNV-combinerOps-parameter"); return skip; } @@ -24382,22 +26949,24 @@ bool StatelessValidation::PreCallValidateGetDeviceFaultInfoEXT(VkDevice device, VkDeviceFaultInfoEXT* pFaultInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_device_fault)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_fault}); + skip |= context.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 |= context.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 |= + context.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 |= context.ValidateStructPnext(pFaultInfo_loc, pFaultInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDeviceFaultInfoEXT-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -24406,16 +26975,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); + stateless::Context context(*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 |= context.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); + stateless::Context context(*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 |= context.ValidateRequiredPointer(loc.dot(Field::pDisplay), pDisplay, "VUID-vkGetWinrtDisplayNV-pDisplay-parameter"); return skip; } #endif // VK_USE_PLATFORM_WIN32_KHR @@ -24426,25 +27001,27 @@ bool StatelessValidation::PreCallValidateCreateDirectFBSurfaceEXT(VkInstance ins const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(instance_extensions.vk_ext_directfb_surface)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateDirectFBSurfaceEXT-pSurface-parameter"); + skip |= + context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateDirectFBSurfaceEXT-pSurface-parameter"); return skip; } @@ -24452,11 +27029,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); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::dfb), dfb, + "VUID-vkGetPhysicalDeviceDirectFBPresentationSupportEXT-dfb-parameter"); return skip; } #endif // VK_USE_PLATFORM_DIRECTFB_EXT @@ -24466,45 +27046,44 @@ bool StatelessValidation::PreCallValidateCmdSetVertexInputEXT( const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions, uint32_t vertexAttributeDescriptionCount, const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_vertex_input_dynamic_state) || IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -24513,27 +27092,30 @@ bool StatelessValidation::PreCallValidateGetMemoryZirconHandleFUCHSIA( VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_external_memory)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pGetZirconHandleInfo_loc, pGetZirconHandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryGetZirconHandleInfoFUCHSIA-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetZirconHandleInfo_loc.dot(Field::memory), pGetZirconHandleInfo->memory); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pZirconHandle), pZirconHandle, + "VUID-vkGetMemoryZirconHandleFUCHSIA-pZirconHandle-parameter"); return skip; } @@ -24541,22 +27123,23 @@ bool StatelessValidation::PreCallValidateGetMemoryZirconHandlePropertiesFUCHSIA( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_external_memory)) + if (!IsExtEnabled(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 |= context.ValidateFlags(loc.dot(Field::handleType), vvl::FlagBitmask::VkExternalMemoryHandleTypeFlagBits, + AllVkExternalMemoryHandleTypeFlagBits, handleType, kRequiredSingleBit, + "VUID-vkGetMemoryZirconHandlePropertiesFUCHSIA-handleType-parameter", + "VUID-vkGetMemoryZirconHandlePropertiesFUCHSIA-handleType-parameter"); + skip |= context.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 |= context.ValidateStructPnext(pMemoryZirconHandleProperties_loc, pMemoryZirconHandleProperties->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryZirconHandlePropertiesFUCHSIA-pNext-pNext", + kVUIDUndefined, false); } return skip; } @@ -24565,31 +27148,33 @@ bool StatelessValidation::PreCallValidateImportSemaphoreZirconHandleFUCHSIA( VkDevice device, const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_external_semaphore)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pImportSemaphoreZirconHandleInfo_loc, pImportSemaphoreZirconHandleInfo->pNext, 0, + nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pImportSemaphoreZirconHandleInfo_loc.dot(Field::semaphore), - pImportSemaphoreZirconHandleInfo->semaphore); + skip |= context.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 |= context.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 |= context.ValidateFlags(pImportSemaphoreZirconHandleInfo_loc.dot(Field::handleType), + vvl::FlagBitmask::VkExternalSemaphoreHandleTypeFlagBits, + AllVkExternalSemaphoreHandleTypeFlagBits, pImportSemaphoreZirconHandleInfo->handleType, + kRequiredSingleBit, "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-handleType-parameter", + "VUID-VkImportSemaphoreZirconHandleInfoFUCHSIA-handleType-parameter"); } return skip; } @@ -24598,28 +27183,30 @@ bool StatelessValidation::PreCallValidateGetSemaphoreZirconHandleFUCHSIA( VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_external_semaphore)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pGetZirconHandleInfo_loc, pGetZirconHandleInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkSemaphoreGetZirconHandleInfoFUCHSIA-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pGetZirconHandleInfo_loc.dot(Field::semaphore), pGetZirconHandleInfo->semaphore); + skip |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pZirconHandle), pZirconHandle, + "VUID-vkGetSemaphoreZirconHandleFUCHSIA-pZirconHandle-parameter"); return skip; } @@ -24629,23 +27216,24 @@ bool StatelessValidation::PreCallValidateCreateBufferCollectionFUCHSIA(VkDevice VkBufferCollectionFUCHSIA* pCollection, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pCollection), pCollection, - "VUID-vkCreateBufferCollectionFUCHSIA-pCollection-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pCollection), pCollection, + "VUID-vkCreateBufferCollectionFUCHSIA-pCollection-parameter"); return skip; } @@ -24653,42 +27241,42 @@ bool StatelessValidation::PreCallValidateSetBufferCollectionImageConstraintsFUCH VkDevice device, VkBufferCollectionFUCHSIA collection, const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::collection), collection); + skip |= context.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 |= context.ValidateStructPnext(pImageConstraintsInfo_loc, pImageConstraintsInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkImageConstraintsInfoFUCHSIA-pNext-pNext", + kVUIDUndefined, true); + + skip |= context.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 |= context.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 |= context.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, @@ -24711,64 +27299,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum( + pFormatConstraints_loc.dot(Field::tiling), vvl::Enum::VkImageTiling, + pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].imageCreateInfo.tiling, + "VUID-VkImageCreateInfo-tiling-parameter"); - skip |= ValidateFlags( + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateReservedFlags(pFormatConstraints_loc.dot(Field::flags), + pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].flags, + "VUID-VkImageFormatConstraintsInfoFUCHSIA-flags-zerobitmask"); - skip |= ValidateStructTypeArray( + skip |= context.ValidateStructTypeArray( pFormatConstraints_loc.dot(Field::colorSpaceCount), pFormatConstraints_loc.dot(Field::pColorSpaces), pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].colorSpaceCount, pImageConstraintsInfo->pFormatConstraints[formatConstraintsIndex].pColorSpaces, @@ -24782,28 +27372,29 @@ bool StatelessValidation::PreCallValidateSetBufferCollectionImageConstraintsFUCH ++colorSpaceIndex) { [[maybe_unused]] const Location pColorSpaces_loc = pFormatConstraints_loc.dot(Field::pColorSpaces, colorSpaceIndex); - skip |= ValidateStructPnext( + skip |= context.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 |= context.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 |= context.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 |= context.ValidateFlags(pImageConstraintsInfo_loc.dot(Field::flags), + vvl::FlagBitmask::VkImageConstraintsInfoFlagBitsFUCHSIA, + AllVkImageConstraintsInfoFlagBitsFUCHSIA, pImageConstraintsInfo->flags, kOptionalFlags, + "VUID-VkImageConstraintsInfoFUCHSIA-flags-parameter"); } return skip; } @@ -24812,23 +27403,24 @@ bool StatelessValidation::PreCallValidateSetBufferCollectionBufferConstraintsFUC VkDevice device, VkBufferCollectionFUCHSIA collection, const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::collection), collection); + skip |= context.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 |= context.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 |= context.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, @@ -24839,33 +27431,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateStructPnext(pBufferConstraintsInfo_loc, pBufferConstraintsInfo->bufferCollectionConstraints.pNext, + 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferCollectionConstraintsInfoFUCHSIA-pNext-pNext", kVUIDUndefined, true); } return skip; } @@ -24874,13 +27465,14 @@ bool StatelessValidation::PreCallValidateDestroyBufferCollectionFUCHSIA(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) + if (!IsExtEnabled(extensions.vk_fuchsia_buffer_collection)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_FUCHSIA_buffer_collection}); - skip |= ValidateRequiredHandle(loc.dot(Field::collection), collection); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -24889,17 +27481,19 @@ bool StatelessValidation::PreCallValidateGetBufferCollectionPropertiesFUCHSIA(Vk VkBufferCollectionPropertiesFUCHSIA* pProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_fuchsia_buffer_collection)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::collection), collection); + skip |= + context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkBufferCollectionPropertiesFUCHSIA-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -24909,20 +27503,22 @@ bool StatelessValidation::PreCallValidateGetDeviceSubpassShadingMaxWorkgroupSize VkExtent2D* pMaxWorkgroupSize, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_huawei_subpass_shading)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::renderpass), renderpass); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_huawei_subpass_shading)) + if (!IsExtEnabled(extensions.vk_huawei_subpass_shading)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_HUAWEI_subpass_shading}); // No xml-driven validation return skip; @@ -24932,11 +27528,12 @@ bool StatelessValidation::PreCallValidateCmdBindInvocationMaskHUAWEI(VkCommandBu VkImageLayout imageLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_huawei_invocation_mask)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::imageLayout), vvl::Enum::VkImageLayout, imageLayout, + "VUID-vkCmdBindInvocationMaskHUAWEI-imageLayout-parameter"); return skip; } @@ -24944,27 +27541,30 @@ bool StatelessValidation::PreCallValidateGetMemoryRemoteAddressNV(VkDevice devic const VkMemoryGetRemoteAddressInfoNV* pMemoryGetRemoteAddressInfo, VkRemoteAddressNV* pAddress, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_external_memory_rdma)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pMemoryGetRemoteAddressInfo_loc, pMemoryGetRemoteAddressInfo->pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkMemoryGetRemoteAddressInfoNV-pNext-pNext", + kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pMemoryGetRemoteAddressInfo_loc.dot(Field::memory), pMemoryGetRemoteAddressInfo->memory); + skip |= + context.ValidateRequiredHandle(pMemoryGetRemoteAddressInfo_loc.dot(Field::memory), pMemoryGetRemoteAddressInfo->memory); - skip |= ValidateFlags( + skip |= context.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 |= + context.ValidateRequiredPointer(loc.dot(Field::pAddress), pAddress, "VUID-vkGetMemoryRemoteAddressNV-pAddress-parameter"); return skip; } @@ -24972,20 +27572,22 @@ bool StatelessValidation::PreCallValidateGetPipelinePropertiesEXT(VkDevice devic VkBaseOutStructure* pPipelineProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_pipeline_properties)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::pPipelineInfo), pPipelineInfo, + "VUID-vkGetPipelinePropertiesEXT-pPipelineInfo-parameter"); + if (!skip) skip |= manual_PreCallValidateGetPipelinePropertiesEXT(device, pPipelineInfo, pPipelineProperties, context); return skip; } bool StatelessValidation::PreCallValidateCmdSetPatchControlPointsEXT(VkCommandBuffer commandBuffer, uint32_t patchControlPoints, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); // No xml-driven validation return skip; @@ -24995,8 +27597,9 @@ bool StatelessValidation::PreCallValidateCmdSetRasterizerDiscardEnableEXT(VkComm VkBool32 rasterizerDiscardEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetRasterizerDiscardEnable(commandBuffer, rasterizerDiscardEnable, error_obj); return skip; @@ -25005,8 +27608,9 @@ bool StatelessValidation::PreCallValidateCmdSetRasterizerDiscardEnableEXT(VkComm bool StatelessValidation::PreCallValidateCmdSetDepthBiasEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetDepthBiasEnable(commandBuffer, depthBiasEnable, error_obj); return skip; @@ -25015,11 +27619,12 @@ bool StatelessValidation::PreCallValidateCmdSetDepthBiasEnableEXT(VkCommandBuffe bool StatelessValidation::PreCallValidateCmdSetLogicOpEXT(VkCommandBuffer commandBuffer, VkLogicOp logicOp, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::logicOp), vvl::Enum::VkLogicOp, logicOp, + "VUID-vkCmdSetLogicOpEXT-logicOp-parameter"); return skip; } @@ -25027,8 +27632,9 @@ bool StatelessValidation::PreCallValidateCmdSetPrimitiveRestartEnableEXT(VkComma VkBool32 primitiveRestartEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state2) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state2, vvl::Extension::_VK_EXT_shader_object}); skip |= PreCallValidateCmdSetPrimitiveRestartEnable(commandBuffer, primitiveRestartEnable, error_obj); return skip; @@ -25040,25 +27646,26 @@ bool StatelessValidation::PreCallValidateCreateScreenSurfaceQNX(VkInstance insta const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(instance_extensions.vk_qnx_screen_surface)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateScreenSurfaceQNX-pSurface-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pSurface), pSurface, "VUID-vkCreateScreenSurfaceQNX-pSurface-parameter"); return skip; } @@ -25067,11 +27674,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); + stateless::Context context(*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)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::window), window, + "VUID-vkGetPhysicalDeviceScreenPresentationSupportQNX-window-parameter"); return skip; } #endif // VK_USE_PLATFORM_SCREEN_QNX @@ -25080,12 +27690,14 @@ bool StatelessValidation::PreCallValidateCmdSetColorWriteEnableEXT(VkCommandBuff const VkBool32* pColorWriteEnables, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_color_write_enable)) + if (!IsExtEnabled(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 |= + context.ValidateBool32Array(loc.dot(Field::attachmentCount), loc.dot(Field::pColorWriteEnables), attachmentCount, + pColorWriteEnables, true, true, "VUID-vkCmdSetColorWriteEnableEXT-attachmentCount-arraylength", + "VUID-vkCmdSetColorWriteEnableEXT-pColorWriteEnables-parameter"); return skip; } @@ -25094,8 +27706,9 @@ bool StatelessValidation::PreCallValidateCmdDrawMultiEXT(VkCommandBuffer command uint32_t firstInstance, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_ext_multi_draw)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_multi_draw}); // No xml-driven validation return skip; } @@ -25105,8 +27718,9 @@ bool StatelessValidation::PreCallValidateCmdDrawMultiIndexedEXT(VkCommandBuffer uint32_t firstInstance, uint32_t stride, const int32_t* pVertexOffset, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_ext_multi_draw)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_multi_draw}); // No xml-driven validation return skip; } @@ -25115,31 +27729,33 @@ bool StatelessValidation::PreCallValidateCreateMicromapEXT(VkDevice device, cons const VkAllocationCallbacks* pAllocator, VkMicromapEXT* pMicromap, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pMicromap), pMicromap, "VUID-vkCreateMicromapEXT-pMicromap-parameter"); + if (!skip) skip |= manual_PreCallValidateCreateMicromapEXT(device, pCreateInfo, pAllocator, pMicromap, context); return skip; } @@ -25147,14 +27763,15 @@ bool StatelessValidation::PreCallValidateDestroyMicromapEXT(VkDevice device, VkM const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - if (!skip) skip |= manual_PreCallValidateDestroyMicromapEXT(device, micromap, pAllocator, error_obj); + if (!skip) skip |= manual_PreCallValidateDestroyMicromapEXT(device, micromap, pAllocator, context); return skip; } @@ -25162,25 +27779,26 @@ bool StatelessValidation::PreCallValidateCmdBuildMicromapsEXT(VkCommandBuffer co const VkMicromapBuildInfoEXT* pInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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) { @@ -25197,7 +27815,7 @@ bool StatelessValidation::PreCallValidateCmdBuildMicromapsEXT(VkCommandBuffer co } } } - if (!skip) skip |= manual_PreCallValidateCmdBuildMicromapsEXT(commandBuffer, infoCount, pInfos, error_obj); + if (!skip) skip |= manual_PreCallValidateCmdBuildMicromapsEXT(commandBuffer, infoCount, pInfos, context); return skip; } @@ -25205,25 +27823,26 @@ bool StatelessValidation::PreCallValidateBuildMicromapsEXT(VkDevice device, VkDe uint32_t infoCount, const VkMicromapBuildInfoEXT* pInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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) { @@ -25240,31 +27859,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, context); return skip; } bool StatelessValidation::PreCallValidateCopyMicromapEXT(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMicromapInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= context.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 |= context.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, context); return skip; } @@ -25272,22 +27892,24 @@ bool StatelessValidation::PreCallValidateCopyMicromapToMemoryEXT(VkDevice device const VkCopyMicromapToMemoryInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMicromapToMemoryInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= context.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 |= context.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, context); return skip; } @@ -25295,22 +27917,24 @@ bool StatelessValidation::PreCallValidateCopyMemoryToMicromapEXT(VkDevice device const VkCopyMemoryToMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMemoryToMicromapInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= context.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 |= context.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, context); return skip; } @@ -25319,43 +27943,45 @@ bool StatelessValidation::PreCallValidateWriteMicromapsPropertiesEXT(VkDevice de size_t dataSize, void* pData, size_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.ValidateHandleArray(loc.dot(Field::micromapCount), loc.dot(Field::pMicromaps), micromapCount, pMicromaps, true, + true, "VUID-vkWriteMicromapsPropertiesEXT-micromapCount-arraylength"); + skip |= context.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkWriteMicromapsPropertiesEXT-queryType-parameter"); + skip |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdCopyMicromapEXT(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMicromapInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= context.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 |= context.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, context); return skip; } @@ -25363,23 +27989,24 @@ bool StatelessValidation::PreCallValidateCmdCopyMicromapToMemoryEXT(VkCommandBuf const VkCopyMicromapToMemoryInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMicromapToMemoryInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= context.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 |= context.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, context); return skip; } @@ -25387,23 +28014,24 @@ bool StatelessValidation::PreCallValidateCmdCopyMemoryToMicromapEXT(VkCommandBuf const VkCopyMemoryToMicromapInfoEXT* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMemoryToMicromapInfoEXT-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= context.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 |= context.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, context); return skip; } @@ -25412,17 +28040,18 @@ bool StatelessValidation::PreCallValidateCmdWriteMicromapsPropertiesEXT(VkComman VkQueryPool queryPool, uint32_t firstQuery, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.ValidateHandleArray(loc.dot(Field::micromapCount), loc.dot(Field::pMicromaps), micromapCount, pMicromaps, true, + true, "VUID-vkCmdWriteMicromapsPropertiesEXT-micromapCount-arraylength"); + skip |= context.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkCmdWriteMicromapsPropertiesEXT-queryType-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::queryPool), queryPool); if (!skip) skip |= manual_PreCallValidateCmdWriteMicromapsPropertiesEXT(commandBuffer, micromapCount, pMicromaps, queryType, queryPool, - firstQuery, error_obj); + firstQuery, context); return skip; } @@ -25431,23 +28060,24 @@ bool StatelessValidation::PreCallValidateGetDeviceMicromapCompatibilityEXT(VkDev VkAccelerationStructureCompatibilityKHR* pCompatibility, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(loc.dot(Field::pCompatibility), pCompatibility, + "VUID-vkGetDeviceMicromapCompatibilityEXT-pCompatibility-parameter"); + if (!skip) skip |= manual_PreCallValidateGetDeviceMicromapCompatibilityEXT(device, pVersionInfo, pCompatibility, context); return skip; } @@ -25456,24 +28086,26 @@ bool StatelessValidation::PreCallValidateGetMicromapBuildSizesEXT(VkDevice devic VkMicromapBuildSizesInfoEXT* pSizeInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_opacity_micromap)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::buildType), vvl::Enum::VkAccelerationStructureBuildTypeKHR, buildType, + "VUID-vkGetMicromapBuildSizesEXT-buildType-parameter"); + skip |= context.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 |= context.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 |= context.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 |= context.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) { @@ -25489,17 +28121,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 |= context.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 |= context.ValidateStructPnext(pSizeInfo_loc, pSizeInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkMicromapBuildSizesInfoEXT-pNext-pNext", kVUIDUndefined, false); - skip |= ValidateBool32(pSizeInfo_loc.dot(Field::discardable), pSizeInfo->discardable); + skip |= context.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, context); return skip; } @@ -25507,8 +28139,9 @@ bool StatelessValidation::PreCallValidateCmdDrawClusterHUAWEI(VkCommandBuffer co uint32_t groupCountY, uint32_t groupCountZ, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) + if (!IsExtEnabled(extensions.vk_huawei_cluster_culling_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_HUAWEI_cluster_culling_shader}); // No xml-driven validation return skip; @@ -25517,21 +28150,23 @@ bool StatelessValidation::PreCallValidateCmdDrawClusterHUAWEI(VkCommandBuffer co bool StatelessValidation::PreCallValidateCmdDrawClusterIndirectHUAWEI(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_huawei_cluster_culling_shader)) + if (!IsExtEnabled(extensions.vk_huawei_cluster_culling_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_HUAWEI_cluster_culling_shader}); - skip |= ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_pageable_device_local_memory)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::memory), memory); + if (!skip) skip |= manual_PreCallValidateSetDeviceMemoryPriorityEXT(device, memory, priority, context); return skip; } @@ -25539,30 +28174,31 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutHostMappingInfoVA VkDevice device, const VkDescriptorSetBindingReferenceVALVE* pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE* pHostMapping, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_valve_descriptor_set_host_mapping)) + if (!IsExtEnabled(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 |= context.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 |= - ValidateRequiredHandle(pBindingReference_loc.dot(Field::descriptorSetLayout), pBindingReference->descriptorSetLayout); + context.ValidateStructPnext(pBindingReference_loc, pBindingReference->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorSetBindingReferenceVALVE-pNext-pNext", kVUIDUndefined, true); + + skip |= context.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 |= context.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 |= context.ValidateStructPnext(pHostMapping_loc, pHostMapping->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkDescriptorSetLayoutHostMappingInfoVALVE-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -25570,11 +28206,13 @@ bool StatelessValidation::PreCallValidateGetDescriptorSetLayoutHostMappingInfoVA bool StatelessValidation::PreCallValidateGetDescriptorSetHostMappingVALVE(VkDevice device, VkDescriptorSet descriptorSet, void** ppData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_valve_descriptor_set_host_mapping)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::descriptorSet), descriptorSet); + skip |= + context.ValidateRequiredPointer(loc.dot(Field::ppData), ppData, "VUID-vkGetDescriptorSetHostMappingVALVE-ppData-parameter"); return skip; } @@ -25582,8 +28220,9 @@ bool StatelessValidation::PreCallValidateCmdCopyMemoryIndirectNV(VkCommandBuffer uint32_t copyCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_copy_memory_indirect)) + if (!IsExtEnabled(extensions.vk_nv_copy_memory_indirect)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_copy_memory_indirect}); // No xml-driven validation return skip; @@ -25593,22 +28232,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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_copy_memory_indirect)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::dstImage), dstImage); + skip |= context.ValidateRangedEnum(loc.dot(Field::dstImageLayout), vvl::Enum::VkImageLayout, dstImageLayout, + "VUID-vkCmdCopyMemoryToImageIndirectNV-dstImageLayout-parameter"); + skip |= context.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 |= context.ValidateFlags(pImageSubresources_loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, + AllVkImageAspectFlagBits, pImageSubresources[copyIndex].aspectMask, kRequiredFlags, + "VUID-VkImageSubresourceLayers-aspectMask-parameter", + "VUID-VkImageSubresourceLayers-aspectMask-requiredbitmask"); } } return skip; @@ -25618,21 +28258,24 @@ bool StatelessValidation::PreCallValidateCmdDecompressMemoryNV(VkCommandBuffer c const VkDecompressMemoryRegionNV* pDecompressMemoryRegions, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_memory_decompression)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateFlags(pDecompressMemoryRegions_loc.dot(Field::decompressionMethod), + vvl::FlagBitmask::VkMemoryDecompressionMethodFlagBitsNV, + AllVkMemoryDecompressionMethodFlagBitsNV, + pDecompressMemoryRegions[decompressRegionIndex].decompressionMethod, kRequiredFlags, + "VUID-VkDecompressMemoryRegionNV-decompressionMethod-parameter", + "VUID-VkDecompressMemoryRegionNV-decompressionMethod-requiredbitmask"); } } return skip; @@ -25643,8 +28286,9 @@ bool StatelessValidation::PreCallValidateCmdDecompressMemoryIndirectCountNV(VkCo VkDeviceAddress indirectCommandsCountAddress, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_memory_decompression)) + if (!IsExtEnabled(extensions.vk_nv_memory_decompression)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_memory_decompression}); // No xml-driven validation return skip; @@ -25655,12 +28299,13 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectMemoryRequirementsNV VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute)) + if (!IsExtEnabled(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 |= context.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 = { @@ -25669,14 +28314,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 |= context.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 |= context.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, @@ -25687,27 +28332,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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"); @@ -25721,24 +28365,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 |= context.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 |= context.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 |= context.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 |= context.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; } @@ -25748,12 +28393,13 @@ bool StatelessValidation::PreCallValidateCmdUpdatePipelineIndirectBufferNV(VkCom VkPipeline pipeline, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::pipelineBindPoint), vvl::Enum::VkPipelineBindPoint, pipelineBindPoint, + "VUID-vkCmdUpdatePipelineIndirectBufferNV-pipelineBindPoint-parameter"); + skip |= context.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); return skip; } @@ -25761,22 +28407,23 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectDeviceAddressNV(VkDe const VkPipelineIndirectDeviceAddressInfoNV* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_nv_device_generated_commands_compute)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::pipeline), pInfo->pipeline); } return skip; } @@ -25784,21 +28431,23 @@ bool StatelessValidation::PreCallValidateGetPipelineIndirectDeviceAddressNV(VkDe bool StatelessValidation::PreCallValidateCmdSetDepthClampEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::depthClampEnable), depthClampEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetPolygonModeEXT(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::polygonMode), vvl::Enum::VkPolygonMode, polygonMode, + "VUID-vkCmdSetPolygonModeEXT-polygonMode-parameter"); return skip; } @@ -25806,27 +28455,29 @@ bool StatelessValidation::PreCallValidateCmdSetRasterizationSamplesEXT(VkCommand VkSampleCountFlagBits rasterizationSamples, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.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; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateFlags(loc.dot(Field::samples), vvl::FlagBitmask::VkSampleCountFlagBits, AllVkSampleCountFlagBits, + samples, kRequiredSingleBit, "VUID-vkCmdSetSampleMaskEXT-samples-parameter", + "VUID-vkCmdSetSampleMaskEXT-samples-parameter"); + skip |= context.ValidateArray(loc.dot(Field::samples), loc.dot(Field::pSampleMask), (samples + 31) / 32, &pSampleMask, true, + true, kVUIDUndefined, "VUID-vkCmdSetSampleMaskEXT-pSampleMask-parameter"); return skip; } @@ -25834,30 +28485,33 @@ bool StatelessValidation::PreCallValidateCmdSetAlphaToCoverageEnableEXT(VkComman VkBool32 alphaToCoverageEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::alphaToCoverageEnable), alphaToCoverageEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetAlphaToOneEnableEXT(VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::alphaToOneEnable), alphaToOneEnable); return skip; } bool StatelessValidation::PreCallValidateCmdSetLogicOpEnableEXT(VkCommandBuffer commandBuffer, VkBool32 logicOpEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::logicOpEnable), logicOpEnable); return skip; } @@ -25865,12 +28519,14 @@ bool StatelessValidation::PreCallValidateCmdSetColorBlendEnableEXT(VkCommandBuff uint32_t attachmentCount, const VkBool32* pColorBlendEnables, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= + context.ValidateBool32Array(loc.dot(Field::attachmentCount), loc.dot(Field::pColorBlendEnables), attachmentCount, + pColorBlendEnables, true, true, "VUID-vkCmdSetColorBlendEnableEXT-attachmentCount-arraylength", + "VUID-vkCmdSetColorBlendEnableEXT-pColorBlendEnables-parameter"); return skip; } @@ -25879,38 +28535,40 @@ bool StatelessValidation::PreCallValidateCmdSetColorBlendEquationEXT(VkCommandBu const VkColorBlendEquationEXT* pColorBlendEquations, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pColorBlendEquations_loc.dot(Field::alphaBlendOp), vvl::Enum::VkBlendOp, + pColorBlendEquations[attachmentIndex].alphaBlendOp, + "VUID-VkColorBlendEquationEXT-alphaBlendOp-parameter"); } } return skip; @@ -25921,13 +28579,14 @@ bool StatelessValidation::PreCallValidateCmdSetColorWriteMaskEXT(VkCommandBuffer const VkColorComponentFlags* pColorWriteMasks, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.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; } @@ -25935,19 +28594,21 @@ bool StatelessValidation::PreCallValidateCmdSetTessellationDomainOriginEXT(VkCom VkTessellationDomainOrigin domainOrigin, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.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; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); // No xml-driven validation return skip; @@ -25957,12 +28618,13 @@ bool StatelessValidation::PreCallValidateCmdSetConservativeRasterizationModeEXT( VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::conservativeRasterizationMode), vvl::Enum::VkConservativeRasterizationModeEXT, + conservativeRasterizationMode, + "VUID-vkCmdSetConservativeRasterizationModeEXT-conservativeRasterizationMode-parameter"); return skip; } @@ -25970,8 +28632,9 @@ bool StatelessValidation::PreCallValidateCmdSetExtraPrimitiveOverestimationSizeE float extraPrimitiveOverestimationSize, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); // No xml-driven validation return skip; @@ -25980,10 +28643,11 @@ bool StatelessValidation::PreCallValidateCmdSetExtraPrimitiveOverestimationSizeE bool StatelessValidation::PreCallValidateCmdSetDepthClipEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthClipEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::depthClipEnable), depthClipEnable); return skip; } @@ -25991,10 +28655,11 @@ bool StatelessValidation::PreCallValidateCmdSetSampleLocationsEnableEXT(VkComman VkBool32 sampleLocationsEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::sampleLocationsEnable), sampleLocationsEnable); return skip; } @@ -26003,31 +28668,33 @@ bool StatelessValidation::PreCallValidateCmdSetColorBlendAdvancedEXT(VkCommandBu const VkColorBlendAdvancedEXT* pColorBlendAdvanced, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= + context.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 |= context.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 |= context.ValidateBool32(pColorBlendAdvanced_loc.dot(Field::srcPremultiplied), + pColorBlendAdvanced[attachmentIndex].srcPremultiplied); - skip |= ValidateBool32(pColorBlendAdvanced_loc.dot(Field::dstPremultiplied), - pColorBlendAdvanced[attachmentIndex].dstPremultiplied); + skip |= context.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 |= context.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 |= context.ValidateBool32(pColorBlendAdvanced_loc.dot(Field::clampResults), + pColorBlendAdvanced[attachmentIndex].clampResults); } } return skip; @@ -26037,11 +28704,12 @@ bool StatelessValidation::PreCallValidateCmdSetProvokingVertexModeEXT(VkCommandB VkProvokingVertexModeEXT provokingVertexMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::provokingVertexMode), vvl::Enum::VkProvokingVertexModeEXT, + provokingVertexMode, "VUID-vkCmdSetProvokingVertexModeEXT-provokingVertexMode-parameter"); return skip; } @@ -26049,8 +28717,9 @@ bool StatelessValidation::PreCallValidateCmdSetLineRasterizationModeEXT(VkComman VkLineRasterizationModeEXT lineRasterizationMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); // No xml-driven validation return skip; @@ -26059,10 +28728,11 @@ bool StatelessValidation::PreCallValidateCmdSetLineRasterizationModeEXT(VkComman bool StatelessValidation::PreCallValidateCmdSetLineStippleEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::stippledLineEnable), stippledLineEnable); return skip; } @@ -26070,10 +28740,11 @@ bool StatelessValidation::PreCallValidateCmdSetDepthClipNegativeOneToOneEXT(VkCo VkBool32 negativeOneToOne, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::negativeOneToOne), negativeOneToOne); return skip; } @@ -26081,10 +28752,11 @@ bool StatelessValidation::PreCallValidateCmdSetViewportWScalingEnableNV(VkComman VkBool32 viewportWScalingEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::viewportWScalingEnable), viewportWScalingEnable); return skip; } @@ -26093,26 +28765,27 @@ bool StatelessValidation::PreCallValidateCmdSetViewportSwizzleNV(VkCommandBuffer const VkViewportSwizzleNV* pViewportSwizzles, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(pViewportSwizzles_loc.dot(Field::w), vvl::Enum::VkViewportCoordinateSwizzleNV, + pViewportSwizzles[viewportIndex].w, "VUID-VkViewportSwizzleNV-w-parameter"); } } return skip; @@ -26122,10 +28795,11 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageToColorEnableNV(VkCommand VkBool32 coverageToColorEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::coverageToColorEnable), coverageToColorEnable); return skip; } @@ -26133,8 +28807,9 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageToColorLocationNV(VkComma uint32_t coverageToColorLocation, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(extensions.vk_ext_shader_object))) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_extended_dynamic_state3, vvl::Extension::_VK_EXT_shader_object}); // No xml-driven validation return skip; @@ -26144,12 +28819,13 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageModulationModeNV(VkComman VkCoverageModulationModeNV coverageModulationMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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); + skip |= context.ValidateRangedEnum(loc.dot(Field::coverageModulationMode), vvl::Enum::VkCoverageModulationModeNV, + coverageModulationMode, + "VUID-vkCmdSetCoverageModulationModeNV-coverageModulationMode-parameter"); return skip; } @@ -26157,10 +28833,11 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageModulationTableEnableNV(V VkBool32 coverageModulationTableEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::coverageModulationTableEnable), coverageModulationTableEnable); return skip; } @@ -26169,13 +28846,14 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageModulationTableNV(VkComma const float* pCoverageModulationTable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateArray(loc.dot(Field::coverageModulationTableCount), loc.dot(Field::pCoverageModulationTable), + coverageModulationTableCount, &pCoverageModulationTable, true, true, + "VUID-vkCmdSetCoverageModulationTableNV-coverageModulationTableCount-arraylength", + "VUID-vkCmdSetCoverageModulationTableNV-pCoverageModulationTable-parameter"); return skip; } @@ -26183,10 +28861,11 @@ bool StatelessValidation::PreCallValidateCmdSetShadingRateImageEnableNV(VkComman VkBool32 shadingRateImageEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::shadingRateImageEnable), shadingRateImageEnable); return skip; } @@ -26194,10 +28873,11 @@ bool StatelessValidation::PreCallValidateCmdSetRepresentativeFragmentTestEnableN VkBool32 representativeFragmentTestEnable, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::representativeFragmentTestEnable), representativeFragmentTestEnable); return skip; } @@ -26205,11 +28885,13 @@ bool StatelessValidation::PreCallValidateCmdSetCoverageReductionModeNV(VkCommand VkCoverageReductionModeNV coverageReductionMode, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_extended_dynamic_state3) || IsExtEnabled(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 |= + context.ValidateRangedEnum(loc.dot(Field::coverageReductionMode), vvl::Enum::VkCoverageReductionModeNV, + coverageReductionMode, "VUID-vkCmdSetCoverageReductionModeNV-coverageReductionMode-parameter"); return skip; } @@ -26217,17 +28899,18 @@ bool StatelessValidation::PreCallValidateGetShaderModuleIdentifierEXT(VkDevice d VkShaderModuleIdentifierEXT* pIdentifier, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_shader_module_identifier)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::shaderModule), shaderModule); + skip |= context.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 |= context.ValidateStructPnext(pIdentifier_loc, pIdentifier->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkShaderModuleIdentifierEXT-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -26237,28 +28920,29 @@ bool StatelessValidation::PreCallValidateGetShaderModuleCreateInfoIdentifierEXT( VkShaderModuleIdentifierEXT* pIdentifier, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_shader_module_identifier)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateStructPnext(pIdentifier_loc, pIdentifier->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkShaderModuleIdentifierEXT-pNext-pNext", kVUIDUndefined, false); } return skip; } @@ -26267,28 +28951,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); + stateless::Context context(*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 |= context.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 |= context.ValidateFlags( + pOpticalFlowImageFormatInfo_loc.dot(Field::usage), vvl::FlagBitmask::VkOpticalFlowUsageFlagBitsNV, + AllVkOpticalFlowUsageFlagBitsNV, pOpticalFlowImageFormatInfo->usage, kRequiredFlags, + "VUID-VkOpticalFlowImageFormatInfoNV-usage-parameter", "VUID-VkOpticalFlowImageFormatInfoNV-usage-requiredbitmask"); + } + skip |= + context.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 |= context.ValidateStructPnext(pImageFormatProperties_loc, pImageFormatProperties[pFormatIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, + "VUID-VkOpticalFlowImageFormatPropertiesNV-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -26300,53 +28988,55 @@ bool StatelessValidation::PreCallValidateCreateOpticalFlowSessionNV(VkDevice dev VkOpticalFlowSessionNV* pSession, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_optical_flow)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_optical_flow}); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pSession), pSession, "VUID-vkCreateOpticalFlowSessionNV-pSession-parameter"); + skip |= + context.ValidateRequiredPointer(loc.dot(Field::pSession), pSession, "VUID-vkCreateOpticalFlowSessionNV-pSession-parameter"); return skip; } @@ -26354,13 +29044,13 @@ bool StatelessValidation::PreCallValidateDestroyOpticalFlowSessionNV(VkDevice de const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nv_optical_flow)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_optical_flow}); + skip |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -26370,14 +29060,14 @@ bool StatelessValidation::PreCallValidateBindOpticalFlowSessionImageNV(VkDevice VkImageView view, VkImageLayout layout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_nv_optical_flow)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_optical_flow}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::session), session); + skip |= context.ValidateRangedEnum(loc.dot(Field::bindingPoint), vvl::Enum::VkOpticalFlowSessionBindingPointNV, bindingPoint, + "VUID-vkBindOpticalFlowSessionImageNV-bindingPoint-parameter"); + skip |= context.ValidateRangedEnum(loc.dot(Field::layout), vvl::Enum::VkImageLayout, layout, + "VUID-vkBindOpticalFlowSessionImageNV-layout-parameter"); return skip; } @@ -26385,25 +29075,25 @@ bool StatelessValidation::PreCallValidateCmdOpticalFlowExecuteNV(VkCommandBuffer const VkOpticalFlowExecuteInfoNV* pExecuteInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_optical_flow)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_optical_flow}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::session), session); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateArray(pExecuteInfo_loc.dot(Field::regionCount), pExecuteInfo_loc.dot(Field::pRegions), + pExecuteInfo->regionCount, &pExecuteInfo->pRegions, false, true, kVUIDUndefined, + "VUID-VkOpticalFlowExecuteInfoNV-pRegions-parameter"); } return skip; } @@ -26411,24 +29101,25 @@ bool StatelessValidation::PreCallValidateCmdOpticalFlowExecuteNV(VkCommandBuffer bool StatelessValidation::PreCallValidateAntiLagUpdateAMD(VkDevice device, const VkAntiLagDataAMD* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_amd_anti_lag)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_AMD_anti_lag}); + skip |= context.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 |= context.ValidateRangedEnum(pData_loc.dot(Field::mode), vvl::Enum::VkAntiLagModeAMD, pData->mode, + "VUID-VkAntiLagDataAMD-mode-parameter"); - skip |= ValidateStructType( + skip |= context.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 |= + context.ValidateRangedEnum(pPresentationInfo_loc.dot(Field::stage), vvl::Enum::VkAntiLagStageAMD, + pData->pPresentationInfo->stage, "VUID-VkAntiLagPresentationInfoAMD-stage-parameter"); } } return skip; @@ -26439,13 +29130,13 @@ bool StatelessValidation::PreCallValidateCreateShadersEXT(VkDevice device, uint3 const VkAllocationCallbacks* pAllocator, VkShaderEXT* pShaders, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_shader_object)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_object}); + skip |= context.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); @@ -26453,51 +29144,53 @@ 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 |= context.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 |= context.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 |= + context.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 |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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; @@ -26508,21 +29201,22 @@ 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 |= + context.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 |= context.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 |= + context.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, context); return skip; } @@ -26530,12 +29224,12 @@ bool StatelessValidation::PreCallValidateDestroyShaderEXT(VkDevice device, VkSha const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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 (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -26543,14 +29237,14 @@ 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; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_ext_shader_object)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_object}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::shader), shader); + skip |= context.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, context); return skip; } @@ -26558,13 +29252,13 @@ bool StatelessValidation::PreCallValidateCmdBindShadersEXT(VkCommandBuffer comma const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_ext_shader_object)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_shader_object}); + skip |= context.ValidateArray(loc.dot(Field::stageCount), loc.dot(Field::pStages), stageCount, &pStages, true, true, + "VUID-vkCmdBindShadersEXT-stageCount-arraylength", "VUID-vkCmdBindShadersEXT-pStages-parameter"); + skip |= context.ValidateArray(loc.dot(Field::stageCount), loc.dot(Field::pShaders), stageCount, &pShaders, true, false, + "VUID-vkCmdBindShadersEXT-stageCount-arraylength", "VUID-vkCmdBindShadersEXT-pShaders-parameter"); return skip; } @@ -26572,12 +29266,13 @@ bool StatelessValidation::PreCallValidateCmdSetDepthClampRangeEXT(VkCommandBuffe const VkDepthClampRangeEXT* pDepthClampRange, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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))) + if (!(IsExtEnabled(extensions.vk_ext_shader_object) || IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::depthClampMode), vvl::Enum::VkDepthClampModeEXT, depthClampMode, + "VUID-vkCmdSetDepthClampRangeEXT-depthClampMode-parameter"); + if (!skip) skip |= manual_PreCallValidateCmdSetDepthClampRangeEXT(commandBuffer, depthClampMode, pDepthClampRange, context); return skip; } @@ -26586,20 +29281,21 @@ bool StatelessValidation::PreCallValidateGetFramebufferTilePropertiesQCOM(VkDevi VkTilePropertiesQCOM* pProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_qcom_tile_properties)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::framebuffer), framebuffer); + skip |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties[pPropertiesIndex].pNext, 0, nullptr, + GeneratedVulkanHeaderVersion, "VUID-VkTilePropertiesQCOM-pNext-pNext", + kVUIDUndefined, false); // No xml-driven validation @@ -26616,12 +29312,13 @@ bool StatelessValidation::PreCallValidateGetDynamicRenderingTilePropertiesQCOM(V VkTilePropertiesQCOM* pProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_qcom_tile_properties)) + if (!IsExtEnabled(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 |= context.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 = { @@ -26633,130 +29330,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateStructPnext(pProperties_loc, pProperties->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkTilePropertiesQCOM-pNext-pNext", kVUIDUndefined, false); // No xml-driven validation @@ -26771,18 +29471,18 @@ bool StatelessValidation::PreCallValidateSetLatencySleepModeNV(VkDevice device, const VkLatencySleepModeInfoNV* pSleepModeInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.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 |= context.ValidateBool32(pSleepModeInfo_loc.dot(Field::lowLatencyMode), pSleepModeInfo->lowLatencyMode); - skip |= ValidateBool32(pSleepModeInfo_loc.dot(Field::lowLatencyBoost), pSleepModeInfo->lowLatencyBoost); + skip |= context.ValidateBool32(pSleepModeInfo_loc.dot(Field::lowLatencyBoost), pSleepModeInfo->lowLatencyBoost); } return skip; } @@ -26791,15 +29491,15 @@ bool StatelessValidation::PreCallValidateLatencySleepNV(VkDevice device, VkSwapc const VkLatencySleepInfoNV* pSleepInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.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 |= context.ValidateRequiredHandle(pSleepInfo_loc.dot(Field::signalSemaphore), pSleepInfo->signalSemaphore); } return skip; } @@ -26808,17 +29508,17 @@ bool StatelessValidation::PreCallValidateSetLatencyMarkerNV(VkDevice device, VkS const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.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 |= context.ValidateRangedEnum(pLatencyMarkerInfo_loc.dot(Field::marker), vvl::Enum::VkLatencyMarkerNV, + pLatencyMarkerInfo->marker, "VUID-VkSetLatencyMarkerInfoNV-marker-parameter"); } return skip; } @@ -26827,19 +29527,19 @@ bool StatelessValidation::PreCallValidateGetLatencyTimingsNV(VkDevice device, Vk VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::swapchain), swapchain); + skip |= context.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 |= context.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) { @@ -26854,17 +29554,16 @@ bool StatelessValidation::PreCallValidateGetLatencyTimingsNV(VkDevice device, Vk bool StatelessValidation::PreCallValidateQueueNotifyOutOfBandNV(VkQueue queue, const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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"); + if (!IsExtEnabled(extensions.vk_nv_low_latency2)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_NV_low_latency2}); + skip |= context.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 |= context.ValidateRangedEnum(pQueueTypeInfo_loc.dot(Field::queueType), vvl::Enum::VkOutOfBandQueueTypeNV, + pQueueTypeInfo->queueType, "VUID-VkOutOfBandQueueTypeInfoNV-queueType-parameter"); } return skip; } @@ -26873,11 +29572,12 @@ bool StatelessValidation::PreCallValidateCmdSetAttachmentFeedbackLoopEnableEXT(V VkImageAspectFlags aspectMask, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_attachment_feedback_loop_dynamic_state)) + if (!IsExtEnabled(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 |= context.ValidateFlags(loc.dot(Field::aspectMask), vvl::FlagBitmask::VkImageAspectFlagBits, AllVkImageAspectFlagBits, + aspectMask, kOptionalFlags, "VUID-vkCmdSetAttachmentFeedbackLoopEnableEXT-aspectMask-parameter"); return skip; } @@ -26886,21 +29586,22 @@ bool StatelessValidation::PreCallValidateGetScreenBufferPropertiesQNX(VkDevice d VkScreenBufferPropertiesQNX* pProperties, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_qnx_external_memory_screen_buffer)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::buffer), buffer, "VUID-vkGetScreenBufferPropertiesQNX-buffer-parameter"); + skip |= context.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 |= context.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; } @@ -26910,35 +29611,38 @@ bool StatelessValidation::PreCallValidateGetGeneratedCommandsMemoryRequirementsE VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoEXT* pInfo, VkMemoryRequirements2* pMemoryRequirements, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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; } @@ -26948,26 +29652,27 @@ bool StatelessValidation::PreCallValidateCmdPreprocessGeneratedCommandsEXT(VkCom VkCommandBuffer stateCommandBuffer, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(extensions.vk_ext_device_generated_commands)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_device_generated_commands}); - skip |= ValidateStructType( + skip |= context.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 |= context.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 |= context.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), + pGeneratedCommandsInfo->indirectCommandsLayout); } - skip |= ValidateRequiredHandle(loc.dot(Field::stateCommandBuffer), stateCommandBuffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::stateCommandBuffer), stateCommandBuffer); if (!skip) skip |= manual_PreCallValidateCmdPreprocessGeneratedCommandsEXT(commandBuffer, pGeneratedCommandsInfo, stateCommandBuffer, - error_obj); + context); return skip; } @@ -26975,26 +29680,27 @@ bool StatelessValidation::PreCallValidateCmdExecuteGeneratedCommandsEXT(VkComman const VkGeneratedCommandsInfoEXT* pGeneratedCommandsInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(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 |= context.ValidateBool32(loc.dot(Field::isPreprocessed), isPreprocessed); + skip |= context.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 |= context.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 |= context.ValidateRequiredHandle(pGeneratedCommandsInfo_loc.dot(Field::indirectCommandsLayout), + pGeneratedCommandsInfo->indirectCommandsLayout); } if (!skip) skip |= - manual_PreCallValidateCmdExecuteGeneratedCommandsEXT(commandBuffer, isPreprocessed, pGeneratedCommandsInfo, error_obj); + manual_PreCallValidateCmdExecuteGeneratedCommandsEXT(commandBuffer, isPreprocessed, pGeneratedCommandsInfo, context); return skip; } @@ -27004,33 +29710,34 @@ bool StatelessValidation::PreCallValidateCreateIndirectCommandsLayoutEXT(VkDevic VkIndirectCommandsLayoutEXT* pIndirectCommandsLayout, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.ValidateFlags(pCreateInfo_loc.dot(Field::shaderStages), vvl::FlagBitmask::VkShaderStageFlagBits, + AllVkShaderStageFlagBits, pCreateInfo->shaderStages, kRequiredFlags, + "VUID-VkIndirectCommandsLayoutCreateInfoEXT-shaderStages-parameter", + "VUID-VkIndirectCommandsLayoutCreateInfoEXT-shaderStages-requiredbitmask"); - skip |= ValidateStructTypeArray( + skip |= context.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", @@ -27039,21 +29746,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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pIndirectCommandsLayout), pIndirectCommandsLayout, - "VUID-vkCreateIndirectCommandsLayoutEXT-pIndirectCommandsLayout-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pIndirectCommandsLayout), pIndirectCommandsLayout, + "VUID-vkCreateIndirectCommandsLayoutEXT-pIndirectCommandsLayout-parameter"); if (!skip) skip |= manual_PreCallValidateCreateIndirectCommandsLayoutEXT(device, pCreateInfo, pAllocator, pIndirectCommandsLayout, - error_obj); + context); return skip; } @@ -27062,12 +29769,13 @@ bool StatelessValidation::PreCallValidateDestroyIndirectCommandsLayoutEXT(VkDevi const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -27078,26 +29786,27 @@ bool StatelessValidation::PreCallValidateCreateIndirectExecutionSetEXT(VkDevice VkIndirectExecutionSetEXT* pIndirectExecutionSet, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pIndirectExecutionSet), pIndirectExecutionSet, - "VUID-vkCreateIndirectExecutionSetEXT-pIndirectExecutionSet-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pIndirectExecutionSet), pIndirectExecutionSet, + "VUID-vkCreateIndirectExecutionSetEXT-pIndirectExecutionSet-parameter"); if (!skip) skip |= - manual_PreCallValidateCreateIndirectExecutionSetEXT(device, pCreateInfo, pAllocator, pIndirectExecutionSet, error_obj); + manual_PreCallValidateCreateIndirectExecutionSetEXT(device, pCreateInfo, pAllocator, pIndirectExecutionSet, context); return skip; } @@ -27106,12 +29815,13 @@ bool StatelessValidation::PreCallValidateDestroyIndirectExecutionSetEXT(VkDevice const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } return skip; } @@ -27120,21 +29830,22 @@ bool StatelessValidation::PreCallValidateUpdateIndirectExecutionSetPipelineEXT( VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetPipelineEXT* pExecutionSetWrites, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::indirectExecutionSet), indirectExecutionSet); + skip |= context.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 |= context.ValidateRequiredHandle(pExecutionSetWrites_loc.dot(Field::pipeline), + pExecutionSetWrites[executionSetWriteIndex].pipeline); } } return skip; @@ -27144,21 +29855,22 @@ bool StatelessValidation::PreCallValidateUpdateIndirectExecutionSetShaderEXT( VkDevice device, VkIndirectExecutionSetEXT indirectExecutionSet, uint32_t executionSetWriteCount, const VkWriteIndirectExecutionSetShaderEXT* pExecutionSetWrites, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_ext_device_generated_commands)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::indirectExecutionSet), indirectExecutionSet); + skip |= context.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 |= context.ValidateRequiredHandle(pExecutionSetWrites_loc.dot(Field::shader), + pExecutionSetWrites[executionSetWriteIndex].shader); } } return skip; @@ -27168,8 +29880,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); + stateless::Context context(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); [[maybe_unused]] const Location loc = error_obj.location; - skip |= ValidateStructTypeArray( + skip |= context.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, @@ -27177,9 +29892,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 |= context.ValidateStructPnext( pProperties_loc, pProperties[pPropertyIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, - "VUID-VkCooperativeMatrixFlexibleDimensionsPropertiesNV-pNext-pNext", kVUIDUndefined, physicalDevice, false); + "VUID-VkCooperativeMatrixFlexibleDimensionsPropertiesNV-pNext-pNext", kVUIDUndefined, false); } } return skip; @@ -27191,42 +29906,44 @@ bool StatelessValidation::PreCallValidateCreateAccelerationStructureKHR(VkDevice VkAccelerationStructureKHR* pAccelerationStructure, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - skip |= ValidateRequiredPointer(loc.dot(Field::pAccelerationStructure), pAccelerationStructure, - "VUID-vkCreateAccelerationStructureKHR-pAccelerationStructure-parameter"); + skip |= context.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, context); return skip; } @@ -27235,14 +29952,15 @@ bool StatelessValidation::PreCallValidateDestroyAccelerationStructureKHR(VkDevic const VkAllocationCallbacks* pAllocator, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.ValidateAllocationCallbacks(*pAllocator, pAllocator_loc); } - if (!skip) skip |= manual_PreCallValidateDestroyAccelerationStructureKHR(device, accelerationStructure, pAllocator, error_obj); + if (!skip) skip |= manual_PreCallValidateDestroyAccelerationStructureKHR(device, accelerationStructure, pAllocator, context); return skip; } @@ -27250,53 +29968,53 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructuresKHR( VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.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 |= - ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, pInfos[infoIndex].type, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter", VK_NULL_HANDLE); + context.ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, true); + + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } - skip |= ValidateStructPointerTypeArray( + skip |= context.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); @@ -27304,25 +30022,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 |= context.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 |= context.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 |= context.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 |= context.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); @@ -27331,7 +30048,7 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructuresKHR( } if (!skip) skip |= - manual_PreCallValidateCmdBuildAccelerationStructuresKHR(commandBuffer, infoCount, pInfos, ppBuildRangeInfos, error_obj); + manual_PreCallValidateCmdBuildAccelerationStructuresKHR(commandBuffer, infoCount, pInfos, ppBuildRangeInfos, context); return skip; } @@ -27340,53 +30057,53 @@ bool StatelessValidation::PreCallValidateCmdBuildAccelerationStructuresIndirectK const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides, const uint32_t* const* ppMaxPrimitiveCounts, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.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 |= - ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, pInfos[infoIndex].type, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter", VK_NULL_HANDLE); + context.ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, - AllVkBuildAccelerationStructureFlagBitsKHR, pInfos[infoIndex].flags, kOptionalFlags, - VK_NULL_HANDLE, "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); + skip |= context.ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, + pInfos[infoIndex].type, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-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 |= context.ValidateFlags(pInfos_loc.dot(Field::flags), vvl::FlagBitmask::VkBuildAccelerationStructureFlagBitsKHR, + AllVkBuildAccelerationStructureFlagBitsKHR, pInfos[infoIndex].flags, kOptionalFlags, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-flags-parameter"); + + skip |= context.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 |= context.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 |= context.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 |= context.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } - skip |= ValidateStructPointerTypeArray( + skip |= context.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); @@ -27394,34 +30111,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 |= context.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 |= context.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 |= context.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 |= context.ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::pIndirectDeviceAddresses), infoCount, + &pIndirectDeviceAddresses, true, true, + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength", + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectDeviceAddresses-parameter"); + skip |= context.ValidateArray(loc.dot(Field::infoCount), loc.dot(Field::pIndirectStrides), infoCount, &pIndirectStrides, true, + true, "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-infoCount-arraylength", + "VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pIndirectStrides-parameter"); + skip |= context.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, context); return skip; } @@ -27430,53 +30147,53 @@ bool StatelessValidation::PreCallValidateBuildAccelerationStructuresKHR( const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.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 |= - ValidateRangedEnum(pInfos_loc.dot(Field::type), vvl::Enum::VkAccelerationStructureTypeKHR, pInfos[infoIndex].type, - "VUID-VkAccelerationStructureBuildGeometryInfoKHR-type-parameter", VK_NULL_HANDLE); + context.ValidateStructPnext(pInfos_loc, pInfos[infoIndex].pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureBuildGeometryInfoKHR-pNext-pNext", kVUIDUndefined, true); + + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pInfos[infoIndex].pGeometries[geometryIndex].flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } - skip |= ValidateStructPointerTypeArray( + skip |= context.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); @@ -27484,25 +30201,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 |= context.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 |= context.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 |= context.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 |= context.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); @@ -27511,7 +30227,7 @@ bool StatelessValidation::PreCallValidateBuildAccelerationStructuresKHR( } if (!skip) skip |= manual_PreCallValidateBuildAccelerationStructuresKHR(device, deferredOperation, infoCount, pInfos, - ppBuildRangeInfos, error_obj); + ppBuildRangeInfos, context); return skip; } @@ -27519,25 +30235,26 @@ bool StatelessValidation::PreCallValidateCopyAccelerationStructureKHR(VkDevice d const VkCopyAccelerationStructureInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= context.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 |= context.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, context); return skip; } @@ -27545,24 +30262,25 @@ bool StatelessValidation::PreCallValidateCopyAccelerationStructureToMemoryKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= + context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= context.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 |= context.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, context); return skip; } @@ -27570,24 +30288,25 @@ bool StatelessValidation::PreCallValidateCopyMemoryToAccelerationStructureKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= + context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= context.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 |= context.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, context); return skip; } @@ -27595,20 +30314,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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), + accelerationStructureCount, pAccelerationStructures, true, true, + "VUID-vkWriteAccelerationStructuresPropertiesKHR-accelerationStructureCount-arraylength"); + skip |= context.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkWriteAccelerationStructuresPropertiesKHR-queryType-parameter"); + skip |= context.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, context); return skip; } @@ -27616,92 +30336,96 @@ bool StatelessValidation::PreCallValidateCmdCopyAccelerationStructureKHR(VkComma const VkCopyAccelerationStructureInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdCopyAccelerationStructureToMemoryKHR( VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= + context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyAccelerationStructureToMemoryInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::src), pInfo->src); + skip |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateCmdCopyMemoryToAccelerationStructureKHR( VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= + context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkCopyMemoryToAccelerationStructureInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::dst), pInfo->dst); + skip |= context.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 |= context.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, context); return skip; } bool StatelessValidation::PreCallValidateGetAccelerationStructureDeviceAddressKHR( VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= + context.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 |= context.ValidateStructPnext(pInfo_loc, pInfo->pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureDeviceAddressInfoKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateRequiredHandle(pInfo_loc.dot(Field::accelerationStructure), pInfo->accelerationStructure); + skip |= context.ValidateRequiredHandle(pInfo_loc.dot(Field::accelerationStructure), pInfo->accelerationStructure); } return skip; } @@ -27710,18 +30434,20 @@ 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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= + context.ValidateHandleArray(loc.dot(Field::accelerationStructureCount), loc.dot(Field::pAccelerationStructures), + accelerationStructureCount, pAccelerationStructures, true, true, + "VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-accelerationStructureCount-arraylength"); + skip |= context.ValidateRangedEnum(loc.dot(Field::queryType), vvl::Enum::VkQueryType, queryType, + "VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-queryType-parameter"); + skip |= context.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, context); return skip; } @@ -27729,26 +30455,26 @@ bool StatelessValidation::PreCallValidateGetDeviceAccelerationStructureCompatibi VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.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 |= context.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 |= context.ValidateRequiredPointer(pVersionInfo_loc.dot(Field::pVersionData), pVersionInfo->pVersionData, + "VUID-VkAccelerationStructureVersionInfoKHR-pVersionData-parameter"); } - skip |= ValidateRequiredPointer(loc.dot(Field::pCompatibility), pCompatibility, - "VUID-vkGetDeviceAccelerationStructureCompatibilityKHR-pCompatibility-parameter"); + skip |= context.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, context); return skip; } @@ -27756,51 +30482,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; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_acceleration_structure)) + if (!IsExtEnabled(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 |= context.ValidateRangedEnum(loc.dot(Field::buildType), vvl::Enum::VkAccelerationStructureBuildTypeKHR, buildType, + "VUID-vkGetAccelerationStructureBuildSizesKHR-buildType-parameter"); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateFlags(pGeometries_loc.dot(Field::flags), vvl::FlagBitmask::VkGeometryFlagBitsKHR, + AllVkGeometryFlagBitsKHR, pBuildInfo->pGeometries[geometryIndex].flags, + kOptionalFlags, "VUID-VkAccelerationStructureGeometryKHR-flags-parameter"); } } - skip |= ValidateStructPointerTypeArray( + skip |= context.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); @@ -27808,32 +30534,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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -27845,21 +30571,22 @@ bool StatelessValidation::PreCallValidateCmdTraceRaysKHR(VkCommandBuffer command uint32_t width, uint32_t height, uint32_t depth, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::pRaygenShaderBindingTable), pRaygenShaderBindingTable, + "VUID-vkCmdTraceRaysKHR-pRaygenShaderBindingTable-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pMissShaderBindingTable), pMissShaderBindingTable, + "VUID-vkCmdTraceRaysKHR-pMissShaderBindingTable-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pHitShaderBindingTable), pHitShaderBindingTable, + "VUID-vkCmdTraceRaysKHR-pHitShaderBindingTable-parameter"); + skip |= context.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); + context); return skip; } @@ -27869,14 +30596,15 @@ bool StatelessValidation::PreCallValidateCreateRayTracingPipelinesKHR(VkDevice d const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) + if (!IsExtEnabled(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 |= context.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); @@ -27884,17 +30612,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 |= context.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 |= context.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) { @@ -27908,34 +30635,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 |= context.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 |= ValidateFlags(pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, - AllVkPipelineShaderStageCreateFlagBits, - pCreateInfos[createInfoIndex].pStages[stageIndex].flags, kOptionalFlags, VK_NULL_HANDLE, - "VUID-VkPipelineShaderStageCreateInfo-flags-parameter"); + skip |= context.ValidateFlags( + pStages_loc.dot(Field::flags), vvl::FlagBitmask::VkPipelineShaderStageCreateFlagBits, + AllVkPipelineShaderStageCreateFlagBits, pCreateInfos[createInfoIndex].pStages[stageIndex].flags, + kOptionalFlags, "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 |= context.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 |= ValidateRequiredPointer(pStages_loc.dot(Field::pName), - pCreateInfos[createInfoIndex].pStages[stageIndex].pName, - "VUID-VkPipelineShaderStageCreateInfo-pName-parameter"); + skip |= context.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 |= context.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; @@ -27948,97 +30675,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 |= context.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 |= context.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); + context.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 |= context.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 |= context.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 |= context.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 |= context.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); + skip |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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, context); return skip; } @@ -28047,16 +30775,17 @@ bool StatelessValidation::PreCallValidateGetRayTracingCaptureReplayShaderGroupHa size_t dataSize, void* pData, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= context.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, context); return skip; } @@ -28068,21 +30797,22 @@ bool StatelessValidation::PreCallValidateCmdTraceRaysIndirectKHR(VkCommandBuffer VkDeviceAddress indirectDeviceAddress, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) + if (!IsExtEnabled(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 |= context.ValidateRequiredPointer(loc.dot(Field::pRaygenShaderBindingTable), pRaygenShaderBindingTable, + "VUID-vkCmdTraceRaysIndirectKHR-pRaygenShaderBindingTable-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pMissShaderBindingTable), pMissShaderBindingTable, + "VUID-vkCmdTraceRaysIndirectKHR-pMissShaderBindingTable-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pHitShaderBindingTable), pHitShaderBindingTable, + "VUID-vkCmdTraceRaysIndirectKHR-pHitShaderBindingTable-parameter"); + skip |= context.ValidateRequiredPointer(loc.dot(Field::pCallableShaderBindingTable), pCallableShaderBindingTable, + "VUID-vkCmdTraceRaysIndirectKHR-pCallableShaderBindingTable-parameter"); if (!skip) skip |= manual_PreCallValidateCmdTraceRaysIndirectKHR(commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable, pCallableShaderBindingTable, - indirectDeviceAddress, error_obj); + indirectDeviceAddress, context); return skip; } @@ -28090,12 +30820,13 @@ bool StatelessValidation::PreCallValidateGetRayTracingShaderGroupStackSizeKHR(Vk VkShaderGroupShaderKHR groupShader, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) + if (!IsExtEnabled(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 |= context.ValidateRequiredHandle(loc.dot(Field::pipeline), pipeline); + skip |= context.ValidateRangedEnum(loc.dot(Field::groupShader), vvl::Enum::VkShaderGroupShaderKHR, groupShader, + "VUID-vkGetRayTracingShaderGroupStackSizeKHR-groupShader-parameter"); return skip; } @@ -28103,8 +30834,9 @@ bool StatelessValidation::PreCallValidateCmdSetRayTracingPipelineStackSizeKHR(Vk uint32_t pipelineStackSize, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, extensions); [[maybe_unused]] const Location loc = error_obj.location; - if (!IsExtEnabled(device_extensions.vk_khr_ray_tracing_pipeline)) + if (!IsExtEnabled(extensions.vk_khr_ray_tracing_pipeline)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_KHR_ray_tracing_pipeline}); // No xml-driven validation return skip; @@ -28114,9 +30846,9 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksEXT(VkCommandBuffer com uint32_t groupCountY, uint32_t groupCountZ, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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}); + if (!IsExtEnabled(extensions.vk_ext_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_mesh_shader}); // No xml-driven validation return skip; } @@ -28125,10 +30857,10 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksIndirectEXT(VkCommandBu VkDeviceSize offset, uint32_t drawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_ext_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_mesh_shader}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); return skip; } @@ -28137,19 +30869,20 @@ bool StatelessValidation::PreCallValidateCmdDrawMeshTasksIndirectCountEXT(VkComm VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride, const ErrorObject& error_obj) const { bool skip = false; + stateless::Context context(*this, error_obj, 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); + if (!IsExtEnabled(extensions.vk_ext_mesh_shader)) skip |= OutputExtensionError(loc, {vvl::Extension::_VK_EXT_mesh_shader}); + skip |= context.ValidateRequiredHandle(loc.dot(Field::buffer), buffer); + skip |= context.ValidateRequiredHandle(loc.dot(Field::countBuffer), countBuffer); return skip; } -bool StatelessValidation::ValidatePipelineViewportStateCreateInfo(const VkPipelineViewportStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineViewportStateCreateInfo(const stateless::Context& context, + 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 |= context.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, @@ -28160,84 +30893,90 @@ 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 |= context.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 |= context.ValidateReservedFlags(loc.dot(Field::flags), info.flags, + "VUID-VkPipelineViewportStateCreateInfo-flags-zerobitmask"); return skip; } -bool StatelessValidation::ValidatePipelineTessellationStateCreateInfo(const VkPipelineTessellationStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineTessellationStateCreateInfo(const stateless::Context& context, + 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 |= context.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 |= context.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 |= context.ValidateReservedFlags(loc.dot(Field::flags), info.flags, + "VUID-VkPipelineTessellationStateCreateInfo-flags-zerobitmask"); return skip; } -bool StatelessValidation::ValidatePipelineVertexInputStateCreateInfo(const VkPipelineVertexInputStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineVertexInputStateCreateInfo(const stateless::Context& context, + 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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 stateless::Context& context, + 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 |= context.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, @@ -28245,158 +30984,164 @@ 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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.ValidateBool32(loc.dot(Field::alphaToCoverageEnable), info.alphaToCoverageEnable); - skip |= ValidateBool32(loc.dot(Field::alphaToOneEnable), info.alphaToOneEnable); + skip |= context.ValidateBool32(loc.dot(Field::alphaToOneEnable), info.alphaToOneEnable); return skip; } -bool StatelessValidation::ValidatePipelineColorBlendStateCreateInfo(const VkPipelineColorBlendStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineColorBlendStateCreateInfo(const stateless::Context& context, + 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 |= context.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 |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 stateless::Context& context, + 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 |= context.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 |= context.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 |= context.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 |= context.ValidateBool32(loc.dot(Field::depthTestEnable), info.depthTestEnable); - skip |= ValidateBool32(loc.dot(Field::depthWriteEnable), info.depthWriteEnable); + skip |= context.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 |= context.ValidateRangedEnum(loc.dot(Field::depthCompareOp), vvl::Enum::VkCompareOp, info.depthCompareOp, + "VUID-VkPipelineDepthStencilStateCreateInfo-depthCompareOp-parameter"); - skip |= ValidateBool32(loc.dot(Field::depthBoundsTestEnable), info.depthBoundsTestEnable); + skip |= context.ValidateBool32(loc.dot(Field::depthBoundsTestEnable), info.depthBoundsTestEnable); - skip |= ValidateBool32(loc.dot(Field::stencilTestEnable), info.stencilTestEnable); + skip |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 |= context.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 stateless::Context& context, + 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 |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(loc.dot(Field::topology), vvl::Enum::VkPrimitiveTopology, info.topology, + "VUID-VkPipelineInputAssemblyStateCreateInfo-topology-parameter"); - skip |= ValidateBool32(loc.dot(Field::primitiveRestartEnable), info.primitiveRestartEnable); + skip |= context.ValidateBool32(loc.dot(Field::primitiveRestartEnable), info.primitiveRestartEnable); return skip; } -bool StatelessValidation::ValidatePipelineRasterizationStateCreateInfo(const VkPipelineRasterizationStateCreateInfo& info, +bool StatelessValidation::ValidatePipelineRasterizationStateCreateInfo(const stateless::Context& context, + 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 |= context.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, @@ -28407,31 +31152,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 |= context.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 |= context.ValidateReservedFlags(loc.dot(Field::flags), info.flags, + "VUID-VkPipelineRasterizationStateCreateInfo-flags-zerobitmask"); - skip |= ValidateBool32(loc.dot(Field::depthClampEnable), info.depthClampEnable); + skip |= context.ValidateBool32(loc.dot(Field::depthClampEnable), info.depthClampEnable); - skip |= ValidateBool32(loc.dot(Field::rasterizerDiscardEnable), info.rasterizerDiscardEnable); + skip |= context.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 |= context.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 |= context.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 |= context.ValidateRangedEnum(loc.dot(Field::frontFace), vvl::Enum::VkFrontFace, info.frontFace, + "VUID-VkPipelineRasterizationStateCreateInfo-frontFace-parameter"); - skip |= ValidateBool32(loc.dot(Field::depthBiasEnable), info.depthBiasEnable); + skip |= context.ValidateBool32(loc.dot(Field::depthBiasEnable), info.depthBiasEnable); return skip; } -bool StatelessValidation::ValidatePipelineShaderStageCreateInfo(const VkPipelineShaderStageCreateInfo& info, +bool StatelessValidation::ValidatePipelineShaderStageCreateInfo(const stateless::Context& context, + const VkPipelineShaderStageCreateInfo& info, const Location& loc) const { bool skip = false; constexpr std::array allowed_structs_VkPipelineShaderStageCreateInfo = { @@ -28443,26 +31189,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 |= context.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 |= context.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 |= context.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 |= + context.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 |= context.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) { @@ -28471,17 +31219,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 |= context.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 stateless::Context& context, + 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 |= context.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, @@ -28494,80 +31243,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 |= context.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 |= context.ValidateBool32(loc.dot(Field::occlusionQueryEnable), info.occlusionQueryEnable); return skip; } -bool StatelessValidation::ValidateDescriptorAddressInfoEXT(const VkDescriptorAddressInfoEXT& info, const Location& loc) const { +bool StatelessValidation::ValidateDescriptorAddressInfoEXT(const stateless::Context& context, + 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 |= context.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 |= context.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 |= context.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 stateless::Context& context, 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 |= context.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 |= context.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 |= context.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 |= context.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 stateless::Context& context, 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 |= context.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 |= context.ValidateStructPnext(loc, info.pNext, 0, nullptr, GeneratedVulkanHeaderVersion, + "VUID-VkAccelerationStructureGeometryInstancesDataKHR-pNext-pNext", kVUIDUndefined, true); - skip |= ValidateBool32(loc.dot(Field::arrayOfPointers), info.arrayOfPointers); + skip |= context.ValidateBool32(loc.dot(Field::arrayOfPointers), info.arrayOfPointers); return skip; } -bool StatelessValidation::ValidateAccelerationStructureGeometryAabbsDataKHR(const VkAccelerationStructureGeometryAabbsDataKHR& info, +bool StatelessValidation::ValidateAccelerationStructureGeometryAabbsDataKHR(const stateless::Context& context, + 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 |= context.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 |= context.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 stateless::Context& context, + 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 |= context.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 |= context.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..f762b6a67ba 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 stateless::Context& context, const VkPipelineViewportStateCreateInfo& info, + const Location& loc) const; +bool ValidatePipelineTessellationStateCreateInfo(const stateless::Context& context, + const VkPipelineTessellationStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineVertexInputStateCreateInfo(const stateless::Context& context, const VkPipelineVertexInputStateCreateInfo& info, + const Location& loc) const; +bool ValidatePipelineMultisampleStateCreateInfo(const stateless::Context& context, const VkPipelineMultisampleStateCreateInfo& info, + const Location& loc) const; +bool ValidatePipelineColorBlendStateCreateInfo(const stateless::Context& context, const VkPipelineColorBlendStateCreateInfo& info, + const Location& loc) const; +bool ValidatePipelineDepthStencilStateCreateInfo(const stateless::Context& context, + const VkPipelineDepthStencilStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineInputAssemblyStateCreateInfo(const stateless::Context& context, + const VkPipelineInputAssemblyStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineRasterizationStateCreateInfo(const stateless::Context& context, + const VkPipelineRasterizationStateCreateInfo& info, const Location& loc) const; +bool ValidatePipelineShaderStageCreateInfo(const stateless::Context& context, const VkPipelineShaderStageCreateInfo& info, + const Location& loc) const; +bool ValidateCommandBufferInheritanceInfo(const stateless::Context& context, const VkCommandBufferInheritanceInfo& info, + const Location& loc) const; +bool ValidateDescriptorAddressInfoEXT(const stateless::Context& context, const VkDescriptorAddressInfoEXT& info, + const Location& loc) const; +bool ValidateAccelerationStructureGeometryTrianglesDataKHR(const stateless::Context& context, + const VkAccelerationStructureGeometryTrianglesDataKHR& info, const Location& loc) const; -bool ValidateAccelerationStructureGeometryInstancesDataKHR(const VkAccelerationStructureGeometryInstancesDataKHR& info, +bool ValidateAccelerationStructureGeometryInstancesDataKHR(const stateless::Context& context, + const VkAccelerationStructureGeometryInstancesDataKHR& info, const Location& loc) const; -bool ValidateAccelerationStructureGeometryAabbsDataKHR(const VkAccelerationStructureGeometryAabbsDataKHR& info, +bool ValidateAccelerationStructureGeometryAabbsDataKHR(const stateless::Context& context, + const VkAccelerationStructureGeometryAabbsDataKHR& info, const Location& loc) const; -bool ValidateIndirectExecutionSetPipelineInfoEXT(const VkIndirectExecutionSetPipelineInfoEXT& info, const Location& loc) const; +bool ValidateIndirectExecutionSetPipelineInfoEXT(const stateless::Context& context, + 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..6a508177c6c 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 stateless::Context::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 stateless::Context::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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_khr_fragment_shading_rate) || IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.vk_khr_video_encode_quantization_map) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkObjectType value) const { +ValidValue stateless::Context::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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_ext_device_generated_commands) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFormat value) const { +ValidValue stateless::Context::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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_nv_optical_flow) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageTiling value) const { +ValidValue stateless::Context::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(extensions.vk_ext_image_drm_format_modifier) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageType value) const { +ValidValue stateless::Context::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 stateless::Context::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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_ext_opacity_micromap) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSharingMode value) const { +ValidValue stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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 stateless::Context::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(extensions.vk_ext_blend_operation_advanced) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCompareOp value) const { +ValidValue stateless::Context::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 stateless::Context::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(extensions.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(extensions.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(extensions.vk_khr_line_rasterization) || IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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,19 @@ 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(extensions.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(extensions.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(extensions.vk_ext_depth_clamp_control) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFrontFace value) const { +ValidValue stateless::Context::IsValidEnumValue(VkFrontFace value) const { switch (value) { case VK_FRONT_FACE_COUNTER_CLOCKWISE: case VK_FRONT_FACE_CLOCKWISE: @@ -781,7 +774,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFrontFace value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVertexInputRate value) const { +ValidValue stateless::Context::IsValidEnumValue(VkVertexInputRate value) const { switch (value) { case VK_VERTEX_INPUT_RATE_VERTEX: case VK_VERTEX_INPUT_RATE_INSTANCE: @@ -792,7 +785,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkVertexInputRate value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPrimitiveTopology value) const { +ValidValue stateless::Context::IsValidEnumValue(VkPrimitiveTopology value) const { switch (value) { case VK_PRIMITIVE_TOPOLOGY_POINT_LIST: case VK_PRIMITIVE_TOPOLOGY_LINE_LIST: @@ -812,21 +805,21 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPrimitiveTopology value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPolygonMode value) const { +ValidValue stateless::Context::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(extensions.vk_nv_fill_rectangle) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkStencilOp value) const { +ValidValue stateless::Context::IsValidEnumValue(VkStencilOp value) const { switch (value) { case VK_STENCIL_OP_KEEP: case VK_STENCIL_OP_ZERO: @@ -843,7 +836,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkStencilOp value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLogicOp value) const { +ValidValue stateless::Context::IsValidEnumValue(VkLogicOp value) const { switch (value) { case VK_LOGIC_OP_CLEAR: case VK_LOGIC_OP_AND: @@ -868,7 +861,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkLogicOp value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBorderColor value) const { +ValidValue stateless::Context::IsValidEnumValue(VkBorderColor value) const { switch (value) { case VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK: case VK_BORDER_COLOR_INT_TRANSPARENT_BLACK: @@ -879,20 +872,20 @@ 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(extensions.vk_ext_custom_border_color) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFilter value) const { +ValidValue stateless::Context::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) + return IsExtEnabled(extensions.vk_img_filter_cubic) || IsExtEnabled(extensions.vk_ext_filter_cubic) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -901,7 +894,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFilter value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerAddressMode value) const { +ValidValue stateless::Context::IsValidEnumValue(VkSamplerAddressMode value) const { switch (value) { case VK_SAMPLER_ADDRESS_MODE_REPEAT: case VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT: @@ -909,15 +902,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(extensions.vk_khr_sampler_mirror_clamp_to_edge) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerMipmapMode value) const { +ValidValue stateless::Context::IsValidEnumValue(VkSamplerMipmapMode value) const { switch (value) { case VK_SAMPLER_MIPMAP_MODE_NEAREST: case VK_SAMPLER_MIPMAP_MODE_LINEAR: @@ -928,7 +920,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSamplerMipmapMode value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorType value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDescriptorType value) const { switch (value) { case VK_DESCRIPTOR_TYPE_SAMPLER: case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: @@ -943,17 +935,17 @@ 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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_valve_mutable_descriptor_type) || + IsExtEnabled(extensions.vk_ext_mutable_descriptor_type) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -962,15 +954,14 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorType value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentLoadOp value) const { +ValidValue stateless::Context::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(extensions.vk_khr_load_store_op_none) || IsExtEnabled(extensions.vk_ext_load_store_op_none) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -979,16 +970,15 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentLoadOp value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentStoreOp value) const { +ValidValue stateless::Context::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(extensions.vk_khr_dynamic_rendering) || IsExtEnabled(extensions.vk_khr_load_store_op_none) || + IsExtEnabled(extensions.vk_qcom_render_pass_store_ops) || + IsExtEnabled(extensions.vk_ext_load_store_op_none) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -997,26 +987,26 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentStoreOp value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineBindPoint value) const { +ValidValue stateless::Context::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(extensions.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) + return IsExtEnabled(extensions.vk_nv_ray_tracing) || IsExtEnabled(extensions.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(extensions.vk_huawei_subpass_shading) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCommandBufferLevel value) const { +ValidValue stateless::Context::IsValidEnumValue(VkCommandBufferLevel value) const { switch (value) { case VK_COMMAND_BUFFER_LEVEL_PRIMARY: case VK_COMMAND_BUFFER_LEVEL_SECONDARY: @@ -1027,19 +1017,17 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCommandBufferLevel value) con } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndexType value) const { +ValidValue stateless::Context::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(extensions.vk_khr_index_type_uint8) || IsExtEnabled(extensions.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(extensions.vk_nv_ray_tracing) || IsExtEnabled(extensions.vk_khr_acceleration_structure) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -1048,14 +1036,13 @@ ValidValue StatelessValidation::IsValidEnumValue(VkIndexType value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSubpassContents value) const { +ValidValue stateless::Context::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(extensions.vk_khr_maintenance7) || IsExtEnabled(extensions.vk_ext_nested_command_buffer) ? ValidValue::Valid : ValidValue::NoExtension; default: @@ -1064,7 +1051,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSubpassContents value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkTessellationDomainOrigin value) const { +ValidValue stateless::Context::IsValidEnumValue(VkTessellationDomainOrigin value) const { switch (value) { case VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT: case VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT: @@ -1075,7 +1062,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkTessellationDomainOrigin valu } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrModelConversion value) const { +ValidValue stateless::Context::IsValidEnumValue(VkSamplerYcbcrModelConversion value) const { switch (value) { case VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY: case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY: @@ -1089,7 +1076,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrModelConversion v } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrRange value) const { +ValidValue stateless::Context::IsValidEnumValue(VkSamplerYcbcrRange value) const { switch (value) { case VK_SAMPLER_YCBCR_RANGE_ITU_FULL: case VK_SAMPLER_YCBCR_RANGE_ITU_NARROW: @@ -1100,7 +1087,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrRange value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkChromaLocation value) const { +ValidValue stateless::Context::IsValidEnumValue(VkChromaLocation value) const { switch (value) { case VK_CHROMA_LOCATION_COSITED_EVEN: case VK_CHROMA_LOCATION_MIDPOINT: @@ -1111,33 +1098,33 @@ ValidValue StatelessValidation::IsValidEnumValue(VkChromaLocation value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorUpdateTemplateType value) const { +ValidValue stateless::Context::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(extensions.vk_khr_push_descriptor) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerReductionMode value) const { +ValidValue stateless::Context::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(extensions.vk_qcom_filter_cubic_clamp) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSemaphoreType value) const { +ValidValue stateless::Context::IsValidEnumValue(VkSemaphoreType value) const { switch (value) { case VK_SEMAPHORE_TYPE_BINARY: case VK_SEMAPHORE_TYPE_TIMELINE: @@ -1148,7 +1135,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkSemaphoreType value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessBufferBehavior value) const { +ValidValue stateless::Context::IsValidEnumValue(VkPipelineRobustnessBufferBehavior value) const { switch (value) { case VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT: case VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED: @@ -1161,7 +1148,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessBufferBehav } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessImageBehavior value) const { +ValidValue stateless::Context::IsValidEnumValue(VkPipelineRobustnessImageBehavior value) const { switch (value) { case VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT: case VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED: @@ -1174,7 +1161,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessImageBehavi } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueueGlobalPriority value) const { +ValidValue stateless::Context::IsValidEnumValue(VkQueueGlobalPriority value) const { switch (value) { case VK_QUEUE_GLOBAL_PRIORITY_LOW: case VK_QUEUE_GLOBAL_PRIORITY_MEDIUM: @@ -1187,7 +1174,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkQueueGlobalPriority value) co } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLineRasterizationMode value) const { +ValidValue stateless::Context::IsValidEnumValue(VkLineRasterizationMode value) const { switch (value) { case VK_LINE_RASTERIZATION_MODE_DEFAULT: case VK_LINE_RASTERIZATION_MODE_RECTANGULAR: @@ -1200,7 +1187,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkLineRasterizationMode value) } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPresentModeKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkPresentModeKHR value) const { switch (value) { case VK_PRESENT_MODE_IMMEDIATE_KHR: case VK_PRESENT_MODE_MAILBOX_KHR: @@ -1209,17 +1196,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(extensions.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(extensions.vk_ext_present_mode_fifo_latest_ready) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkColorSpaceKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkColorSpaceKHR value) const { switch (value) { case VK_COLOR_SPACE_SRGB_NONLINEAR_KHR: return ValidValue::Valid; @@ -1237,16 +1223,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(extensions.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(extensions.vk_amd_display_native_hdr) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateCombinerOpKHR value) const { +ValidValue stateless::Context::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 +1246,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateCombinerOp } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeTuningModeKHR value) const { +ValidValue stateless::Context::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 +1260,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeTuningModeKHR valu } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1PredictionModeKHR value) const { +ValidValue stateless::Context::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 +1273,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1PredictionModeK } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1RateControlGroupKHR value) const { +ValidValue stateless::Context::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 +1285,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1RateControlGrou } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkTimeDomainKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkTimeDomainKHR value) const { switch (value) { case VK_TIME_DOMAIN_DEVICE_KHR: case VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR: @@ -1312,7 +1298,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkTimeDomainKHR value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDebugReportObjectTypeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDebugReportObjectTypeEXT value) const { switch (value) { case VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT: case VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT: @@ -1348,28 +1334,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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_fuchsia_buffer_collection) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkRasterizationOrderAMD value) const { +ValidValue stateless::Context::IsValidEnumValue(VkRasterizationOrderAMD value) const { switch (value) { case VK_RASTERIZATION_ORDER_STRICT_AMD: case VK_RASTERIZATION_ORDER_RELAXED_AMD: @@ -1380,7 +1366,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkRasterizationOrderAMD value) } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderInfoTypeAMD value) const { +ValidValue stateless::Context::IsValidEnumValue(VkShaderInfoTypeAMD value) const { switch (value) { case VK_SHADER_INFO_TYPE_STATISTICS_AMD: case VK_SHADER_INFO_TYPE_BINARY_AMD: @@ -1392,7 +1378,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkShaderInfoTypeAMD value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationCheckEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkValidationCheckEXT value) const { switch (value) { case VK_VALIDATION_CHECK_ALL_EXT: case VK_VALIDATION_CHECK_SHADERS_EXT: @@ -1403,7 +1389,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkValidationCheckEXT value) con } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplayPowerStateEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDisplayPowerStateEXT value) const { switch (value) { case VK_DISPLAY_POWER_STATE_OFF_EXT: case VK_DISPLAY_POWER_STATE_SUSPEND_EXT: @@ -1415,7 +1401,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDisplayPowerStateEXT value) c } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceEventTypeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDeviceEventTypeEXT value) const { switch (value) { case VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT: return ValidValue::Valid; @@ -1425,7 +1411,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDeviceEventTypeEXT value) con } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplayEventTypeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDisplayEventTypeEXT value) const { switch (value) { case VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT: return ValidValue::Valid; @@ -1435,7 +1421,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDisplayEventTypeEXT value) co } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkViewportCoordinateSwizzleNV value) const { +ValidValue stateless::Context::IsValidEnumValue(VkViewportCoordinateSwizzleNV value) const { switch (value) { case VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV: case VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV: @@ -1452,7 +1438,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkViewportCoordinateSwizzleNV v } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDiscardRectangleModeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDiscardRectangleModeEXT value) const { switch (value) { case VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT: case VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT: @@ -1463,7 +1449,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDiscardRectangleModeEXT value } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkConservativeRasterizationModeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkConservativeRasterizationModeEXT value) const { switch (value) { case VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT: case VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT: @@ -1475,7 +1461,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkConservativeRasterizationMode } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendOverlapEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkBlendOverlapEXT value) const { switch (value) { case VK_BLEND_OVERLAP_UNCORRELATED_EXT: case VK_BLEND_OVERLAP_DISJOINT_EXT: @@ -1487,7 +1473,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBlendOverlapEXT value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoverageModulationModeNV value) const { +ValidValue stateless::Context::IsValidEnumValue(VkCoverageModulationModeNV value) const { switch (value) { case VK_COVERAGE_MODULATION_MODE_NONE_NV: case VK_COVERAGE_MODULATION_MODE_RGB_NV: @@ -1500,7 +1486,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCoverageModulationModeNV valu } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShadingRatePaletteEntryNV value) const { +ValidValue stateless::Context::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 +1507,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkShadingRatePaletteEntryNV val } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoarseSampleOrderTypeNV value) const { +ValidValue stateless::Context::IsValidEnumValue(VkCoarseSampleOrderTypeNV value) const { switch (value) { case VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV: case VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV: @@ -1534,7 +1520,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCoarseSampleOrderTypeNV value } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR value) const { +ValidValue stateless::Context::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 +1532,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkGeometryTypeKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkGeometryTypeKHR value) const { switch (value) { case VK_GEOMETRY_TYPE_TRIANGLES_KHR: case VK_GEOMETRY_TYPE_AABBS_KHR: @@ -1558,7 +1544,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkGeometryTypeKHR value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureTypeKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkAccelerationStructureTypeKHR value) const { switch (value) { case VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR: case VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR: @@ -1570,7 +1556,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureTypeKHR } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCopyAccelerationStructureModeKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkCopyAccelerationStructureModeKHR value) const { switch (value) { case VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR: case VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR: @@ -1583,7 +1569,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCopyAccelerationStructureMode } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMemoryRequirementsTypeNV value) const { +ValidValue stateless::Context::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 +1581,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMemoryRe } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkMemoryOverallocationBehaviorAMD value) const { +ValidValue stateless::Context::IsValidEnumValue(VkMemoryOverallocationBehaviorAMD value) const { switch (value) { case VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD: case VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD: @@ -1607,7 +1593,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkMemoryOverallocationBehaviorA } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceConfigurationTypeINTEL value) const { +ValidValue stateless::Context::IsValidEnumValue(VkPerformanceConfigurationTypeINTEL value) const { switch (value) { case VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL: return ValidValue::Valid; @@ -1617,7 +1603,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceConfigurationTypeI } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueryPoolSamplingModeINTEL value) const { +ValidValue stateless::Context::IsValidEnumValue(VkQueryPoolSamplingModeINTEL value) const { switch (value) { case VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL: return ValidValue::Valid; @@ -1627,7 +1613,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkQueryPoolSamplingModeINTEL va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceOverrideTypeINTEL value) const { +ValidValue stateless::Context::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 +1624,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceOverrideTypeINTEL } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceParameterTypeINTEL value) const { +ValidValue stateless::Context::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 +1635,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceParameterTypeINTEL } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureEnableEXT value) const { +ValidValue stateless::Context::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 +1649,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureEnableEXT va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureDisableEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkValidationFeatureDisableEXT value) const { switch (value) { case VK_VALIDATION_FEATURE_DISABLE_ALL_EXT: case VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT: @@ -1680,7 +1666,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureDisableEXT v } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoverageReductionModeNV value) const { +ValidValue stateless::Context::IsValidEnumValue(VkCoverageReductionModeNV value) const { switch (value) { case VK_COVERAGE_REDUCTION_MODE_MERGE_NV: case VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV: @@ -1691,7 +1677,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCoverageReductionModeNV value } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkProvokingVertexModeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkProvokingVertexModeEXT value) const { switch (value) { case VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT: case VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT: @@ -1703,7 +1689,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkProvokingVertexModeEXT value) #ifdef VK_USE_PLATFORM_WIN32_KHR template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFullScreenExclusiveEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkFullScreenExclusiveEXT value) const { switch (value) { case VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT: case VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT: @@ -1717,7 +1703,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFullScreenExclusiveEXT value) #endif // VK_USE_PLATFORM_WIN32_KHR template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeNV value) const { +ValidValue stateless::Context::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 +1715,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(extensions.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(extensions.vk_nv_device_generated_commands_compute) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDepthBiasRepresentationEXT value) const { +ValidValue stateless::Context::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 +1737,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDepthBiasRepresentationEXT va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateTypeNV value) const { +ValidValue stateless::Context::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 +1748,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateTypeNV val } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateNV value) const { +ValidValue stateless::Context::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 +1769,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateNV value) } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMotionInstanceTypeNV value) const { +ValidValue stateless::Context::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 +1781,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMotionIn } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultAddressTypeEXT value) const { +ValidValue stateless::Context::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 +1797,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultAddressTypeEXT val } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { switch (value) { case VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT: return ValidValue::Valid; @@ -1822,7 +1807,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultVendorBinaryHeader } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceAddressBindingTypeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDeviceAddressBindingTypeEXT value) const { switch (value) { case VK_DEVICE_ADDRESS_BINDING_TYPE_BIND_EXT: case VK_DEVICE_ADDRESS_BINDING_TYPE_UNBIND_EXT: @@ -1833,19 +1818,19 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDeviceAddressBindingTypeEXT v } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkMicromapTypeEXT value) const { +ValidValue stateless::Context::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(extensions.vk_nv_displacement_micromap) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBuildMicromapModeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkBuildMicromapModeEXT value) const { switch (value) { case VK_BUILD_MICROMAP_MODE_BUILD_EXT: return ValidValue::Valid; @@ -1855,7 +1840,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBuildMicromapModeEXT value) c } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCopyMicromapModeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkCopyMicromapModeEXT value) const { switch (value) { case VK_COPY_MICROMAP_MODE_CLONE_EXT: case VK_COPY_MICROMAP_MODE_SERIALIZE_EXT: @@ -1868,7 +1853,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCopyMicromapModeEXT value) co } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureCompatibilityKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkAccelerationStructureCompatibilityKHR value) const { switch (value) { case VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR: case VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR: @@ -1879,7 +1864,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureCompatib } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureBuildTypeKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkAccelerationStructureBuildTypeKHR value) const { switch (value) { case VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR: case VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR: @@ -1891,7 +1876,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureBuildTyp } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG value) const { +ValidValue stateless::Context::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG value) const { switch (value) { case VK_DIRECT_DRIVER_LOADING_MODE_EXCLUSIVE_LUNARG: case VK_DIRECT_DRIVER_LOADING_MODE_INCLUSIVE_LUNARG: @@ -1902,7 +1887,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV value) const { +ValidValue stateless::Context::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV value) const { switch (value) { case VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV: case VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV: @@ -1915,7 +1900,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowSessionBindingPointNV value) const { +ValidValue stateless::Context::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 +1918,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowSessionBindingPoin } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagModeAMD value) const { +ValidValue stateless::Context::IsValidEnumValue(VkAntiLagModeAMD value) const { switch (value) { case VK_ANTI_LAG_MODE_DRIVER_CONTROL_AMD: case VK_ANTI_LAG_MODE_ON_AMD: @@ -1945,7 +1930,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagModeAMD value) const { } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagStageAMD value) const { +ValidValue stateless::Context::IsValidEnumValue(VkAntiLagStageAMD value) const { switch (value) { case VK_ANTI_LAG_STAGE_INPUT_AMD: case VK_ANTI_LAG_STAGE_PRESENT_AMD: @@ -1956,7 +1941,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagStageAMD value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderCodeTypeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkShaderCodeTypeEXT value) const { switch (value) { case VK_SHADER_CODE_TYPE_BINARY_EXT: case VK_SHADER_CODE_TYPE_SPIRV_EXT: @@ -1967,7 +1952,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkShaderCodeTypeEXT value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDepthClampModeEXT value) const { +ValidValue stateless::Context::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 +1963,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDepthClampModeEXT value) cons } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLayerSettingTypeEXT value) const { +ValidValue stateless::Context::IsValidEnumValue(VkLayerSettingTypeEXT value) const { switch (value) { case VK_LAYER_SETTING_TYPE_BOOL32_EXT: case VK_LAYER_SETTING_TYPE_INT32_EXT: @@ -1995,7 +1980,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkLayerSettingTypeEXT value) co } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLatencyMarkerNV value) const { +ValidValue stateless::Context::IsValidEnumValue(VkLatencyMarkerNV value) const { switch (value) { case VK_LATENCY_MARKER_SIMULATION_START_NV: case VK_LATENCY_MARKER_SIMULATION_END_NV: @@ -2016,7 +2001,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkLatencyMarkerNV value) const } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOutOfBandQueueTypeNV value) const { +ValidValue stateless::Context::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 +2012,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkOutOfBandQueueTypeNV value) c } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlockMatchWindowCompareModeQCOM value) const { +ValidValue stateless::Context::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 +2023,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBlockMatchWindowCompareModeQC } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCubicFilterWeightsQCOM value) const { +ValidValue stateless::Context::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 +2036,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkCubicFilterWeightsQCOM value) } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV value) const { +ValidValue stateless::Context::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 +2049,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV va } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectExecutionSetInfoTypeEXT value) const { +ValidValue stateless::Context::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 +2060,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkIndirectExecutionSetInfoTypeE } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeEXT value) const { +ValidValue stateless::Context::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 +2075,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(extensions.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(extensions.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(extensions.vk_khr_ray_tracing_maintenance1) ? ValidValue::Valid : ValidValue::NoExtension; default: return ValidValue::NotFound; }; } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBuildAccelerationStructureModeKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkBuildAccelerationStructureModeKHR value) const { switch (value) { case VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR: case VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR: @@ -2113,7 +2098,7 @@ ValidValue StatelessValidation::IsValidEnumValue(VkBuildAccelerationStructureMod } template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderGroupShaderKHR value) const { +ValidValue stateless::Context::IsValidEnumValue(VkShaderGroupShaderKHR value) const { switch (value) { case VK_SHADER_GROUP_SHADER_GENERAL_KHR: case VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR: @@ -2126,16 +2111,16 @@ ValidValue StatelessValidation::IsValidEnumValue(VkShaderGroupShaderKHR value) c } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineCacheHeaderVersion value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPipelineCacheHeaderVersion value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPipelineCacheHeaderVersion value) const { +const char* stateless::Context::DescribeEnum(VkPipelineCacheHeaderVersion value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageLayout value) const { +vvl::Extensions stateless::Context::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 +2160,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageLayout value) cons }; } template <> -const char* StatelessValidation::DescribeEnum(VkImageLayout value) const { +const char* stateless::Context::DescribeEnum(VkImageLayout value) const { return string_VkImageLayout(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkObjectType value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkObjectType value) const { switch (value) { case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION: return {vvl::Extension::_VK_KHR_sampler_ycbcr_conversion}; @@ -2238,12 +2223,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkObjectType value) const }; } template <> -const char* StatelessValidation::DescribeEnum(VkObjectType value) const { +const char* stateless::Context::DescribeEnum(VkObjectType value) const { return string_VkObjectType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFormat value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkFormat value) const { switch (value) { case VK_FORMAT_G8B8G8R8_422_UNORM: case VK_FORMAT_B8G8R8G8_422_UNORM: @@ -2322,12 +2307,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkFormat value) const { }; } template <> -const char* StatelessValidation::DescribeEnum(VkFormat value) const { +const char* stateless::Context::DescribeEnum(VkFormat value) const { return string_VkFormat(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageTiling value) const { +vvl::Extensions stateless::Context::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 +2321,21 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageTiling value) cons }; } template <> -const char* StatelessValidation::DescribeEnum(VkImageTiling value) const { +const char* stateless::Context::DescribeEnum(VkImageTiling value) const { return string_VkImageTiling(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageType value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkImageType value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkImageType value) const { +const char* stateless::Context::DescribeEnum(VkImageType value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkQueryType value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkQueryType value) const { switch (value) { case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR: return {vvl::Extension::_VK_KHR_video_queue}; @@ -2382,48 +2367,48 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkQueryType value) const }; } template <> -const char* StatelessValidation::DescribeEnum(VkQueryType value) const { +const char* stateless::Context::DescribeEnum(VkQueryType value) const { return string_VkQueryType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSharingMode value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkSharingMode value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSharingMode value) const { +const char* stateless::Context::DescribeEnum(VkSharingMode value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkComponentSwizzle value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkComponentSwizzle value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkComponentSwizzle value) const { +const char* stateless::Context::DescribeEnum(VkComponentSwizzle value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkImageViewType value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkImageViewType value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkImageViewType value) const { +const char* stateless::Context::DescribeEnum(VkImageViewType value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlendFactor value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkBlendFactor value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBlendFactor value) const { +const char* stateless::Context::DescribeEnum(VkBlendFactor value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlendOp value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkBlendOp value) const { switch (value) { case VK_BLEND_OP_ZERO_EXT: case VK_BLEND_OP_SRC_EXT: @@ -2477,21 +2462,21 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlendOp value) const { }; } template <> -const char* StatelessValidation::DescribeEnum(VkBlendOp value) const { +const char* stateless::Context::DescribeEnum(VkBlendOp value) const { return string_VkBlendOp(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCompareOp value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkCompareOp value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCompareOp value) const { +const char* stateless::Context::DescribeEnum(VkCompareOp value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDynamicState value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDynamicState value) const { switch (value) { case VK_DYNAMIC_STATE_CULL_MODE: case VK_DYNAMIC_STATE_FRONT_FACE: @@ -2577,39 +2562,39 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkDynamicState value) con }; } template <> -const char* StatelessValidation::DescribeEnum(VkDynamicState value) const { +const char* stateless::Context::DescribeEnum(VkDynamicState value) const { return string_VkDynamicState(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFrontFace value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkFrontFace value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFrontFace value) const { +const char* stateless::Context::DescribeEnum(VkFrontFace value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkVertexInputRate value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkVertexInputRate value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkVertexInputRate value) const { +const char* stateless::Context::DescribeEnum(VkVertexInputRate value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPrimitiveTopology value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPrimitiveTopology value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPrimitiveTopology value) const { +const char* stateless::Context::DescribeEnum(VkPrimitiveTopology value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPolygonMode value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPolygonMode value) const { switch (value) { case VK_POLYGON_MODE_FILL_RECTANGLE_NV: return {vvl::Extension::_VK_NV_fill_rectangle}; @@ -2618,30 +2603,30 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkPolygonMode value) cons }; } template <> -const char* StatelessValidation::DescribeEnum(VkPolygonMode value) const { +const char* stateless::Context::DescribeEnum(VkPolygonMode value) const { return string_VkPolygonMode(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkStencilOp value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkStencilOp value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkStencilOp value) const { +const char* stateless::Context::DescribeEnum(VkStencilOp value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkLogicOp value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkLogicOp value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkLogicOp value) const { +const char* stateless::Context::DescribeEnum(VkLogicOp value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBorderColor value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkBorderColor value) const { switch (value) { case VK_BORDER_COLOR_FLOAT_CUSTOM_EXT: case VK_BORDER_COLOR_INT_CUSTOM_EXT: @@ -2651,12 +2636,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkBorderColor value) cons }; } template <> -const char* StatelessValidation::DescribeEnum(VkBorderColor value) const { +const char* stateless::Context::DescribeEnum(VkBorderColor value) const { return string_VkBorderColor(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFilter value) const { +vvl::Extensions stateless::Context::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 +2650,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkFilter value) const { }; } template <> -const char* StatelessValidation::DescribeEnum(VkFilter value) const { +const char* stateless::Context::DescribeEnum(VkFilter value) const { return string_VkFilter(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerAddressMode value) const { +vvl::Extensions stateless::Context::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 +2664,21 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerAddressMode valu }; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerAddressMode value) const { +const char* stateless::Context::DescribeEnum(VkSamplerAddressMode value) const { return string_VkSamplerAddressMode(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerMipmapMode value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkSamplerMipmapMode value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerMipmapMode value) const { +const char* stateless::Context::DescribeEnum(VkSamplerMipmapMode value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDescriptorType value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDescriptorType value) const { switch (value) { case VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK: return {vvl::Extension::_VK_EXT_inline_uniform_block}; @@ -2711,12 +2696,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkDescriptorType value) c }; } template <> -const char* StatelessValidation::DescribeEnum(VkDescriptorType value) const { +const char* stateless::Context::DescribeEnum(VkDescriptorType value) const { return string_VkDescriptorType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAttachmentLoadOp value) const { +vvl::Extensions stateless::Context::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 +2710,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkAttachmentLoadOp value) }; } template <> -const char* StatelessValidation::DescribeEnum(VkAttachmentLoadOp value) const { +const char* stateless::Context::DescribeEnum(VkAttachmentLoadOp value) const { return string_VkAttachmentLoadOp(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAttachmentStoreOp value) const { +vvl::Extensions stateless::Context::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 +2725,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkAttachmentStoreOp value }; } template <> -const char* StatelessValidation::DescribeEnum(VkAttachmentStoreOp value) const { +const char* stateless::Context::DescribeEnum(VkAttachmentStoreOp value) const { return string_VkAttachmentStoreOp(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineBindPoint value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPipelineBindPoint value) const { switch (value) { case VK_PIPELINE_BIND_POINT_EXECUTION_GRAPH_AMDX: return {vvl::Extension::_VK_AMDX_shader_enqueue}; @@ -2758,21 +2743,21 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineBindPoint value }; } template <> -const char* StatelessValidation::DescribeEnum(VkPipelineBindPoint value) const { +const char* stateless::Context::DescribeEnum(VkPipelineBindPoint value) const { return string_VkPipelineBindPoint(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCommandBufferLevel value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkCommandBufferLevel value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCommandBufferLevel value) const { +const char* stateless::Context::DescribeEnum(VkCommandBufferLevel value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndexType value) const { +vvl::Extensions stateless::Context::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 +2768,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndexType value) const }; } template <> -const char* StatelessValidation::DescribeEnum(VkIndexType value) const { +const char* stateless::Context::DescribeEnum(VkIndexType value) const { return string_VkIndexType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSubpassContents value) const { +vvl::Extensions stateless::Context::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 +2782,48 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkSubpassContents value) }; } template <> -const char* StatelessValidation::DescribeEnum(VkSubpassContents value) const { +const char* stateless::Context::DescribeEnum(VkSubpassContents value) const { return string_VkSubpassContents(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkTessellationDomainOrigin value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkTessellationDomainOrigin value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkTessellationDomainOrigin value) const { +const char* stateless::Context::DescribeEnum(VkTessellationDomainOrigin value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerYcbcrModelConversion value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkSamplerYcbcrModelConversion value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerYcbcrModelConversion value) const { +const char* stateless::Context::DescribeEnum(VkSamplerYcbcrModelConversion value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerYcbcrRange value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkSamplerYcbcrRange value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerYcbcrRange value) const { +const char* stateless::Context::DescribeEnum(VkSamplerYcbcrRange value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkChromaLocation value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkChromaLocation value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkChromaLocation value) const { +const char* stateless::Context::DescribeEnum(VkChromaLocation value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDescriptorUpdateTemplateType value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDescriptorUpdateTemplateType value) const { switch (value) { case VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS: return {vvl::Extension::_VK_KHR_push_descriptor}; @@ -2847,12 +2832,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkDescriptorUpdateTemplat }; } template <> -const char* StatelessValidation::DescribeEnum(VkDescriptorUpdateTemplateType value) const { +const char* stateless::Context::DescribeEnum(VkDescriptorUpdateTemplateType value) const { return string_VkDescriptorUpdateTemplateType(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerReductionMode value) const { +vvl::Extensions stateless::Context::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 +2846,57 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkSamplerReductionMode va }; } template <> -const char* StatelessValidation::DescribeEnum(VkSamplerReductionMode value) const { +const char* stateless::Context::DescribeEnum(VkSamplerReductionMode value) const { return string_VkSamplerReductionMode(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkSemaphoreType value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkSemaphoreType value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkSemaphoreType value) const { +const char* stateless::Context::DescribeEnum(VkSemaphoreType value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineRobustnessBufferBehavior value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPipelineRobustnessBufferBehavior value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPipelineRobustnessBufferBehavior value) const { +const char* stateless::Context::DescribeEnum(VkPipelineRobustnessBufferBehavior value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPipelineRobustnessImageBehavior value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPipelineRobustnessImageBehavior value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPipelineRobustnessImageBehavior value) const { +const char* stateless::Context::DescribeEnum(VkPipelineRobustnessImageBehavior value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkQueueGlobalPriority value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkQueueGlobalPriority value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkQueueGlobalPriority value) const { +const char* stateless::Context::DescribeEnum(VkQueueGlobalPriority value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkLineRasterizationMode value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkLineRasterizationMode value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkLineRasterizationMode value) const { +const char* stateless::Context::DescribeEnum(VkLineRasterizationMode value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPresentModeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPresentModeKHR value) const { switch (value) { case VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR: case VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR: @@ -2923,12 +2908,12 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkPresentModeKHR value) c }; } template <> -const char* StatelessValidation::DescribeEnum(VkPresentModeKHR value) const { +const char* stateless::Context::DescribeEnum(VkPresentModeKHR value) const { return string_VkPresentModeKHR(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkColorSpaceKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkColorSpaceKHR value) const { switch (value) { case VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT: case VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT: @@ -2952,57 +2937,57 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkColorSpaceKHR value) co }; } template <> -const char* StatelessValidation::DescribeEnum(VkColorSpaceKHR value) const { +const char* stateless::Context::DescribeEnum(VkColorSpaceKHR value) const { return string_VkColorSpaceKHR(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFragmentShadingRateCombinerOpKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkFragmentShadingRateCombinerOpKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFragmentShadingRateCombinerOpKHR value) const { +const char* stateless::Context::DescribeEnum(VkFragmentShadingRateCombinerOpKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkVideoEncodeTuningModeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkVideoEncodeTuningModeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkVideoEncodeTuningModeKHR value) const { +const char* stateless::Context::DescribeEnum(VkVideoEncodeTuningModeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkVideoEncodeAV1PredictionModeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkVideoEncodeAV1PredictionModeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkVideoEncodeAV1PredictionModeKHR value) const { +const char* stateless::Context::DescribeEnum(VkVideoEncodeAV1PredictionModeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkVideoEncodeAV1RateControlGroupKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkVideoEncodeAV1RateControlGroupKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkVideoEncodeAV1RateControlGroupKHR value) const { +const char* stateless::Context::DescribeEnum(VkVideoEncodeAV1RateControlGroupKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkTimeDomainKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkTimeDomainKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkTimeDomainKHR value) const { +const char* stateless::Context::DescribeEnum(VkTimeDomainKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDebugReportObjectTypeEXT value) const { +vvl::Extensions stateless::Context::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 +3010,266 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkDebugReportObjectTypeEX }; } template <> -const char* StatelessValidation::DescribeEnum(VkDebugReportObjectTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkDebugReportObjectTypeEXT value) const { return string_VkDebugReportObjectTypeEXT(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkRasterizationOrderAMD value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkRasterizationOrderAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkRasterizationOrderAMD value) const { +const char* stateless::Context::DescribeEnum(VkRasterizationOrderAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkShaderInfoTypeAMD value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkShaderInfoTypeAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkShaderInfoTypeAMD value) const { +const char* stateless::Context::DescribeEnum(VkShaderInfoTypeAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkValidationCheckEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkValidationCheckEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkValidationCheckEXT value) const { +const char* stateless::Context::DescribeEnum(VkValidationCheckEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDisplayPowerStateEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDisplayPowerStateEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDisplayPowerStateEXT value) const { +const char* stateless::Context::DescribeEnum(VkDisplayPowerStateEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDeviceEventTypeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDeviceEventTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDeviceEventTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkDeviceEventTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDisplayEventTypeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDisplayEventTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDisplayEventTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkDisplayEventTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkViewportCoordinateSwizzleNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkViewportCoordinateSwizzleNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkViewportCoordinateSwizzleNV value) const { +const char* stateless::Context::DescribeEnum(VkViewportCoordinateSwizzleNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDiscardRectangleModeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDiscardRectangleModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDiscardRectangleModeEXT value) const { +const char* stateless::Context::DescribeEnum(VkDiscardRectangleModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkConservativeRasterizationModeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkConservativeRasterizationModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkConservativeRasterizationModeEXT value) const { +const char* stateless::Context::DescribeEnum(VkConservativeRasterizationModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlendOverlapEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkBlendOverlapEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBlendOverlapEXT value) const { +const char* stateless::Context::DescribeEnum(VkBlendOverlapEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCoverageModulationModeNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkCoverageModulationModeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCoverageModulationModeNV value) const { +const char* stateless::Context::DescribeEnum(VkCoverageModulationModeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkShadingRatePaletteEntryNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkShadingRatePaletteEntryNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkShadingRatePaletteEntryNV value) const { +const char* stateless::Context::DescribeEnum(VkShadingRatePaletteEntryNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCoarseSampleOrderTypeNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkCoarseSampleOrderTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCoarseSampleOrderTypeNV value) const { +const char* stateless::Context::DescribeEnum(VkCoarseSampleOrderTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkRayTracingShaderGroupTypeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkRayTracingShaderGroupTypeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkRayTracingShaderGroupTypeKHR value) const { +const char* stateless::Context::DescribeEnum(VkRayTracingShaderGroupTypeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkGeometryTypeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkGeometryTypeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkGeometryTypeKHR value) const { +const char* stateless::Context::DescribeEnum(VkGeometryTypeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureTypeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkAccelerationStructureTypeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureTypeKHR value) const { +const char* stateless::Context::DescribeEnum(VkAccelerationStructureTypeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCopyAccelerationStructureModeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkCopyAccelerationStructureModeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCopyAccelerationStructureModeKHR value) const { +const char* stateless::Context::DescribeEnum(VkCopyAccelerationStructureModeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureMemoryRequirementsTypeNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkAccelerationStructureMemoryRequirementsTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureMemoryRequirementsTypeNV value) const { +const char* stateless::Context::DescribeEnum(VkAccelerationStructureMemoryRequirementsTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkMemoryOverallocationBehaviorAMD value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkMemoryOverallocationBehaviorAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkMemoryOverallocationBehaviorAMD value) const { +const char* stateless::Context::DescribeEnum(VkMemoryOverallocationBehaviorAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPerformanceConfigurationTypeINTEL value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPerformanceConfigurationTypeINTEL value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPerformanceConfigurationTypeINTEL value) const { +const char* stateless::Context::DescribeEnum(VkPerformanceConfigurationTypeINTEL value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkQueryPoolSamplingModeINTEL value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkQueryPoolSamplingModeINTEL value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkQueryPoolSamplingModeINTEL value) const { +const char* stateless::Context::DescribeEnum(VkQueryPoolSamplingModeINTEL value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPerformanceOverrideTypeINTEL value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPerformanceOverrideTypeINTEL value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPerformanceOverrideTypeINTEL value) const { +const char* stateless::Context::DescribeEnum(VkPerformanceOverrideTypeINTEL value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkPerformanceParameterTypeINTEL value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkPerformanceParameterTypeINTEL value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkPerformanceParameterTypeINTEL value) const { +const char* stateless::Context::DescribeEnum(VkPerformanceParameterTypeINTEL value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkValidationFeatureEnableEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkValidationFeatureEnableEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkValidationFeatureEnableEXT value) const { +const char* stateless::Context::DescribeEnum(VkValidationFeatureEnableEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkValidationFeatureDisableEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkValidationFeatureDisableEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkValidationFeatureDisableEXT value) const { +const char* stateless::Context::DescribeEnum(VkValidationFeatureDisableEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCoverageReductionModeNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkCoverageReductionModeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCoverageReductionModeNV value) const { +const char* stateless::Context::DescribeEnum(VkCoverageReductionModeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkProvokingVertexModeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkProvokingVertexModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkProvokingVertexModeEXT value) const { +const char* stateless::Context::DescribeEnum(VkProvokingVertexModeEXT value) const { return nullptr; } #ifdef VK_USE_PLATFORM_WIN32_KHR template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFullScreenExclusiveEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkFullScreenExclusiveEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFullScreenExclusiveEXT value) const { +const char* stateless::Context::DescribeEnum(VkFullScreenExclusiveEXT value) const { return nullptr; } #endif // VK_USE_PLATFORM_WIN32_KHR template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectCommandsTokenTypeNV value) const { +vvl::Extensions stateless::Context::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 +3281,75 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectCommandsTokenTy }; } template <> -const char* StatelessValidation::DescribeEnum(VkIndirectCommandsTokenTypeNV value) const { +const char* stateless::Context::DescribeEnum(VkIndirectCommandsTokenTypeNV value) const { return string_VkIndirectCommandsTokenTypeNV(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDepthBiasRepresentationEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDepthBiasRepresentationEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDepthBiasRepresentationEXT value) const { +const char* stateless::Context::DescribeEnum(VkDepthBiasRepresentationEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFragmentShadingRateTypeNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkFragmentShadingRateTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFragmentShadingRateTypeNV value) const { +const char* stateless::Context::DescribeEnum(VkFragmentShadingRateTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkFragmentShadingRateNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkFragmentShadingRateNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkFragmentShadingRateNV value) const { +const char* stateless::Context::DescribeEnum(VkFragmentShadingRateNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureMotionInstanceTypeNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkAccelerationStructureMotionInstanceTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureMotionInstanceTypeNV value) const { +const char* stateless::Context::DescribeEnum(VkAccelerationStructureMotionInstanceTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDeviceFaultAddressTypeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDeviceFaultAddressTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDeviceFaultAddressTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkDeviceFaultAddressTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { +const char* stateless::Context::DescribeEnum(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDeviceAddressBindingTypeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDeviceAddressBindingTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDeviceAddressBindingTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkDeviceAddressBindingTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkMicromapTypeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkMicromapTypeEXT value) const { switch (value) { case VK_MICROMAP_TYPE_DISPLACEMENT_MICROMAP_NV: return {vvl::Extension::_VK_NV_displacement_micromap}; @@ -3373,174 +3358,174 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkMicromapTypeEXT value) }; } template <> -const char* StatelessValidation::DescribeEnum(VkMicromapTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkMicromapTypeEXT value) const { return string_VkMicromapTypeEXT(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBuildMicromapModeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkBuildMicromapModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBuildMicromapModeEXT value) const { +const char* stateless::Context::DescribeEnum(VkBuildMicromapModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCopyMicromapModeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkCopyMicromapModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCopyMicromapModeEXT value) const { +const char* stateless::Context::DescribeEnum(VkCopyMicromapModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureCompatibilityKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkAccelerationStructureCompatibilityKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureCompatibilityKHR value) const { +const char* stateless::Context::DescribeEnum(VkAccelerationStructureCompatibilityKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAccelerationStructureBuildTypeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkAccelerationStructureBuildTypeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAccelerationStructureBuildTypeKHR value) const { +const char* stateless::Context::DescribeEnum(VkAccelerationStructureBuildTypeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDirectDriverLoadingModeLUNARG value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDirectDriverLoadingModeLUNARG value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDirectDriverLoadingModeLUNARG value) const { +const char* stateless::Context::DescribeEnum(VkDirectDriverLoadingModeLUNARG value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkOpticalFlowPerformanceLevelNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkOpticalFlowPerformanceLevelNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkOpticalFlowPerformanceLevelNV value) const { +const char* stateless::Context::DescribeEnum(VkOpticalFlowPerformanceLevelNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkOpticalFlowSessionBindingPointNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkOpticalFlowSessionBindingPointNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkOpticalFlowSessionBindingPointNV value) const { +const char* stateless::Context::DescribeEnum(VkOpticalFlowSessionBindingPointNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAntiLagModeAMD value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkAntiLagModeAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAntiLagModeAMD value) const { +const char* stateless::Context::DescribeEnum(VkAntiLagModeAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkAntiLagStageAMD value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkAntiLagStageAMD value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkAntiLagStageAMD value) const { +const char* stateless::Context::DescribeEnum(VkAntiLagStageAMD value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkShaderCodeTypeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkShaderCodeTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkShaderCodeTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkShaderCodeTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDepthClampModeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDepthClampModeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDepthClampModeEXT value) const { +const char* stateless::Context::DescribeEnum(VkDepthClampModeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkLayerSettingTypeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkLayerSettingTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkLayerSettingTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkLayerSettingTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkLatencyMarkerNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkLatencyMarkerNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkLatencyMarkerNV value) const { +const char* stateless::Context::DescribeEnum(VkLatencyMarkerNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkOutOfBandQueueTypeNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkOutOfBandQueueTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkOutOfBandQueueTypeNV value) const { +const char* stateless::Context::DescribeEnum(VkOutOfBandQueueTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBlockMatchWindowCompareModeQCOM value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkBlockMatchWindowCompareModeQCOM value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBlockMatchWindowCompareModeQCOM value) const { +const char* stateless::Context::DescribeEnum(VkBlockMatchWindowCompareModeQCOM value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkCubicFilterWeightsQCOM value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkCubicFilterWeightsQCOM value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkCubicFilterWeightsQCOM value) const { +const char* stateless::Context::DescribeEnum(VkCubicFilterWeightsQCOM value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkDisplaySurfaceStereoTypeNV value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkDisplaySurfaceStereoTypeNV value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkDisplaySurfaceStereoTypeNV value) const { +const char* stateless::Context::DescribeEnum(VkDisplaySurfaceStereoTypeNV value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectExecutionSetInfoTypeEXT value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkIndirectExecutionSetInfoTypeEXT value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkIndirectExecutionSetInfoTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkIndirectExecutionSetInfoTypeEXT value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectCommandsTokenTypeEXT value) const { +vvl::Extensions stateless::Context::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 +3540,25 @@ vvl::Extensions StatelessValidation::GetEnumExtensions(VkIndirectCommandsTokenTy }; } template <> -const char* StatelessValidation::DescribeEnum(VkIndirectCommandsTokenTypeEXT value) const { +const char* stateless::Context::DescribeEnum(VkIndirectCommandsTokenTypeEXT value) const { return string_VkIndirectCommandsTokenTypeEXT(value); } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkBuildAccelerationStructureModeKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkBuildAccelerationStructureModeKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkBuildAccelerationStructureModeKHR value) const { +const char* stateless::Context::DescribeEnum(VkBuildAccelerationStructureModeKHR value) const { return nullptr; } template <> -vvl::Extensions StatelessValidation::GetEnumExtensions(VkShaderGroupShaderKHR value) const { +vvl::Extensions stateless::Context::GetEnumExtensions(VkShaderGroupShaderKHR value) const { return {}; } template <> -const char* StatelessValidation::DescribeEnum(VkShaderGroupShaderKHR value) const { +const char* stateless::Context::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..060d58f08fe 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 stateless::Context::IsValidEnumValue(VkPipelineCacheHeaderVersion value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageLayout value) const; +ValidValue stateless::Context::IsValidEnumValue(VkImageLayout value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkObjectType value) const; +ValidValue stateless::Context::IsValidEnumValue(VkObjectType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFormat value) const; +ValidValue stateless::Context::IsValidEnumValue(VkFormat value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageTiling value) const; +ValidValue stateless::Context::IsValidEnumValue(VkImageTiling value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageType value) const; +ValidValue stateless::Context::IsValidEnumValue(VkImageType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueryType value) const; +ValidValue stateless::Context::IsValidEnumValue(VkQueryType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSharingMode value) const; +ValidValue stateless::Context::IsValidEnumValue(VkSharingMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkComponentSwizzle value) const; +ValidValue stateless::Context::IsValidEnumValue(VkComponentSwizzle value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkImageViewType value) const; +ValidValue stateless::Context::IsValidEnumValue(VkImageViewType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendFactor value) const; +ValidValue stateless::Context::IsValidEnumValue(VkBlendFactor value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendOp value) const; +ValidValue stateless::Context::IsValidEnumValue(VkBlendOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCompareOp value) const; +ValidValue stateless::Context::IsValidEnumValue(VkCompareOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDynamicState value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDynamicState value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFrontFace value) const; +ValidValue stateless::Context::IsValidEnumValue(VkFrontFace value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVertexInputRate value) const; +ValidValue stateless::Context::IsValidEnumValue(VkVertexInputRate value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPrimitiveTopology value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPrimitiveTopology value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPolygonMode value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPolygonMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkStencilOp value) const; +ValidValue stateless::Context::IsValidEnumValue(VkStencilOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLogicOp value) const; +ValidValue stateless::Context::IsValidEnumValue(VkLogicOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBorderColor value) const; +ValidValue stateless::Context::IsValidEnumValue(VkBorderColor value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFilter value) const; +ValidValue stateless::Context::IsValidEnumValue(VkFilter value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerAddressMode value) const; +ValidValue stateless::Context::IsValidEnumValue(VkSamplerAddressMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerMipmapMode value) const; +ValidValue stateless::Context::IsValidEnumValue(VkSamplerMipmapMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorType value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDescriptorType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentLoadOp value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAttachmentLoadOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAttachmentStoreOp value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAttachmentStoreOp value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineBindPoint value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPipelineBindPoint value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCommandBufferLevel value) const; +ValidValue stateless::Context::IsValidEnumValue(VkCommandBufferLevel value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndexType value) const; +ValidValue stateless::Context::IsValidEnumValue(VkIndexType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSubpassContents value) const; +ValidValue stateless::Context::IsValidEnumValue(VkSubpassContents value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkTessellationDomainOrigin value) const; +ValidValue stateless::Context::IsValidEnumValue(VkTessellationDomainOrigin value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrModelConversion value) const; +ValidValue stateless::Context::IsValidEnumValue(VkSamplerYcbcrModelConversion value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerYcbcrRange value) const; +ValidValue stateless::Context::IsValidEnumValue(VkSamplerYcbcrRange value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkChromaLocation value) const; +ValidValue stateless::Context::IsValidEnumValue(VkChromaLocation value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDescriptorUpdateTemplateType value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDescriptorUpdateTemplateType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSamplerReductionMode value) const; +ValidValue stateless::Context::IsValidEnumValue(VkSamplerReductionMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkSemaphoreType value) const; +ValidValue stateless::Context::IsValidEnumValue(VkSemaphoreType value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessBufferBehavior value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPipelineRobustnessBufferBehavior value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPipelineRobustnessImageBehavior value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPipelineRobustnessImageBehavior value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueueGlobalPriority value) const; +ValidValue stateless::Context::IsValidEnumValue(VkQueueGlobalPriority value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLineRasterizationMode value) const; +ValidValue stateless::Context::IsValidEnumValue(VkLineRasterizationMode value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPresentModeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPresentModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkColorSpaceKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkColorSpaceKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateCombinerOpKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkFragmentShadingRateCombinerOpKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeTuningModeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkVideoEncodeTuningModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1PredictionModeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkVideoEncodeAV1PredictionModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkVideoEncodeAV1RateControlGroupKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkVideoEncodeAV1RateControlGroupKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkTimeDomainKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkTimeDomainKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDebugReportObjectTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDebugReportObjectTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkRasterizationOrderAMD value) const; +ValidValue stateless::Context::IsValidEnumValue(VkRasterizationOrderAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderInfoTypeAMD value) const; +ValidValue stateless::Context::IsValidEnumValue(VkShaderInfoTypeAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationCheckEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkValidationCheckEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplayPowerStateEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDisplayPowerStateEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceEventTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDeviceEventTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplayEventTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDisplayEventTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkViewportCoordinateSwizzleNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkViewportCoordinateSwizzleNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDiscardRectangleModeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDiscardRectangleModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkConservativeRasterizationModeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkConservativeRasterizationModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlendOverlapEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkBlendOverlapEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoverageModulationModeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkCoverageModulationModeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShadingRatePaletteEntryNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkShadingRatePaletteEntryNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoarseSampleOrderTypeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkCoarseSampleOrderTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkRayTracingShaderGroupTypeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkGeometryTypeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkGeometryTypeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureTypeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAccelerationStructureTypeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCopyAccelerationStructureModeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkCopyAccelerationStructureModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMemoryRequirementsTypeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAccelerationStructureMemoryRequirementsTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkMemoryOverallocationBehaviorAMD value) const; +ValidValue stateless::Context::IsValidEnumValue(VkMemoryOverallocationBehaviorAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceConfigurationTypeINTEL value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPerformanceConfigurationTypeINTEL value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkQueryPoolSamplingModeINTEL value) const; +ValidValue stateless::Context::IsValidEnumValue(VkQueryPoolSamplingModeINTEL value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceOverrideTypeINTEL value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPerformanceOverrideTypeINTEL value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkPerformanceParameterTypeINTEL value) const; +ValidValue stateless::Context::IsValidEnumValue(VkPerformanceParameterTypeINTEL value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureEnableEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkValidationFeatureEnableEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkValidationFeatureDisableEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkValidationFeatureDisableEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCoverageReductionModeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkCoverageReductionModeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkProvokingVertexModeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkProvokingVertexModeEXT value) const; #ifdef VK_USE_PLATFORM_WIN32_KHR template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFullScreenExclusiveEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkFullScreenExclusiveEXT value) const; #endif // VK_USE_PLATFORM_WIN32_KHR template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkIndirectCommandsTokenTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDepthBiasRepresentationEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDepthBiasRepresentationEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateTypeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkFragmentShadingRateTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkFragmentShadingRateNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkFragmentShadingRateNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureMotionInstanceTypeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAccelerationStructureMotionInstanceTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultAddressTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDeviceFaultAddressTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDeviceFaultVendorBinaryHeaderVersionEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDeviceAddressBindingTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDeviceAddressBindingTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkMicromapTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkMicromapTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBuildMicromapModeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkBuildMicromapModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCopyMicromapModeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkCopyMicromapModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureCompatibilityKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAccelerationStructureCompatibilityKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAccelerationStructureBuildTypeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAccelerationStructureBuildTypeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDirectDriverLoadingModeLUNARG value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkOpticalFlowPerformanceLevelNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOpticalFlowSessionBindingPointNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkOpticalFlowSessionBindingPointNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagModeAMD value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAntiLagModeAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkAntiLagStageAMD value) const; +ValidValue stateless::Context::IsValidEnumValue(VkAntiLagStageAMD value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderCodeTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkShaderCodeTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDepthClampModeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDepthClampModeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLayerSettingTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkLayerSettingTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkLatencyMarkerNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkLatencyMarkerNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkOutOfBandQueueTypeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkOutOfBandQueueTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBlockMatchWindowCompareModeQCOM value) const; +ValidValue stateless::Context::IsValidEnumValue(VkBlockMatchWindowCompareModeQCOM value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkCubicFilterWeightsQCOM value) const; +ValidValue stateless::Context::IsValidEnumValue(VkCubicFilterWeightsQCOM value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV value) const; +ValidValue stateless::Context::IsValidEnumValue(VkDisplaySurfaceStereoTypeNV value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectExecutionSetInfoTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkIndirectExecutionSetInfoTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkIndirectCommandsTokenTypeEXT value) const; +ValidValue stateless::Context::IsValidEnumValue(VkIndirectCommandsTokenTypeEXT value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkBuildAccelerationStructureModeKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkBuildAccelerationStructureModeKHR value) const; template <> -ValidValue StatelessValidation::IsValidEnumValue(VkShaderGroupShaderKHR value) const; +ValidValue stateless::Context::IsValidEnumValue(VkShaderGroupShaderKHR value) const; // NOLINTEND diff --git a/layers/vulkan/generated/valid_flag_values.cpp b/layers/vulkan/generated/valid_flag_values.cpp index 91a3a30c059..8f349758eed 100644 --- a/layers/vulkan/generated/valid_flag_values.cpp +++ b/layers/vulkan/generated/valid_flag_values.cpp @@ -31,76 +31,73 @@ // - 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 stateless::Context::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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_nv_ray_tracing) && !IsExtEnabled(extensions.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(extensions.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(extensions.vk_khr_fragment_shading_rate) && !IsExtEnabled(extensions.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(extensions.vk_nv_device_generated_commands) && + !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_khr_maintenance1)) { return {vvl::Extension::_VK_KHR_maintenance1}; } } @@ -110,225 +107,221 @@ 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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_img_filter_cubic) && !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_khr_fragment_shading_rate) && !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_nv_ray_tracing) && !IsExtEnabled(extensions.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(extensions.vk_nv_ray_tracing) && !IsExtEnabled(extensions.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(extensions.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(extensions.vk_khr_fragment_shading_rate) && !IsExtEnabled(extensions.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(extensions.vk_nv_device_generated_commands) && + !IsExtEnabled(extensions.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(extensions.vk_nv_mesh_shader) && !IsExtEnabled(extensions.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(extensions.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(extensions.vk_khr_synchronization2)) { return {vvl::Extension::_VK_KHR_synchronization2}; } } @@ -336,141 +329,140 @@ 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(extensions.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(extensions.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(extensions.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(extensions.vk_khr_buffer_device_address) && + !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.vk_khr_buffer_device_address) && + !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_nv_ray_tracing) && !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_ext_pipeline_creation_cache_control)) { return {vvl::Extension::_VK_EXT_pipeline_creation_cache_control}; } } if (value & (VK_PIPELINE_CACHE_CREATE_INTERNALLY_SYNCHRONIZED_MERGE_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_maintenance8)) { + if (!IsExtEnabled(extensions.vk_khr_maintenance8)) { return {vvl::Extension::_VK_KHR_maintenance8}; } } 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(extensions.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(extensions.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(extensions.vk_ext_pipeline_protected_access)) { return {vvl::Extension::_VK_EXT_pipeline_protected_access}; } } @@ -480,70 +472,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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_nv_displacement_micromap)) { return {vvl::Extension::_VK_NV_displacement_micromap}; } } @@ -551,7 +543,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(extensions.vk_ext_subgroup_size_control)) { return {vvl::Extension::_VK_EXT_subgroup_size_control}; } } @@ -565,23 +557,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(extensions.vk_nv_ray_tracing) && !IsExtEnabled(extensions.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(extensions.vk_nv_mesh_shader) && !IsExtEnabled(extensions.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(extensions.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(extensions.vk_huawei_cluster_culling_shader)) { return {vvl::Extension::_VK_HUAWEI_cluster_culling_shader}; } } @@ -589,8 +580,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(extensions.vk_arm_rasterization_order_attachment_access) && + !IsExtEnabled(extensions.vk_ext_rasterization_order_attachment_access)) { return {vvl::Extension::_VK_ARM_rasterization_order_attachment_access, vvl::Extension::_VK_EXT_rasterization_order_attachment_access}; } @@ -598,8 +589,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(extensions.vk_arm_rasterization_order_attachment_access) && + !IsExtEnabled(extensions.vk_ext_rasterization_order_attachment_access)) { return {vvl::Extension::_VK_ARM_rasterization_order_attachment_access, vvl::Extension::_VK_EXT_rasterization_order_attachment_access}; } @@ -607,118 +598,118 @@ 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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_valve_mutable_descriptor_type) && + !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_valve_mutable_descriptor_type) && + !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_ext_attachment_feedback_loop_layout)) { return {vvl::Extension::_VK_EXT_attachment_feedback_loop_layout}; } } if (value & (VK_DEPENDENCY_QUEUE_FAMILY_OWNERSHIP_TRANSFER_USE_ALL_STAGES_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_maintenance8)) { + if (!IsExtEnabled(extensions.vk_khr_maintenance8)) { return {vvl::Extension::_VK_KHR_maintenance8}; } } return {}; case vvl::FlagBitmask::VkFramebufferCreateFlagBits: if (value & (VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT)) { - if (!IsExtEnabled(device_extensions.vk_khr_imageless_framebuffer)) { + if (!IsExtEnabled(extensions.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(extensions.vk_qcom_render_pass_transform)) { return {vvl::Extension::_VK_QCOM_render_pass_transform}; } } @@ -726,142 +717,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(extensions.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(extensions.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(extensions.vk_arm_rasterization_order_attachment_access) && + !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_khr_maintenance7) && !IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_khr_video_encode_quantization_map)) { return {vvl::Extension::_VK_KHR_video_encode_quantization_map}; } } @@ -869,21 +859,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(extensions.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(extensions.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(extensions.vk_ext_device_address_binding_report)) { return {vvl::Extension::_VK_EXT_device_address_binding_report}; } } @@ -891,50 +881,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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_nv_ray_tracing_motion_blur)) { return {vvl::Extension::_VK_NV_ray_tracing_motion_blur}; } } @@ -944,123 +934,122 @@ 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 stateless::Context::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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.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(extensions.vk_ext_legacy_dithering)) { return {vvl::Extension::_VK_EXT_legacy_dithering}; } } if (value & (VK_PIPELINE_CREATE_2_DISALLOW_OPACITY_MICROMAP_BIT_ARM)) { - if (!IsExtEnabled(device_extensions.vk_arm_pipeline_opacity_micromap)) { + if (!IsExtEnabled(extensions.vk_arm_pipeline_opacity_micromap)) { return {vvl::Extension::_VK_ARM_pipeline_opacity_micromap}; } } if (value & (VK_PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR)) { - if (!IsExtEnabled(device_extensions.vk_khr_pipeline_binary)) { + if (!IsExtEnabled(extensions.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(extensions.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(extensions.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(extensions.vk_ext_device_generated_commands)) { return {vvl::Extension::_VK_EXT_device_generated_commands}; } } @@ -1070,7 +1059,7 @@ vvl::Extensions StatelessValidation::IsValidFlag64Value(vvl::FlagBitmask flag_bi } } -std::string StatelessValidation::DescribeFlagBitmaskValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const { +std::string stateless::Context::DescribeFlagBitmaskValue(vvl::FlagBitmask flag_bitmask, VkFlags value) const { switch (flag_bitmask) { case vvl::FlagBitmask::VkAccessFlagBits: return string_VkAccessFlags(value); @@ -1294,7 +1283,7 @@ std::string StatelessValidation::DescribeFlagBitmaskValue(vvl::FlagBitmask flag_ } } -std::string StatelessValidation::DescribeFlagBitmaskValue64(vvl::FlagBitmask flag_bitmask, VkFlags64 value) const { +std::string stateless::Context::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 99470efc802..22f71ab299c 100644 --- a/layers/vulkan/generated/vk_extension_helper.cpp +++ b/layers/vulkan/generated/vk_extension_helper.cpp @@ -567,11 +567,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) { @@ -595,18 +594,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) { @@ -654,7 +648,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 f445176dc09..496840c277e 100644 --- a/layers/vulkan/generated/vk_extension_helper.h +++ b/layers/vulkan/generated/vk_extension_helper.h @@ -64,9 +64,9 @@ Times to use it - Checking not enabled - if (!IsExtEnabled(...)) { } - Special extensions that being EXPOSED alters the VUs - - IsExtEnabled(device_extensions.vk_khr_portability_subset) + - IsExtEnabled(extensions.vk_khr_portability_subset) - Special extensions that alter behaviour of enabled - - IsExtEnabled(device_extensions.vk_khr_maintenance*) + - IsExtEnabled(extensions.vk_khr_maintenance*) Times to NOT use it - If checking if a struct or enum is being used. There are a stateless checks @@ -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 { @@ -1757,8 +1759,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 e1a8a0d1270..190ca319b66 100644 --- a/scripts/generators/extension_helper_generator.py +++ b/scripts/generators/extension_helper_generator.py @@ -170,9 +170,9 @@ def generateHeader(self): - Checking not enabled - if (!IsExtEnabled(...)) { } - Special extensions that being EXPOSED alters the VUs - - IsExtEnabled(device_extensions.vk_khr_portability_subset) + - IsExtEnabled(extensions.vk_khr_portability_subset) - Special extensions that alter behaviour of enabled - - IsExtEnabled(device_extensions.vk_khr_maintenance*) + - IsExtEnabled(extensions.vk_khr_maintenance*) Times to NOT use it - If checking if a struct or enum is being used. There are a stateless checks @@ -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/object_tracker_generator.py b/scripts/generators/object_tracker_generator.py index 51da22ff6a3..d5c2ffa775c 100644 --- a/scripts/generators/object_tracker_generator.py +++ b/scripts/generators/object_tracker_generator.py @@ -935,7 +935,7 @@ def validateObjects(self, members: list[Member], prefix: str, arrayIndex: int, p location = f'{errorLoc}.dot(Field::{member.name})' if parentName == 'VkPhysicalDeviceSurfaceInfo2KHR': param_vuid = '"VUID-VkPhysicalDeviceSurfaceInfo2KHR-surface-07919"' - pre_call_validate += 'if (!IsExtEnabled(instance_extensions.vk_google_surfaceless_query)) {\n' + pre_call_validate += 'if (!IsExtEnabled(extensions.vk_google_surfaceless_query)) {\n' else: pre_call_validate += '// There should be an explicit VU (if not that is a spec bug)\n' pre_call_validate += '{\n' diff --git a/scripts/generators/spirv_validation_generator.py b/scripts/generators/spirv_validation_generator.py index e58393c15de..2bb228d3f59 100644 --- a/scripts/generators/spirv_validation_generator.py +++ b/scripts/generators/spirv_validation_generator.py @@ -344,7 +344,7 @@ def generate(self): } else if (it->second.extension) { // kEnabledByApiLevel is not valid as some extension are promoted with feature bits to be used. // If the new Api Level gives support, it will be caught in the "it->second.version" check instead. - if (IsExtEnabledByCreateinfo(device_extensions.*(it->second.extension))) { + if (IsExtEnabledByCreateinfo(extensions.*(it->second.extension))) { has_support = true; } } else if (it->second.property) { @@ -384,7 +384,7 @@ def generate(self): } // Portability checks - if (IsExtEnabled(device_extensions.vk_khr_portability_subset)) { + if (IsExtEnabled(extensions.vk_khr_portability_subset)) { if ((VK_FALSE == enabled_features.shaderSampleRateInterpolationFunctions) && (spv::CapabilityInterpolationFunction == insn.Word(1))) { skip |= LogError("VUID-RuntimeSpirv-shaderSampleRateInterpolationFunctions-06325", device, loc, @@ -427,7 +427,7 @@ def generate(self): has_support = true; } } else if (it->second.extension) { - if (IsExtEnabled(device_extensions.*(it->second.extension))) { + if (IsExtEnabled(extensions.*(it->second.extension))) { has_support = true; } } diff --git a/scripts/generators/stateless_validation_helper_generator.py b/scripts/generators/stateless_validation_helper_generator.py index f9fa78e9fd7..efaf82ad3a5 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', @@ -227,7 +226,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 @@ -349,7 +350,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 stateless::Context &context, const {struct_name} &info, const Location &loc) const;') self.write("".join(out)) @@ -410,7 +411,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, '{context}') if lines: self.validatedStructs[struct.name] = lines @@ -429,17 +430,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 stateless::Context::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: @@ -451,17 +451,16 @@ def generateSource(self): ''') out.append(''' - bool StatelessValidation::ValidatePnextPropertyStructContents(const Location& loc, + bool stateless::Context::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: @@ -474,17 +473,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 stateless::Context::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: @@ -512,6 +510,16 @@ 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') + # For vkCreateDevice, the extensions member has already been set up properly + # for other VkPhysicalDevice calls, we need to use their supported extensions rather + # than the extensions members, which is how the VkInstance was configured. + if command.params[0].type == 'VkPhysicalDevice' and command.name != 'vkCreateDevice': + out.append(''' + const auto &physdev_extensions = physical_device_extensions.at(physicalDevice); + stateless::Context context(*this, error_obj, physdev_extensions, IsExtEnabled(physdev_extensions.vk_khr_maintenance5)); + ''') + else: + out.append(' stateless::Context context(*this, error_obj, 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') @@ -522,10 +530,7 @@ def generateSource(self): outExpression = [] for extension in command.extensions: outExpression.append(f'vvl::Extension::_{extension.name}') - if extension.instance: - cExpression.append(f'IsExtEnabled(instance_extensions.{extension.name.lower()})') - else: - cExpression.append(f'IsExtEnabled(device_extensions.{extension.name.lower()})') + cExpression.append(f'IsExtEnabled(extensions.{extension.name.lower()})') cExpression = " || ".join(cExpression) if len(outExpression) > 1: @@ -545,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, 'context.') if command.instance and command.version: # check function name so KHR version doesn't trigger flase positive @@ -567,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]) + ', context' 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 stateless::Context &context, 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.', '', [], 'context.')) out.append(' return skip;\n') out.append('}\n') @@ -627,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, context): checkExpr = [] callerName = structTypeName if structTypeName else funcName if lengthMember: @@ -640,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 |= {context}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 @@ -649,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 |= {context}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") @@ -669,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 |= {context}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('->') @@ -690,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 |= {context}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 |= {context}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, context): # Build format specifier list kwargs = {} if '{funcName}' in line: @@ -711,6 +716,8 @@ def processStructMemberCode(self, line, funcName, errorLoc, memberNamePrefix, me kwargs['displayNamePrefix'] = memberDisplayNamePrefix[0] else: kwargs['displayNamePrefix'] = memberDisplayNamePrefix + if '{context}' in line: + kwargs['context'] = context if kwargs: # Need to escape the C++ curly braces @@ -731,31 +738,31 @@ 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, context): 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, context)) else: - output.append(self.processStructMemberCode(line, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix)) + output.append(self.processStructMemberCode(line, funcName, errorLoc, memberNamePrefix, memberDisplayNamePrefix, context)) 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, context): struct = self.vk.structs[structTypeName] if structTypeName in self.vk.structs else None callerName = structTypeName if structTypeName else funcName lines = [] # Generated lines of code duplicateCountVuid = [] # prevent duplicate VUs being generated - # TODO Using a regex in this context is not ideal. Would be nicer if usedLines were a list of objects with "settings" (such as "isPhysDevice") + # TODO Using a regex in this context is not ideal. Would be nicer if usedLines were a list of objects with "settings" validatePNextRegex = re.compile(r'(.*ValidateStructPnext\(.*)(\).*\n*)', re.M) # 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 |= {context}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 @@ -838,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 |= {context}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 @@ -852,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 |= {context}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 |= {context}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 |= {context}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 |= {context}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: @@ -874,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 |= {context}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') @@ -883,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 |= {context}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 |= {context}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 |= {context}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 @@ -909,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 |= {context}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, context) # Feature structs are large and just wasting time checking booleans that are almost impossible to be invalid isFeatureStruct = member.type in ['VkPhysicalDeviceFeatures', 'VkPhysicalDeviceFeatures2'] @@ -941,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, context) # 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 @@ -954,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: @@ -970,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 |= {context}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 |= {context}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 |= {context}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 |= {context}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') @@ -1009,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 |= {context}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 |= {context}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 |= {context}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, [], context)) # Append the parameter check to the function body for the current command if usedLines: # Apply special conditional checks @@ -1048,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, context: str): pNextCase = '\n' pNextCheck = '' @@ -1061,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 (extensions.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(extensions.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 @@ -1090,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(extensions.{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 @@ -1131,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..bc2914f1246 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 stateless::Context::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 stateless::Context::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(extensions.{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 stateless::Context::GetEnumExtensions({enum.name} value) const {{ return {{}}; }}\n') + out.append(f'template<> const char* stateless::Context::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 stateless::Context::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* stateless::Context::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 f4dd5ff75e6..cb7d3b4c544 100644 --- a/scripts/generators/valid_flag_values_generator.py +++ b/scripts/generators/valid_flag_values_generator.py @@ -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 stateless::Context::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(extensions.{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 stateless::Context::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(extensions.{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 stateless::Context::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 stateless::Context::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..3f76be61dc8 100644 --- a/tests/framework/video_objects.h +++ b/tests/framework/video_objects.h @@ -2805,6 +2805,10 @@ class VkVideoLayerTest : public VkLayerTest { protected_no_fault_supported_ = (prot_mem_props.protectedNoFault == VK_TRUE); + // TODO: these tests use features and capabilities structures for extensions that + // aren't enabled on all platforms. + m_errorMonitor->SetAllowedFailureMsg("VUID-VkDeviceCreateInfo-pNext-pNext"); + m_errorMonitor->SetAllowedFailureMsg("VUID-VkVideoCapabilitiesKHR-pNext-pNext"); RETURN_IF_SKIP(InitState()); uint32_t qf_count; @@ -3635,7 +3639,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 +3657,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 6ca3505501f..eef67f5fa53 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_); } @@ -104,9 +105,12 @@ TEST_F(VkBestPracticesLayerTest, UseDeprecatedInstanceExtensions) { m_errorMonitor->SetDesiredWarning("BestPractices-deprecated-extension"); } - m_errorMonitor->SetDesiredWarning("BestPractices-deprecated-extension"); // VK_KHR_get_physical_device_properties2, + m_errorMonitor->SetDesiredWarning("BestPractices-deprecated-extension"); // VK_KHR_get_physical_device_properties2 + m_errorMonitor->SetDesiredWarning("BestPractices-deprecated-extension"); // VK_EXT_validation_features m_errorMonitor->SetDesiredWarning("BestPractices-specialuse-extension"); // VK_EXT_debug_utils - VkInstance dummy; + m_errorMonitor->SetDesiredWarning("BestPractices-specialuse-extension"); // VK_EXT_validation_features + + VkInstance dummy = VK_NULL_HANDLE; auto features = features_; auto ici = GetInstanceCreateInfo(); features.pNext = ici.pNext; @@ -114,9 +118,6 @@ TEST_F(VkBestPracticesLayerTest, UseDeprecatedInstanceExtensions) { vk::CreateInstance(&ici, nullptr, &dummy); m_errorMonitor->VerifyFound(); - // Create a 1.0 vulkan instance and request an extension promoted to core in 1.1 - m_errorMonitor->SetUnexpectedError("khronos-Validation-debug-build-warning-message"); - m_errorMonitor->SetUnexpectedError("khronos-Validation-fine-grained-locking-warning-message"); VkApplicationInfo new_info{}; new_info.apiVersion = VK_API_VERSION_1_0; new_info.pApplicationName = ici.pApplicationInfo->pApplicationName; @@ -124,8 +125,22 @@ TEST_F(VkBestPracticesLayerTest, UseDeprecatedInstanceExtensions) { new_info.pEngineName = ici.pApplicationInfo->pEngineName; new_info.engineVersion = ici.pApplicationInfo->engineVersion; ici.pApplicationInfo = &new_info; + + // Create a 1.0 vulkan instance and request an extension promoted to core in 1.1 + if (IsExtensionsEnabled(VK_EXT_DEBUG_REPORT_EXTENSION_NAME)) { + // Extra error if VK_EXT_debug_report is used on Android still + m_errorMonitor->SetDesiredWarning("BestPractices-deprecated-extension"); + } + m_errorMonitor->SetUnexpectedError("khronos-Validation-debug-build-warning-message"); + m_errorMonitor->SetUnexpectedError("khronos-Validation-fine-grained-locking-warning-message"); + 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 vk::CreateInstance(&ici, nullptr, &dummy); - vk::DestroyInstance(dummy, nullptr); + m_errorMonitor->VerifyFound(); + if (dummy != VK_NULL_HANDLE) { + vk::DestroyInstance(dummy, nullptr); + } } TEST_F(VkBestPracticesLayerTest, UseDeprecatedDeviceExtensions) { diff --git a/tests/unit/debug_printf.cpp b/tests/unit/debug_printf.cpp index bff37d40903..8ca19eecf98 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..d4d69f1686c 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(); @@ -432,15 +430,9 @@ TEST_F(NegativeDeviceFeatureProperty, MissingExtensionPromoted) { } TEST_F(NegativeDeviceFeatureProperty, Features11WithoutVulkan12) { + SetTargetApiVersion(VK_API_VERSION_1_1); TEST_DESCRIPTION("VkPhysicalDeviceVulkan11Features was added in Vulkan1.2"); - if (m_instance_api_version < VK_API_VERSION_1_2) { - GTEST_SKIP() << "Need 1.2 instance support"; - } - app_info_.apiVersion = m_instance_api_version.Value(); RETURN_IF_SKIP(InitDeviceFeatureProperty()); - if (PhysicalDeviceProps().apiVersion > VK_API_VERSION_1_1) { - GTEST_SKIP() << "Need 1.0/1.1 device support"; - } VkPhysicalDeviceVulkan11Features features11 = vku::InitStructHelper(); m_second_device_ci.pNext = &features11; @@ -449,13 +441,11 @@ TEST_F(NegativeDeviceFeatureProperty, Features11WithoutVulkan12) { vk::CreateDevice(Gpu(), &m_second_device_ci, nullptr, &m_second_device); m_errorMonitor->VerifyFound(); - if (PhysicalDeviceProps().apiVersion == VK_API_VERSION_1_1) { - VkPhysicalDeviceVulkan12Properties bad_version_1_1_struct = vku::InitStructHelper(); - VkPhysicalDeviceProperties2 phys_dev_props_2 = vku::InitStructHelper(&bad_version_1_1_struct); - m_errorMonitor->SetDesiredError("VUID-VkPhysicalDeviceProperties2-pNext-pNext"); - vk::GetPhysicalDeviceProperties2(Gpu(), &phys_dev_props_2); - m_errorMonitor->VerifyFound(); - } + VkPhysicalDeviceVulkan12Properties bad_version_1_1_struct = vku::InitStructHelper(); + VkPhysicalDeviceProperties2 phys_dev_props_2 = vku::InitStructHelper(&bad_version_1_1_struct); + m_errorMonitor->SetDesiredError("VUID-VkPhysicalDeviceProperties2-pNext-pNext"); + vk::GetPhysicalDeviceProperties2(Gpu(), &phys_dev_props_2); + m_errorMonitor->VerifyFound(); } TEST_F(NegativeDeviceFeatureProperty, Robustness2WithoutRobustness) { diff --git a/tests/unit/dynamic_rendering.cpp b/tests/unit/dynamic_rendering.cpp index e39699c1b37..9fbd4a57382 100644 --- a/tests/unit/dynamic_rendering.cpp +++ b/tests/unit/dynamic_rendering.cpp @@ -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/external_memory_sync.cpp b/tests/unit/external_memory_sync.cpp index 65b28ce81f8..a9acc6992aa 100644 --- a/tests/unit/external_memory_sync.cpp +++ b/tests/unit/external_memory_sync.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 Advanced Micro Devices, Inc. All rights reserved. * @@ -24,6 +24,8 @@ TEST_F(NegativeExternalMemorySync, CreateBufferIncompatibleHandleTypes) { TEST_DESCRIPTION("Creating buffer with incompatible external memory handle types"); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -64,6 +66,8 @@ TEST_F(NegativeExternalMemorySync, CreateImageIncompatibleHandleTypes) { TEST_DESCRIPTION("Creating image with incompatible external memory handle types"); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -117,8 +121,11 @@ TEST_F(NegativeExternalMemorySync, CreateImageIncompatibleHandleTypes) { TEST_F(NegativeExternalMemorySync, CreateImageIncompatibleHandleTypesNV) { TEST_DESCRIPTION("Creating image with incompatible external memory handle types from NVIDIA extension"); + SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME); AddRequiredExtensions(VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); VkExternalMemoryImageCreateInfoNV external_memory_info = vku::InitStructHelper(); @@ -159,6 +166,8 @@ TEST_F(NegativeExternalMemorySync, CreateImageIncompatibleHandleTypesNV) { TEST_F(NegativeExternalMemorySync, ExportImageHandleType) { TEST_DESCRIPTION("Test exporting memory with mismatching handleTypes."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -212,6 +221,8 @@ TEST_F(NegativeExternalMemorySync, ExportImageHandleType) { TEST_F(NegativeExternalMemorySync, BufferMemoryWithUnsupportedHandleType) { TEST_DESCRIPTION("Bind buffer memory with unsupported external memory handle type."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -260,6 +271,8 @@ TEST_F(NegativeExternalMemorySync, BufferMemoryWithUnsupportedHandleType) { TEST_F(NegativeExternalMemorySync, BufferMemoryWithIncompatibleHandleTypes) { TEST_DESCRIPTION("Bind buffer memory with incompatible external memory handle types."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -299,6 +312,8 @@ TEST_F(NegativeExternalMemorySync, BufferMemoryWithIncompatibleHandleTypes) { TEST_F(NegativeExternalMemorySync, ImageMemoryWithUnsupportedHandleType) { TEST_DESCRIPTION("Bind image memory with unsupported external memory handle type."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -346,6 +361,8 @@ TEST_F(NegativeExternalMemorySync, ImageMemoryWithUnsupportedHandleType) { TEST_F(NegativeExternalMemorySync, ImageMemoryWithIncompatibleHandleTypes) { TEST_DESCRIPTION("Bind image memory with incompatible external memory handle types."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -399,6 +416,8 @@ TEST_F(NegativeExternalMemorySync, ImageMemoryWithIncompatibleHandleTypes) { TEST_F(NegativeExternalMemorySync, ExportBufferHandleType) { TEST_DESCRIPTION("Test exporting memory with mismatching handleTypes."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -636,6 +655,8 @@ TEST_F(NegativeExternalMemorySync, SyncFdSemaphoreTimelineDependency) { TEST_F(NegativeExternalMemorySync, SyncFdExportFromImportedSemaphore) { TEST_DESCRIPTION("Export from semaphore with imported payload that does not support export"); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); AddRequiredExtensions(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -697,6 +718,8 @@ TEST_F(NegativeExternalMemorySync, SyncFdExportFromImportedFence) { TEST_DESCRIPTION("Export from fence with imported payload that does not support export"); SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -1155,6 +1178,8 @@ TEST_F(NegativeExternalMemorySync, ImportMemoryHandleType) { const auto handle_type = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT; #endif AddRequiredExtensions(ext_mem_extension_name); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); if (IsPlatformMockICD()) { @@ -1417,6 +1442,8 @@ TEST_F(NegativeExternalMemorySync, FenceExportWithIncompatibleHandleType) { TEST_F(NegativeExternalMemorySync, SemaphoreExportWithUnsupportedHandleType) { TEST_DESCRIPTION("Create semaphore with unsupported external handle type in VkExportSemaphoreCreateInfo"); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -1442,6 +1469,8 @@ TEST_F(NegativeExternalMemorySync, SemaphoreExportWithUnsupportedHandleType) { TEST_F(NegativeExternalMemorySync, SemaphoreExportWithIncompatibleHandleType) { TEST_DESCRIPTION("Create semaphore with incompatible external handle types in VkExportSemaphoreCreateInfo"); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -1503,6 +1532,8 @@ TEST_F(NegativeExternalMemorySync, MemoryImageLayout) { SetTargetApiVersion(VK_API_VERSION_1_1); AddOptionalExtensions(VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -1885,6 +1916,8 @@ TEST_F(NegativeExternalMemorySync, Win32ExportFromImportedSemaphore) { TEST_DESCRIPTION("Export from semaphore with imported payload that does not support export"); SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -1993,6 +2026,8 @@ TEST_F(NegativeExternalMemorySync, Win32ExportFromImportedFence) { TEST_F(NegativeExternalMemorySync, BufferDedicatedAllocation) { TEST_DESCRIPTION("Bind external buffer that requires dedicated allocation to non-dedicated memory."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -2018,6 +2053,8 @@ TEST_F(NegativeExternalMemorySync, BufferDedicatedAllocation) { TEST_F(NegativeExternalMemorySync, ImageDedicatedAllocation) { TEST_DESCRIPTION("Bind external image that requires dedicated allocation to non-dedicated memory."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -2284,6 +2321,8 @@ TEST_F(NegativeExternalMemorySync, FdMemoryHandleProperties) { TEST_F(NegativeExternalMemorySync, ImportMemoryFdBufferNoDedicated) { SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -2338,6 +2377,8 @@ TEST_F(NegativeExternalMemorySync, ImportMemoryFdBufferNoDedicated) { TEST_F(NegativeExternalMemorySync, ImportMemoryFdBufferDifferentDedicated) { SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -2394,6 +2435,8 @@ TEST_F(NegativeExternalMemorySync, ImportMemoryFdBufferDifferentDedicated) { TEST_F(NegativeExternalMemorySync, ImportMemoryFdBadFd) { SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -2422,6 +2465,8 @@ TEST_F(NegativeExternalMemorySync, ImportMemoryFdBadFd) { TEST_F(NegativeExternalMemorySync, ImportMemoryFdHandleType) { SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -2451,6 +2496,8 @@ TEST_F(NegativeExternalMemorySync, ImportMemoryFdBufferSupport) { SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); AddRequiredFeature(vkt::Feature::protectedMemory); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -2480,6 +2527,8 @@ TEST_F(NegativeExternalMemorySync, ImportMemoryFdBufferSupport) { TEST_F(NegativeExternalMemorySync, ImportMemoryFdImageSupport) { SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); diff --git a/tests/unit/external_memory_sync_positive.cpp b/tests/unit/external_memory_sync_positive.cpp index 6d72dd3388a..1aa0108c90b 100644 --- a/tests/unit/external_memory_sync_positive.cpp +++ b/tests/unit/external_memory_sync_positive.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. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -44,6 +44,8 @@ TEST_F(PositiveExternalMemorySync, ImportMemoryFd) { TEST_DESCRIPTION("Basic importing of POXIS handle for memory allocation"); SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -255,6 +257,8 @@ TEST_F(PositiveExternalMemorySync, ExternalMemory) { TEST_F(PositiveExternalMemorySync, BufferDedicatedAllocation) { TEST_DESCRIPTION("Create external buffer that requires dedicated allocation."); SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -450,6 +454,8 @@ TEST_F(PositiveExternalMemorySync, ExportFromImportedFence) { TEST_DESCRIPTION("Export from fence with imported payload"); SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -498,6 +504,8 @@ TEST_F(PositiveExternalMemorySync, ImportMemoryWin32BufferDifferentDedicated) { TEST_DESCRIPTION("https://gitlab.khronos.org/vulkan/Vulkan-ValidationLayers/-/issues/35"); SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -554,6 +562,8 @@ TEST_F(PositiveExternalMemorySync, MultipleExportOpaqueFd) { TEST_DESCRIPTION("regression from dEQP-VK.api.external.semaphore.opaque_fd.export_multiple_times_temporary"); SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); @@ -576,6 +586,8 @@ TEST_F(PositiveExternalMemorySync, ImportMemoryFdBufferDifferentDedicated) { TEST_DESCRIPTION("https://gitlab.khronos.org/vulkan/Vulkan-ValidationLayers/-/issues/35"); SetTargetApiVersion(VK_API_VERSION_1_1); AddRequiredExtensions(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); diff --git a/tests/unit/gpu_av.cpp b/tests/unit/gpu_av.cpp index afdb466595f..9cef0f801a3 100644 --- a/tests/unit/gpu_av.cpp +++ b/tests/unit/gpu_av.cpp @@ -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/other_positive.cpp b/tests/unit/other_positive.cpp index acfed218b0d..f19ff659097 100644 --- a/tests/unit/other_positive.cpp +++ b/tests/unit/other_positive.cpp @@ -571,6 +571,9 @@ TEST_F(VkPositiveLayerTest, ExtensionPhysicalDeviceFeatureKHR) { TEST_F(VkPositiveLayerTest, NoExtensionFromInstanceFunction) { TEST_DESCRIPTION("Valid because we instance functions don't know which device it needs"); + SetTargetApiVersion(VK_API_VERSION_1_1); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); VkFormatProperties format_properties; // need VK_KHR_sampler_ycbcr_conversion if it was a device function @@ -707,4 +710,4 @@ TEST_F(VkPositiveLayerTest, PhysicalDeviceLayeredApiVulkanProperties) { VkPhysicalDeviceProperties2 phys_dev_props_2 = vku::InitStructHelper(&api_prop_lists); vk::GetPhysicalDeviceProperties2(Gpu(), &phys_dev_props_2); -} \ No newline at end of file +} diff --git a/tests/unit/others.cpp b/tests/unit/others.cpp index ee26222c847..12ade88333c 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 bec395128c8..bda68ebad7c 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 c966b710250..0b5e77327a7 100644 --- a/tests/unit/shader_object.cpp +++ b/tests/unit/shader_object.cpp @@ -6633,6 +6633,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/sparse_image.cpp b/tests/unit/sparse_image.cpp index 1f6f46de166..03bf6a9ed9c 100644 --- a/tests/unit/sparse_image.cpp +++ b/tests/unit/sparse_image.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 Advanced Micro Devices, Inc. All rights reserved. * @@ -622,6 +622,8 @@ TEST_F(NegativeSparseImage, QueueBindSparseMemoryType3) { AddRequiredFeature(vkt::Feature::sparseBinding); AddRequiredFeature(vkt::Feature::sparseResidencyBuffer); AddRequiredFeature(vkt::Feature::sparseResidencyImage2D); + // Required to pass in various memory flags without querying for corresponding extensions. + AddRequiredExtensions(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); RETURN_IF_SKIP(Init()); IgnoreHandleTypeError(m_errorMonitor); diff --git a/tests/unit/sync_val_positive.cpp b/tests/unit/sync_val_positive.cpp index 3ea73c297b4..f38eede1450 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 d2488011ba5..d00e5f07cf1 100644 --- a/tests/unit/wsi.cpp +++ b/tests/unit/wsi.cpp @@ -3274,6 +3274,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();