diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-05-14 14:01:56 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-05-14 14:01:56 +0200 |
commit | 1f1f4b779382289abba98c5914ff18f593124bac (patch) | |
tree | cd23dacf7c7ba94024e418d47a0aa215169e58c3 | |
parent | e11ffc0d4f2703904355f25ea076bda41e7c4ec2 (diff) | |
parent | 5e16aa067ac6a8b5f031ffcefc356777a0da34ad (diff) |
Merge remote-tracking branch 'origin/5.15.0' into 5.15
Change-Id: I1cf01e05694ba93326f2e549ca16cbf5a273c01a
-rw-r--r-- | dist/changes-5.15.0 | 24 | ||||
-rw-r--r-- | src/render/frontend/qrenderaspect.cpp | 3 | ||||
-rw-r--r-- | src/render/shadergraph/qshadergraph.cpp | 22 | ||||
-rw-r--r-- | src/render/surfaces/vulkaninstance_p.h | 14 | ||||
-rw-r--r-- | tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp | 44 |
5 files changed, 97 insertions, 10 deletions
diff --git a/dist/changes-5.15.0 b/dist/changes-5.15.0 new file mode 100644 index 000000000..d2225b2b5 --- /dev/null +++ b/dist/changes-5.15.0 @@ -0,0 +1,24 @@ +Qt 5.15 introduces many new features and improvements as well as bugfixes +over the 5.14.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.15 series is binary compatible with the 5.14.x series. +Applications compiled for 5.14 will continue to run with 5.15. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* UNSPECIFIED * +**************************************************************************** + + - QSortPolicy add Uniform mode (to control whether uniform minization + should be performed) + - QMouseDevice add updateAxesContinuously property diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp index d9b53cb8d..de99840b2 100644 --- a/src/render/frontend/qrenderaspect.cpp +++ b/src/render/frontend/qrenderaspect.cpp @@ -842,6 +842,9 @@ void QRenderAspect::onUnregistered() d->m_renderer->releaseGraphicsResources(); + if (d->m_aspectManager) + d->services()->eventFilterService()->unregisterEventFilter(d->m_pickEventFilter.data()); + delete d->m_nodeManagers; d->m_nodeManagers = nullptr; diff --git a/src/render/shadergraph/qshadergraph.cpp b/src/render/shadergraph/qshadergraph.cpp index c2f3c343e..285aff116 100644 --- a/src/render/shadergraph/qshadergraph.cpp +++ b/src/render/shadergraph/qshadergraph.cpp @@ -242,16 +242,6 @@ QVector<QShaderGraph::Statement> QShaderGraph::createStatements(const QStringLis return res; }(); - const QVector<Edge> enabledEdges = [this, intersectsEnabledLayers] { - auto res = QVector<Edge>(); - std::copy_if(m_edges.cbegin(), m_edges.cend(), - std::back_inserter(res), - [intersectsEnabledLayers] (const Edge &edge) { - return intersectsEnabledLayers(edge.layers); - }); - return res; - }(); - const QHash<QUuid, Statement> idHash = [enabledNodes] { auto nextVarId = 0; auto res = QHash<QUuid, Statement>(); @@ -260,6 +250,18 @@ QVector<QShaderGraph::Statement> QShaderGraph::createStatements(const QStringLis return res; }(); + const QVector<Edge> enabledEdges = [this, intersectsEnabledLayers, &idHash] { + auto res = QVector<Edge>(); + std::copy_if(m_edges.cbegin(), m_edges.cend(), + std::back_inserter(res), + [intersectsEnabledLayers, &idHash] (const Edge &edge) { + return intersectsEnabledLayers(edge.layers) + && idHash.contains(edge.sourceNodeUuid) + && idHash.contains(edge.targetNodeUuid); + }); + return res; + }(); + auto result = QVector<Statement>(); QVector<Edge> currentEdges = enabledEdges; QVector<QUuid> currentUuids = [enabledNodes, enabledEdges] { diff --git a/src/render/surfaces/vulkaninstance_p.h b/src/render/surfaces/vulkaninstance_p.h index f46939ce6..67f52af6a 100644 --- a/src/render/surfaces/vulkaninstance_p.h +++ b/src/render/surfaces/vulkaninstance_p.h @@ -40,9 +40,22 @@ #ifndef QT3DRENDER_VULKANINSTANCE_P_H #define QT3DRENDER_VULKANINSTANCE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qtguiglobal.h> #include <Qt3DRender/private/qt3drender_global_p.h> + QT_BEGIN_NAMESPACE + #if QT_CONFIG(vulkan) class QVulkanInstance; namespace Qt3DRender { @@ -50,6 +63,7 @@ Q_3DRENDERSHARED_PRIVATE_EXPORT QVulkanInstance& staticVulkanInstance() noexcept; } // Qt3DRender #endif + QT_END_NAMESPACE #endif // QT3DRENDER_VULKANINSTANCE_P_H diff --git a/tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp b/tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp index 6336763f5..e21b57577 100644 --- a/tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp +++ b/tests/auto/render/shadergraph/qshadergraph/tst_qshadergraph.cpp @@ -116,6 +116,7 @@ private slots: void shouldDealWithEdgesJumpingOverLayers(); void shouldGenerateDifferentStatementsDependingOnActiveLayers(); void shouldDealWithBranchesWithoutOutput(); + void shouldDiscardEdgesConnectedToDiscardedNodes(); }; void tst_QShaderGraph::shouldHaveEdgeDefaultState() @@ -816,6 +817,49 @@ void tst_QShaderGraph::shouldDealWithBranchesWithoutOutput() QCOMPARE(statements, expected); } +void tst_QShaderGraph::shouldDiscardEdgesConnectedToDiscardedNodes() +{ + // GIVEN + const auto input = createNode({ + createPort(QShaderNodePort::Output, "input") + }); + const auto output = createNode({ + createPort(QShaderNodePort::Input, "output") + }); + const auto function0 = createNode({ + createPort(QShaderNodePort::Input, "function0Input"), + createPort(QShaderNodePort::Output, "function0Output") + }, {"0"}); + const auto function1 = createNode({ + createPort(QShaderNodePort::Input, "function1Input"), + createPort(QShaderNodePort::Output, "function1Output") + }, {"1"}); + + const auto graph = [=] { + auto res = QShaderGraph(); + res.addNode(input); + res.addNode(function0); + res.addNode(function1); + res.addNode(output); + res.addEdge(createEdge(input.uuid(), "input", function0.uuid(), "function0Input", {"0"})); + res.addEdge(createEdge(input.uuid(), "input", function1.uuid(), "function1Input")); + res.addEdge(createEdge(function0.uuid(), "function0Output", output.uuid(), "output")); + res.addEdge(createEdge(function1.uuid(), "function1Output", output.uuid(), "output")); + return res; + }(); + + // WHEN + const auto statements = graph.createStatements({"0"}); + + // THEN + const auto expected = QVector<QShaderGraph::Statement>() + << createStatement(input, {}, {0}) + << createStatement(function0, {0}, {1}) + << createStatement(output, {1}, {}); + dumpStatementsIfNeeded(statements, expected); + QCOMPARE(statements, expected); +} + QTEST_MAIN(tst_QShaderGraph) #include "tst_qshadergraph.moc" |