summaryrefslogtreecommitdiffstats
path: root/src/render/materialsystem
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/materialsystem')
-rw-r--r--src/render/materialsystem/effect.cpp4
-rw-r--r--src/render/materialsystem/filterkey.cpp8
-rw-r--r--src/render/materialsystem/material.cpp4
-rw-r--r--src/render/materialsystem/materialsystem.pri63
-rw-r--r--src/render/materialsystem/parameter.cpp4
-rw-r--r--src/render/materialsystem/qfilterkey.cpp4
-rw-r--r--src/render/materialsystem/qmaterial.cpp6
-rw-r--r--src/render/materialsystem/qparameter.cpp6
-rw-r--r--src/render/materialsystem/qrenderpass.cpp2
-rw-r--r--src/render/materialsystem/qshaderprogram.cpp28
-rw-r--r--src/render/materialsystem/qshaderprogrambuilder.cpp28
-rw-r--r--src/render/materialsystem/qtechnique.cpp3
-rw-r--r--src/render/materialsystem/renderpass.cpp4
-rw-r--r--src/render/materialsystem/shader.cpp4
-rw-r--r--src/render/materialsystem/shaderbuilder.cpp4
-rw-r--r--src/render/materialsystem/shaderdata.cpp21
-rw-r--r--src/render/materialsystem/shaderdata_p.h3
-rw-r--r--src/render/materialsystem/technique.cpp4
18 files changed, 62 insertions, 138 deletions
diff --git a/src/render/materialsystem/effect.cpp b/src/render/materialsystem/effect.cpp
index 94b700cf4..49a03d753 100644
--- a/src/render/materialsystem/effect.cpp
+++ b/src/render/materialsystem/effect.cpp
@@ -12,11 +12,11 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
+using namespace Qt3DCore;
+
Effect::Effect()
: BackendNode()
{
diff --git a/src/render/materialsystem/filterkey.cpp b/src/render/materialsystem/filterkey.cpp
index 7429735ef..7d0b74ead 100644
--- a/src/render/materialsystem/filterkey.cpp
+++ b/src/render/materialsystem/filterkey.cpp
@@ -6,11 +6,11 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
+using namespace Qt3DCore;
+
FilterKey::FilterKey()
: BackendNode()
{
@@ -56,11 +56,7 @@ bool FilterKey::equals(const FilterKey &other) const
// https://codereview.qt-project.org/#/c/204484/
// and adding the following early comparison of the types should give
// an equivalent performance gain:
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return (other.value().metaType() == value().metaType() &&
-#else
- return (other.value().type() == value().type() &&
-#endif
other.name() == name() &&
other.value() == value());
}
diff --git a/src/render/materialsystem/material.cpp b/src/render/materialsystem/material.cpp
index 10737d647..16ee6f62b 100644
--- a/src/render/materialsystem/material.cpp
+++ b/src/render/materialsystem/material.cpp
@@ -10,13 +10,13 @@
#include "qeffect.h"
#include <Qt3DRender/private/qmaterial_p.h>
-using namespace Qt3DCore;
-
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
namespace Render {
+using namespace Qt3DCore;
+
Material::Material()
: BackendNode()
{
diff --git a/src/render/materialsystem/materialsystem.pri b/src/render/materialsystem/materialsystem.pri
deleted file mode 100644
index 50e414a8e..000000000
--- a/src/render/materialsystem/materialsystem.pri
+++ /dev/null
@@ -1,63 +0,0 @@
-INCLUDEPATH += $$PWD
-
-HEADERS += \
- $$PWD/filterkey_p.h \
- $$PWD/effect_p.h \
- $$PWD/material_p.h \
- $$PWD/parameter_p.h \
- $$PWD/qfilterkey.h \
- $$PWD/qfilterkey_p.h \
- $$PWD/qeffect.h \
- $$PWD/qeffect_p.h \
- $$PWD/qmaterial.h \
- $$PWD/qmaterial_p.h \
- $$PWD/qparameter.h \
- $$PWD/qparameter_p.h \
- $$PWD/qrenderpass_p.h \
- $$PWD/qrenderpass.h \
- $$PWD/qshaderdata.h \
- $$PWD/qshaderdata_p.h \
- $$PWD/qshaderimage.h \
- $$PWD/qshaderimage_p.h \
- $$PWD/qshaderprogram.h \
- $$PWD/qshaderprogram_p.h \
- $$PWD/qshaderprogrambuilder.h \
- $$PWD/qshaderprogrambuilder_p.h \
- $$PWD/qtechnique.h \
- $$PWD/qtechnique_p.h \
- $$PWD/renderpass_p.h \
- $$PWD/shader_p.h \
- $$PWD/shaderbuilder_p.h \
- $$PWD/shaderdata_p.h \
- $$PWD/shaderimage_p.h \
- $$PWD/technique_p.h \
- $$PWD/qgraphicsapifilter.h \
- $$PWD/qgraphicsapifilter_p.h \
- $$PWD/techniquemanager_p.h
-
-SOURCES += \
- $$PWD/filterkey.cpp \
- $$PWD/effect.cpp \
- $$PWD/material.cpp \
- $$PWD/parameter.cpp \
- $$PWD/qfilterkey.cpp \
- $$PWD/qeffect.cpp \
- $$PWD/qmaterial.cpp \
- $$PWD/qparameter.cpp \
- $$PWD/qrenderpass.cpp \
- $$PWD/qshaderdata.cpp \
- $$PWD/qshaderimage.cpp \
- $$PWD/qshaderprogram.cpp \
- $$PWD/qshaderprogrambuilder.cpp \
- $$PWD/qtechnique.cpp \
- $$PWD/renderpass.cpp \
- $$PWD/shader.cpp \
- $$PWD/shaderbuilder.cpp \
- $$PWD/shaderdata.cpp \
- $$PWD/shaderimage.cpp \
- $$PWD/technique.cpp \
- $$PWD/qgraphicsapifilter.cpp \
- $$PWD/techniquemanager.cpp
-
-RESOURCES += \
- $$PWD/materialsystem.qrc
diff --git a/src/render/materialsystem/parameter.cpp b/src/render/materialsystem/parameter.cpp
index 9ba592dff..5a6450cd6 100644
--- a/src/render/materialsystem/parameter.cpp
+++ b/src/render/materialsystem/parameter.cpp
@@ -13,11 +13,11 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
+using namespace Qt3DCore;
+
Parameter::Parameter()
: BackendNode()
, m_nameId(-1)
diff --git a/src/render/materialsystem/qfilterkey.cpp b/src/render/materialsystem/qfilterkey.cpp
index 2b6106f2e..326057e00 100644
--- a/src/render/materialsystem/qfilterkey.cpp
+++ b/src/render/materialsystem/qfilterkey.cpp
@@ -71,7 +71,7 @@ void QFilterKey::setName(const QString &name)
}
/*!
- \property QFilterKey::value
+ \property Qt3DRender::QFilterKey::value
Holds the value of the filter key.
*/
@@ -89,7 +89,7 @@ QVariant QFilterKey::value() const
}
/*!
- \property QFilterKey::name
+ \property Qt3DRender::QFilterKey::name
Holds the name of the filter key.
*/
diff --git a/src/render/materialsystem/qmaterial.cpp b/src/render/materialsystem/qmaterial.cpp
index 8fb7581f4..2fb5a3a48 100644
--- a/src/render/materialsystem/qmaterial.cpp
+++ b/src/render/materialsystem/qmaterial.cpp
@@ -133,8 +133,8 @@
// Set different parameters on the materials
const QString parameterName = QStringLiteral("color");
- material1->addParameter(new QParameter(parameterName, QColor::fromRgbF(0.0f, 1.0f, 0.0f, 1.0f);
- material2->addParameter(new QParameter(parameterName, QColor::fromRgbF(1.0f, 1.0f, 1.0f, 1.0f);
+ material1->addParameter(new QParameter(parameterName, QColor::fromRgbF(0.0f, 1.0f, 0.0f, 1.0f)));
+ material2->addParameter(new QParameter(parameterName, QColor::fromRgbF(1.0f, 1.0f, 1.0f, 1.0f)));
\endcode
@@ -184,7 +184,7 @@ QMaterial::QMaterial(QMaterialPrivate &dd, QNode *parent)
Specifies the effect to be used with the material.
*/
/*!
- \property QMaterial::effect
+ \property Qt3DRender::QMaterial::effect
Specifies the effect to be used with the material.
*/
diff --git a/src/render/materialsystem/qparameter.cpp b/src/render/materialsystem/qparameter.cpp
index 990f5ee1b..b49844d96 100644
--- a/src/render/materialsystem/qparameter.cpp
+++ b/src/render/materialsystem/qparameter.cpp
@@ -5,10 +5,8 @@
#include "qparameter_p.h"
#include <Qt3DRender/private/renderlogging_p.h>
#include <Qt3DRender/qtexture.h>
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtCore/qiterable.h>
#include <QtCore/qsequentialiterable.h>
-#endif
/*!
\qmltype Parameter
@@ -163,11 +161,7 @@ inline QVariant toBackendValue(const QVariant &v)
void QParameterPrivate::setValue(const QVariant &v)
{
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (v.metaType().id() == QMetaType::QVariantList) {
-#else
- if (v.type() == QVariant::List) {
-#endif
QSequentialIterable iterable = v.value<QSequentialIterable>();
QVariantList variants;
variants.reserve(iterable.size());
diff --git a/src/render/materialsystem/qrenderpass.cpp b/src/render/materialsystem/qrenderpass.cpp
index 81cb328cd..78047e576 100644
--- a/src/render/materialsystem/qrenderpass.cpp
+++ b/src/render/materialsystem/qrenderpass.cpp
@@ -140,7 +140,7 @@ QRenderPassPrivate::QRenderPassPrivate()
\sa QRenderPassFilter, QFilterKey, QParameter, QRenderState, QEffect, QTechnique
*/
/*!
- \typedef ParameterList
+ \typedef Qt3DRender::ParameterList
\relates Qt3DRender::QRenderPass
A list of Qt3DRender::QParameter parameters.
diff --git a/src/render/materialsystem/qshaderprogram.cpp b/src/render/materialsystem/qshaderprogram.cpp
index cbb1b77b5..0d055c99f 100644
--- a/src/render/materialsystem/qshaderprogram.cpp
+++ b/src/render/materialsystem/qshaderprogram.cpp
@@ -462,7 +462,7 @@
*/
/*!
- \enum QShaderProgram::ShaderType
+ \enum Qt3DRender::QShaderProgram::ShaderType
This enum identifies the type of shader used.
@@ -475,7 +475,7 @@
*/
/*!
- \enum QShaderProgram::Status
+ \enum Qt3DRender::QShaderProgram::Status
This enum identifies the status of shader used.
@@ -485,7 +485,7 @@
*/
/*!
- \enum QShaderProgram::Format
+ \enum Qt3DRender::QShaderProgram::Format
This enum identifies the format of the shader code used.
@@ -549,7 +549,7 @@ QShaderProgram::QShaderProgram(QShaderProgramPrivate &dd, QNode *parent)
Holds the vertex shader code used by this shader program.
*/
/*!
- \property QShaderProgram::vertexShaderCode
+ \property Qt3DRender::QShaderProgram::vertexShaderCode
Holds the vertex shader code used by this shader program.
*/
@@ -574,7 +574,7 @@ QByteArray QShaderProgram::vertexShaderCode() const
Holds the tesselation control shader code used by this shader program.
*/
/*!
- \property QShaderProgram::tessellationControlShaderCode
+ \property Qt3DRender::QShaderProgram::tessellationControlShaderCode
Holds the tesselation control shader code used by this shader program.
*/
@@ -599,7 +599,7 @@ QByteArray QShaderProgram::tessellationControlShaderCode() const
Holds the tesselation evaluation shader code used by this shader program.
*/
/*!
- \property QShaderProgram::tessellationEvaluationShaderCode
+ \property Qt3DRender::QShaderProgram::tessellationEvaluationShaderCode
Holds the tesselation evaluation shader code used by this shader program.
*/
@@ -624,7 +624,7 @@ QByteArray QShaderProgram::tessellationEvaluationShaderCode() const
Holds the geometry shader code used by this shader program.
*/
/*!
- \property QShaderProgram::geometryShaderCode
+ \property Qt3DRender::QShaderProgram::geometryShaderCode
Holds the geometry shader code used by this shader program.
*/
@@ -649,7 +649,7 @@ QByteArray QShaderProgram::geometryShaderCode() const
Holds the fragment shader code used by this shader program.
*/
/*!
- \property QShaderProgram::fragmentShaderCode
+ \property Qt3DRender::QShaderProgram::fragmentShaderCode
Holds the fragment shader code used by this shader program.
*/
@@ -674,7 +674,7 @@ QByteArray QShaderProgram::fragmentShaderCode() const
Holds the compute shader code used by this shader program.
*/
/*!
- \property QShaderProgram::computeShaderCode
+ \property Qt3DRender::QShaderProgram::computeShaderCode
Holds the compute shader code used by this shader program.
*/
@@ -754,7 +754,7 @@ QByteArray QShaderProgram::shaderCode(ShaderType type) const
compilation failure of the shader program.
*/
/*!
- \property QShaderProgram::log
+ \property Qt3DRender::QShaderProgram::log
Holds the log of the current shader program. This is useful to diagnose a
compilation failure of the shader program.
@@ -771,7 +771,7 @@ QString QShaderProgram::log() const
Holds the status of the current shader program.
*/
/*!
- \property QShaderProgram::status
+ \property Qt3DRender::QShaderProgram::status
Holds the status of the current shader program.
*/
@@ -801,7 +801,7 @@ void QShaderProgram::setFormat(QShaderProgram::Format format)
The default is ShaderProgram.GLSL
*/
/*!
- \property QShaderProgram::format
+ \property Qt3DRender::QShaderProgram::format
\since 5.15
Holds the format of the code provided on the ShaderProgram.
@@ -841,11 +841,7 @@ QByteArray QShaderProgramPrivate::resolveAutoBindingIndices(const QByteArray &co
do {
matchStart = shaderCode.indexOf(regexp, matchStart);
if (matchStart != -1) {
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
const auto match = regexp.matchView(QStringView{shaderCode}.mid(matchStart));
-#else
- const auto match = regexp.match(shaderCode.mid(matchStart));
-#endif
const auto length = match.capturedLength(0);
shaderCode.replace(matchStart, length, replacement.arg(variable++));
}
diff --git a/src/render/materialsystem/qshaderprogrambuilder.cpp b/src/render/materialsystem/qshaderprogrambuilder.cpp
index 0c546e9dd..154b5bef8 100644
--- a/src/render/materialsystem/qshaderprogrambuilder.cpp
+++ b/src/render/materialsystem/qshaderprogrambuilder.cpp
@@ -135,7 +135,7 @@ QShaderProgramBuilder::QShaderProgramBuilder(QShaderProgramBuilderPrivate &dd, Q
Holds the shader program on which this builder generates code.
*/
/*!
- \property QShaderProgramBuilder::shaderProgram
+ \property Qt3DRender::QShaderProgramBuilder::shaderProgram
Holds the shader program on which this builder generates code.
*/
@@ -176,7 +176,7 @@ QShaderProgram *QShaderProgramBuilder::shaderProgram() const
during code generation.
*/
/*!
- \property QShaderProgramBuilder::enabledLayers
+ \property Qt3DRender::QShaderProgramBuilder::enabledLayers
Holds the list of layers this builder will activate on the shader graphs
during code generation.
@@ -202,7 +202,7 @@ QStringList QShaderProgramBuilder::enabledLayers() const
Holds the URL to the vertex shader graph used by this shader program builder.
*/
/*!
- \property QShaderProgramBuilder::vertexShaderGraph
+ \property Qt3DRender::QShaderProgramBuilder::vertexShaderGraph
Holds the URL to the vertex shader graph used by this shader program builder.
*/
@@ -227,7 +227,7 @@ QUrl QShaderProgramBuilder::vertexShaderGraph() const
Holds the URL to the tesselation control shader graph used by this shader program builder.
*/
/*!
- \property QShaderProgramBuilder::tessellationControlShaderGraph
+ \property Qt3DRender::QShaderProgramBuilder::tessellationControlShaderGraph
Holds the URL to the tesselation control shader graph used by this shader program builder.
*/
@@ -252,7 +252,7 @@ QUrl QShaderProgramBuilder::tessellationControlShaderGraph() const
Holds the URL to the tesselation evaluation shader graph used by this shader program builder.
*/
/*!
- \property QShaderProgramBuilder::tessellationEvaluationShaderGraph
+ \property Qt3DRender::QShaderProgramBuilder::tessellationEvaluationShaderGraph
Holds the URL to the tesselation evaluation shader graph used by this shader program builder.
*/
@@ -277,7 +277,7 @@ QUrl QShaderProgramBuilder::tessellationEvaluationShaderGraph() const
Holds the URL to the geometry shader graph used by this shader program builder.
*/
/*!
- \property QShaderProgramBuilder::geometryShaderGraph
+ \property Qt3DRender::QShaderProgramBuilder::geometryShaderGraph
Holds the URL to the geometry shader graph used by this shader program builder.
*/
@@ -302,7 +302,7 @@ QUrl QShaderProgramBuilder::geometryShaderGraph() const
Holds the URL to the fragment shader graph used by this shader program builder.
*/
/*!
- \property QShaderProgramBuilder::fragmentShaderGraph
+ \property Qt3DRender::QShaderProgramBuilder::fragmentShaderGraph
Holds the URL to the fragment shader graph used by this shader program builder.
*/
@@ -327,7 +327,7 @@ QUrl QShaderProgramBuilder::fragmentShaderGraph() const
Holds the URL to the compute shader graph used by this shader program builder.
*/
/*!
- \property QShaderProgramBuilder::computeShaderGraph
+ \property Qt3DRender::QShaderProgramBuilder::computeShaderGraph
Holds the URL to the compute shader graph used by this shader program builder.
*/
@@ -353,7 +353,7 @@ QUrl QShaderProgramBuilder::computeShaderGraph() const
\since 2.13
*/
/*!
- \property QShaderProgramBuilder::vertexShaderCode
+ \property Qt3DRender::QShaderProgramBuilder::vertexShaderCode
Holds the generate vertex shader code.
\since 5.13
@@ -371,7 +371,7 @@ QByteArray QShaderProgramBuilder::vertexShaderCode() const
\since 2.13
*/
/*!
- \property QShaderProgramBuilder::tessellationControlShaderCode
+ \property Qt3DRender::QShaderProgramBuilder::tessellationControlShaderCode
Holds the generate tessellation control shader code.
\since 5.13
@@ -389,7 +389,7 @@ QByteArray QShaderProgramBuilder::tessellationControlShaderCode() const
\since 2.13
*/
/*!
- \property QShaderProgramBuilder::tessellationEvaluationShaderCode
+ \property Qt3DRender::QShaderProgramBuilder::tessellationEvaluationShaderCode
Holds the generate tessellation evaluation shader code.
\since 5.13
@@ -407,7 +407,7 @@ QByteArray QShaderProgramBuilder::tessellationEvaluationShaderCode() const
\since 2.13
*/
/*!
- \property QShaderProgramBuilder::geometryShaderCode
+ \property Qt3DRender::QShaderProgramBuilder::geometryShaderCode
Holds the generate geometry shader code.
\since 5.13
@@ -425,7 +425,7 @@ QByteArray QShaderProgramBuilder::geometryShaderCode() const
\since 2.13
*/
/*!
- \property QShaderProgramBuilder::fragmentShaderCode
+ \property Qt3DRender::QShaderProgramBuilder::fragmentShaderCode
Holds the generate fragment shader code.
\since 5.13
@@ -443,7 +443,7 @@ QByteArray QShaderProgramBuilder::fragmentShaderCode() const
\since 2.13
*/
/*!
- \property QShaderProgramBuilder::computeShaderCode
+ \property Qt3DRender::QShaderProgramBuilder::computeShaderCode
Holds the generate compute shader code.
\since 5.13
diff --git a/src/render/materialsystem/qtechnique.cpp b/src/render/materialsystem/qtechnique.cpp
index 6a5ec71b1..65376f801 100644
--- a/src/render/materialsystem/qtechnique.cpp
+++ b/src/render/materialsystem/qtechnique.cpp
@@ -8,10 +8,11 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
namespace Qt3DRender {
+using namespace Qt3DCore;
+
QTechniquePrivate::QTechniquePrivate()
: QNodePrivate()
{
diff --git a/src/render/materialsystem/renderpass.cpp b/src/render/materialsystem/renderpass.cpp
index a3aadfb2b..74f55884e 100644
--- a/src/render/materialsystem/renderpass.cpp
+++ b/src/render/materialsystem/renderpass.cpp
@@ -15,11 +15,11 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
+using namespace Qt3DCore;
+
RenderPass::RenderPass()
: BackendNode()
{
diff --git a/src/render/materialsystem/shader.cpp b/src/render/materialsystem/shader.cpp
index 1fc42a255..a71fd19f3 100644
--- a/src/render/materialsystem/shader.cpp
+++ b/src/render/materialsystem/shader.cpp
@@ -16,10 +16,10 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
+
+using namespace Qt3DCore;
const int Shader::modelMatrixNameId = StringToInt::lookupId(QLatin1String("modelMatrix"));
const int Shader::viewMatrixNameId = StringToInt::lookupId(QLatin1String("viewMatrix"));
const int Shader::projectionMatrixNameId = StringToInt::lookupId(QLatin1String("projectionMatrix"));
diff --git a/src/render/materialsystem/shaderbuilder.cpp b/src/render/materialsystem/shaderbuilder.cpp
index c2916c28d..afe666f62 100644
--- a/src/render/materialsystem/shaderbuilder.cpp
+++ b/src/render/materialsystem/shaderbuilder.cpp
@@ -77,11 +77,11 @@ private:
Q_GLOBAL_STATIC(GlobalShaderPrototypes, qt3dGlobalShaderPrototypes)
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
+using namespace Qt3DCore;
+
QString ShaderBuilder::getPrototypesFile()
{
return qt3dGlobalShaderPrototypes->prototypesFile();
diff --git a/src/render/materialsystem/shaderdata.cpp b/src/render/materialsystem/shaderdata.cpp
index 365c1929d..ad6dbfff7 100644
--- a/src/render/materialsystem/shaderdata.cpp
+++ b/src/render/materialsystem/shaderdata.cpp
@@ -13,11 +13,11 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
+using namespace Qt3DCore;
+
namespace {
const int qNodeIdTypeId = qMetaTypeId<Qt3DCore::QNodeId>();
@@ -122,20 +122,22 @@ void ShaderData::syncFromFrontEnd(const QNode *frontEnd, bool firstTime)
}
}
-bool ShaderData::hasPropertyValuesForBlock(int blockName) const
-{
- std::shared_lock readLocker(m_lock);
- return m_blockNameToPropertyValues.find(blockName) != m_blockNameToPropertyValues.cend();
-}
-
const ShaderData::PropertyValuesForBlock &ShaderData::propertyValuesForBlock(int blockName) const
{
std::shared_lock readLocker(m_lock);
return m_blockNameToPropertyValues.at(blockName);
}
-void ShaderData::generatePropertyValuesForBlock(const QString &fullBlockName)
+void ShaderData::generatePropertyValuesForBlockIfNeeded(const QString &fullBlockName)
{
+ const int fullBlockNameId = StringToInt::lookupId(fullBlockName);
+
+ std::unique_lock readWriteLocker(m_lock);
+ const bool hasPropertyValuesForBlock = m_blockNameToPropertyValues.find(fullBlockNameId) != m_blockNameToPropertyValues.cend();
+ if (hasPropertyValuesForBlock) {
+ return;
+ }
+
const QHash<QString, ShaderData::PropertyValue> &props = properties();
ShaderData::PropertyValuesForBlock valueBlock;
@@ -162,7 +164,6 @@ void ShaderData::generatePropertyValuesForBlock(const QString &fullBlockName)
++it;
}
- std::unique_lock writeLocker(m_lock);
m_blockNameToPropertyValues[StringToInt::lookupId(fullBlockName)] = std::move(valueBlock);
}
diff --git a/src/render/materialsystem/shaderdata_p.h b/src/render/materialsystem/shaderdata_p.h
index 440819e38..cf29742b6 100644
--- a/src/render/materialsystem/shaderdata_p.h
+++ b/src/render/materialsystem/shaderdata_p.h
@@ -74,9 +74,8 @@ public:
// Block.Property nameId, property nameId, PropertyValue *
using PropertyValuesForBlock = std::vector<std::tuple<int, int, const PropertyValue *>>;
- bool hasPropertyValuesForBlock(int blockNameId) const;
const PropertyValuesForBlock &propertyValuesForBlock(int blockNameId) const;
- void generatePropertyValuesForBlock(const QString &blockName);
+ void generatePropertyValuesForBlockIfNeeded(const QString &blockName);
protected:
PropertyReaderInterfacePtr m_propertyReader;
diff --git a/src/render/materialsystem/technique.cpp b/src/render/materialsystem/technique.cpp
index ef691bab0..89d0f5b39 100644
--- a/src/render/materialsystem/technique.cpp
+++ b/src/render/materialsystem/technique.cpp
@@ -19,11 +19,11 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
+using namespace Qt3DCore;
+
Technique::Technique()
: BackendNode()
, m_isCompatibleWithRenderer(false)