From: Timothy Arceri Date: Thu, 4 May 2017 04:48:02 +0000 (+1000) Subject: mesa: add KHR_no_error support to copy buffer subdata functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f9e682065239be8618506d51923e32ca04156764;p=mesa.git mesa: add KHR_no_error support to copy buffer subdata functions Reviewed-by: Eric Anholt --- diff --git a/src/mapi/glapi/gen/ARB_copy_buffer.xml b/src/mapi/glapi/gen/ARB_copy_buffer.xml index d1c6f1fecce..12e0c195da6 100644 --- a/src/mapi/glapi/gen/ARB_copy_buffer.xml +++ b/src/mapi/glapi/gen/ARB_copy_buffer.xml @@ -11,7 +11,7 @@ - + diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 03f6c8b6beb..3cb486edab0 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -75,7 +75,7 @@ - + diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index b0a7543f577..d7e77de4245 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -2348,6 +2348,24 @@ copy_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *src, ctx->Driver.CopyBufferSubData(ctx, src, dst, readOffset, writeOffset, size); } +void GLAPIENTRY +_mesa_CopyBufferSubData_no_error(GLenum readTarget, GLenum writeTarget, + GLintptr readOffset, GLintptr writeOffset, + GLsizeiptr size) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object **src_ptr = get_buffer_target(ctx, readTarget); + struct gl_buffer_object *src = *src_ptr; + + struct gl_buffer_object **dst_ptr = get_buffer_target(ctx, writeTarget); + struct gl_buffer_object *dst = *dst_ptr; + + dst->MinMaxCacheDirty = true; + ctx->Driver.CopyBufferSubData(ctx, src, dst, readOffset, writeOffset, + size); +} + void GLAPIENTRY _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, @@ -2370,6 +2388,21 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, "glCopyBufferSubData"); } +void GLAPIENTRY +_mesa_CopyNamedBufferSubData_no_error(GLuint readBuffer, GLuint writeBuffer, + GLintptr readOffset, + GLintptr writeOffset, GLsizeiptr size) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object *src = _mesa_lookup_bufferobj(ctx, readBuffer); + struct gl_buffer_object *dst = _mesa_lookup_bufferobj(ctx, writeBuffer); + + dst->MinMaxCacheDirty = true; + ctx->Driver.CopyBufferSubData(ctx, src, dst, readOffset, writeOffset, + size); +} + void GLAPIENTRY _mesa_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 93a360dcb63..926ffb4faf2 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -254,13 +254,20 @@ _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params); void GLAPIENTRY _mesa_GetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid **params); - +void GLAPIENTRY +_mesa_CopyBufferSubData_no_error(GLenum readTarget, GLenum writeTarget, + GLintptr readOffset, GLintptr writeOffset, + GLsizeiptr size); void GLAPIENTRY _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); void GLAPIENTRY +_mesa_CopyNamedBufferSubData_no_error(GLuint readBuffer, GLuint writeBuffer, + GLintptr readOffset, + GLintptr writeOffset, GLsizeiptr size); +void GLAPIENTRY _mesa_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);