diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2017-03-15 10:17:05 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2018-02-02 13:58:34 +0000 |
commit | 437a33de9336a5c50711e63dd6dfcd86ad28d5a5 (patch) | |
tree | 6f6cbf6fa5285a79cda6a849a0b96e744ec840c6 /src/render/materialsystem/shaderdata.cpp | |
parent | 46319648436814afb5a77755dde6681e304befaf (diff) |
Render: Use SIMD Vectors and Matrices in the backend
Change-Id: I19b3b2f8fcb06eb2bc600ebe370465dd15a8eabc
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/materialsystem/shaderdata.cpp')
-rw-r--r-- | src/render/materialsystem/shaderdata.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/render/materialsystem/shaderdata.cpp b/src/render/materialsystem/shaderdata.cpp index fec1e66ac..de423c3c2 100644 --- a/src/render/materialsystem/shaderdata.cpp +++ b/src/render/materialsystem/shaderdata.cpp @@ -171,7 +171,7 @@ void ShaderData::cleanup(NodeManagers *managers) m_updatedShaderData.clear(); } -QVariant ShaderData::getTransformedProperty(const QString &name, const QMatrix4x4 &viewMatrix) +QVariant ShaderData::getTransformedProperty(const QString &name, const Matrix4x4 &viewMatrix) { // Note protecting m_worldMatrix at this point as we assume all world updates // have been performed when reaching this point @@ -180,11 +180,11 @@ QVariant ShaderData::getTransformedProperty(const QString &name, const QMatrix4x const TransformType transformType = it.value(); switch (transformType) { case ModelToEye: - return QVariant::fromValue(viewMatrix * m_worldMatrix * m_originalProperties.value(name).value<QVector3D>()); + return QVariant::fromValue(viewMatrix * m_worldMatrix * Vector3D(m_originalProperties.value(name).value<QVector3D>())); case ModelToWorld: - return QVariant::fromValue(m_worldMatrix * m_originalProperties.value(it.key()).value<QVector3D>()); + return QVariant::fromValue(m_worldMatrix * Vector3D(m_originalProperties.value(it.key()).value<QVector3D>())); case ModelToWorldDirection: - return QVariant::fromValue((m_worldMatrix * QVector4D(m_originalProperties.value(it.key()).value<QVector3D>(), 0.0f)).toVector3D()); + return QVariant::fromValue(Vector3D(m_worldMatrix * Vector4D(m_originalProperties.value(it.key()).value<QVector3D>(), 0.0f))); case NoTransform: break; } @@ -193,7 +193,7 @@ QVariant ShaderData::getTransformedProperty(const QString &name, const QMatrix4x } // Called by FramePreparationJob or by RenderView when dealing with lights -void ShaderData::updateWorldTransform(const QMatrix4x4 &worldMatrix) +void ShaderData::updateWorldTransform(const Matrix4x4 &worldMatrix) { QMutexLocker lock(&m_mutex); if (m_worldMatrix != worldMatrix) { |