summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 73bd03c..6b7e133 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -404,11 +404,11 @@ x11_surface_get_formats(VkIcdSurfaceBase *surface,
return VK_SUCCESS;
}
- assert(*pSurfaceFormatCount >= ARRAY_SIZE(formats));
+ *pSurfaceFormatCount = MIN2(*pSurfaceFormatCount, ARRAY_SIZE(formats));
typed_memcpy(pSurfaceFormats, formats, *pSurfaceFormatCount);
- *pSurfaceFormatCount = ARRAY_SIZE(formats);
- return VK_SUCCESS;
+ return *pSurfaceFormatCount < ARRAY_SIZE(formats) ?
+ VK_INCOMPLETE : VK_SUCCESS;
}
static VkResult