diff options
author | Timothy Arceri <[email protected]> | 2017-05-04 14:48:02 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-05-07 15:29:33 +1000 |
commit | f9e682065239be8618506d51923e32ca04156764 (patch) | |
tree | 5c6e4a70c5cff5c6afa85b9ba552ae0fc44f9f44 /src/mesa/main | |
parent | 5e86bfaee3ebbcc711e30929770dd114c7a8221c (diff) |
mesa: add KHR_no_error support to copy buffer subdata functions
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/bufferobj.c | 33 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.h | 9 |
2 files changed, 41 insertions, 1 deletions
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 @@ -2349,6 +2349,24 @@ copy_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *src, } 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, GLsizeiptr size) @@ -2371,6 +2389,21 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, } 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, GLsizeiptr size) 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); |