diff options
author | Timothy Arceri <[email protected]> | 2017-05-12 21:29:11 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-05-17 10:12:03 +1000 |
commit | 7ec12293bee9cff0d161bfde7fb9c9e8a0aafd2b (patch) | |
tree | 63fac019cf3e3574924fa8d4b55c91361fea409d | |
parent | cab148c28231c109e2dee7b2dbea77997117932e (diff) |
mesa: add KHR_no_error support for glNamedBufferSubData()
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/mapi/glapi/gen/ARB_direct_state_access.xml | 2 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.c | 27 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.h | 3 |
3 files changed, 24 insertions, 8 deletions
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index fa375e0e7a2..b8780f75b35 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -68,7 +68,7 @@ <param name="usage" type="GLenum" /> </function> - <function name="NamedBufferSubData"> + <function name="NamedBufferSubData" no_error="true"> <param name="buffer" type="GLuint" /> <param name="offset" type="GLintptr" /> <param name="size" type="GLsizeiptr" /> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index e53adb32d30..3e903cb3c29 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1858,22 +1858,26 @@ _mesa_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *bufObj, static ALWAYS_INLINE void buffer_sub_data(GLenum target, GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data, - bool dsa, const char *func) + bool dsa, bool no_error, const char *func) { GET_CURRENT_CONTEXT(ctx); struct gl_buffer_object *bufObj; if (dsa) { - bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, func); - if (!bufObj) - return; + if (no_error) { + bufObj = _mesa_lookup_bufferobj(ctx, buffer); + } else { + bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, func); + if (!bufObj) + return; + } } else { bufObj = get_buffer(ctx, func, target, GL_INVALID_OPERATION); if (!bufObj) return; } - if (validate_buffer_sub_data(ctx, bufObj, offset, size, func)) + if (no_error || validate_buffer_sub_data(ctx, bufObj, offset, size, func)) _mesa_buffer_sub_data(ctx, bufObj, offset, size, data); } @@ -1882,14 +1886,23 @@ void GLAPIENTRY _mesa_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) { - buffer_sub_data(target, 0, offset, size, data, false, "glBufferSubData"); + buffer_sub_data(target, 0, offset, size, data, false, false, + "glBufferSubData"); +} + +void GLAPIENTRY +_mesa_NamedBufferSubData_no_error(GLuint buffer, GLintptr offset, + GLsizeiptr size, const GLvoid *data) +{ + buffer_sub_data(0, buffer, offset, size, data, true, true, + "glNamedBufferSubData"); } void GLAPIENTRY _mesa_NamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data) { - buffer_sub_data(0, buffer, offset, size, data, true, + buffer_sub_data(0, buffer, offset, size, data, true, false, "glNamedBufferSubData"); } diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index a7a9673b852..b3cfcc0a4a3 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -197,6 +197,9 @@ _mesa_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); void GLAPIENTRY +_mesa_NamedBufferSubData_no_error(GLuint buffer, GLintptr offset, + GLsizeiptr size, const GLvoid *data); +void GLAPIENTRY _mesa_NamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); |