mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Feat] (MG_State/VertexArrayState): Implement divisor.
This commit is contained in:
@@ -94,6 +94,18 @@ namespace MobileGL {
|
|||||||
Uint VertexArrayObject::GetExternalIndex() const {
|
Uint VertexArrayObject::GetExternalIndex() const {
|
||||||
return m_externalIndex;
|
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 GLState
|
||||||
} // namespace MG_State
|
} // namespace MG_State
|
||||||
} // namespace MobileGL
|
} // namespace MobileGL
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace MobileGL {
|
|||||||
int Stride = 0;
|
int Stride = 0;
|
||||||
SizeT Offset = 0;
|
SizeT Offset = 0;
|
||||||
Bool IsInteger = false;
|
Bool IsInteger = false;
|
||||||
|
Uint Divisor = 0;
|
||||||
SharedPtr<BufferObject> Buffer;
|
SharedPtr<BufferObject> Buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -40,6 +41,9 @@ namespace MobileGL {
|
|||||||
void ClearDirtyAttributes();
|
void ClearDirtyAttributes();
|
||||||
Uint GetExternalIndex() const;
|
Uint GetExternalIndex() const;
|
||||||
|
|
||||||
|
void SetAttributeDivisor(Uint index, Uint divisor);
|
||||||
|
Uint GetAttributeDivisor(Uint index) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MarkAttributeDirty(Uint index);
|
void MarkAttributeDirty(Uint index);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user