Commit 9f64ee45 authored by Laszlo Agocs's avatar Laszlo Agocs
Browse files

vk: Try MAILBOX then IMMEDIATE when FIFO is not wanted

parent cfe6c8cb
...@@ -1008,11 +1008,13 @@ bool QRhiVulkan::recreateSwapChain(QRhiSwapChain *swapChain) ...@@ -1008,11 +1008,13 @@ bool QRhiVulkan::recreateSwapChain(QRhiSwapChain *swapChain)
if (swapChainD->supportsReadback && swapChainD->m_flags.testFlag(QRhiSwapChain::UsedAsTransferSource)) if (swapChainD->supportsReadback && swapChainD->m_flags.testFlag(QRhiSwapChain::UsedAsTransferSource))
usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT; usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
VkPresentModeKHR presentMode = swapChainD->m_flags.testFlag(QRhiSwapChain::NoVSync) VkPresentModeKHR presentMode = VK_PRESENT_MODE_FIFO_KHR;
? VK_PRESENT_MODE_IMMEDIATE_KHR if (swapChainD->m_flags.testFlag(QRhiSwapChain::NoVSync)) {
: VK_PRESENT_MODE_FIFO_KHR; if (swapChainD->supportedPresentationModes.contains(VK_PRESENT_MODE_MAILBOX_KHR))
if (!swapChainD->supportedPresentationModes.contains(presentMode)) presentMode = VK_PRESENT_MODE_MAILBOX_KHR;
presentMode = VK_PRESENT_MODE_FIFO_KHR; else if (swapChainD->supportedPresentationModes.contains(VK_PRESENT_MODE_IMMEDIATE_KHR))
presentMode = VK_PRESENT_MODE_IMMEDIATE_KHR;
}
qDebug("Creating new swapchain of %d buffers, size %dx%d, presentation mode %d", qDebug("Creating new swapchain of %d buffers, size %dx%d, presentation mode %d",
reqBufferCount, swapChainD->pixelSize.width(), swapChainD->pixelSize.height(), presentMode); reqBufferCount, swapChainD->pixelSize.width(), swapChainD->pixelSize.height(), presentMode);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment