aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/dd.h
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-03-03 10:44:35 +0000
committerKeith Whitwell <[email protected]>2009-03-03 10:44:35 +0000
commiteb8a1d96424cb732b0a723cb1fdba90958d24e16 (patch)
tree8bcdfcab1681f7c43c4c20f71e08133bd4816215 /src/mesa/main/dd.h
parentc64a2b708944ec671b1104067245500fcfc6ed94 (diff)
mesa: add MapBufferRange driver callbacks
Will be needed in coming GL extensions (GL_map_buffer_range, GL 3.0). Will be used by the vbo module to avoid reallocating vbo's at each draw primitive call.
Diffstat (limited to 'src/mesa/main/dd.h')
-rw-r--r--src/mesa/main/dd.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index b1e006901bf..b33c26dfed2 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -36,6 +36,22 @@
struct gl_pixelstore_attrib;
struct mesa_display_list;
+#if FEATURE_ARB_vertex_buffer_object
+/* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
+ * NULL) if buffer is unavailable for immediate mapping.
+ *
+ * Does GL_MAP_INVALIDATE_RANGE_BIT do this? It seems so, but it
+ * would require more book-keeping in the driver than seems necessary
+ * at this point.
+ *
+ * Does GL_MAP_INVALDIATE_BUFFER_BIT do this? Not really -- we don't
+ * want to provoke the driver to throw away the old storage, we will
+ * respect the contents of already referenced data.
+ */
+#define MESA_MAP_NOWAIT_BIT 0x0040
+#endif
+
+
/**
* Device driver function table.
* Core Mesa uses these function pointers to call into device drivers.
@@ -780,6 +796,16 @@ struct dd_function_table {
void * (*MapBuffer)( GLcontext *ctx, GLenum target, GLenum access,
struct gl_buffer_object *obj );
+ /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
+ */
+ void * (*MapBufferRange)( GLcontext *ctx, GLenum target,
+ GLintptr offset, GLsizeiptr length, GLbitfield access,
+ struct gl_buffer_object *obj);
+
+ void (*FlushMappedBufferRange) (GLcontext *ctx, GLenum target,
+ GLintptr offset, GLsizeiptr length,
+ struct gl_buffer_object *obj);
+
GLboolean (*UnmapBuffer)( GLcontext *ctx, GLenum target,
struct gl_buffer_object *obj );
/*@}*/