diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-30 15:44:49 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-10-05 14:56:04 +0200 |
commit | 62b9f1f3909fbe856d59639caed45ea3c466519c (patch) | |
tree | 92d92aed90c5c0d95f0cbbfe0f60d26fea352896 /src/quick/scenegraph | |
parent | 389d4b1971630a67e3d6fa45b11ec13af59d26e0 (diff) |
Follow rhi per-frame to per-pass flag change
Change-Id: I728cecd85807eb835703a0bb8bb4acdb1f2068ae
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 9 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 4 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 8091ccad5d..636b06dfa0 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -3644,7 +3644,14 @@ void Renderer::prepareRenderPass(RenderPassContext *ctx) void Renderer::beginRenderPass(RenderPassContext *) { - commandBuffer()->beginPass(renderTarget(), m_pstate.clearColor, m_pstate.dsClear); + commandBuffer()->beginPass(renderTarget(), m_pstate.clearColor, m_pstate.dsClear, nullptr, + // we cannot tell if the application will have + // native rendering thrown in to this pass + // (QQuickWindow::beginExternalCommands()), so + // we have no choice but to set the flag always + // (thus triggering using secondary command + // buffers with Vulkan) + QRhiCommandBuffer::ExternalContent); if (m_renderPassRecordingCallbacks.start) m_renderPassRecordingCallbacks.start(m_renderPassRecordingCallbacks.userData); diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 2924516eaf..ea4f21facb 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -649,9 +649,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) emit window->beforeFrameBegin(); Q_ASSERT(rhi == cd->rhi); - // ### the flag should only be set when the app requests it, but there's no way to do that right now - QRhi::BeginFrameFlags frameFlags = QRhi::ExternalContentsInPass; - QRhi::FrameOpResult frameResult = rhi->beginFrame(cd->swapchain, frameFlags); + QRhi::FrameOpResult frameResult = rhi->beginFrame(cd->swapchain); if (frameResult != QRhi::FrameOpSuccess) { if (frameResult == QRhi::FrameOpDeviceLost) handleDeviceLoss(); diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index fca2cfb5fa..48ae4a9116 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -704,9 +704,7 @@ void QSGRenderThread::syncAndRender(QImage *grabImage) emit window->beforeFrameBegin(); Q_ASSERT(rhi == cd->rhi); - // ### the flag should only be set when the app requests it, but there's no way to do that right now - QRhi::BeginFrameFlags frameFlags = QRhi::ExternalContentsInPass; - QRhi::FrameOpResult frameResult = rhi->beginFrame(cd->swapchain, frameFlags); + QRhi::FrameOpResult frameResult = rhi->beginFrame(cd->swapchain); if (frameResult != QRhi::FrameOpSuccess) { if (frameResult == QRhi::FrameOpDeviceLost) handleDeviceLoss(); |