diff options
-rwxr-xr-x | main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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))) { |