Removed redundant state changes.

This commit is contained in:
Leonardo Zide 2021-03-28 13:30:35 -07:00
parent 989373155f
commit b6acab713d

View file

@ -944,15 +944,25 @@ void lcContext::SetVertexFormatConditional(int BufferOffset)
mVertexBufferOffset = VertexBufferPointer;
if (!mNormalEnabled)
{
glEnableVertexAttribArray(1);
glEnableVertexAttribArray(2);
glEnableVertexAttribArray(3);
mNormalEnabled = true; // todo: store state using an array
}
if (!mTexCoordEnabled)
{
glEnableVertexAttribArray(2);
mTexCoordEnabled = true;
}
if (!mColorEnabled)
{
glEnableVertexAttribArray(3);
mColorEnabled = true;
}
}
}
}
void lcContext::SetVertexFormat(int BufferOffset, int PositionSize, int NormalSize, int TexCoordSize, int ColorSize, bool EnableNormals)