From 1e686542139ed671aea075131a507430a5819e30 Mon Sep 17 00:00:00 2001 From: Jordan Halase Date: Thu, 7 Nov 2019 13:58:05 -0600 Subject: Move presentMode into RenderVulkan --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 1dbd93e..0686583 100755 --- a/main.c +++ b/main.c @@ -219,6 +219,7 @@ struct RenderVulkan { VkInstance instance; VkDebugReportCallbackEXT debugCallback; VkSurfaceKHR surface; + VkPresentModeKHR presentMode; VkPhysicalDeviceProperties deviceProperties; // TODO: Make this a pointer. It's really big. VkPhysicalDevice physicalDevice; uint32_t graphicsIndex; @@ -1238,6 +1239,7 @@ static int rvkCreateRawSwapchain(struct RenderVulkan *vk, int width, int height) VkSurfaceFormatKHR *surfaceFormats; VkPresentModeKHR *presentModes; VkResult result; + /* TODO: Separate this preliminary stuff into a configureSurface() */ if ((result = vk->api->vkGetPhysicalDeviceSurfaceCapabilitiesKHR( vk->physicalDevice, vk->surface, &surfaceCapabilities))) { rvkSetErrMsg(vk, "Could not get surface capabilities: %d", result); @@ -1307,6 +1309,7 @@ static int rvkCreateRawSwapchain(struct RenderVulkan *vk, int width, int height) presentMode = VK_PRESENT_MODE_FIFO_KHR; } free(presentModes); + vk->presentMode = presentMode; printf("Using present mode:\t\t`%s`\t(%d)\n", strPresentMode(presentMode), presentMode); // TODO: Clamp @@ -1329,7 +1332,7 @@ static int rvkCreateRawSwapchain(struct RenderVulkan *vk, int width, int height) createInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; createInfo.preTransform = surfaceCapabilities.currentTransform; createInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; - createInfo.presentMode = presentMode; + createInfo.presentMode = vk->presentMode; createInfo.clipped = VK_TRUE; createInfo.oldSwapchain = VK_NULL_HANDLE; // TODO if ((result = vk->dev->vkCreateSwapchainKHR(vk->device, &createInfo, ALLOC_VK, &vk->swapchain->rawSwapchain))) { -- cgit v1.2.1