From c5f3987068d9857be82fd77f2c8888fccba64315 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Fri, 4 Sep 2015 13:39:59 -0600 Subject: bug-14538: Remove driver validation checks Marked validation checks done in the driver with TODOVV. Once we verify the check is covered in a validation layer we can remove the driver code. --- loader/debug_report.c | 20 ++++++++++++-------- loader/loader.c | 25 +++++-------------------- loader/trampoline.c | 2 -- loader/wsi_swapchain.c | 2 +- 4 files changed, 18 insertions(+), 31 deletions(-) (limited to 'loader') diff --git a/loader/debug_report.c b/loader/debug_report.c index c7c1d9a2..8a6bf5de 100644 --- a/loader/debug_report.c +++ b/loader/debug_report.c @@ -141,16 +141,18 @@ VkResult VKAPI loader_DbgCreateMsgCallback( VkResult res; uint32_t storage_idx; - if (instance == VK_NULL_HANDLE) - return VK_ERROR_INVALID_HANDLE; + /* TODOVV: move to validation layer */ +// if (instance == VK_NULL_HANDLE) +// return VK_ERROR_INVALID_HANDLE; for (inst = loader.instances; inst; inst = inst->next) { if ((VkInstance) inst == instance) break; } - if (inst == VK_NULL_HANDLE) - return VK_ERROR_INVALID_HANDLE; + /* TODOVV: move to validation layer */ +// if (inst == VK_NULL_HANDLE) +// return VK_ERROR_INVALID_HANDLE; icd_info = calloc(sizeof(VkDbgMsgCallback), inst->total_icd_count); if (!icd_info) { @@ -210,16 +212,18 @@ VkResult VKAPI loader_DbgDestroyMsgCallback( VkResult res = VK_SUCCESS; struct loader_instance *inst; - if (instance == VK_NULL_HANDLE) - return VK_ERROR_INVALID_HANDLE; + /* TODOVV: Move to validation layer */ +// if (instance == VK_NULL_HANDLE) +// return VK_ERROR_INVALID_HANDLE; for (inst = loader.instances; inst; inst = inst->next) { if ((VkInstance) inst == instance) break; } - if (inst == VK_NULL_HANDLE) - return VK_ERROR_INVALID_HANDLE; + /* TODOVV: Move to validation layer */ +// if (inst == VK_NULL_HANDLE) +// return VK_ERROR_INVALID_HANDLE; icd_info = *(VkDbgMsgCallback **) &msgCallback; storage_idx = 0; diff --git a/loader/loader.c b/loader/loader.c index 0b7d1ba6..b12a065d 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -2664,10 +2664,11 @@ VkResult VKAPI loader_DestroyInstance( prev = next; next = next->next; } - if (next == NULL) { - // This must be an invalid instance handle or empty list - return VK_ERROR_INVALID_HANDLE; - } + /* TODOVV: Move this test to validation layer */ +// if (next == NULL) { +// // This must be an invalid instance handle or empty list +// return VK_ERROR_INVALID_HANDLE; +// } while (icds) { if (icds->instance) { @@ -3088,10 +3089,6 @@ LOADER_EXPORT VkResult VKAPI vkGetGlobalExtensionProperties( uint32_t copy_size; tls_instance = NULL; - if (pCount == NULL) { - return VK_ERROR_INVALID_POINTER; - } - memset(&icd_extensions, 0, sizeof(icd_extensions)); loader_platform_thread_once(&once_init, loader_initialize); @@ -3160,10 +3157,6 @@ LOADER_EXPORT VkResult VKAPI vkGetGlobalLayerProperties( uint32_t copy_size; - if (pCount == NULL) { - return VK_ERROR_INVALID_POINTER; - } - /* TODO: do we still need to lock */ loader_platform_thread_lock_mutex(&loader_lock); @@ -3203,10 +3196,6 @@ VkResult VKAPI loader_GetPhysicalDeviceExtensionProperties( struct loader_icd *icd = loader_get_icd(gpu, &gpu_index); uint32_t copy_size; - if (pCount == NULL) { - return VK_ERROR_INVALID_POINTER; - } - uint32_t count; struct loader_extension_list *dev_ext_list; @@ -3253,10 +3242,6 @@ VkResult VKAPI loader_GetPhysicalDeviceLayerProperties( uint32_t gpu_index; struct loader_icd *icd = loader_get_icd(gpu, &gpu_index); - if (pCount == NULL) { - return VK_ERROR_INVALID_POINTER; - } - uint32_t count = icd->this_instance->device_layer_list.count; if (pProperties == NULL) { diff --git a/loader/trampoline.c b/loader/trampoline.c index 33971c33..4ca018c4 100644 --- a/loader/trampoline.c +++ b/loader/trampoline.c @@ -44,8 +44,6 @@ LOADER_EXPORT VkResult VKAPI vkCreateInstance( struct loader_instance *ptr_instance = NULL; VkResult res = VK_ERROR_INITIALIZATION_FAILED; - if (pCreateInfo == NULL) - return VK_ERROR_INVALID_POINTER; loader_platform_thread_once(&once_init, loader_initialize); if (pCreateInfo->pAllocCb diff --git a/loader/wsi_swapchain.c b/loader/wsi_swapchain.c index ec0ee0d0..a59f389b 100644 --- a/loader/wsi_swapchain.c +++ b/loader/wsi_swapchain.c @@ -95,7 +95,7 @@ VkResult VKAPI loader_GetPhysicalDeviceSurfaceSupportKHR( { uint32_t gpu_index; struct loader_icd *icd = loader_get_icd(physicalDevice, &gpu_index); - VkResult res = VK_ERROR_UNAVAILABLE; + VkResult res = VK_ERROR_UNKNOWN; *pSupported = false; if (icd->GetPhysicalDeviceSurfaceSupportKHR) { -- cgit v1.2.3