summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-11-18 17:30:58 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-11-18 17:30:58 +0000
commit5e94e34c5b9567980929e677357467806aacaf1a (patch)
treed5b3d6fd82fba5f3a3241ee4a261ab53587fd9d2
parentb58719b2222fd3b3527758aaf482b1635af7857c (diff)
parenta951564557c91fdbb6974c089eec374d51011ad1 (diff)
Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10
-rw-r--r--src/animation/backend/handler.cpp11
-rw-r--r--src/animation/backend/handler_p.h1
-rw-r--r--src/animation/backend/loadanimationclipjob.cpp1
-rw-r--r--src/render/graphicshelpers/graphicshelperes2.cpp3
-rw-r--r--src/render/graphicshelpers/graphicshelpergl2.cpp3
-rw-r--r--src/render/graphicshelpers/graphicshelpergl3_2.cpp3
-rw-r--r--src/render/graphicshelpers/graphicshelpergl3_3.cpp3
-rw-r--r--src/render/graphicshelpers/graphicshelpergl4.cpp3
-rw-r--r--src/render/materialsystem/parameter.cpp5
9 files changed, 32 insertions, 1 deletions
diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp
index fd8e0916d..ed48d281f 100644
--- a/src/animation/backend/handler.cpp
+++ b/src/animation/backend/handler.cpp
@@ -149,6 +149,16 @@ void Handler::setBlendedClipAnimatorRunning(const HBlendedClipAnimator &handle,
// The vectors may get outdated when the application removes/deletes an
// animator component in the meantime. Recognize this. This should be
// relatively infrequent so in most cases the vectors will not change at all.
+void Handler::cleanupHandleList(QVector<HAnimationClip> *clips)
+{
+ for (auto it = clips->begin(); it != clips->end(); ) {
+ if (!m_animationClipLoaderManager->data(*it))
+ clips->erase(it);
+ else
+ ++it;
+ }
+}
+
void Handler::cleanupHandleList(QVector<HClipAnimator> *animators)
{
for (auto it = animators->begin(); it != animators->end(); ) {
@@ -185,6 +195,7 @@ QVector<Qt3DCore::QAspectJobPtr> Handler::jobsToExecute(qint64 time)
const bool hasLoadAnimationClipJob = !m_dirtyAnimationClips.isEmpty();
if (hasLoadAnimationClipJob) {
qCDebug(HandlerLogic) << "Added LoadAnimationClipJob";
+ cleanupHandleList(&m_dirtyAnimationClips);
m_loadAnimationClipJob->addDirtyAnimationClips(m_dirtyAnimationClips);
jobs.push_back(m_loadAnimationClipJob);
m_dirtyAnimationClips.clear();
diff --git a/src/animation/backend/handler_p.h b/src/animation/backend/handler_p.h
index d35d5a132..99e2ae1f6 100644
--- a/src/animation/backend/handler_p.h
+++ b/src/animation/backend/handler_p.h
@@ -121,6 +121,7 @@ public:
QVector<Qt3DCore::QAspectJobPtr> jobsToExecute(qint64 time);
+ void cleanupHandleList(QVector<HAnimationClip> *clips);
void cleanupHandleList(QVector<HClipAnimator> *animators);
void cleanupHandleList(QVector<HBlendedClipAnimator> *animators);
diff --git a/src/animation/backend/loadanimationclipjob.cpp b/src/animation/backend/loadanimationclipjob.cpp
index c0201e0e9..4584449bc 100644
--- a/src/animation/backend/loadanimationclipjob.cpp
+++ b/src/animation/backend/loadanimationclipjob.cpp
@@ -72,6 +72,7 @@ void LoadAnimationClipJob::run()
AnimationClipLoaderManager *animationClipManager = m_handler->animationClipLoaderManager();
for (const auto animationClipHandle : qAsConst(m_animationClipHandles)) {
AnimationClip *animationClip = animationClipManager->data(animationClipHandle);
+ Q_ASSERT(animationClip);
animationClip->loadAnimation();
}
diff --git a/src/render/graphicshelpers/graphicshelperes2.cpp b/src/render/graphicshelpers/graphicshelperes2.cpp
index a22d8752a..676363b73 100644
--- a/src/render/graphicshelpers/graphicshelperes2.cpp
+++ b/src/render/graphicshelpers/graphicshelperes2.cpp
@@ -209,6 +209,9 @@ QVector<ShaderUniform> GraphicsHelperES2::programUniformsAndLocations(GLuint pro
uniformName[sizeof(uniformName) - 1] = '\0';
uniform.m_location = m_funcs->glGetUniformLocation(programId, uniformName);
uniform.m_name = QString::fromUtf8(uniformName, uniformNameLength);
+ // Work around for uniform array names that aren't returned with [0] by some drivers
+ if (uniform.m_size > 1 && !uniform.m_name.endsWith(QLatin1String("[0]")))
+ uniform.m_name.append(QLatin1String("[0]"));
uniforms.append(uniform);
}
return uniforms;
diff --git a/src/render/graphicshelpers/graphicshelpergl2.cpp b/src/render/graphicshelpers/graphicshelpergl2.cpp
index 60d3b49ba..6da8a9b6f 100644
--- a/src/render/graphicshelpers/graphicshelpergl2.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl2.cpp
@@ -178,6 +178,9 @@ QVector<ShaderUniform> GraphicsHelperGL2::programUniformsAndLocations(GLuint pro
uniformName[sizeof(uniformName) - 1] = '\0';
uniform.m_location = m_funcs->glGetUniformLocation(programId, uniformName);
uniform.m_name = QString::fromUtf8(uniformName, uniformNameLength);
+ // Work around for uniform array names that aren't returned with [0] by some drivers
+ if (uniform.m_size > 1 && !uniform.m_name.endsWith(QLatin1String("[0]")))
+ uniform.m_name.append(QLatin1String("[0]"));
uniform.m_rawByteSize = uniformByteSize(uniform);
uniforms.append(uniform);
}
diff --git a/src/render/graphicshelpers/graphicshelpergl3_2.cpp b/src/render/graphicshelpers/graphicshelpergl3_2.cpp
index 289ae18be..a35c4e37f 100644
--- a/src/render/graphicshelpers/graphicshelpergl3_2.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl3_2.cpp
@@ -207,6 +207,9 @@ QVector<ShaderUniform> GraphicsHelperGL3_2::programUniformsAndLocations(GLuint p
uniformName[sizeof(uniformName) - 1] = '\0';
uniform.m_location = m_funcs->glGetUniformLocation(programId, uniformName);
uniform.m_name = QString::fromUtf8(uniformName, uniformNameLength);
+ // Work around for uniform array names that aren't returned with [0] by some drivers
+ if (uniform.m_size > 1 && !uniform.m_name.endsWith(QLatin1String("[0]")))
+ uniform.m_name.append(QLatin1String("[0]"));
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_BLOCK_INDEX, &uniform.m_blockIndex);
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_OFFSET, &uniform.m_offset);
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_ARRAY_STRIDE, &uniform.m_arrayStride);
diff --git a/src/render/graphicshelpers/graphicshelpergl3_3.cpp b/src/render/graphicshelpers/graphicshelpergl3_3.cpp
index 40f8076bb..40c2bafeb 100644
--- a/src/render/graphicshelpers/graphicshelpergl3_3.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl3_3.cpp
@@ -206,6 +206,9 @@ QVector<ShaderUniform> GraphicsHelperGL3_3::programUniformsAndLocations(GLuint p
uniformName[sizeof(uniformName) - 1] = '\0';
uniform.m_location = m_funcs->glGetUniformLocation(programId, uniformName);
uniform.m_name = QString::fromUtf8(uniformName, uniformNameLength);
+ // Work around for uniform array names that aren't returned with [0] by some drivers
+ if (uniform.m_size > 1 && !uniform.m_name.endsWith(QLatin1String("[0]")))
+ uniform.m_name.append(QLatin1String("[0]"));
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_BLOCK_INDEX, &uniform.m_blockIndex);
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_OFFSET, &uniform.m_offset);
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_ARRAY_STRIDE, &uniform.m_arrayStride);
diff --git a/src/render/graphicshelpers/graphicshelpergl4.cpp b/src/render/graphicshelpers/graphicshelpergl4.cpp
index 284970873..ce1b8ac2b 100644
--- a/src/render/graphicshelpers/graphicshelpergl4.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl4.cpp
@@ -249,6 +249,9 @@ QVector<ShaderUniform> GraphicsHelperGL4::programUniformsAndLocations(GLuint pro
uniformName[sizeof(uniformName) - 1] = '\0';
uniform.m_location = m_funcs->glGetUniformLocation(programId, uniformName);
uniform.m_name = QString::fromUtf8(uniformName, uniformNameLength);
+ // Work around for uniform array names that aren't returned with [0] by some drivers
+ if (uniform.m_size > 1 && !uniform.m_name.endsWith(QLatin1String("[0]")))
+ uniform.m_name.append(QLatin1String("[0]"));
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_BLOCK_INDEX, &uniform.m_blockIndex);
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_OFFSET, &uniform.m_offset);
m_funcs->glGetActiveUniformsiv(programId, 1, (GLuint*)&i, GL_UNIFORM_ARRAY_STRIDE, &uniform.m_arrayStride);
diff --git a/src/render/materialsystem/parameter.cpp b/src/render/materialsystem/parameter.cpp
index 6671e4943..f00df3c90 100644
--- a/src/render/materialsystem/parameter.cpp
+++ b/src/render/materialsystem/parameter.cpp
@@ -87,10 +87,13 @@ void Parameter::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
if (propertyChange->propertyName() == QByteArrayLiteral("name")) {
m_name = propertyChange->value().toString();
m_nameId = StringToInt::lookupId(m_name);
+ markDirty(AbstractRenderer::MaterialDirty | AbstractRenderer::ParameterDirty);
} else if (propertyChange->propertyName() == QByteArrayLiteral("value")) {
m_uniformValue = UniformValue::fromVariant(propertyChange->value());
+ markDirty(AbstractRenderer::ParameterDirty);
+ } else if (propertyChange->propertyName() == QByteArrayLiteral("enabled")) {
+ markDirty(AbstractRenderer::MaterialDirty | AbstractRenderer::ParameterDirty);
}
- markDirty(AbstractRenderer::AllDirty);
}
BackendNode::sceneChangeEvent(e);