Merge branch '7.8'
[mesa.git] / src / gallium / drivers / softpipe / sp_texture.h
index 2537ab6a40d62ac1368528c8b559c5a681367ba5..1c8636d1d56b9695038117a455b9c01611cc937f 100644 (file)
 
 
 #include "pipe/p_state.h"
+#include "pipe/p_video_state.h"
+
+
+#define SP_MAX_TEXTURE_2D_LEVELS 13  /* 4K x 4K */
+#define SP_MAX_TEXTURE_3D_LEVELS 9   /* 512 x 512 x 512 */
 
 
 struct pipe_context;
@@ -41,12 +46,19 @@ struct softpipe_texture
 {
    struct pipe_texture base;
 
-   unsigned long level_offset[PIPE_MAX_TEXTURE_LEVELS];
-   unsigned stride[PIPE_MAX_TEXTURE_LEVELS];
+   unsigned long level_offset[SP_MAX_TEXTURE_2D_LEVELS];
+   unsigned stride[SP_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;
+
+   /**
+    * Malloc'ed data for regular textures, or a mapping to dt above.
+    */
+   void *data;
 
    /* True if texture images are power-of-two in all dimensions:
     */
@@ -62,6 +74,15 @@ struct softpipe_transfer
    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 *
@@ -76,6 +97,12 @@ 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_screen_texture_funcs(struct pipe_screen *screen);