[Mesa-dev] [PATCH 2/2] vulkan/wsi/wayland: Handle VK_INCOMPLETE for GetPresentModes

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed Jan 25 11:36:18 UTC 2017


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 25/01/17 00:44, Jason Ekstrand wrote:
> ---
>   src/vulkan/wsi/wsi_common_wayland.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
> index d745413..04cea97 100644
> --- a/src/vulkan/wsi/wsi_common_wayland.c
> +++ b/src/vulkan/wsi/wsi_common_wayland.c
> @@ -443,11 +443,13 @@ wsi_wl_surface_get_present_modes(VkIcdSurfaceBase *surface,
>         return VK_SUCCESS;
>      }
>   
> -   assert(*pPresentModeCount >= ARRAY_SIZE(present_modes));
> +   *pPresentModeCount = MIN2(*pPresentModeCount, ARRAY_SIZE(present_modes));
>      typed_memcpy(pPresentModes, present_modes, *pPresentModeCount);
> -   *pPresentModeCount = ARRAY_SIZE(present_modes);
>   
> -   return VK_SUCCESS;
> +   if (*pPresentModeCount < ARRAY_SIZE(present_modes))
> +      return VK_INCOMPLETE;
> +   else
> +      return VK_SUCCESS;
>   }
>   
>   VkResult wsi_create_wl_surface(const VkAllocationCallbacks *pAllocator,




More information about the mesa-dev mailing list