mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
vk: Fix size return value handling in a couple plces
This commit is contained in:
parent
9a95d08ed6
commit
b3c037f329
3 changed files with 16 additions and 4 deletions
|
|
@ -653,7 +653,7 @@ VkResult anv_GetGlobalExtensionProperties(
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
assert(*pCount <= ARRAY_SIZE(global_extensions));
|
||||
assert(*pCount >= ARRAY_SIZE(global_extensions));
|
||||
|
||||
*pCount = ARRAY_SIZE(global_extensions);
|
||||
memcpy(pProperties, global_extensions, sizeof(global_extensions));
|
||||
|
|
@ -679,7 +679,7 @@ VkResult anv_GetPhysicalDeviceExtensionProperties(
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
assert(*pCount < ARRAY_SIZE(device_extensions));
|
||||
assert(*pCount >= ARRAY_SIZE(device_extensions));
|
||||
|
||||
*pCount = ARRAY_SIZE(device_extensions);
|
||||
memcpy(pProperties, device_extensions, sizeof(device_extensions));
|
||||
|
|
|
|||
|
|
@ -327,9 +327,15 @@ wsi_wl_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 = MIN_NUM_IMAGES;
|
||||
props->maxImageCount = 4;
|
||||
props->currentExtent = (VkExtent2D) { -1, -1 };
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue