summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi/wsi_common_x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vulkan/wsi/wsi_common_x11.c')
-rw-r--r--src/vulkan/wsi/wsi_common_x11.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 6b7e133..09718eb 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -421,11 +421,11 @@ x11_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;
+ return *pPresentModeCount < ARRAY_SIZE(present_modes) ?
+ VK_INCOMPLETE : VK_SUCCESS;
}
VkResult wsi_create_xcb_surface(const VkAllocationCallbacks *pAllocator,