From: Timothy Arceri Date: Thu, 4 May 2017 03:49:02 +0000 (+1000) Subject: mesa: add KHR_no_error support for flush mapped buffer functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=426e4765d26d37ecda920cb8cccc0cba17def6fc;p=mesa.git mesa: add KHR_no_error support for flush mapped buffer functions Reviewed-by: Eric Anholt --- diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index fe5a7e92143..03f6c8b6beb 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -120,7 +120,7 @@ - + diff --git a/src/mapi/glapi/gen/ARB_map_buffer_range.xml b/src/mapi/glapi/gen/ARB_map_buffer_range.xml index b79b70a3081..35a20bea6b8 100644 --- a/src/mapi/glapi/gen/ARB_map_buffer_range.xml +++ b/src/mapi/glapi/gen/ARB_map_buffer_range.xml @@ -23,7 +23,7 @@ - + diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 75526b5e339..9e96f31017f 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -2830,6 +2830,19 @@ flush_mapped_buffer_range(struct gl_context *ctx, MAP_USER); } +void GLAPIENTRY +_mesa_FlushMappedBufferRange_no_error(GLenum target, GLintptr offset, + GLsizeiptr length) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object **bufObjPtr = get_buffer_target(ctx, target); + struct gl_buffer_object *bufObj = *bufObjPtr; + + if (ctx->Driver.FlushMappedBufferRange) + ctx->Driver.FlushMappedBufferRange(ctx, offset, length, bufObj, + MAP_USER); +} + void GLAPIENTRY _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) @@ -2846,6 +2859,18 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, "glFlushMappedBufferRange"); } +void GLAPIENTRY +_mesa_FlushMappedNamedBufferRange_no_error(GLuint buffer, GLintptr offset, + GLsizeiptr length) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer); + + if (ctx->Driver.FlushMappedBufferRange) + ctx->Driver.FlushMappedBufferRange(ctx, offset, length, bufObj, + MAP_USER); +} + void GLAPIENTRY _mesa_FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length) diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 44fcaaad860..c7c89a9375f 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -310,12 +310,17 @@ _mesa_MapNamedBuffer_no_error(GLuint buffer, GLenum access); void * GLAPIENTRY _mesa_MapNamedBuffer(GLuint buffer, GLenum access); - +void GLAPIENTRY +_mesa_FlushMappedBufferRange_no_error(GLenum target, GLintptr offset, + GLsizeiptr length); void GLAPIENTRY _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length); void GLAPIENTRY +_mesa_FlushMappedNamedBufferRange_no_error(GLuint buffer, GLintptr offset, + GLsizeiptr length); +void GLAPIENTRY _mesa_FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length);