aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-09-30 15:44:49 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-10-05 14:56:04 +0200
commit62b9f1f3909fbe856d59639caed45ea3c466519c (patch)
tree92d92aed90c5c0d95f0cbbfe0f60d26fea352896 /src/quick
parent389d4b1971630a67e3d6fa45b11ec13af59d26e0 (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')
-rw-r--r--src/quick/items/qquickrendercontrol.cpp2
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp9
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp4
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp4
4 files changed, 11 insertions, 8 deletions
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index 97c7f04553..7d1ee373b2 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -602,7 +602,7 @@ void QQuickRenderControl::beginFrame()
emit d->window->beforeFrameBegin();
- d->rhi->beginOffscreenFrame(&d->cb, QRhi::ExternalContentsInPass); // must specify ExternalContents since we do not know in advance
+ d->rhi->beginOffscreenFrame(&d->cb);
}
/*!
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();