aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-11-16 18:19:02 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-11-17 10:09:05 +0100
commitca8b48ed6279fbfcc4a13c65cfe4baa9b70327f0 (patch)
tree44b02ed23641533832a57b30c5e6ed76b80e0170
parent09ea2ca2a7501e515f086d7a0f4300fc965e4396 (diff)
Fix incorrect assumptions with Metal in tst_qquickwindow
Two cases fail due to attempting to query the MTLRenderCommandEncoder in a state where QRhi::beginPass() was not yet called. This is invalid and we should not test for it either. Change-Id: Ieaaaabd275db68be98365fb76a39f30a635d3543 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index a3eb7d70ef..7fe8d94c74 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -3642,8 +3642,10 @@ void tst_qquickwindow::rendererInterface()
case QSGRendererInterface::MetalRhi:
if (!rif->getResource(window, QSGRendererInterface::CommandListResource))
ok[idx] = false;
- if (!rif->getResource(window, QSGRendererInterface::CommandEncoderResource))
- ok[idx] = false;
+ if (idx == 1 || idx == 2) { // must be recording a render pass to query the command encoder
+ if (!rif->getResource(window, QSGRendererInterface::CommandEncoderResource))
+ ok[idx] = false;
+ }
break;
default:
break;
@@ -3837,8 +3839,10 @@ void tst_qquickwindow::rendererInterfaceWithRenderControl()
case QSGRendererInterface::MetalRhi:
if (!rif->getResource(window, QSGRendererInterface::CommandListResource))
ok[idx] = false;
- if (!rif->getResource(window, QSGRendererInterface::CommandEncoderResource))
- ok[idx] = false;
+ if (idx == 1 || idx == 2) { // must be recording a render pass to query the command encoder
+ if (!rif->getResource(window, QSGRendererInterface::CommandEncoderResource))
+ ok[idx] = false;
+ }
break;
default:
break;