diff --git a/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.cpp b/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.cpp index ee9d24e8..c5231df8 100644 --- a/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.cpp +++ b/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.cpp @@ -94,6 +94,18 @@ namespace MobileGL { Uint VertexArrayObject::GetExternalIndex() const { return m_externalIndex; } + + void VertexArrayObject::SetAttributeDivisor(Uint index, Uint divisor) { + if (index >= MAX_VERTEX_ATTRIBS) return; + if (m_attributes[index].Divisor == divisor) return; + m_attributes[index].Divisor = divisor; + MarkAttributeDirty(index); + } + + Uint VertexArrayObject::GetAttributeDivisor(Uint index) const { + if (index >= MAX_VERTEX_ATTRIBS) return 0; + return m_attributes[index].Divisor; + } } // namespace GLState } // namespace MG_State } // namespace MobileGL diff --git a/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.h b/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.h index 76135add..63374fc4 100644 --- a/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.h +++ b/MobileGL/MG_State/GLState/VertexArrayState/VertexArrayObject.h @@ -13,6 +13,7 @@ namespace MobileGL { int Stride = 0; SizeT Offset = 0; Bool IsInteger = false; + Uint Divisor = 0; SharedPtr Buffer; }; @@ -40,6 +41,9 @@ namespace MobileGL { void ClearDirtyAttributes(); Uint GetExternalIndex() const; + void SetAttributeDivisor(Uint index, Uint divisor); + Uint GetAttributeDivisor(Uint index) const; + private: void MarkAttributeDirty(Uint index);