softpipe: rework to use the llvmpipe winsys
[mesa.git] / src / gallium / drivers / softpipe / sp_texture.h
index bf437a7c61842ebed4d80c27ca3282d1fb045bbf..e8d17ce7daf5362df57d86d598fd8d546c7ad6de 100644 (file)
@@ -30,6 +30,7 @@
 
 
 #include "pipe/p_state.h"
+#include "pipe/p_video_state.h"
 
 
 struct pipe_context;
@@ -42,26 +43,62 @@ struct softpipe_texture
    struct pipe_texture base;
 
    unsigned long level_offset[PIPE_MAX_TEXTURE_LEVELS];
-   unsigned long stride[PIPE_MAX_TEXTURE_LEVELS];
+   unsigned stride[PIPE_MAX_TEXTURE_LEVELS];
 
-   /* The data is held here:
+   /**
+    * Display target, for textures with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET
+    * usage.
+    */
+   struct sw_displaytarget *dt;
+
+   /**
+    * Malloc'ed data for regular textures, or a mapping to dt above.
     */
-   struct pipe_buffer *buffer;
+   void *data;
 
-   boolean modified;
+   /* True if texture images are power-of-two in all dimensions:
+    */
+   boolean pot;
+
+   unsigned timestamp;
 };
 
+struct softpipe_transfer
+{
+   struct pipe_transfer base;
 
-/** cast wrapper */
+   unsigned long offset;
+};
+
+struct softpipe_video_surface
+{
+   struct pipe_video_surface base;
+
+   /* The data is held here:
+    */
+   struct pipe_texture *tex;
+};
+
+
+/** cast wrappers */
 static INLINE struct softpipe_texture *
 softpipe_texture(struct pipe_texture *pt)
 {
    return (struct softpipe_texture *) pt;
 }
 
+static INLINE struct softpipe_transfer *
+softpipe_transfer(struct pipe_transfer *pt)
+{
+   return (struct softpipe_transfer *) pt;
+}
+
+static INLINE struct softpipe_video_surface *
+softpipe_video_surface(struct pipe_video_surface *pvs)
+{
+   return (struct softpipe_video_surface *) pvs;
+}
 
-extern void
-softpipe_init_texture_funcs( struct softpipe_context *softpipe );
 
 extern void
 softpipe_init_screen_texture_funcs(struct pipe_screen *screen);