[Mesa-dev] [PATCH 003/101] mesa: add sample_maski() helper

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


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

diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 38d91f7204..121023ac82 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -105,6 +105,17 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
    }
 }
 
+static void
+sample_maski(struct gl_context *ctx, GLuint index, GLbitfield mask)
+{
+   if (ctx->Multisample.SampleMaskValue == mask)
+      return;
+
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleMask ? 0 : _NEW_MULTISAMPLE);
+   ctx->NewDriverState |= ctx->DriverFlags.NewSampleMask;
+   ctx->Multisample.SampleMaskValue = mask;
+}
+
 void GLAPIENTRY
 _mesa_SampleMaski(GLuint index, GLbitfield mask)
 {
@@ -120,12 +131,7 @@ _mesa_SampleMaski(GLuint index, GLbitfield mask)
       return;
    }
 
-   if (ctx->Multisample.SampleMaskValue == mask)
-      return;
-
-   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewSampleMask ? 0 : _NEW_MULTISAMPLE);
-   ctx->NewDriverState |= ctx->DriverFlags.NewSampleMask;
-   ctx->Multisample.SampleMaskValue = mask;
+   sample_maski(ctx, index, mask);
 }
 
 /**
-- 
2.13.3



More information about the mesa-dev mailing list