X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsoftpipe%2Fsp_texture.h;h=c0e6ba8a869ff34c95474934dadc602e4b1dc63e;hb=275c4bd3643d773210780cb8d578ca84f2604684;hp=bf437a7c61842ebed4d80c27ca3282d1fb045bbf;hpb=374cf77b2f0f13f9380fb0c9d804222a83bdc2e0;p=mesa.git diff --git a/src/gallium/drivers/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h index bf437a7c618..c0e6ba8a869 100644 --- a/src/gallium/drivers/softpipe/sp_texture.h +++ b/src/gallium/drivers/softpipe/sp_texture.h @@ -30,6 +30,11 @@ #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,30 +46,69 @@ struct softpipe_texture { struct pipe_texture base; - unsigned long level_offset[PIPE_MAX_TEXTURE_LEVELS]; - unsigned long 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 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: */ - struct pipe_buffer *buffer; + boolean pot; + + unsigned timestamp; +}; + +struct softpipe_transfer +{ + struct pipe_transfer base; + + unsigned long offset; +}; + +struct softpipe_video_surface +{ + struct pipe_video_surface base; - boolean modified; + /* The data is held here: + */ + struct pipe_texture *tex; }; -/** cast wrapper */ +/** 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); +void +softpipe_init_texture_funcs(struct pipe_context *pipe); + #endif /* SP_TEXTURE */