Skip to content
Snippets Groups Projects
Commit 54d80070 authored by Miikka Heikkinen's avatar Miikka Heikkinen Committed by Qt Cherry-pick Bot
Browse files

Fix property lookup for effects


There could be multilayered inheritance structure on top of
QQuick3DEffect, so account for that when determining which properties
need to be added as uniforms.

Task-number: QDS-2114
Change-Id: I3f89bc1ff6070890829575d66c127d269de7edab
Reviewed-by: default avatarMahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: default avatarAntti Määttä <antti.maatta@qt.io>
Reviewed-by: default avatarTomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 5c0c79ea)
Reviewed-by: default avatarQt Cherry-pick Bot <cherrypick_bot@qt-project.org>
parent 080d5770
No related branches found
No related tags found
No related merge requests found
...@@ -258,7 +258,15 @@ QSSGRenderGraphObject *QQuick3DEffect::updateSpatialNode(QSSGRenderGraphObject * ...@@ -258,7 +258,15 @@ QSSGRenderGraphObject *QQuick3DEffect::updateSpatialNode(QSSGRenderGraphObject *
// Properties -> uniforms // Properties -> uniforms
QByteArray uniforms; QByteArray uniforms;
const int propCount = metaObject()->propertyCount(); const int propCount = metaObject()->propertyCount();
const int propOffset = metaObject()->propertyOffset(); int propOffset = metaObject()->propertyOffset();
// Effect can have multilayered inheritance structure, so find the actual propOffset
const QMetaObject *superClass = metaObject()->superClass();
while (superClass && qstrcmp(superClass->className(), "QQuick3DEffect") != 0) {
propOffset = superClass->propertyOffset();
superClass = superClass->superClass();
}
QVector<QMetaProperty> textureProperties; // We'll deal with these later QVector<QMetaProperty> textureProperties; // We'll deal with these later
for (int i = propOffset; i != propCount; ++i) { for (int i = propOffset; i != propCount; ++i) {
const auto property = metaObject()->property(i); const auto property = metaObject()->property(i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment