mesa: only emit _NEW_MULTISAMPLE when min sample shading changes
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 2 Jun 2017 15:52:49 +0000 (17:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 6 Jun 2017 09:47:22 +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 16fe2b7ced6b5a2f282d7de9cbd7fbeddc980c4d..07786130d51bba42380d322f863d429f3033488d 100644 (file)
@@ -140,10 +140,13 @@ _mesa_MinSampleShading(GLclampf value)
       return;
    }
 
-   FLUSH_VERTICES(ctx, 0);
+   value = CLAMP(value, 0.0f, 1.0f);
+
+   if (ctx->Multisample.MinSampleShadingValue == value)
+      return;
 
-   ctx->Multisample.MinSampleShadingValue = CLAMP(value, 0.0f, 1.0f);
-   ctx->NewState |= _NEW_MULTISAMPLE;
+   FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+   ctx->Multisample.MinSampleShadingValue = value;
 }
 
 /**