diff options
author | Timothy Arceri <[email protected]> | 2017-05-12 21:36:25 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-05-17 10:12:03 +1000 |
commit | b3888b7a681d5ef598ef55f3c3822082daa46fda (patch) | |
tree | 7323ca310a64f5e8b7b9b1d9813d4666d7cf9c13 | |
parent | 7ec12293bee9cff0d161bfde7fb9c9e8a0aafd2b (diff) |
mesa: add KHR_no_error support for glBufferSubData()
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/mapi/glapi/gen/gl_API.xml | 3 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.c | 20 | ||||
-rw-r--r-- | src/mesa/main/bufferobj.h | 3 |
3 files changed, 22 insertions, 4 deletions
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 8afd5ec5138..762fb5a6769 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -5051,7 +5051,8 @@ <glx ignore="true"/> </function> - <function name="BufferSubData" es1="1.1" es2="2.0" marshal="custom"> + <function name="BufferSubData" es1="1.1" es2="2.0" marshal="custom" + no_error="true"> <param name="target" type="GLenum"/> <param name="offset" type="GLintptr"/> <param name="size" type="GLsizeiptr" counter="true"/> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 3e903cb3c29..461d69779a1 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1872,9 +1872,14 @@ buffer_sub_data(GLenum target, GLuint buffer, GLintptr offset, return; } } else { - bufObj = get_buffer(ctx, func, target, GL_INVALID_OPERATION); - if (!bufObj) - return; + if (no_error) { + struct gl_buffer_object **bufObjPtr = get_buffer_target(ctx, target); + bufObj = *bufObjPtr; + } else { + bufObj = get_buffer(ctx, func, target, GL_INVALID_OPERATION); + if (!bufObj) + return; + } } if (no_error || validate_buffer_sub_data(ctx, bufObj, offset, size, func)) @@ -1883,6 +1888,15 @@ buffer_sub_data(GLenum target, GLuint buffer, GLintptr offset, void GLAPIENTRY +_mesa_BufferSubData_no_error(GLenum target, GLintptr offset, + GLsizeiptr size, const GLvoid *data) +{ + buffer_sub_data(target, 0, offset, size, data, false, true, + "glBufferSubData"); +} + + +void GLAPIENTRY _mesa_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) { diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index b3cfcc0a4a3..f652ec30d05 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -193,6 +193,9 @@ _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); void GLAPIENTRY +_mesa_BufferSubData_no_error(GLenum target, GLintptr offset, + GLsizeiptr size, const GLvoid *data); +void GLAPIENTRY _mesa_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); |