From: Samuel Pitoiset Date: Thu, 20 Jul 2017 08:59:41 +0000 (+0200) Subject: mesa: add KHR_no_error support to glNamedBufferData() and glBufferData() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f05193734c86750c7943e31949dc8c23c0e7d72;p=mesa.git mesa: add KHR_no_error support to glNamedBufferData() and glBufferData() Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 7927a4e1f6f..ca2ef76bfe3 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -61,7 +61,7 @@ - + diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 8c4277b984b..e1b3c43fb19 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -5045,7 +5045,7 @@ - + diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 1bae0258054..2d1b652dfc0 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -2024,6 +2024,14 @@ buffer_data_error(struct gl_context *ctx, struct gl_buffer_object *bufObj, buffer_data(ctx, bufObj, target, size, data, usage, func, false); } +static void +buffer_data_no_error(struct gl_context *ctx, struct gl_buffer_object *bufObj, + GLenum target, GLsizeiptr size, const GLvoid *data, + GLenum usage, const char *func) +{ + buffer_data(ctx, bufObj, target, size, data, usage, func, true); +} + void _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj, GLenum target, GLsizeiptr size, const GLvoid *data, @@ -2032,6 +2040,17 @@ _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj, buffer_data_error(ctx, bufObj, target, size, data, usage, func); } +void GLAPIENTRY +_mesa_BufferData_no_error(GLenum target, GLsizeiptr size, const GLvoid *data, + GLenum usage) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object **bufObj = get_buffer_target(ctx, target); + buffer_data_no_error(ctx, *bufObj, target, size, data, usage, + "glBufferData"); +} + void GLAPIENTRY _mesa_BufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) @@ -2047,6 +2066,17 @@ _mesa_BufferData(GLenum target, GLsizeiptr size, "glBufferData"); } +void GLAPIENTRY +_mesa_NamedBufferData_no_error(GLuint buffer, GLsizeiptr size, + const GLvoid *data, GLenum usage) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer); + buffer_data_no_error(ctx, bufObj, GL_NONE, size, data, usage, + "glNamedBufferData"); +} + void GLAPIENTRY _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage) diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 69e85498186..19f935d1be9 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -196,10 +196,18 @@ void GLAPIENTRY _mesa_NamedBufferStorage(GLuint buffer, GLsizeiptr size, const GLvoid *data, GLbitfield flags); +void GLAPIENTRY +_mesa_BufferData_no_error(GLenum target, GLsizeiptr size, + const GLvoid *data, GLenum usage); + void GLAPIENTRY _mesa_BufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +void GLAPIENTRY +_mesa_NamedBufferData_no_error(GLuint buffer, GLsizeiptr size, + const GLvoid *data, GLenum usage); + void GLAPIENTRY _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);