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 /src/mesa/main/bufferobj.c | |
parent | cab148c28231c109e2dee7b2dbea77997117932e (diff) |
mesa: add KHR_no_error support for glNamedBufferSubData()
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r-- | src/mesa/main/bufferobj.c | 27 |
1 files changed, 20 insertions, 7 deletions
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"); } |