diff options
Diffstat (limited to 'src/quick/scenegraph/qsgrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 80f022ddb4..2924516eaf 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -526,15 +526,21 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) rhiSupport->prepareWindowForRhi(window); QRhiSwapChain::Flags flags = QRhiSwapChain::UsedAsTransferSource; // may be used in a grab + const QSurfaceFormat requestedFormat = window->requestedFormat(); // QQ is always premul alpha. Decide based on alphaBufferSize in // requestedFormat(). (the platform plugin can override format() but // what matters here is what the application wanted, hence using the // requested one) - const bool alpha = window->requestedFormat().alphaBufferSize() > 0; + const bool alpha = requestedFormat.alphaBufferSize() > 0; if (alpha) flags |= QRhiSwapChain::SurfaceHasPreMulAlpha; + // Request NoVSync if swap interval was set to 0. What this means in + // practice is another question, but at least we tried. + if (requestedFormat.swapInterval() == 0) + flags |= QRhiSwapChain::NoVSync; + cd->swapchain = rhi->newSwapChain(); static bool depthBufferEnabled = qEnvironmentVariableIsEmpty("QSG_NO_DEPTH_BUFFER"); if (depthBufferEnabled) { |