aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultrendercontext_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-04-17 17:11:42 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-04-17 19:32:00 +0200
commite05fcf6b604dae0c060729eaf4e75542c0973caf (patch)
tree0d7157a3cd9742ce00641bbd9ffd5a90584c8acd /src/quick/scenegraph/qsgdefaultrendercontext_p.h
parent51e610183fe6bf4a7e38a67219041d406ad6e9d5 (diff)
rhi: Make rendercontext query safe in slots connected to invalidated
separateIndexBuffers() returns an incorrect value when called from a slot connected to the invalidated() signal. This is because members like m_rhi are nulled out before emitting the signal (thus making isValid() return false), and this follows the existing QOpenGLContext (m_gl) behavior. Instead of altering the logic, just decide the value of separateIndexBuffers in initialize() and keep returning that from the query from then on. This is relevant for Qt Quick 3D at least, which happens to destroy manually created QSGLayer instances (which in turn own renderer objects) in a slot connected to invalidated(). Task-number: QTBUG-83469 Change-Id: I81b34b57921242367c80f7d04331cb6bd3318ec8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultrendercontext_p.h')
-rw-r--r--src/quick/scenegraph/qsgdefaultrendercontext_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgdefaultrendercontext_p.h b/src/quick/scenegraph/qsgdefaultrendercontext_p.h
index 97ed681f9a..cddfe9add2 100644
--- a/src/quick/scenegraph/qsgdefaultrendercontext_p.h
+++ b/src/quick/scenegraph/qsgdefaultrendercontext_p.h
@@ -179,6 +179,7 @@ protected:
QRhiCommandBuffer *m_currentFrameCommandBuffer;
QRhiRenderPassDescriptor *m_currentFrameRenderPass;
qreal m_currentDevicePixelRatio;
+ bool m_separateIndexBuffer;
};
QT_END_NAMESPACE