summaryrefslogtreecommitdiff
path: root/src/render/jobs/renderviewjobutils.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-20 10:39:32 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-20 10:39:32 +0200
commit0e3d54f8d7f9be26687afebcc9f456e4cefc2357 (patch)
treef3826c927305cc137006aed968be6fbf57b42009 /src/render/jobs/renderviewjobutils.cpp
parent52121396c55e6100316f006c87b4fdaa8b5a0719 (diff)
parent7e638edbd15640302516f9a69d20f62d26d4af06 (diff)
downloadqt3d-0e3d54f8d7f9be26687afebcc9f456e4cefc2357.tar.gz
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: src/render/framegraph/qrendersurfaceselector.cpp src/render/frontend/qrendersettings.cpp src/render/jobs/renderviewjobutils_p.h tests/auto/render/render.pro Change-Id: Ibe9eb962e3990e07f01a5608a2d60c79bc4c160f
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;