summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-09-06 18:06:33 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2021-09-07 14:41:11 +0200
commit4cde0e484c009415397430050cde389fb9b445b6 (patch)
treee06d5ae760842952c5689652fd471e4cc300c435 /tests
parentb6b0c33058ba7f43661e316d9f27d4102f6a988f (diff)
rhi: Enable serializing a layout description without baking an srb
Pick-to: 6.2 Change-Id: I66d28cc9d5417bcd5d192fa100c21f69fd42fd6b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/rhi/qrhi/tst_qrhi.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
index 61e19434e0..603acc03de 100644
--- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
+++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
@@ -3314,6 +3314,15 @@ void tst_QRhi::srbLayoutCompatibility()
QVERIFY(!srb1->serializedLayoutDescription().isEmpty());
QVERIFY(!srb2->serializedLayoutDescription().isEmpty());
QCOMPARE(srb1->serializedLayoutDescription(), srb2->serializedLayoutDescription());
+
+ // see what we would get if a binding list got serialized "manually", without pulling it out from the srb after building
+ // (the results should be identical)
+ QVector<quint32> layoutDesc1;
+ QRhiShaderResourceBinding::serializeLayoutDescription(srb1->cbeginBindings(), srb1->cendBindings(), std::back_inserter(layoutDesc1));
+ QCOMPARE(layoutDesc1, srb1->serializedLayoutDescription());
+ QVector<quint32> layoutDesc2;
+ QRhiShaderResourceBinding::serializeLayoutDescription(srb2->cbeginBindings(), srb2->cendBindings(), std::back_inserter(layoutDesc2));
+ QCOMPARE(layoutDesc2, srb2->serializedLayoutDescription());
}
// different visibility (not compatible)