diff options
author | Samuel Pitoiset <[email protected]> | 2017-06-02 17:52:47 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-06 11:47:16 +0200 |
commit | 706e31fe5a228bd357a3d8e0495d3085a3953ccf (patch) | |
tree | 52ac4a2ea80dabeaa0079b5692218d7037f01caa /src | |
parent | 9cd69022d5603fc21dc583f51cf12ccefaa6272f (diff) |
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 <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/multisample.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c index 5453e38632e..f0e7a611805 100644 --- a/src/mesa/main/multisample.c +++ b/src/mesa/main/multisample.c @@ -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); + + if (ctx->Multisample.SampleCoverageInvert == invert && + ctx->Multisample.SampleCoverageValue == value) + return; - ctx->Multisample.SampleCoverageValue = CLAMP(value, 0.0f, 1.0f); + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + ctx->Multisample.SampleCoverageValue = value; ctx->Multisample.SampleCoverageInvert = invert; - ctx->NewState |= _NEW_MULTISAMPLE; } |