Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Laszlo Agocs
qtrhi
Commits
9f64ee45
Commit
9f64ee45
authored
Jan 07, 2019
by
Laszlo Agocs
Browse files
vk: Try MAILBOX then IMMEDIATE when FIFO is not wanted
parent
cfe6c8cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rhi/qrhivulkan.cpp
View file @
9f64ee45
...
...
@@ -1008,11 +1008,13 @@ bool QRhiVulkan::recreateSwapChain(QRhiSwapChain *swapChain)
if
(
swapChainD
->
supportsReadback
&&
swapChainD
->
m_flags
.
testFlag
(
QRhiSwapChain
::
UsedAsTransferSource
))
usage
|=
VK_IMAGE_USAGE_TRANSFER_SRC_BIT
;
VkPresentModeKHR
presentMode
=
swapChainD
->
m_flags
.
testFlag
(
QRhiSwapChain
::
NoVSync
)
?
VK_PRESENT_MODE_IMMEDIATE_KHR
:
VK_PRESENT_MODE_FIFO_KHR
;
if
(
!
swapChainD
->
supportedPresentationModes
.
contains
(
presentMode
))
presentMode
=
VK_PRESENT_MODE_FIFO_KHR
;
VkPresentModeKHR
presentMode
=
VK_PRESENT_MODE_FIFO_KHR
;
if
(
swapChainD
->
m_flags
.
testFlag
(
QRhiSwapChain
::
NoVSync
))
{
if
(
swapChainD
->
supportedPresentationModes
.
contains
(
VK_PRESENT_MODE_MAILBOX_KHR
))
presentMode
=
VK_PRESENT_MODE_MAILBOX_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"
,
reqBufferCount
,
swapChainD
->
pixelSize
.
width
(),
swapChainD
->
pixelSize
.
height
(),
presentMode
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment