[Mesa-dev] [PATCH 046/101] mesa: add min_sample_shading() helper

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jul 21 17:39:55 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mesa/main/multisample.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index f8b117f143..037c8a6a15 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -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);
 }
 
 /**
-- 
2.13.3



More information about the mesa-dev mailing list