diff options
| author | Chris Forbes <chrisforbes@google.com> | 2015-12-30 10:45:47 +1300 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2016-01-14 15:25:53 -0700 |
| commit | d22510a14d05e59b2598b3b9780d62febfb7f375 (patch) | |
| tree | b7c36bf698d9bf30518863ca0a345655c5856686 | |
| parent | c33ed956f620e0851a10b77969412d814ed123a4 (diff) | |
| download | usermoji-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.c | 11 |
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; } |
