summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-01-24 16:43:15 -0800
committerJason Ekstrand <[email protected]>2017-01-25 09:05:25 -0800
commit659edd9f5ce995aa47e2ab02425508cc29140cce (patch)
tree22ef6f80c5b88bd8724a4774726207692cc364d8
parentdc578ef060f6b92e6fd2f77bb6454a5fb22a471c (diff)
vulkan/wsi/wayland: Handle VK_INCOMPLETE for GetPresentModes
Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "17.0" <[email protected]>
-rw-r--r--src/vulkan/wsi/wsi_common_wayland.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index d745413c403..04cea97f421 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,