From f002f7dad7fbe0b6f9457605b3d2968f00643aa9 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 2 Apr 2020 06:07:47 +0100 Subject: cube: Remove unncessary VK_FORMAT_UNDEFINED check for surface formats From the spec: The number of format pairs supported must be greater than or equal to 1. pSurfaceFormats must not contain an entry whose value for format is VK_FORMAT_UNDEFINED. --- cube/cube.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'cube/cube.c') diff --git a/cube/cube.c b/cube/cube.c index 83c53180..7de8e268 100644 --- a/cube/cube.c +++ b/cube/cube.c @@ -3489,15 +3489,8 @@ static void demo_init_vk_swapchain(struct demo *demo) { VkSurfaceFormatKHR *surfFormats = (VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR)); err = demo->fpGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu, demo->surface, &formatCount, surfFormats); assert(!err); - // If the format list includes just one entry of VK_FORMAT_UNDEFINED, - // the surface has no preferred format. Otherwise, at least one - // supported format will be returned. - if (formatCount == 1 && surfFormats[0].format == VK_FORMAT_UNDEFINED) { - demo->format = VK_FORMAT_B8G8R8A8_UNORM; - } else { - assert(formatCount >= 1); - demo->format = surfFormats[0].format; - } + assert(formatCount >= 1); + demo->format = surfFormats[0].format; demo->color_space = surfFormats[0].colorSpace; free(surfFormats); -- cgit v1.2.3