[Mesa-dev] [PATCH 1/3] mesa: add driver interface for glInvalidateBuffer(Sub)Data
Marek Olšák
maraeo at gmail.com
Sun Mar 16 11:52:39 PDT 2014
Please disregard this series. The extension is not about reallocating
a buffer as I thought, it's actually about freeing a buffer and
allocating it later when it's used again.
Marek
On Sun, Mar 16, 2014 at 6:00 PM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> src/mesa/main/bufferobj.c | 14 ++++++--------
> src/mesa/main/dd.h | 8 +++++++-
> 2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index 2e9e059..e7b6382 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -2813,10 +2813,9 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
> return;
> }
>
> - /* We don't actually do anything for this yet. Just return after
> - * validating the parameters and generating the required errors.
> - */
> - return;
> + if (ctx->Driver.InvalidateBufferSubData) {
> + ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
> + }
> }
>
> void GLAPIENTRY
> @@ -2847,8 +2846,7 @@ _mesa_InvalidateBufferData(GLuint buffer)
> return;
> }
>
> - /* We don't actually do anything for this yet. Just return after
> - * validating the parameters and generating the required errors.
> - */
> - return;
> + if (ctx->Driver.InvalidateBufferSubData) {
> + ctx->Driver.InvalidateBufferSubData(ctx, bufObj, 0, bufObj->Size);
> + }
> }
> diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
> index 9715241..a2d2696 100644
> --- a/src/mesa/main/dd.h
> +++ b/src/mesa/main/dd.h
> @@ -957,7 +957,13 @@ struct dd_function_table {
> GLenum access, GLenum format);
>
> void (*MemoryBarrier)(struct gl_context *ctx, GLbitfield barriers);
> - /** @} */
> +
> + /** @}
> + * \name GL_ARB_invalidate_subdata interface.
> + */
> + void (*InvalidateBufferSubData)(struct gl_context *ctx,
> + struct gl_buffer_object *bufObj,
> + unsigned offset, unsigned length);
> };
>
>
> --
> 1.8.3.2
>
More information about the mesa-dev
mailing list