aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2015-12-30 10:45:47 +1300
committerJon Ashburn <jon@lunarg.com>2016-01-14 15:25:53 -0700
commitd22510a14d05e59b2598b3b9780d62febfb7f375 (patch)
treeb7c36bf698d9bf30518863ca0a345655c5856686
parentc33ed956f620e0851a10b77969412d814ed123a4 (diff)
downloadusermoji-d22510a14d05e59b2598b3b9780d62febfb7f375.tar.xz
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 <chrisforbes@google.com>
-rw-r--r--icd/nulldrv/nulldrv.c11
1 files changed, 11 insertions, 0 deletions
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;
}