Mesa (master): mesa: add KHR_no_error support for unmap buffer functions

Timothy Arceri tarceri at kemper.freedesktop.org
Sun May 7 05:37:06 UTC 2017


Module: Mesa
Branch: master
Commit: bbae62c714b8e4b74ab8e4105ca5a6bff40ba5ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bbae62c714b8e4b74ab8e4105ca5a6bff40ba5ce

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Thu May  4 13:31:27 2017 +1000

mesa: add KHR_no_error support for unmap buffer functions

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mapi/glapi/gen/ARB_direct_state_access.xml |  2 +-
 src/mapi/glapi/gen/gl_API.xml                  |  2 +-
 src/mesa/main/bufferobj.c                      | 19 +++++++++++++++++++
 src/mesa/main/bufferobj.h                      |  4 ++++
 4 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index b147e7252e..fe5a7e9214 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -115,7 +115,7 @@
       <param name="access" type="GLbitfield" />
    </function>
 
-   <function name="UnmapNamedBuffer">
+   <function name="UnmapNamedBuffer" no_error="true">
       <return type="GLboolean" />
       <param name="buffer" type="GLuint" />
    </function>
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 29e4ba43de..a304ac0e4d 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -5104,7 +5104,7 @@
         <glx ignore="true"/>
     </function>
 
-    <function name="UnmapBuffer" es2="3.0">
+    <function name="UnmapBuffer" es2="3.0" no_error="true">
         <param name="target" type="GLenum"/>
         <return type="GLboolean"/>
         <glx ignore="true"/>
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 0fdb623b4b..6fa32e90fd 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -2067,6 +2067,16 @@ validate_and_unmap_buffer(struct gl_context *ctx,
 }
 
 GLboolean GLAPIENTRY
+_mesa_UnmapBuffer_no_error(GLenum target)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_buffer_object **bufObjPtr = get_buffer_target(ctx, target);
+   struct gl_buffer_object *bufObj = *bufObjPtr;
+
+   return unmap_buffer(ctx, bufObj);
+}
+
+GLboolean GLAPIENTRY
 _mesa_UnmapBuffer(GLenum target)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -2080,6 +2090,15 @@ _mesa_UnmapBuffer(GLenum target)
 }
 
 GLboolean GLAPIENTRY
+_mesa_UnmapNamedBuffer_no_error(GLuint buffer)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+
+   return unmap_buffer(ctx, bufObj);
+}
+
+GLboolean GLAPIENTRY
 _mesa_UnmapNamedBuffer(GLuint buffer)
 {
    GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 30e3105ff6..d538d0f2ca 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -253,9 +253,13 @@ _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,
                               const GLvoid *data);
 
 GLboolean GLAPIENTRY
+_mesa_UnmapBuffer_no_error(GLenum target);
+GLboolean GLAPIENTRY
 _mesa_UnmapBuffer(GLenum target);
 
 GLboolean GLAPIENTRY
+_mesa_UnmapNamedBuffer_no_error(GLuint buffer);
+GLboolean GLAPIENTRY
 _mesa_UnmapNamedBuffer(GLuint buffer);
 
 void GLAPIENTRY




More information about the mesa-commit mailing list