[Mesa-dev] [PATCH 19/42] mesa: prepare create_textures() helper for KHR_no_error support

Timothy Arceri tarceri at itsqueeze.com
Tue Jun 27 23:32:17 UTC 2017


On 27/06/17 21:20, Samuel Pitoiset wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>   src/mesa/main/texobj.c | 34 +++++++++++++++++++++-------------
>   1 file changed, 21 insertions(+), 13 deletions(-)
> 
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index 0fcf5839689..1b2bb50d1d3 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -1195,17 +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;

Again this is not an error so we should not be skipping it. With this 
left here.

17-19:

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

> -
>      /*
>       * This must be atomic (generation and allocation of texture IDs)
>       */
> @@ -1233,6 +1222,25 @@ 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;
> +   }
> +
> +   if (!textures)
> +      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");
>   }
>   
>   /**
> 


More information about the mesa-dev mailing list