From bb572db9778ddc02162043e397de4c587ea93b85 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Wed, 28 Jun 2017 14:46:14 -0600 Subject: layers: Add VUIDS to allocator checks Change-Id: If4c37b631de1564dc56bcb1aa69e356538618acb --- layers/vk_validation_error_database.txt | 6 +++--- scripts/parameter_validation_generator.py | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt index 215a69f2..f42f916c 100644 --- a/layers/vk_validation_error_database.txt +++ b/layers/vk_validation_error_database.txt @@ -19,9 +19,9 @@ VALIDATION_ERROR_0001c40d~^~Y~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquir VALIDATION_ERROR_0002b00b~^~Y~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-sType-sType)~^~implicit VALIDATION_ERROR_0002b801~^~N~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-semaphore-parameter~^~core~^~The spec valid usage text states 'If semaphore is not VK_NULL_HANDLE, semaphore must be a valid VkSemaphore handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-semaphore-parameter)~^~implicit VALIDATION_ERROR_0002f001~^~N~^~Unknown~^~vkAcquireNextImage2KHX~^~VUID-VkAcquireNextImageInfoKHX-swapchain-parameter~^~core~^~The spec valid usage text states 'swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAcquireNextImageInfoKHX-swapchain-parameter)~^~implicit -VALIDATION_ERROR_002004f0~^~N~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnAllocation-00632~^~core~^~The spec valid usage text states 'pfnAllocation must be a pointer to a valid user-defined PFN_vkAllocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnAllocation-00632)~^~ -VALIDATION_ERROR_002004f2~^~N~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnReallocation-00633~^~core~^~The spec valid usage text states 'pfnReallocation must be a pointer to a valid user-defined PFN_vkReallocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnReallocation-00633)~^~ -VALIDATION_ERROR_002004f4~^~N~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnFree-00634~^~core~^~The spec valid usage text states 'pfnFree must be a pointer to a valid user-defined PFN_vkFreeFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnFree-00634)~^~ +VALIDATION_ERROR_002004f0~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnAllocation-00632~^~core~^~The spec valid usage text states 'pfnAllocation must be a pointer to a valid user-defined PFN_vkAllocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnAllocation-00632)~^~ +VALIDATION_ERROR_002004f2~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnReallocation-00633~^~core~^~The spec valid usage text states 'pfnReallocation must be a pointer to a valid user-defined PFN_vkReallocationFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnReallocation-00633)~^~ +VALIDATION_ERROR_002004f4~^~Y~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnFree-00634~^~core~^~The spec valid usage text states 'pfnFree must be a pointer to a valid user-defined PFN_vkFreeFunction' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnFree-00634)~^~ VALIDATION_ERROR_002004f6~^~N~^~Unknown~^~vkCmdBindPipeline~^~VUID-VkAllocationCallbacks-pfnInternalAllocation-00635~^~core~^~The spec valid usage text states 'If either of pfnInternalAllocation or pfnInternalFree is not NULL, both must be valid callbacks' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAllocationCallbacks-pfnInternalAllocation-00635)~^~ VALIDATION_ERROR_004009c0~^~N~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-window-01248~^~core~^~The spec valid usage text states 'window must point to a valid Android ANativeWindow.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-window-01248)~^~TBD in parameter validation layer. VALIDATION_ERROR_00409005~^~Y~^~Unknown~^~vkCreateAndroidSurfaceKHR~^~VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask~^~core~^~The spec valid usage text states 'flags must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask)~^~implicit diff --git a/scripts/parameter_validation_generator.py b/scripts/parameter_validation_generator.py index 86cb7c18..38b0d882 100644 --- a/scripts/parameter_validation_generator.py +++ b/scripts/parameter_validation_generator.py @@ -835,6 +835,14 @@ class ParamCheckerOutputGenerator(OutputGenerator): # Function pointers need a reinterpret_cast to void* ptr_required_vuid = self.GetVuid("VUID-%s-%s-parameter" % (vuid_tag_name, value.name)) if value.type[:4] == 'PFN_': + allocator_dict = {'pfnAllocation': '002004f0', + 'pfnReallocation': '002004f2', + 'pfnFree': '002004f4', + 'pfnInternalAllocation': '002004f6' + } + vuid = allocator_dict.get(value.name) + if vuid is not None: + ptr_required_vuid = 'VALIDATION_ERROR_%s' % vuid checkExpr.append('skipCall |= validate_required_pointer(layer_data->report_data, "{}", {ppp}"{}"{pps}, reinterpret_cast({}{}), {});\n'.format(funcPrintName, valuePrintName, prefix, value.name, ptr_required_vuid, **postProcSpec)) else: checkExpr.append('skipCall |= validate_required_pointer(layer_data->report_data, "{}", {ppp}"{}"{pps}, {}{}, {});\n'.format(funcPrintName, valuePrintName, prefix, value.name, ptr_required_vuid, **postProcSpec)) -- cgit v1.2.3