mesa: always return GL_OUT_OF_MEMORY or GL_NO_ERROR when KHR_no_error enabled
[mesa.git] / src / mesa / main / bufferobj.h
index 0b77bff87564e5a1cbc4b19ef3c7088cd82a90fd..259de9465a11e984400fca8f16354d19e60a2e3e 100644 (file)
@@ -45,8 +45,14 @@ _mesa_bufferobj_mapped(const struct gl_buffer_object *obj,
    return obj->Mappings[index].Pointer != NULL;
 }
 
-/** Can we not use this buffer while mapped? */
-static inline GLboolean
+/**
+ * Check whether the given buffer object is illegally mapped prior to
+ * drawing from (or reading back to) the buffer.
+ * Note that it's legal for a buffer to be mapped at draw/readback time
+ * if it was mapped persistently (See GL_ARB_buffer_storage spec).
+ * \return true if the buffer is illegally mapped, false otherwise
+ */
+static inline bool
 _mesa_check_disallowed_mapping(const struct gl_buffer_object *obj)
 {
    return _mesa_bufferobj_mapped(obj, MAP_USER) &&
@@ -74,7 +80,6 @@ _mesa_free_buffer_objects(struct gl_context *ctx);
 
 extern bool
 _mesa_handle_bind_buffer_gen(struct gl_context *ctx,
-                             GLenum target,
                              GLuint buffer,
                              struct gl_buffer_object **buf_handle,
                              const char *caller);
@@ -93,12 +98,6 @@ extern struct gl_buffer_object *
 _mesa_lookup_bufferobj_err(struct gl_context *ctx, GLuint buffer,
                            const char *caller);
 
-extern void
-_mesa_begin_bufferobj_lookups(struct gl_context *ctx);
-
-extern void
-_mesa_end_bufferobj_lookups(struct gl_context *ctx);
-
 extern struct gl_buffer_object *
 _mesa_multi_bind_lookup_bufferobj(struct gl_context *ctx,
                                   const GLuint *buffers,
@@ -109,6 +108,10 @@ _mesa_initialize_buffer_object(struct gl_context *ctx,
                                struct gl_buffer_object *obj,
                                GLuint name);
 
+extern void
+_mesa_delete_buffer_object(struct gl_context *ctx,
+                           struct gl_buffer_object *bufObj);
+
 extern void
 _mesa_reference_buffer_object_(struct gl_context *ctx,
                                struct gl_buffer_object **ptr,
@@ -230,8 +233,12 @@ _mesa_NamedBufferSubData(GLuint buffer, GLintptr offset,
                          GLsizeiptr size, const GLvoid *data);
 
 void GLAPIENTRY
-_mesa_GetBufferSubData(GLenum target, GLintptrARB offset,
-                       GLsizeiptrARB size, void * data);
+_mesa_GetBufferSubData(GLenum target, GLintptr offset,
+                       GLsizeiptr size, GLvoid *data);
+
+void GLAPIENTRY
+_mesa_GetNamedBufferSubData(GLuint buffer, GLintptr offset,
+                            GLsizeiptr size, GLvoid *data);
 
 void GLAPIENTRY
 _mesa_ClearBufferData(GLenum target, GLenum internalformat,
@@ -267,9 +274,20 @@ _mesa_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params);
 void GLAPIENTRY
 _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params);
 
+void GLAPIENTRY
+_mesa_GetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint *params);
+
+void GLAPIENTRY
+_mesa_GetNamedBufferParameteri64v(GLuint buffer, GLenum pname,
+                                  GLint64 *params);
+
 void GLAPIENTRY
 _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params);
 
+void GLAPIENTRY
+_mesa_GetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid **params);
+
+
 void GLAPIENTRY
 _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
                         GLintptr readOffset, GLintptr writeOffset,
@@ -303,16 +321,6 @@ void GLAPIENTRY
 _mesa_FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset,
                                   GLsizeiptr length);
 
-GLenum GLAPIENTRY
-_mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
-
-GLenum GLAPIENTRY
-_mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
-
-void GLAPIENTRY
-_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name,
-                                GLenum pname, GLint* params);
-
 void GLAPIENTRY
 _mesa_BindBufferRange(GLenum target, GLuint index,
                       GLuint buffer, GLintptr offset, GLsizeiptr size);
@@ -334,5 +342,12 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
 void GLAPIENTRY
 _mesa_InvalidateBufferData(GLuint buffer);
 
+void GLAPIENTRY
+_mesa_BufferPageCommitmentARB(GLenum target, GLintptr offset, GLsizeiptr size,
+                              GLboolean commit);
+
+void GLAPIENTRY
+_mesa_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset,
+                                   GLsizeiptr size, GLboolean commit);
 
 #endif