summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-09-06 18:06:33 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-07 13:19:18 +0000
commit8f52022bbdd6aae40539191ce9db8b87328fe5b6 (patch)
tree7451f594fa2979d3a08460668b8661c1eea9d261 /tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
parent6b6475539815f73dcab5ccf94ea33fd54fcb23bf (diff)
rhi: Enable serializing a layout description without baking an srb
Change-Id: I66d28cc9d5417bcd5d192fa100c21f69fd42fd6b Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 4cde0e484c009415397430050cde389fb9b445b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/gui/rhi/qrhi/tst_qrhi.cpp')
-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)