mesa: only emit _NEW_MULTISAMPLE when sample mask changes
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 2 Jun 2017 15:52:48 +0000 (17:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 6 Jun 2017 09:47:19 +0000 (11:47 +0200)
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>
src/mesa/main/multisample.c

index f0e7a611805f12399e92c80b86ceb3792ae0a5c0..16fe2b7ced6b5a2f282d7de9cbd7fbeddc980c4d 100644 (file)
@@ -119,6 +119,9 @@ _mesa_SampleMaski(GLuint index, GLbitfield mask)
       return;
    }
 
+   if (ctx->Multisample.SampleMaskValue == mask)
+      return;
+
    FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
    ctx->Multisample.SampleMaskValue = mask;
 }