[Mesa-dev] [PATCH 25/42] mesa: prepare create_render_buffers() for KHR_no_error support

Timothy Arceri tarceri at itsqueeze.com
Wed Jun 28 01:09:08 UTC 2017



On 27/06/17 21:20, Samuel Pitoiset wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>   src/mesa/main/fbobject.c | 30 ++++++++++++++++++++----------
>   1 file changed, 20 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 74b38180900..d16fe6bd21a 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -1705,14 +1705,6 @@ create_render_buffers(struct gl_context *ctx, GLsizei n, GLuint *renderbuffers,
>      GLuint first;
>      GLint i;
>   
> -   if (n < 0) {
> -      _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", func);
> -      return;
> -   }
> -
> -   if (!renderbuffers)
> -      return;

Same again please leave this here. With that 24-25:

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

> -
>      _mesa_HashLockMutex(ctx->Shared->RenderBuffers);
>   
>      first = _mesa_HashFindFreeKeyBlock(ctx->Shared->RenderBuffers, n);
> @@ -1734,11 +1726,29 @@ create_render_buffers(struct gl_context *ctx, GLsizei n, GLuint *renderbuffers,
>   }
>   
>   
> +static void
> +create_render_buffers_err(struct gl_context *ctx, GLsizei n,
> +                          GLuint *renderbuffers, bool dsa)
> +{
> +   const char *func = dsa ? "glCreateRenderbuffers" : "glGenRenderbuffers";
> +
> +   if (n < 0) {
> +      _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", func);
> +      return;
> +   }
> +
> +   if (!renderbuffers)
> +      return;
> +
> +   create_render_buffers(ctx, n, renderbuffers, dsa);
> +}
> +
> +
>   void GLAPIENTRY
>   _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers)
>   {
>      GET_CURRENT_CONTEXT(ctx);
> -   create_render_buffers(ctx, n, renderbuffers, false);
> +   create_render_buffers_err(ctx, n, renderbuffers, false);
>   }
>   
>   
> @@ -1746,7 +1756,7 @@ void GLAPIENTRY
>   _mesa_CreateRenderbuffers(GLsizei n, GLuint *renderbuffers)
>   {
>      GET_CURRENT_CONTEXT(ctx);
> -   create_render_buffers(ctx, n, renderbuffers, true);
> +   create_render_buffers_err(ctx, n, renderbuffers, true);
>   }
>   
>   
> 


More information about the mesa-dev mailing list