summaryrefslogtreecommitdiffstats
path: root/src/render/jobs/renderviewjobutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/jobs/renderviewjobutils.cpp')
-rw-r--r--src/render/jobs/renderviewjobutils.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/render/jobs/renderviewjobutils.cpp b/src/render/jobs/renderviewjobutils.cpp
index 798828bd3..3face7197 100644
--- a/src/render/jobs/renderviewjobutils.cpp
+++ b/src/render/jobs/renderviewjobutils.cpp
@@ -438,7 +438,7 @@ UniformBlockValueBuilder::~UniformBlockValueBuilder()
{
}
-void UniformBlockValueBuilder::buildActiveUniformNameValueMapHelper(const QString &blockName, const QString &qmlPropertyName, const QVariant &value)
+void UniformBlockValueBuilder::buildActiveUniformNameValueMapHelper(ShaderData *currentShaderData, const QString &blockName, const QString &qmlPropertyName, const QVariant &value)
{
// In the end, values are either scalar or a scalar array
// Composed elements (structs, structs array) are simplified into simple scalars
@@ -471,20 +471,29 @@ void UniformBlockValueBuilder::buildActiveUniformNameValueMapHelper(const QStrin
QString varName = blockName + QLatin1Char('.') + qmlPropertyName;
if (uniforms.contains(varName)) {
qCDebug(Shaders) << "UBO scalar member " << varName << " set for update";
- activeUniformNamesToValue.insert(StringToInt::lookupId(varName), value);
+
+ // If the property needs to be transformed, we transform it here as
+ // the shaderdata cannot hold transformed properties for multiple
+ // thread contexts at once
+ if (currentShaderData->propertyTransformType(qmlPropertyName) != ShaderData::NoTransform)
+ activeUniformNamesToValue.insert(StringToInt::lookupId(varName),
+ currentShaderData->getTransformedProperty(qmlPropertyName, viewMatrix));
+ else
+ activeUniformNamesToValue.insert(StringToInt::lookupId(varName), value);
}
}
}
void UniformBlockValueBuilder::buildActiveUniformNameValueMapStructHelper(ShaderData *rShaderData, const QString &blockName, const QString &qmlPropertyName)
{
- const QHash<QString, QVariant> &properties = updatedPropertiesOnly ? rShaderData->updatedProperties() : rShaderData->properties();
+ const QHash<QString, QVariant> &properties = rShaderData->properties();
QHash<QString, QVariant>::const_iterator it = properties.begin();
const QHash<QString, QVariant>::const_iterator end = properties.end();
while (it != end) {
const auto prefix = qmlPropertyName.isEmpty() ? QLatin1String("") : QLatin1String(".");
- buildActiveUniformNameValueMapHelper(blockName + prefix + qmlPropertyName,
+ buildActiveUniformNameValueMapHelper(rShaderData,
+ blockName + prefix + qmlPropertyName,
it.key(),
it.value());
++it;