diff options
author | Samuel Pitoiset <[email protected]> | 2017-06-26 13:49:03 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-28 10:25:12 +0200 |
commit | ab6d383e32311800ae8bbe0e9d63a4e8d80a66de (patch) | |
tree | 19f0c2724d4079b6c0c49feec218337d7be506b8 /src/mesa/main | |
parent | 821b806d23786f7eb7f63ce83ceb3f0d7b7ee4aa (diff) |
mesa: prepare create_textures() helper for KHR_no_error support
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/texobj.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 0fcf5839689..8cd70c3eaea 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1195,14 +1195,6 @@ create_textures(struct gl_context *ctx, GLenum target, GLuint first; GLint i; - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) - _mesa_debug(ctx, "%s %d\n", caller, n); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", caller); - return; - } - if (!textures) return; @@ -1233,6 +1225,22 @@ create_textures(struct gl_context *ctx, GLenum target, _mesa_HashUnlockMutex(ctx->Shared->TexObjects); } + +static void +create_textures_err(struct gl_context *ctx, GLenum target, + GLsizei n, GLuint *textures, const char *caller) +{ + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "%s %d\n", caller, n); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", caller); + return; + } + + create_textures(ctx, target, n, textures, caller); +} + /*@}*/ @@ -1257,7 +1265,7 @@ void GLAPIENTRY _mesa_GenTextures(GLsizei n, GLuint *textures) { GET_CURRENT_CONTEXT(ctx); - create_textures(ctx, 0, n, textures, "glGenTextures"); + create_textures_err(ctx, 0, n, textures, "glGenTextures"); } /** @@ -1290,7 +1298,7 @@ _mesa_CreateTextures(GLenum target, GLsizei n, GLuint *textures) return; } - create_textures(ctx, target, n, textures, "glCreateTextures"); + create_textures_err(ctx, target, n, textures, "glCreateTextures"); } /** |