gallium: remove pipe_surface::usage
[mesa.git] / src / gallium / drivers / svga / svga_resource_buffer.h
index a689fcb3bb7925518efc948c56284bec9669d545..ee12acf69719bc24730109faee012fee9be86f9c 100644 (file)
@@ -42,7 +42,6 @@
 #define SVGA_BUFFER_MAX_RANGES 32
 
 
-struct svga_screen;
 struct svga_context;
 struct svga_winsys_buffer;
 struct svga_winsys_surface;
@@ -90,7 +89,9 @@ struct svga_buffer
     * Host surface handle.
     * 
     * This is a platform independent abstraction for host SID. We create when 
-    * trying to bind
+    * trying to bind.
+    *
+    * Only set for non-user buffers.
     */
    struct svga_winsys_surface *handle;
 
@@ -127,6 +128,12 @@ struct svga_buffer
        * is the relative offset within that buffer.
        */
       unsigned offset;
+
+      /**
+       * Range of user buffer that is uploaded in @buffer at @offset.
+       */
+      unsigned start;
+      unsigned end;
    } uploaded;
 
    /**
@@ -135,6 +142,8 @@ struct svga_buffer
     * A piece of GMR memory, with the same size of the buffer. It is created
     * when mapping the buffer, and will be used to upload vertex data to the
     * host.
+    *
+    * Only set for non-user buffers.
     */
    struct svga_winsys_buffer *hwbuf;
 
@@ -189,7 +198,11 @@ svga_buffer(struct pipe_resource *buffer)
 static INLINE boolean 
 svga_buffer_is_user_buffer( struct pipe_resource *buffer )
 {
-   return svga_buffer(buffer)->user;
+   if (buffer) {
+      return svga_buffer(buffer)->user;
+   } else {
+      return FALSE;
+   }
 }
 
 
@@ -229,10 +242,4 @@ svga_winsys_buffer_create(struct svga_context *svga,
                           unsigned usage,
                           unsigned size);
 
-void
-svga_redefine_user_buffer(struct pipe_context *ctx,
-                          struct pipe_resource *resource,
-                          unsigned offset,
-                          unsigned size);
-
 #endif /* SVGA_BUFFER_H */