mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Feat] (MG_State/VertexArrayState): Implement divisor.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace MobileGL {
|
||||
int Stride = 0;
|
||||
SizeT Offset = 0;
|
||||
Bool IsInteger = false;
|
||||
Uint Divisor = 0;
|
||||
SharedPtr<BufferObject> 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user