summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-06-26 14:01:27 +0200
committerSamuel Pitoiset <[email protected]>2017-06-28 10:25:12 +0200
commit455b1a3a4b688e859d4b0b12f1f13f4e472444be (patch)
treec00fea06f8f2f085bffe68ac88e6ec79411e8ace /src/mesa
parent56f428817f4f57806e73d0acd18949bf563f6540 (diff)
mesa: prepare create_samplers() helper for KHR_no_error support
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/samplerobj.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index d3ed4da3932..7ac1743e2d3 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -154,20 +154,11 @@ _mesa_new_sampler_object(struct gl_context *ctx, GLuint name)
}
static void
-create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers,
- const char *caller)
+create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers)
{
GLuint first;
GLint i;
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "%s(%d)\n", caller, count);
-
- if (count < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", caller);
- return;
- }
-
if (!samplers)
return;
@@ -186,18 +177,34 @@ create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers,
_mesa_HashUnlockMutex(ctx->Shared->SamplerObjects);
}
+static void
+create_samplers_err(struct gl_context *ctx, GLsizei count, GLuint *samplers,
+ const char *caller)
+{
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "%s(%d)\n", caller, count);
+
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", caller);
+ return;
+ }
+
+ create_samplers(ctx, count, samplers);
+}
+
void GLAPIENTRY
_mesa_GenSamplers(GLsizei count, GLuint *samplers)
{
GET_CURRENT_CONTEXT(ctx);
- create_samplers(ctx, count, samplers, "glGenSamplers");
+ create_samplers_err(ctx, count, samplers, "glGenSamplers");
}
void GLAPIENTRY
_mesa_CreateSamplers(GLsizei count, GLuint *samplers)
{
GET_CURRENT_CONTEXT(ctx);
- create_samplers(ctx, count, samplers, "glCreateSamplers");
+ create_samplers_err(ctx, count, samplers, "glCreateSamplers");
}