From: Timothy Arceri Date: Thu, 4 May 2017 03:08:57 +0000 (+1000) Subject: mesa: add KHR_no_error support for some map buffer functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9d010f57dbb905c79a8916a2de3bc060a4099854;p=mesa.git mesa: add KHR_no_error support for some map 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 43841bb6c06..b147e7252e0 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -101,13 +101,13 @@ - + - + diff --git a/src/mapi/glapi/gen/ARB_map_buffer_range.xml b/src/mapi/glapi/gen/ARB_map_buffer_range.xml index cf7b211482d..b79b70a3081 100644 --- a/src/mapi/glapi/gen/ARB_map_buffer_range.xml +++ b/src/mapi/glapi/gen/ARB_map_buffer_range.xml @@ -15,7 +15,7 @@ - + diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 83f4c013ee1..29e4ba43de6 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -5097,7 +5097,7 @@ - + diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 797b6fb3069..d1726d68628 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -2575,6 +2575,19 @@ map_buffer_range(struct gl_context *ctx, struct gl_buffer_object *bufObj, return map; } +void * GLAPIENTRY +_mesa_MapBufferRange_no_error(GLenum target, GLintptr offset, + GLsizeiptr length, GLbitfield access) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_buffer_object **bufObjPtr = get_buffer_target(ctx, target); + struct gl_buffer_object *bufObj = *bufObjPtr; + + return map_buffer_range(ctx, bufObj, offset, length, access, + "glMapBufferRange"); +} + void * GLAPIENTRY _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) @@ -2600,6 +2613,17 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, "glMapBufferRange"); } +void * GLAPIENTRY +_mesa_MapNamedBufferRange_no_error(GLuint buffer, GLintptr offset, + GLsizeiptr length, GLbitfield access) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer); + + return map_buffer_range(ctx, bufObj, offset, length, access, + "glMapNamedBufferRange"); +} + void * GLAPIENTRY _mesa_MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access) @@ -2651,6 +2675,21 @@ get_map_buffer_access_flags(struct gl_context *ctx, GLenum access, } } +void * GLAPIENTRY +_mesa_MapBuffer_no_error(GLenum target, GLenum access) +{ + GET_CURRENT_CONTEXT(ctx); + + GLbitfield accessFlags; + get_map_buffer_access_flags(ctx, access, &accessFlags); + + struct gl_buffer_object **bufObjPtr = get_buffer_target(ctx, target); + struct gl_buffer_object *bufObj = *bufObjPtr; + + return map_buffer_range(ctx, bufObj, 0, bufObj->Size, accessFlags, + "glMapBuffer"); +} + void * GLAPIENTRY _mesa_MapBuffer(GLenum target, GLenum access) { @@ -2675,6 +2714,20 @@ _mesa_MapBuffer(GLenum target, GLenum access) "glMapBuffer"); } +void * GLAPIENTRY +_mesa_MapNamedBuffer_no_error(GLuint buffer, GLenum access) +{ + GET_CURRENT_CONTEXT(ctx); + + GLbitfield accessFlags; + get_map_buffer_access_flags(ctx, access, &accessFlags); + + struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer); + + return map_buffer_range(ctx, bufObj, 0, bufObj->Size, accessFlags, + "glMapNamedBuffer"); +} + void * GLAPIENTRY _mesa_MapNamedBuffer(GLuint buffer, GLenum access) { diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index f9d887465dc..f95e31ab107 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -293,16 +293,26 @@ _mesa_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLsizeiptr size); void * GLAPIENTRY +_mesa_MapBufferRange_no_error(GLenum target, GLintptr offset, + GLsizeiptr length, GLbitfield access); +void * GLAPIENTRY _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); void * GLAPIENTRY +_mesa_MapNamedBufferRange_no_error(GLuint buffer, GLintptr offset, + GLsizeiptr length, GLbitfield access); +void * GLAPIENTRY _mesa_MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +void * GLAPIENTRY +_mesa_MapBuffer_no_error(GLenum target, GLenum access); void * GLAPIENTRY _mesa_MapBuffer(GLenum target, GLenum access); +void * GLAPIENTRY +_mesa_MapNamedBuffer_no_error(GLuint buffer, GLenum access); void * GLAPIENTRY _mesa_MapNamedBuffer(GLuint buffer, GLenum access);