diff options
Diffstat (limited to 'src/render/backend/uniform_p.h')
-rw-r--r-- | src/render/backend/uniform_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/render/backend/uniform_p.h b/src/render/backend/uniform_p.h index ee83823aa..b1ddcf01c 100644 --- a/src/render/backend/uniform_p.h +++ b/src/render/backend/uniform_p.h @@ -195,6 +195,7 @@ public: template<typename T> void setData(const QList<T> &v) { + m_elementByteSize = sizeof(T); m_data.resize(v.size() * sizeof(T) / sizeof(float)); m_valueType = ScalarValue; float *data = m_data.data(); @@ -204,6 +205,8 @@ public: static UniformValue fromVariant(const QVariant &variant); int byteSize() const { return int(m_data.size()) * sizeof(float); } + int elementCount() const { return byteSize() / elementByteSize(); } + int elementByteSize() const { return m_elementByteSize; } template<typename T> const T *constData() const @@ -235,6 +238,7 @@ private: // TODO: Replace this hack see QTBUG-57510 UniformType m_storedType = Unknown; + int m_elementByteSize = sizeof(float); }; template<> |