aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-09-14 18:01:17 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-09-17 15:32:11 -0600
commit1e47e4b481b5a4a0891ad3e0db1683be49dfbdf2 (patch)
tree28e0f9dd6e15f829261d7c1375a1b0228be74b7e /loader
parente06f119d4e40f9a1be48457926fe1df342013da7 (diff)
downloadusermoji-1e47e4b481b5a4a0891ad3e0db1683be49dfbdf2.tar.xz
bug-14538: Remove validation error codes
https://cvs.khronos.org/bugzilla/show_bug.cgi?id=14538
Diffstat (limited to 'loader')
-rw-r--r--loader/loader.c18
-rw-r--r--loader/wsi_swapchain.c15
2 files changed, 15 insertions, 18 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 29f8e958..c0965289 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -622,7 +622,7 @@ static VkResult loader_add_layer_names_to_list(
layer_prop = loader_get_layer_property(search_target, search_list);
if (!layer_prop) {
loader_log(VK_DBG_REPORT_ERROR_BIT, 0, "Unable to find layer %s", search_target);
- err = VK_ERROR_INVALID_LAYER;
+ err = VK_ERROR_LAYER_NOT_PRESENT;
continue;
}
@@ -2190,8 +2190,7 @@ VkResult loader_enable_instance_layers(
{
VkResult err;
- if (inst == NULL)
- return VK_ERROR_UNKNOWN;
+ assert(inst && "Cannot have null instance");
if (!loader_init_layer_list(inst, &inst->activated_layer_list)) {
loader_log(VK_DBG_REPORT_ERROR_BIT, 0, "Failed to alloc Instance activated layer list");
@@ -2323,8 +2322,7 @@ static VkResult loader_enable_device_layers(
{
VkResult err;
- if (dev == NULL)
- return VK_ERROR_UNKNOWN;
+ assert(dev && "Cannot have null device");
if (dev->activated_layer_list.list == NULL || dev->activated_layer_list.capacity == 0) {
loader_init_layer_list(inst, &dev->activated_layer_list);
@@ -2467,7 +2465,7 @@ VkResult loader_validate_layers(
prop = loader_get_layer_property(ppEnabledLayerNames[i],
list);
if (!prop) {
- return VK_ERROR_INVALID_LAYER;
+ return VK_ERROR_LAYER_NOT_PRESENT;
}
}
@@ -2513,7 +2511,7 @@ VkResult loader_validate_instance_extensions(
if (!extension_prop) {
/* Didn't find extension name in any of the global layers, error out */
- return VK_ERROR_INVALID_EXTENSION;
+ return VK_ERROR_EXTENSION_NOT_PRESENT;
}
}
return VK_SUCCESS;
@@ -2560,7 +2558,7 @@ VkResult loader_validate_device_extensions(
if (!extension_prop) {
/* Didn't find extension name in any of the device layers, error out */
- return VK_ERROR_INVALID_EXTENSION;
+ return VK_ERROR_EXTENSION_NOT_PRESENT;
}
}
return VK_SUCCESS;
@@ -2698,7 +2696,7 @@ VkResult loader_init_physical_device_info(
{
struct loader_icd *icd;
uint32_t n, count = 0;
- VkResult res = VK_ERROR_UNKNOWN;
+ VkResult res;
icd = ptr_instance->icds;
while (icd) {
@@ -3122,7 +3120,7 @@ LOADER_EXPORT VkResult VKAPI vkEnumerateInstanceExtensionProperties(
if (global_ext_list == NULL) {
loader_platform_thread_unlock_mutex(&loader_lock);
- return VK_ERROR_INVALID_LAYER;
+ return VK_ERROR_LAYER_NOT_PRESENT;
}
if (pProperties == NULL) {
diff --git a/loader/wsi_swapchain.c b/loader/wsi_swapchain.c
index a59f389b..e6f2387f 100644
--- a/loader/wsi_swapchain.c
+++ b/loader/wsi_swapchain.c
@@ -95,17 +95,16 @@ VkResult VKAPI loader_GetPhysicalDeviceSurfaceSupportKHR(
{
uint32_t gpu_index;
struct loader_icd *icd = loader_get_icd(physicalDevice, &gpu_index);
- VkResult res = VK_ERROR_UNKNOWN;
+
+ assert(pSupported && "GetPhysicalDeviceSurfaceSupportKHR: Error, null pSupported");
*pSupported = false;
- if (icd->GetPhysicalDeviceSurfaceSupportKHR) {
- res = icd->GetPhysicalDeviceSurfaceSupportKHR(physicalDevice,
- queueNodeIndex,
- pSurfaceDescription,
- pSupported);
- }
+ assert(icd->GetPhysicalDeviceSurfaceSupportKHR && "loader: null GetPhysicalDeviceSurfaceSupportKHR ICD pointer");
- return res;
+ return icd->GetPhysicalDeviceSurfaceSupportKHR(physicalDevice,
+ queueNodeIndex,
+ pSurfaceDescription,
+ pSupported);
}