From d22510a14d05e59b2598b3b9780d62febfb7f375 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 30 Dec 2015 10:45:47 +1300 Subject: nulldrv: Expose some basic formats as presentable Previously we just left whatever junk the caller had in this memory, which generally crashed a caller. Signed-off-by: Chris Forbes --- icd/nulldrv/nulldrv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/icd/nulldrv/nulldrv.c b/icd/nulldrv/nulldrv.c index 56edb488..7433ae79 100644 --- a/icd/nulldrv/nulldrv.c +++ b/icd/nulldrv/nulldrv.c @@ -739,6 +739,17 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR( { NULLDRV_LOG_FUNC; + if (pSurfaceFormats) { + uint32_t i; + for (i = 0; i < *pSurfaceFormatCount; i++) { + pSurfaceFormats[i].format = nulldrv_presentable_formats[i]; + pSurfaceFormats[i].colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; + } + } + else { + *pSurfaceFormatCount = ARRAY_SIZE(nulldrv_presentable_formats); + } + return VK_SUCCESS; } -- cgit v1.2.3