summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-07-17 21:57:27 +0200
committerSamuel Pitoiset <[email protected]>2017-07-31 13:53:39 +0200
commit5f51c970a99d0aba01baf7520d8508d725e4832d (patch)
tree0ccd428934d1977faa487b98441e0392f440d2f3
parente4b170e4f061784380505f173eb247af3269d26c (diff)
mesa: add sample_maski() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/mesa/main/multisample.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 38d91f7204e..121023ac827 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);
}
/**