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,13 +944,23 @@ void lcContext::SetVertexFormatConditional(int BufferOffset)
mVertexBufferOffset = VertexBufferPointer;
glEnableVertexAttribArray(1);
glEnableVertexAttribArray(2);
glEnableVertexAttribArray(3);
if (!mNormalEnabled)
{
glEnableVertexAttribArray(1);
mNormalEnabled = true; // todo: store state using an array
}
mNormalEnabled = true; // todo: store state using an array
mTexCoordEnabled = true;
mColorEnabled = true;
if (!mTexCoordEnabled)
{
glEnableVertexAttribArray(2);
mTexCoordEnabled = true;
}
if (!mColorEnabled)
{
glEnableVertexAttribArray(3);
mColorEnabled = true;
}
}
}
}