st/mesa: add prototype for st_bufferobj_validate_usage()
[mesa.git] / src / mesa / state_tracker / st_cb_bufferobjects.h
index dcbb5a52336a61a04d838812acf4a5714d46ac27..a27daac2bf01983ca653f2335d87d41a899b28d7 100644 (file)
@@ -30,7 +30,7 @@
 
 struct st_context;
 struct gl_buffer_object;
-struct pipe_buffer;
+struct pipe_resource;
 
 /**
  * State_tracker vertex/pixel buffer object, derived from Mesa's
@@ -39,26 +39,25 @@ struct pipe_buffer;
 struct st_buffer_object
 {
    struct gl_buffer_object Base;
-   struct pipe_buffer *buffer;  
-   GLsizeiptrARB size;
+   struct pipe_resource *buffer;     /* GPU storage */
+   struct pipe_transfer *transfer; /* In-progress map information */
 };
 
 
-/* Are the obj->Name tests necessary?  Unfortunately yes, mesa
- * allocates a couple of gl_buffer_object structs statically, and the
- * Name == 0 test is the only way to identify them and avoid casting
- * them erroneously to our structs.
- */
+/** cast wrapper */
 static INLINE struct st_buffer_object *
 st_buffer_object(struct gl_buffer_object *obj)
 {
-   if (obj->Name)
-      return (struct st_buffer_object *) obj;
-   else
-      return NULL;
+   return (struct st_buffer_object *) obj;
 }
 
 
+extern void
+st_bufferobj_validate_usage(struct st_context *st,
+                           struct st_buffer_object *obj,
+                           unsigned usage);
+
+
 extern void
 st_init_bufferobject_functions(struct dd_function_table *functions);