mesa: add KHR_no_error support for flush mapped buffer functions
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 4 May 2017 03:49:02 +0000 (13:49 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 7 May 2017 05:29:33 +0000 (15:29 +1000)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mapi/glapi/gen/ARB_map_buffer_range.xml
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h

index fe5a7e92143d171d9dee77332e7b540096c9b05a..03f6c8b6bebc8014ee5b3d9dfbe4601e8d689b88 100644 (file)
       <param name="buffer" type="GLuint" />
    </function>
 
-   <function name="FlushMappedNamedBufferRange">
+   <function name="FlushMappedNamedBufferRange" no_error="true">
       <param name="buffer" type="GLuint" />
       <param name="offset" type="GLintptr" />
       <param name="length" type="GLsizeiptr" />
index b79b70a308172b6386c3c4a746d704b20875b954..35a20bea6b874b4cbff38d55190c6ebcea6a47e0 100644 (file)
@@ -23,7 +23,7 @@
         <return type="GLvoid *"/>
     </function>
 
-    <function name="FlushMappedBufferRange" es2="3.0">
+    <function name="FlushMappedBufferRange" es2="3.0" no_error="true">
         <param name="target" type="GLenum"/>
         <param name="offset" type="GLintptr"/>
         <param name="length" type="GLsizeiptr"/>
index 75526b5e339e07dc2bcffbdb9d6b141d7bc94464..9e96f31017f64c2827ecf0da169f40fec7dc33ad 100644 (file)
@@ -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)
index 44fcaaad860cef183cf41845c5ed0c2787da520f..c7c89a9375f38abf88a1c655d8b8686e85aaaf01 100644 (file)
@@ -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);