Mesa (master): mesa: add ARB_clear_buffer_object named functions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 19 08:24:13 UTC 2019


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

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Tue Nov  5 15:37:12 2019 +0100

mesa: add ARB_clear_buffer_object named functions

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 docs/features.txt                              |  2 +-
 src/mapi/glapi/gen/ARB_clear_buffer_object.xml |  5 ++--
 src/mapi/glapi/gen/static_data.py              |  8 ++++---
 src/mesa/main/bufferobj.c                      | 33 ++++++++++++++++++++++++++
 src/mesa/main/bufferobj.h                      | 11 +++++++++
 src/mesa/main/tests/dispatch_sanity.cpp        |  4 ++--
 6 files changed, 54 insertions(+), 9 deletions(-)

diff --git a/docs/features.txt b/docs/features.txt
index 0193aba5cf0..82ebac79b04 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -377,7 +377,7 @@ GL_EXT_direct_state_access additions from other extensions (complete list):
   GL_AMD_gpu_shader_int64                               n/a (not enabled in compat profile)
   GL_ARB_bindless_texture                               DONE
   GL_ARB_buffer_storage                                 DONE
-  GL_ARB_clear_buffer_object                            not started
+  GL_ARB_clear_buffer_object                            DONE
   GL_ARB_framebuffer_no_attachments                     DONE
   GL_ARB_gpu_shader_fp64                                not started
   GL_ARB_instanced_arrays                               not started
diff --git a/src/mapi/glapi/gen/ARB_clear_buffer_object.xml b/src/mapi/glapi/gen/ARB_clear_buffer_object.xml
index 25a42b3a479..490ec74f242 100644
--- a/src/mapi/glapi/gen/ARB_clear_buffer_object.xml
+++ b/src/mapi/glapi/gen/ARB_clear_buffer_object.xml
@@ -26,7 +26,7 @@
         <param name="data" type="const GLvoid *"/>
     </function>
 
-<!--    <function name="ClearNamedBufferDataEXT">
+    <function name="ClearNamedBufferDataEXT">
         <param name="buffer" type="GLuint"/>
         <param name="internalformat" type="GLenum"/>
         <param name="format" type="GLenum"/>
@@ -34,7 +34,6 @@
         <param name="data" type="const GLvoid *"/>
     </function>
 
-
     <function name="ClearNamedBufferSubDataEXT">
         <param name="buffer" type="GLuint"/>
         <param name="internalformat" type="GLenum"/>
@@ -43,7 +42,7 @@
         <param name="format" type="GLenum"/>
         <param name="type" type="GLenum"/>
         <param name="data" type="const GLvoid *"/>
-    </function> -->
+    </function>
 
 </category>
 
diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py
index 9937b7aaa4e..c9d9b2cb2d6 100644
--- a/src/mapi/glapi/gen/static_data.py
+++ b/src/mapi/glapi/gen/static_data.py
@@ -1616,9 +1616,11 @@ offsets = {
     "GetVertexArrayPointervEXT": 1580,
     "GetVertexArrayIntegeri_vEXT": 1581,
     "GetVertexArrayPointeri_vEXT": 1582,
-    "NamedFramebufferParameteriEXT": 1583,
-    "GetNamedFramebufferParameterivEXT": 1584,
-    "VertexArrayVertexAttribLOffsetEXT": 1585,
+    "ClearNamedBufferDataEXT": 1583,
+    "ClearNamedBufferSubDataEXT": 1584,
+    "NamedFramebufferParameteriEXT": 1585,
+    "GetNamedFramebufferParameterivEXT": 1586,
+    "VertexArrayVertexAttribLOffsetEXT": 1587,
 }
 
 functions = [
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index e370d04c31d..73b210d105a 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -2574,6 +2574,22 @@ _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat,
 
 
 void GLAPIENTRY
+_mesa_ClearNamedBufferDataEXT(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);
+   if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
+                                     &bufObj, "glClearNamedBufferDataEXT"))
+      return;
+
+   clear_buffer_sub_data_error(ctx, bufObj, internalformat, 0, bufObj->Size,
+                               format, type, data, "glClearNamedBufferDataEXT",
+                               false);
+}
+
+
+void GLAPIENTRY
 _mesa_ClearBufferSubData_no_error(GLenum target, GLenum internalformat,
                                   GLintptr offset, GLsizeiptr size,
                                   GLenum format, GLenum type,
@@ -2641,6 +2657,23 @@ _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,
                                true);
 }
 
+void GLAPIENTRY
+_mesa_ClearNamedBufferSubDataEXT(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);
+   if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
+                                     &bufObj, "glClearNamedBufferSubDataEXT"))
+      return;
+
+   clear_buffer_sub_data_error(ctx, bufObj, internalformat, offset, size,
+                               format, type, data, "glClearNamedBufferSubDataEXT",
+                               true);
+}
+
 static GLboolean
 unmap_buffer(struct gl_context *ctx, struct gl_buffer_object *bufObj)
 {
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 6cc04eb4bb8..23c4f20f3e2 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -278,6 +278,11 @@ _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat,
                            const GLvoid *data);
 
 void GLAPIENTRY
+_mesa_ClearNamedBufferDataEXT(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,
@@ -301,6 +306,12 @@ _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,
                               GLenum format, GLenum type,
                               const GLvoid *data);
 
+void GLAPIENTRY
+_mesa_ClearNamedBufferSubDataEXT(GLuint buffer, GLenum internalformat,
+                                 GLintptr offset, GLsizeiptr size,
+                                 GLenum format, GLenum type,
+                                 const GLvoid *data);
+
 GLboolean GLAPIENTRY
 _mesa_UnmapBuffer_no_error(GLenum target);
 GLboolean GLAPIENTRY
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 6df90e966f1..a34879ff17e 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -858,8 +858,8 @@ const struct function common_desktop_functions_possible[] = {
    { "glTextureStorage3DEXT", 43, -1 },
    { "glClearBufferData", 43, -1 },
    { "glClearBufferSubData", 43, -1 },
-// { "glClearNamedBufferDataEXT", 43, -1 },             // XXX: Add to xml
-// { "glClearNamedBufferSubDataEXT", 43, -1 },          // XXX: Add to xml
+   { "glClearNamedBufferDataEXT", 43, -1 },
+   { "glClearNamedBufferSubDataEXT", 43, -1 },
    { "glCopyImageSubData", 43, -1 },
    { "glTextureView", 43, -1 },
    { "glBindVertexBuffer", 43, -1 },




More information about the mesa-commit mailing list