mesa: add ARB_clear_buffer_object named functions
[mesa.git] / src / mesa / main / bufferobj.c
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)
 {