Merge branch '7.8'
[mesa.git] / src / gallium / drivers / llvmpipe / lp_texture.h
index 23b37c61c7cf80d9c4d6bf87528d09e000094efd..b23f929b1670a7bc95a8dc8f92cb23975f92b81c 100644 (file)
  * 
  **************************************************************************/
 
-#ifndef SP_TEXTURE_H
-#define SP_TEXTURE_H
+#ifndef LP_TEXTURE_H
+#define LP_TEXTURE_H
 
 
 #include "pipe/p_state.h"
 
 
+#define LP_MAX_TEXTURE_2D_LEVELS 13  /* 4K x 4K for now */
+#define LP_MAX_TEXTURE_3D_LEVELS 10  /* 512 x 512 x 512 for now */
+
+
 struct pipe_context;
 struct pipe_screen;
 struct llvmpipe_context;
 
+struct sw_displaytarget;
+
 
 struct llvmpipe_texture
 {
    struct pipe_texture base;
 
-   unsigned long level_offset[PIPE_MAX_TEXTURE_LEVELS];
-   unsigned stride[PIPE_MAX_TEXTURE_LEVELS];
+   unsigned long level_offset[LP_MAX_TEXTURE_2D_LEVELS];
+   unsigned stride[LP_MAX_TEXTURE_2D_LEVELS];
 
-   /* The data is held here:
+   /**
+    * Display target, for textures with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET
+    * usage.
     */
-   struct pipe_buffer *buffer;
+   struct sw_displaytarget *dt;
 
-   boolean modified;
+   /**
+    * Malloc'ed data for regular textures, or a mapping to dt above.
+    */
+   void *data;
+
+   unsigned timestamp;
 };
 
+
 struct llvmpipe_transfer
 {
    struct pipe_transfer base;
@@ -66,6 +80,14 @@ llvmpipe_texture(struct pipe_texture *pt)
    return (struct llvmpipe_texture *) pt;
 }
 
+
+static INLINE const struct llvmpipe_texture *
+llvmpipe_texture_const(const struct pipe_texture *pt)
+{
+   return (const struct llvmpipe_texture *) pt;
+}
+
+
 static INLINE struct llvmpipe_transfer *
 llvmpipe_transfer(struct pipe_transfer *pt)
 {
@@ -73,11 +95,8 @@ llvmpipe_transfer(struct pipe_transfer *pt)
 }
 
 
-extern void
-llvmpipe_init_texture_funcs( struct llvmpipe_context *llvmpipe );
-
 extern void
 llvmpipe_init_screen_texture_funcs(struct pipe_screen *screen);
 
 
-#endif /* SP_TEXTURE */
+#endif /* LP_TEXTURE_H */