GLES: Fix bias state

This commit is contained in:
Emile Belanger 2021-12-11 12:19:37 +00:00 committed by Christoph Oelckers
parent 5300abb76d
commit 9e9bb66e9a

View file

@ -390,19 +390,17 @@ void FGLRenderState::ApplyState()
mMaterial.mChanged = false;
}
if (mBias.mChanged)
if (mBias.mFactor == 0 && mBias.mUnits == 0)
{
if (mBias.mFactor == 0 && mBias.mUnits == 0)
{
glDisable(GL_POLYGON_OFFSET_FILL);
}
else
{
glEnable(GL_POLYGON_OFFSET_FILL);
}
glPolygonOffset(mBias.mFactor, mBias.mUnits);
mBias.mChanged = false;
glDisable(GL_POLYGON_OFFSET_FILL);
}
else
{
glEnable(GL_POLYGON_OFFSET_FILL);
}
glPolygonOffset(mBias.mFactor, mBias.mUnits);
mBias.mChanged = false;
}
void FGLRenderState::ApplyBuffers()