diff options
author | Chad Versace <[email protected]> | 2015-10-07 11:36:51 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-10-07 11:36:51 -0700 |
commit | f9c948ed00787c56bac265dc934049ed67a1cd61 (patch) | |
tree | b694c5f3884d421cddcd4e6c996d1783121f22a6 /src/vulkan/anv_wsi_wayland.c | |
parent | 8dee32e71f0ccbdf2b9404fe553a83da8bea79dc (diff) |
vk/0.170.2: Update VkResult
Version 0.170.2 removes most of the error enums. In many cases, I had to
replace an error with a less accurate (or even incorrect) one.
In other cases, the error path is replaced with an assertion.
Diffstat (limited to 'src/vulkan/anv_wsi_wayland.c')
-rw-r--r-- | src/vulkan/anv_wsi_wayland.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/vulkan/anv_wsi_wayland.c b/src/vulkan/anv_wsi_wayland.c index a601ad1851f..ba3ce8a2c65 100644 --- a/src/vulkan/anv_wsi_wayland.c +++ b/src/vulkan/anv_wsi_wayland.c @@ -322,10 +322,11 @@ wsi_wl_get_surface_info(struct anv_wsi_implementation *impl, { struct wsi_wayland *wsi = (struct wsi_wayland *)impl; - if (pDataSize == NULL) - return vk_error(VK_ERROR_INVALID_POINTER); + assert(pDataSize != NULL); switch (infoType) { + default: + unreachable("bad VkSurfaceInfoTypeWSI"); case VK_SURFACE_INFO_TYPE_PROPERTIES_WSI: { VkSurfacePropertiesWSI *props = pData; @@ -384,8 +385,6 @@ wsi_wl_get_surface_info(struct anv_wsi_implementation *impl, memcpy(pData, present_modes, *pDataSize); return VK_SUCCESS; - default: - return vk_error(VK_ERROR_INVALID_VALUE); } } @@ -423,6 +422,8 @@ wsi_wl_get_swap_chain_info(struct anv_swap_chain *anv_chain, size_t size; switch (infoType) { + default: + unreachable("bad VkSwapChainInfoTypeWSI"); case VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI: { VkSwapChainImagePropertiesWSI *images = pData; @@ -441,9 +442,6 @@ wsi_wl_get_swap_chain_info(struct anv_swap_chain *anv_chain, return VK_SUCCESS; } - - default: - return vk_error(VK_ERROR_INVALID_VALUE); } } @@ -615,14 +613,16 @@ wsi_wl_image_init(struct wsi_wl_swap_chain *chain, struct wsi_wl_image *image) image->memory->bo.gem_handle, surface->stride, I915_TILING_X); if (ret) { - result = vk_error(VK_ERROR_UNKNOWN); + /* FINISHME: Choose a better error. */ + result = vk_error(VK_ERROR_OUT_OF_DEVICE_MEMORY); goto fail_mem; } int fd = anv_gem_handle_to_fd(chain->base.device, image->memory->bo.gem_handle); if (fd == -1) { - result = vk_error(VK_ERROR_UNKNOWN); + /* FINISHME: Choose a better error. */ + result = vk_error(VK_ERROR_OUT_OF_DEVICE_MEMORY); goto fail_mem; } @@ -769,8 +769,13 @@ anv_wl_init_wsi(struct anv_instance *instance) int ret = pthread_mutex_init(&wsi->mutex, NULL); if (ret != 0) { - result = (ret == ENOMEM) ? VK_ERROR_OUT_OF_HOST_MEMORY : - VK_ERROR_UNKNOWN; + if (ret == ENOMEM) { + result = VK_ERROR_OUT_OF_HOST_MEMORY; + } else { + /* FINISHME: Choose a better error. */ + result = VK_ERROR_OUT_OF_HOST_MEMORY; + } + goto fail_alloc; } |