aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-09-04 13:39:59 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-09-10 10:16:35 -0600
commitc5f3987068d9857be82fd77f2c8888fccba64315 (patch)
treed5be3012b8a1a6bb0055cd6f67a67d3522abfebf /loader
parentfae25d2777686b78b39042e621dfb0aae567d47f (diff)
downloadusermoji-c5f3987068d9857be82fd77f2c8888fccba64315.tar.xz
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.
Diffstat (limited to 'loader')
-rw-r--r--loader/debug_report.c20
-rw-r--r--loader/loader.c25
-rw-r--r--loader/trampoline.c2
-rw-r--r--loader/wsi_swapchain.c2
4 files changed, 18 insertions, 31 deletions
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) {