From a5600b6e5904c19cbfe752806778bb9122388cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Mathisen?= Date: Sun, 13 Nov 2016 05:23:33 +0100 Subject: [PATCH] Vulkan example: Proper surface format search. --- examples/vulkan_example/main.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/examples/vulkan_example/main.cpp b/examples/vulkan_example/main.cpp index f1efd8b8..b0535e84 100644 --- a/examples/vulkan_example/main.cpp +++ b/examples/vulkan_example/main.cpp @@ -23,7 +23,7 @@ static VkRenderPass g_RenderPass = VK_NULL_HANDLE; static uint32_t g_QueueFamily = 0; static VkQueue g_Queue = VK_NULL_HANDLE; -static VkFormat g_Format = VK_FORMAT_B8G8R8A8_UNORM; +static VkFormat g_ImageFormat = VK_FORMAT_B8G8R8A8_UNORM; static VkFormat g_ViewFormat = VK_FORMAT_B8G8R8A8_UNORM; static VkColorSpaceKHR g_ColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; static VkImageSubresourceRange g_ImageRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}; @@ -76,7 +76,7 @@ static void resize_vulkan(GLFWwindow* /*window*/, int w, int h) VkSwapchainCreateInfoKHR info = {}; info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; info.surface = g_Surface; - info.imageFormat = g_Format; + info.imageFormat = g_ImageFormat; info.imageColorSpace = g_ColorSpace; info.imageArrayLayers = 1; info.imageUsage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; @@ -216,7 +216,7 @@ static void setup_vulkan(GLFWwindow* window) // Get queue { uint32_t count; - vkGetPhysicalDeviceQueueFamilyProperties(g_Gpu, &count, nullptr); + vkGetPhysicalDeviceQueueFamilyProperties(g_Gpu, &count, NULL); VkQueueFamilyProperties *queues = (VkQueueFamilyProperties*)malloc(sizeof(VkQueueFamilyProperties)*count); vkGetPhysicalDeviceQueueFamilyProperties(g_Gpu, &count, queues); for(uint32_t i=0; i