- do not send depth bias changes to the GPU if nothing has changed.

This commit is contained in:
Christoph Oelckers 2021-05-21 21:01:20 +02:00
commit 7eef7614f8
2 changed files with 14 additions and 2 deletions

View file

@ -555,18 +555,28 @@ public:
mRenderStyle = rs;
}
auto GetDepthBias()
{
return mBias;
}
void SetDepthBias(float a, float b)
{
mBias.mChanged = mBias.mFactor != a || mBias.mUnits != b;
mBias.mFactor = a;
mBias.mUnits = b;
mBias.mChanged = true;
}
void SetDepthBias(FDepthBiasState& bias)
{
SetDepthBias(bias.mFactor, bias.mUnits);
}
void ClearDepthBias()
{
mBias.mChanged = mBias.mFactor != 0 || mBias.mUnits != 0;
mBias.mFactor = 0;
mBias.mUnits = 0;
mBias.mChanged = true;
}
private: