mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
vulkan/wsi/x11: Smplify implementation of vkGetPhysicalDeviceSurfaceFormatsKHR
This patch simplifies x11_surface_get_formats(). It is actually just a
readability improvement over the patch I provided earlier this week
(750d8cad72).
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
parent
b677b99db5
commit
129da27426
1 changed files with 3 additions and 8 deletions
|
|
@ -396,16 +396,11 @@ x11_surface_get_formats(VkIcdSurfaceBase *surface,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
if (*pSurfaceFormatCount > ARRAY_SIZE(formats))
|
||||
*pSurfaceFormatCount = ARRAY_SIZE(formats);
|
||||
else if (*pSurfaceFormatCount < ARRAY_SIZE(formats))
|
||||
result = VK_INCOMPLETE;
|
||||
|
||||
*pSurfaceFormatCount = MIN2(*pSurfaceFormatCount, ARRAY_SIZE(formats));
|
||||
typed_memcpy(pSurfaceFormats, formats, *pSurfaceFormatCount);
|
||||
|
||||
return result;
|
||||
return *pSurfaceFormatCount < ARRAY_SIZE(formats) ?
|
||||
VK_INCOMPLETE : VK_SUCCESS;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue