X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsoftpipe%2Fsp_texture.h;h=6b205dc53290cca4b6747aa1d5fbd6ad21cf985f;hb=ccd13da0fc1f1813b55fc0d2181a6cb0d3b42b0d;hp=2ef64e1e7c31bec2a582a30379023cf1f37047a8;hpb=3d36d6b4cf735e93a6ae5eadf28e671252fb5303;p=mesa.git diff --git a/src/gallium/drivers/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h index 2ef64e1e7c3..6b205dc5329 100644 --- a/src/gallium/drivers/softpipe/sp_texture.h +++ b/src/gallium/drivers/softpipe/sp_texture.h @@ -30,7 +30,10 @@ #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; @@ -38,24 +41,39 @@ 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; @@ -63,21 +81,13 @@ 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 * -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 * @@ -86,15 +96,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); +extern void +softpipe_init_texture_funcs(struct pipe_context *pipe); + #endif /* SP_TEXTURE */