aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-09-23 14:43:43 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-09-30 09:00:37 +0200
commitcf51a723ffbddc5338628b99fa4a5b5b4d17295c (patch)
treebb2faccafb31d856f20ef4244e2295717274bac1 /src/quick/scenegraph
parent6bb678bad25eafe76dcebcd1ff184be9de9125bb (diff)
Remove depth-stencil buffer sizing on the rhi path
...as this will be done automatically by QRhiSwapChain after the corresponding QtGui changes. Task-number: QTBUG-78641 Change-Id: I8edeb728f3aba07bfa6bc6331966fba4bdee71f4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp14
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp8
2 files changed, 11 insertions, 11 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index a5b5fe04f5..e69d25aab3 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -667,9 +667,6 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
if (cd->swapchainJustBecameRenderable)
qCDebug(QSG_LOG_RENDERLOOP, "just became exposed");
- cd->depthStencilForSwapchain->setPixelSize(effectiveOutputSize);
- cd->depthStencilForSwapchain->build();
-
cd->hasActiveSwapchain = cd->swapchain->buildOrResize();
if (!cd->hasActiveSwapchain && rhi->isDeviceLost()) {
handleDeviceLoss();
@@ -679,10 +676,15 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
cd->swapchainJustBecameRenderable = false;
cd->hasRenderableSwapchain = cd->hasActiveSwapchain;
- if (!cd->hasActiveSwapchain)
- qWarning("Failed to build or resize swapchain");
- else
+ if (cd->hasActiveSwapchain) {
+ // surface size atomicity: now that buildOrResize() succeeded,
+ // query the size that was used in there by the swapchain, and
+ // that is the size we will use while preparing the next frame.
+ effectiveOutputSize = cd->swapchain->currentPixelSize();
qCDebug(QSG_LOG_RENDERLOOP) << "rhi swapchain size" << effectiveOutputSize;
+ } else {
+ qWarning("Failed to build or resize swapchain");
+ }
}
Q_ASSERT(rhi == cd->rhi);
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index cbf57225b0..3689f6501f 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -715,9 +715,6 @@ void QSGRenderThread::syncAndRender(QImage *grabImage)
if (cd->swapchainJustBecameRenderable)
qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "just became exposed");
- cd->depthStencilForSwapchain->setPixelSize(effectiveOutputSize);
- cd->depthStencilForSwapchain->build();
-
cd->hasActiveSwapchain = cd->swapchain->buildOrResize();
if (!cd->hasActiveSwapchain && rhi->isDeviceLost()) {
handleDeviceLoss();
@@ -731,7 +728,7 @@ void QSGRenderThread::syncAndRender(QImage *grabImage)
if (!cd->hasActiveSwapchain)
qWarning("Failed to build or resize swapchain");
else
- qCDebug(QSG_LOG_RENDERLOOP) << "rhi swapchain size" << effectiveOutputSize;
+ qCDebug(QSG_LOG_RENDERLOOP) << "rhi swapchain size" << cd->swapchain->currentPixelSize();
}
Q_ASSERT(rhi == cd->rhi);
@@ -810,8 +807,9 @@ void QSGRenderThread::syncAndRender(QImage *grabImage)
}
}
if (current) {
+ const QSize outputSize = rhi ? cd->swapchain->currentPixelSize() : windowSize;
- d->renderSceneGraph(windowSize);
+ d->renderSceneGraph(outputSize);
if (profileFrames)
renderTime = threadTimer.nsecsElapsed();