diff options
author | Nicolas Guichard <nicolas.guichard@kdab.com> | 2020-02-19 12:38:27 +0100 |
---|---|---|
committer | Nicolas Guichard <nicolas.guichard@kdab.com> | 2020-02-19 17:39:51 +0100 |
commit | 7981dbfaf371a368fbd69e935768b310f42a0e5a (patch) | |
tree | 8724fd053f27b21a822a2dd20e7c127d48b4f8ce /tests | |
parent | 49dbe760e4e0d8a781b5336efdce4748a7d73a33 (diff) |
QShaderGraph: don't generate statements with undefined inputs
This fixes the shader generation for graphs like this one:
Function0 ------> Output0
(with unbound input)
Input ------> Function1 ------> Output1
With those graphs, createStatements will not return any statement for
nodes Function0 and Output0.
Change-Id: Iec32aa51623e176b03ae23e580f06d14df80a194
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp b/tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp index 50c925a111..014a163f58 100644 --- a/tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp +++ b/tests/auto/gui/util/qshadergraph/tst_qshadergraph.cpp @@ -516,12 +516,9 @@ void tst_QShaderGraph::shouldHandleUnboundPortsDuringGraphSerialization() const auto statements = graph.createStatements(); // THEN - // Note that no edge leads to the unbound input + // Note that no statement has any unbound input const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(input, {}, {0}) - << createStatement(function, {-1, 0, -1}, {2, 3, 4}) - << createStatement(unboundOutput, {-1}, {}) - << createStatement(output, {3}, {}); + << createStatement(input, {}, {0}); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } @@ -568,9 +565,8 @@ void tst_QShaderGraph::shouldSurviveCyclesDuringGraphSerialization() const auto statements = graph.createStatements(); // THEN - // Obviously will lead to a compile failure later on since it cuts everything beyond the cycle - const auto expected = QVector<QShaderGraph::Statement>() - << createStatement(output, {2}, {}); + // The cycle is ignored + const auto expected = QVector<QShaderGraph::Statement>(); dumpStatementsIfNeeded(statements, expected); QCOMPARE(statements, expected); } |