mesa: only emit _NEW_MULTISAMPLE when coverage parameters change

We usually check that given parameters are different before
updating the state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Samuel Pitoiset 2017-06-02 17:52:47 +02:00
parent 9cd69022d5
commit 706e31fe5a

View file

@ -41,11 +41,15 @@ _mesa_SampleCoverage(GLclampf value, GLboolean invert)
{
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
value = CLAMP(value, 0.0f, 1.0f);
ctx->Multisample.SampleCoverageValue = CLAMP(value, 0.0f, 1.0f);
if (ctx->Multisample.SampleCoverageInvert == invert &&
ctx->Multisample.SampleCoverageValue == value)
return;
FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
ctx->Multisample.SampleCoverageValue = value;
ctx->Multisample.SampleCoverageInvert = invert;
ctx->NewState |= _NEW_MULTISAMPLE;
}