main: Add entry points for ClearNamedBuffer[Sub]Data.
authorLaura Ekstrand <laura@jlekstrand.net>
Wed, 11 Feb 2015 20:17:38 +0000 (12:17 -0800)
committerLaura Ekstrand <laura@jlekstrand.net>
Tue, 17 Mar 2015 17:18:33 +0000 (10:18 -0700)
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h
src/mesa/main/tests/dispatch_sanity.cpp

index 042b2a883c96770ebd59c210785dadb91e033196..ce4017b29a8ca869e67e89712abdef79acfea263 100644 (file)
       <param name="size" type="GLsizeiptr" />
    </function>
 
+   <function name="ClearNamedBufferData" offset="assign">
+      <param name="buffer" type="GLuint" />
+      <param name="internalformat" type="GLenum" />
+      <param name="format" type="GLenum" />
+      <param name="type" type="GLenum" />
+      <param name="data" type="const GLvoid *" />
+   </function>
+
+   <function name="ClearNamedBufferSubData" offset="assign">
+      <param name="buffer" type="GLuint" />
+      <param name="internalformat" type="GLenum" />
+      <param name="offset" type="GLintptr" />
+      <param name="size" type="GLsizeiptr" />
+      <param name="format" type="GLenum" />
+      <param name="type" type="GLenum" />
+      <param name="data" type="const GLvoid *" />
+   </function>
+
    <!-- Texture object functions -->
 
    <function name="CreateTextures" offset="assign">
index b2d0ef9cfc835883af3d8e6f40a7be633c61bdfe..ae086a66b06cb95c4c5d6479b73f087a9f1176f2 100644 (file)
@@ -1773,6 +1773,22 @@ _mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format,
                                "glClearBufferData", false);
 }
 
+void GLAPIENTRY
+_mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat,
+                           GLenum format, GLenum type, const GLvoid *data)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_buffer_object *bufObj;
+
+   bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, "glClearNamedBufferData");
+   if (!bufObj)
+      return;
+
+   _mesa_clear_buffer_sub_data(ctx, bufObj, internalformat, 0, bufObj->Size,
+                               format, type, data,
+                               "glClearNamedBufferData", false);
+}
+
 
 void GLAPIENTRY
 _mesa_ClearBufferSubData(GLenum target, GLenum internalformat,
@@ -1792,6 +1808,25 @@ _mesa_ClearBufferSubData(GLenum target, GLenum internalformat,
                                "glClearBufferSubData", true);
 }
 
+void GLAPIENTRY
+_mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,
+                              GLintptr offset, GLsizeiptr size,
+                              GLenum format, GLenum type,
+                              const GLvoid *data)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_buffer_object *bufObj;
+
+   bufObj = _mesa_lookup_bufferobj_err(ctx, buffer,
+                                       "glClearNamedBufferSubData");
+   if (!bufObj)
+      return;
+
+   _mesa_clear_buffer_sub_data(ctx, bufObj, internalformat, offset, size,
+                               format, type, data,
+                               "glClearNamedBufferSubData", true);
+}
+
 
 void * GLAPIENTRY
 _mesa_MapBuffer(GLenum target, GLenum access)
index 5911270c0e867c82b8373020e31a43e61666a713..52547274ff29992a85703f1107cb430ce90492fb 100644 (file)
@@ -222,12 +222,23 @@ _mesa_ClearBufferData(GLenum target, GLenum internalformat,
                       GLenum format, GLenum type,
                       const GLvoid * data);
 
+void GLAPIENTRY
+_mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat,
+                           GLenum format, GLenum type,
+                           const GLvoid *data);
+
 void GLAPIENTRY
 _mesa_ClearBufferSubData(GLenum target, GLenum internalformat,
                          GLintptr offset, GLsizeiptr size,
                          GLenum format, GLenum type,
                          const GLvoid * data);
 
+void GLAPIENTRY
+_mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,
+                              GLintptr offset, GLsizeiptr size,
+                              GLenum format, GLenum type,
+                              const GLvoid *data);
+
 void * GLAPIENTRY
 _mesa_MapBuffer(GLenum target, GLenum access);
 
index 63b9dcfa385bc7c964df3e4c4bd4acce4b90287a..aff5cd6319c028c7bc61e8eaf330b99e7300e98c 100644 (file)
@@ -958,6 +958,8 @@ const struct function gl_core_functions_possible[] = {
    { "glNamedBufferData", 45, -1 },
    { "glNamedBufferSubData", 45, -1 },
    { "glCopyNamedBufferSubData", 45, -1 },
+   { "glClearNamedBufferData", 45, -1 },
+   { "glClearNamedBufferSubData", 45, -1 },
    { "glCreateTextures", 45, -1 },
    { "glTextureStorage1D", 45, -1 },
    { "glTextureStorage2D", 45, -1 },