aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
diff options
context:
space:
mode:
authorChris Adams <chris.adams@jollamobile.com>2012-11-19 18:36:09 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-22 07:54:00 +0100
commit7f2cc816e549d704f238af9f5886905d9e2dec86 (patch)
treefd0e0a9a9ca95e3860a1dccd530ad345ada2d9f7 /tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
parentfe3aac4a4e4f5ebdcbc13050b30d2d24d5451124 (diff)
Expose QMatrix4x4 properties as mat4 uniforms in shaders
Previously, QMatrix4x4 properties were not exposed as uniforms in shaders. This commit adds conversion code for matrix 4x4 properties so that they are automatically converted to mat4 uniforms. Task-number: QTBUG-27952 Change-Id: I9b1de39fbbcb02743cf8c4e09b4d83c44f1dd438 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp')
-rw-r--r--tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp b/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
index 909af209c9..f45f3dd23a 100644
--- a/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
+++ b/tests/auto/quick/qquickshadereffect/tst_qquickshadereffect.cpp
@@ -56,8 +56,10 @@ class TestShaderEffect : public QQuickShaderEffect
Q_PROPERTY(QVariant _0aA9zZ READ dummyRead NOTIFY dummyChanged)
Q_PROPERTY(QVariant x86 READ dummyRead NOTIFY dummyChanged)
Q_PROPERTY(QVariant X READ dummyRead NOTIFY dummyChanged)
+ Q_PROPERTY(QMatrix4x4 mat4x4 READ mat4x4Read NOTIFY dummyChanged)
public:
+ QMatrix4x4 mat4x4Read() const { return QMatrix4x4(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1); }
QVariant dummyRead() const { return QVariant(); }
bool isConnected(const QMetaMethod &signal) const { return m_signals.contains(signal); }
@@ -248,6 +250,11 @@ void tst_qquickshadereffect::lookThroughShaderCode_data()
<< QByteArray("uniform lowp float X;")
<< QByteArray(" ")
<< int(PropertyPresent);
+
+ QTest::newRow("property name #4")
+ << QByteArray("uniform highp mat4 mat4x4;")
+ << QByteArray(" ")
+ << int(PropertyPresent);
}
void tst_qquickshadereffect::lookThroughShaderCode()