mesa: add min_sample_shading() helper
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 19 Jul 2017 07:59:49 +0000 (09:59 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 31 Jul 2017 11:53:39 +0000 (13:53 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/multisample.c

index f8b117f143d42bf46277faab1ff2548593e601df..037c8a6a15c9870519b2aa51fc5a112bc1db6ace 100644 (file)
@@ -141,6 +141,20 @@ _mesa_SampleMaski(GLuint index, GLbitfield mask)
    sample_maski(ctx, index, mask);
 }
 
+static void
+min_sample_shading(struct gl_context *ctx, GLclampf value)
+{
+   value = CLAMP(value, 0.0f, 1.0f);
+
+   if (ctx->Multisample.MinSampleShadingValue == value)
+      return;
+
+   FLUSH_VERTICES(ctx,
+                  ctx->DriverFlags.NewSampleShading ? 0 : _NEW_MULTISAMPLE);
+   ctx->NewDriverState |= ctx->DriverFlags.NewSampleShading;
+   ctx->Multisample.MinSampleShadingValue = value;
+}
+
 /**
  * Called via glMinSampleShadingARB
  */
@@ -155,15 +169,7 @@ _mesa_MinSampleShading(GLclampf value)
       return;
    }
 
-   value = CLAMP(value, 0.0f, 1.0f);
-
-   if (ctx->Multisample.MinSampleShadingValue == value)
-      return;
-
-   FLUSH_VERTICES(ctx,
-                  ctx->DriverFlags.NewSampleShading ? 0 : _NEW_MULTISAMPLE);
-   ctx->NewDriverState |= ctx->DriverFlags.NewSampleShading;
-   ctx->Multisample.MinSampleShadingValue = value;
+   min_sample_shading(ctx, value);
 }
 
 /**