Allow custom pipe driver buffer usage flags.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 6 Nov 2007 14:43:20 +0000 (14:43 +0000)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 6 Nov 2007 14:52:39 +0000 (14:52 +0000)
src/mesa/pipe/i915simple/i915_prim_vbuf.c
src/mesa/pipe/i915simple/i915_winsys.h
src/mesa/pipe/p_defines.h

index 75ca6d6e5ef51bb7105ed9e7128d348b15bbe033..086ad04d1e697432d4793dc98464b4d99aaa7a9c 100644 (file)
@@ -378,7 +378,7 @@ static void vbuf_flush_elements( struct draw_stage *stage )
       vbuf->buf = winsys->buffer_create(winsys, 64);
    winsys->buffer_data( winsys, vbuf->buf, 
                         VBUF_SIZE, NULL, 
-                        PIPE_BUFFER_USAGE_VERTEX );
+                        I915_BUFFER_USAGE_LIT_VERTEX );
    vbuf->vertex_map = winsys->buffer_map(winsys, 
                                          vbuf->buf, 
                                          PIPE_BUFFER_FLAG_WRITE );
index 947c5a334d41d8c88ab74f8166f8019caf2fafd7..cbb851a9323a86b0cbe3527f176cd0f54069033e 100644 (file)
@@ -37,6 +37,9 @@
 #define I915_WINSYS_H
 
 
+#include "pipe/p_defines.h"
+
+
 /* Pipe drivers are (meant to be!) independent of both GL and the
  * window system.  The window system provides a buffer manager and a
  * set of additional hooks for things like command buffer submission,
@@ -100,6 +103,8 @@ struct i915_winsys {
 #define I915_BUFFER_ACCESS_WRITE   0x1 
 #define I915_BUFFER_ACCESS_READ    0x2
 
+#define I915_BUFFER_USAGE_LIT_VERTEX  (PIPE_BUFFER_USAGE_CUSTOM << 0)
+
 
 struct pipe_context *i915_create( struct pipe_winsys *,
                                  struct i915_winsys *,
index 119ea1bd775a0214686d35c769cf823be05189bb..cc0232cdcd8f879c9db8679b0443bd665b8e60f9 100644 (file)
 /**
  * Buffer usage flags
  */
-#define PIPE_BUFFER_USAGE_PIXEL    0x1
-#define PIPE_BUFFER_USAGE_VERTEX   0x2
-#define PIPE_BUFFER_USAGE_INDEX    0x4
-#define PIPE_BUFFER_USAGE_CONSTANT 0x8
-
+#define PIPE_BUFFER_USAGE_PIXEL    (1 << 0)
+#define PIPE_BUFFER_USAGE_VERTEX   (1 << 1)
+#define PIPE_BUFFER_USAGE_INDEX    (1 << 2)
+#define PIPE_BUFFER_USAGE_CONSTANT (1 << 3)
+/** Pipe driver custam usage flags should be greater or equal to this value */
+#define PIPE_BUFFER_USAGE_CUSTOM   (1 << 16)
 
 /** 
  * Flush types: