From 0127af12812c56b24891cc92e610950b61057771 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 21 Jul 2017 12:02:26 +0200 Subject: [PATCH] mesa: add KHR_no_error support to glClear*Buffer*Data() Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- .../glapi/gen/ARB_clear_buffer_object.xml | 4 +- .../glapi/gen/ARB_direct_state_access.xml | 4 +- src/mesa/main/bufferobj.c | 73 +++++++++++++++++++ src/mesa/main/bufferobj.h | 21 ++++++ 4 files changed, 98 insertions(+), 4 deletions(-) diff --git a/src/mapi/glapi/gen/ARB_clear_buffer_object.xml b/src/mapi/glapi/gen/ARB_clear_buffer_object.xml index 2284eacd656..25a42b3a479 100644 --- a/src/mapi/glapi/gen/ARB_clear_buffer_object.xml +++ b/src/mapi/glapi/gen/ARB_clear_buffer_object.xml @@ -8,7 +8,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index ca2ef76bfe3..fa90ffcdd22 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -83,7 +83,7 @@ - + @@ -91,7 +91,7 @@ - + diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 61f680cf315..037b2adae0f 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -2338,6 +2338,33 @@ clear_buffer_sub_data_error(struct gl_context *ctx, type, data, func, subdata, false); } + +static void +clear_buffer_sub_data_no_error(struct gl_context *ctx, + struct gl_buffer_object *bufObj, + GLenum internalformat, GLintptr offset, + GLsizeiptr size, GLenum format, GLenum type, + const GLvoid *data, const char *func, + bool subdata) +{ + clear_buffer_sub_data(ctx, bufObj, internalformat, offset, size, format, + type, data, func, subdata, true); +} + + +void GLAPIENTRY +_mesa_ClearBufferData_no_error(GLenum target, GLenum internalformat, + GLenum format, GLenum type, const GLvoid *data) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object **bufObj = get_buffer_target(ctx, target); + clear_buffer_sub_data_no_error(ctx, *bufObj, internalformat, 0, + (*bufObj)->Size, format, type, data, + "glClearBufferData", false); +} + + void GLAPIENTRY _mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid *data) @@ -2353,6 +2380,21 @@ _mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format, format, type, data, "glClearBufferData", false); } + +void GLAPIENTRY +_mesa_ClearNamedBufferData_no_error(GLuint buffer, GLenum internalformat, + GLenum format, GLenum type, + const GLvoid *data) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer); + clear_buffer_sub_data_no_error(ctx, bufObj, internalformat, 0, bufObj->Size, + format, type, data, "glClearNamedBufferData", + false); +} + + void GLAPIENTRY _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid *data) @@ -2370,6 +2412,21 @@ _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat, } +void GLAPIENTRY +_mesa_ClearBufferSubData_no_error(GLenum target, GLenum internalformat, + GLintptr offset, GLsizeiptr size, + GLenum format, GLenum type, + const GLvoid *data) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object **bufObj = get_buffer_target(ctx, target); + clear_buffer_sub_data_no_error(ctx, *bufObj, internalformat, offset, size, + format, type, data, "glClearBufferSubData", + true); +} + + void GLAPIENTRY _mesa_ClearBufferSubData(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, @@ -2388,6 +2445,22 @@ _mesa_ClearBufferSubData(GLenum target, GLenum internalformat, true); } + +void GLAPIENTRY +_mesa_ClearNamedBufferSubData_no_error(GLuint buffer, GLenum internalformat, + GLintptr offset, GLsizeiptr size, + GLenum format, GLenum type, + const GLvoid *data) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer); + clear_buffer_sub_data_no_error(ctx, bufObj, internalformat, offset, size, + format, type, data, + "glClearNamedBufferSubData", true); +} + + void GLAPIENTRY _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 19f935d1be9..9920ed233ac 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -234,22 +234,43 @@ void GLAPIENTRY _mesa_GetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +void GLAPIENTRY +_mesa_ClearBufferData_no_error(GLenum target, GLenum internalformat, + GLenum format, GLenum type, const GLvoid *data); + void GLAPIENTRY _mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid *data); +void GLAPIENTRY +_mesa_ClearNamedBufferData_no_error(GLuint buffer, GLenum internalformat, + GLenum format, GLenum type, + const GLvoid *data); + void GLAPIENTRY _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid *data); +void GLAPIENTRY +_mesa_ClearBufferSubData_no_error(GLenum target, GLenum internalformat, + GLintptr offset, GLsizeiptr size, + GLenum format, GLenum type, + const GLvoid *data); + void GLAPIENTRY _mesa_ClearBufferSubData(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid *data); +void GLAPIENTRY +_mesa_ClearNamedBufferSubData_no_error(GLuint buffer, GLenum internalformat, + GLintptr offset, GLsizeiptr size, + GLenum format, GLenum type, + const GLvoid *data); + void GLAPIENTRY _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, -- 2.30.2