diff options
Diffstat (limited to 'drivers/vulkan/vulkan_context.cpp')
-rw-r--r-- | drivers/vulkan/vulkan_context.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 864ad5931a..b8cea7136d 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -1871,7 +1871,10 @@ Error VulkanContext::_update_swap_chain(Window *window) { // Set the windows present mode if it is available, otherwise FIFO is used (guaranteed supported). if (present_mode_available) { - window->presentMode = requested_present_mode; + if (window->presentMode != requested_present_mode) { + window->presentMode = requested_present_mode; + print_verbose("Using present mode: " + String(string_VkPresentModeKHR(window->presentMode))); + } } else { String present_mode_string; switch (window->vsync_mode) { @@ -1892,8 +1895,6 @@ Error VulkanContext::_update_swap_chain(Window *window) { window->vsync_mode = DisplayServer::VSYNC_ENABLED; // Set to default. } - print_verbose("Using present mode: " + String(string_VkPresentModeKHR(window->presentMode))); - free(presentModes); // Determine the number of VkImages to use in the swap chain. @@ -2271,7 +2272,7 @@ Error VulkanContext::prepare_buffers() { print_verbose("Vulkan: Early suboptimal swapchain."); break; } else if (err != VK_SUCCESS) { - ERR_BREAK_MSG(err != VK_SUCCESS, "Vulkan: Did not create swapchain successfully."); + ERR_BREAK_MSG(err != VK_SUCCESS, "Vulkan: Did not create swapchain successfully. Error code: " + String(string_VkResult(err))); } else { w->semaphore_acquired = true; } @@ -2348,7 +2349,7 @@ Error VulkanContext::swap_buffers() { submit_info.signalSemaphoreCount = 1; submit_info.pSignalSemaphores = &draw_complete_semaphores[frame_index]; err = vkQueueSubmit(graphics_queue, 1, &submit_info, fences[frame_index]); - ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "Vulkan: Cannot submit graphics queue. Error code: " + String(string_VkResult(err))); command_buffer_queue.write[0] = nullptr; command_buffer_count = 1; @@ -2379,7 +2380,7 @@ Error VulkanContext::swap_buffers() { submit_info.signalSemaphoreCount = 1; submit_info.pSignalSemaphores = &image_ownership_semaphores[frame_index]; err = vkQueueSubmit(present_queue, 1, &submit_info, nullFence); - ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "Vulkan: Cannot submit present queue. Error code: " + String(string_VkResult(err))); } // If we are using separate queues, we have to wait for image ownership, @@ -2488,14 +2489,14 @@ Error VulkanContext::swap_buffers() { if (err == VK_ERROR_OUT_OF_DATE_KHR) { // Swapchain is out of date (e.g. the window was resized) and // must be recreated. - print_verbose("Vulkan: Swapchain is out of date, recreating."); + print_verbose("Vulkan queue submit: Swapchain is out of date, recreating."); resize_notify(); } else if (err == VK_SUBOPTIMAL_KHR) { // Swapchain is not as optimal as it could be, but the platform's // presentation engine will still present the image correctly. - print_verbose("Vulkan: Swapchain is suboptimal."); + print_verbose("Vulkan queue submit: Swapchain is suboptimal."); } else { - ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "Error code: " + String(string_VkResult(err))); } buffers_prepared = false; |