[Mesa-dev] [PATCH 04/21] mesa: add invalidate_buffer_subdata() helper

Timothy Arceri tarceri at itsqueeze.com
Sun Jun 4 21:46:53 UTC 2017


On 01/06/17 23:04, Samuel Pitoiset wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>   src/mesa/main/bufferobj.c | 15 +++++++++++----
>   1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index 9e656a4c98..08f5a9e59b 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -4237,6 +4237,15 @@ _mesa_BindBuffersBase(GLenum target, GLuint first, GLsizei count,
>      }
>   }
>   
> +static inline void

Compilers will generally ignore inline in a .c file. To force inlining 
you should use ALWAYS_INLINE here. With that 2-4 are:

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

> +invalidate_buffer_subdata(struct gl_context *ctx,
> +                          struct gl_buffer_object *bufObj, GLintptr offset,
> +                          GLsizeiptr length)
> +{
> +   if (ctx->Driver.InvalidateBufferSubData)
> +      ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
> +}
> +
>   void GLAPIENTRY
>   _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
>                                 GLsizeiptr length)
> @@ -4286,8 +4295,7 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
>         return;
>      }
>   
> -   if (ctx->Driver.InvalidateBufferSubData)
> -      ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
> +   invalidate_buffer_subdata(ctx, bufObj, offset, length);
>   }
>   
>   void GLAPIENTRY
> @@ -4324,8 +4332,7 @@ _mesa_InvalidateBufferData(GLuint buffer)
>         return;
>      }
>   
> -   if (ctx->Driver.InvalidateBufferSubData)
> -      ctx->Driver.InvalidateBufferSubData(ctx, bufObj, 0, bufObj->Size);
> +   invalidate_buffer_subdata(ctx, bufObj, 0, bufObj->Size);
>   }
>   
>   static void
> 


More information about the mesa-dev mailing list