aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-08 20:18:38 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-08 20:03:39 +0000
commit92da3afdb69c52b955f3828ec10574031f094c7d (patch)
tree8183d033621f3660d701e95be73d99dcfb1a51fb /src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
parent76c7f7b10f309b05d83114669f7c9aa116bcbd9a (diff)
D3D12: Add a way to test device loss and fix discovered issues
Set QT_D3D_DEVICE_LOSS_TEST to a number N > 0 to trigger a device reset N times in 5 second intervals. Cinematic is able to survive now which is excellent news. Also tested a real driver update which worked as well, Cinematic kept running all the time (unlike Creator). Change-Id: Ib59c7dece6b90321e6bd7e01c0687c51d5b61333 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp')
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
index 9798f0ca66..44c2744978 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
@@ -656,6 +656,20 @@ void QSGD3D12RenderThread::syncAndRender()
int(threadTimer.elapsed() - renderTime / 1000000));
Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+
+ static int devLossTest = qEnvironmentVariableIntValue("QT_D3D_TEST_DEVICE_LOSS");
+ if (devLossTest > 0) {
+ static QElapsedTimer kt;
+ static bool timerRunning = false;
+ if (!timerRunning) {
+ kt.start();
+ timerRunning = true;
+ } else if (kt.elapsed() > 5000) {
+ --devLossTest;
+ kt.restart();
+ engine->simulateDeviceLoss();
+ }
+ }
}
template<class T> T *windowFor(const QVector<T> &list, QQuickWindow *window)