mesa: add ARB_clear_buffer_object named functions
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 5 Nov 2019 14:37:12 +0000 (15:37 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 19 Nov 2019 07:49:45 +0000 (08:49 +0100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
docs/features.txt
src/mapi/glapi/gen/ARB_clear_buffer_object.xml
src/mapi/glapi/gen/static_data.py
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h
src/mesa/main/tests/dispatch_sanity.cpp

index 0193aba5cf000c7e2942a78febe69a01d4c25b6d..82ebac79b04e523bd76c074b728b33419c2c09c4 100644 (file)
@@ -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
index 25a42b3a479d33d35ca9eb92d5b55d103e8c75fa..490ec74f2422246080ef3f5a45f33964d2cccd8d 100644 (file)
@@ -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>
 
index 9937b7aaa4ef2bade564bc7e9764a85b1bf8d6c6..c9d9b2cb2d651dac95a7603e5d688e71ce804d5b 100644 (file)
@@ -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 = [
index e370d04c31d675ebf797bc4c803a90e4adda9d0d..73b210d105ad1e68658e2cb957fbeb87f34bf0bb 100644 (file)
@@ -2573,6 +2573,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,
@@ -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)
 {
index 6cc04eb4bb882173304e5d0ca227f84e7fcca8cd..23c4f20f3e2bfe3716e318613329e1cb0b6aa62d 100644 (file)
@@ -277,6 +277,11 @@ _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat,
                            GLenum format, GLenum type,
                            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,
@@ -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
index 6df90e966f1f72b7da4ac4be7aa2ee793cdf4c88..a34879ff17e86c941089774733713b1d91cb866f 100644 (file)
@@ -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 },