summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-07-19 09:59:49 +0200
committerSamuel Pitoiset <[email protected]>2017-07-31 13:53:39 +0200
commitbd805a3c313990860a28cee0b172d557adf87e26 (patch)
treee0af5656ee7e2243a3c9d9efb7532dfd798930d0 /src
parentd5d01193f43aeb0cf7ab58f58c614ecc142398eb (diff)
mesa: add min_sample_shading() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/multisample.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index f8b117f143d..037c8a6a15c 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);
}
/**