summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_texture.h')
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.h40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/gallium/drivers/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h
index 2537ab6a40d..7e3249b46f0 100644
--- a/src/gallium/drivers/softpipe/sp_texture.h
+++ b/src/gallium/drivers/softpipe/sp_texture.h
@@ -32,29 +32,48 @@
#include "pipe/p_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;
struct pipe_screen;
struct softpipe_context;
-struct softpipe_texture
+/**
+ * Subclass of pipe_resource.
+ */
+struct softpipe_resource
{
- struct pipe_texture base;
+ struct pipe_resource 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];
+
+ /**
+ * Display target, only valid for PIPE_TEXTURE_2D with the
+ * PIPE_BIND_DISPLAY_TARGET usage.
+ */
+ struct sw_displaytarget *dt;
- /* The data is held here:
+ /**
+ * Malloc'ed data for regular buffers and textures, or a mapping to dt above.
*/
- struct pipe_buffer *buffer;
+ void *data;
/* True if texture images are power-of-two in all dimensions:
*/
boolean pot;
+ boolean userBuffer;
unsigned timestamp;
};
+
+/**
+ * Subclass of pipe_transfer.
+ */
struct softpipe_transfer
{
struct pipe_transfer base;
@@ -64,10 +83,10 @@ struct softpipe_transfer
/** cast wrappers */
-static INLINE struct softpipe_texture *
-softpipe_texture(struct pipe_texture *pt)
+static INLINE struct softpipe_resource *
+softpipe_resource(struct pipe_resource *pt)
{
- return (struct softpipe_texture *) pt;
+ return (struct softpipe_resource *) pt;
}
static INLINE struct softpipe_transfer *
@@ -80,5 +99,8 @@ softpipe_transfer(struct pipe_transfer *pt)
extern void
softpipe_init_screen_texture_funcs(struct pipe_screen *screen);
+extern void
+softpipe_init_texture_funcs(struct pipe_context *pipe);
+
#endif /* SP_TEXTURE */