mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
mesa: prepare create_samplers() helper for KHR_no_error support
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
56f428817f
commit
455b1a3a4b
1 changed files with 19 additions and 12 deletions
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue