Merge remote branch 'origin/master' into gallium_draw_llvm
[mesa.git] / src / gallium / drivers / cell / ppu / cell_texture.h
index 0264fed88e68232785dd7665f0f9395fb27cb14a..ac0b9167750bcb620cb5d204e44c49477ca8406d 100644 (file)
@@ -28,8 +28,9 @@
 #ifndef CELL_TEXTURE_H
 #define CELL_TEXTURE_H
 
+#include "cell/common.h"
 
-struct pipe_context;
+struct cell_context;
 struct pipe_texture;
 
 
@@ -40,14 +41,38 @@ struct cell_texture
 {
    struct pipe_texture base;
 
-   unsigned long level_offset[PIPE_MAX_TEXTURE_LEVELS];
+   unsigned long level_offset[CELL_MAX_TEXTURE_LEVELS];
+   unsigned long stride[CELL_MAX_TEXTURE_LEVELS];
 
-   /* The data is held here:
+   /**
+    * Display target, for textures with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET
+    * usage.
+    */
+   struct sw_displaytarget *dt;
+   unsigned dt_stride;
+
+   /**
+    * Malloc'ed data for regular textures, or a mapping to dt above.
+    */
+   void *data;
+
+   /* Size of the linear buffer??
     */
-   struct pipe_buffer *buffer;
    unsigned long buffer_size;
 
-   void *tiled_data;  /* XXX this may be temporary */ /*ALIGN16*/
+   /** The buffer above, mapped.  This is the memory from which the
+    * SPUs will fetch texels.  This texture data is in the tiled layout.
+    */
+   ubyte *mapped;
+};
+
+
+struct cell_transfer
+{
+   struct pipe_transfer base;
+
+   unsigned long offset;
+   void *map;
 };
 
 
@@ -59,22 +84,18 @@ cell_texture(struct pipe_texture *pt)
 }
 
 
+/** cast wrapper */
+static INLINE struct cell_transfer *
+cell_transfer(struct pipe_transfer *pt)
+{
+   return (struct cell_transfer *) pt;
+}
 
-extern struct pipe_texture *
-cell_texture_create(struct pipe_context *pipe,
-                    const struct pipe_texture *templat);
 
 extern void
-cell_texture_release(struct pipe_context *pipe, struct pipe_texture **pt);
-
-extern struct pipe_surface *
-cell_get_tex_surface(struct pipe_context *pipe,
-                     struct pipe_texture *pt,
-                     unsigned face, unsigned level, unsigned zslice);
-
+cell_init_screen_texture_funcs(struct pipe_screen *screen);
 
 extern void
-cell_update_texture_mapping(struct cell_context *cell);
-
+cell_init_texture_transfer_funcs(struct cell_context *cell);
 
-#endif /* CELL_TEXTURE */
+#endif /* CELL_TEXTURE_H */