summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qshadergenerator.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-07-06 11:55:39 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-07-07 20:35:05 +0200
commit471e4fcb226c4523efe93b1bdaf0db026495da94 (patch)
treebb963937b2446eb32d7632568433083a386f2c68 /src/gui/util/qshadergenerator.cpp
parent7f400522c39f6a1abf083dc1af49ea3109635cc8 (diff)
Use QList instead of QVector in gui implementation
Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/gui/util/qshadergenerator.cpp')
-rw-r--r--src/gui/util/qshadergenerator.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/util/qshadergenerator.cpp b/src/gui/util/qshadergenerator.cpp
index 1ec25ccd7b..4933e913a3 100644
--- a/src/gui/util/qshadergenerator.cpp
+++ b/src/gui/util/qshadergenerator.cpp
@@ -322,17 +322,17 @@ QByteArray QShaderGenerator::createShaderCode(const QStringList &enabledLayers)
[enabledLayers] (const QString &s) { return enabledLayers.contains(s); });
};
- QVector<QString> globalInputVariables;
+ QList<QString> globalInputVariables;
const QRegularExpression globalInputExtractRegExp(QStringLiteral("^.*\\s+(\\w+).*;$"));
- const QVector<QShaderNode> nodes = graph.nodes();
+ const QList<QShaderNode> nodes = graph.nodes();
for (const QShaderNode &node : nodes) {
if (intersectsEnabledLayers(node.layers())) {
const QByteArrayList headerSnippets = node.rule(format).headerSnippets;
for (const QByteArray &snippet : headerSnippets) {
code << replaceParameters(snippet, node, format);
- // If node is an input, record the variable name into the globalInputVariables vector
+ // If node is an input, record the variable name into the globalInputVariables list
if (node.type() == QShaderNode::Input) {
const QRegularExpressionMatch match = globalInputExtractRegExp.match(QString::fromUtf8(code.last()));
if (match.hasMatch())
@@ -355,7 +355,7 @@ QByteArray QShaderGenerator::createShaderCode(const QStringList &enabledLayers)
struct Assignment
{
QString expression;
- QVector<Variable *> referencedVariables;
+ QList<Variable *> referencedVariables;
};
struct Variable
@@ -415,11 +415,11 @@ QByteArray QShaderGenerator::createShaderCode(const QStringList &enabledLayers)
// just use vertexPosition directly.
// The added benefit is when having arrays, we don't try to create
// mat4 v38 = skinningPalelette[100] which would be invalid
- QVector<Variable> temporaryVariables;
+ QList<Variable> temporaryVariables;
// Reserve more than enough space to ensure no reallocation will take place
temporaryVariables.reserve(nodes.size() * 8);
- QVector<LineContent> lines;
+ QList<LineContent> lines;
auto createVariable = [&] () -> Variable * {
Q_ASSERT(temporaryVariables.capacity() > 0);
@@ -456,14 +456,14 @@ QByteArray QShaderGenerator::createShaderCode(const QStringList &enabledLayers)
for (const QShaderGraph::Statement &statement : graph.createStatements(enabledLayers)) {
const QShaderNode node = statement.node;
QByteArray line = node.rule(format).substitution;
- const QVector<QShaderNodePort> ports = node.ports();
+ const QList<QShaderNodePort> ports = node.ports();
struct VariableReplacement {
QByteArray placeholder;
QByteArray variable;
};
- QVector<VariableReplacement> variableReplacements;
+ QList<VariableReplacement> variableReplacements;
// Generate temporary variable names vN
for (const QShaderNodePort &port : ports) {