summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_wsi_x11.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-09-04 19:05:51 -0700
committerJason Ekstrand <[email protected]>2015-09-04 19:05:51 -0700
commitb3c037f329beb5d7a63a7e755ca3b15acdfce972 (patch)
tree8747cb61f8db30dbfdafb43257e9fbf48f949e80 /src/vulkan/anv_wsi_x11.c
parent9a95d08ed6af92c38f84d750022131c9d03f77ce (diff)
vk: Fix size return value handling in a couple plces
Diffstat (limited to 'src/vulkan/anv_wsi_x11.c')
-rw-r--r--src/vulkan/anv_wsi_x11.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vulkan/anv_wsi_x11.c b/src/vulkan/anv_wsi_x11.c
index 212c01be0b9..b412a2bab32 100644
--- a/src/vulkan/anv_wsi_x11.c
+++ b/src/vulkan/anv_wsi_x11.c
@@ -59,9 +59,15 @@ x11_get_surface_info(struct anv_wsi_implementation *impl,
switch (infoType) {
case VK_SURFACE_INFO_TYPE_PROPERTIES_WSI: {
- assert(*pDataSize >= sizeof(VkSurfacePropertiesWSI));
VkSurfacePropertiesWSI *props = pData;
+ if (pData == NULL) {
+ *pDataSize = sizeof(*props);
+ return VK_SUCCESS;
+ }
+
+ assert(*pDataSize >= sizeof(*props));
+
props->minImageCount = 2;
props->maxImageCount = 4;
props->currentExtent = (VkExtent2D) { -1, -1 };