X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_texture.h;h=d50c3c9af79a01b743d0f109b1afa58b548bd5d8;hb=c1477f6ffe6a3d032dbcc76a5f506a7293e2fece;hp=416468478b11a46d9ea4970a6b5be3172d550c34;hpb=ff20543c815a14fddad1efaaef1610454a1924d4;p=mesa.git diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h index 416468478b1..d50c3c9af79 100644 --- a/src/mesa/state_tracker/st_texture.h +++ b/src/mesa/state_tracker/st_texture.h @@ -38,6 +38,9 @@ struct pipe_resource; +/** + * Subclass of gl_texure_image. + */ struct st_texture_image { struct gl_texture_image base; @@ -57,7 +60,9 @@ struct st_texture_image }; - +/** + * Subclass of gl_texure_object. + */ struct st_texture_object { struct gl_texture_object base; /* The "parent" object */ @@ -66,6 +71,12 @@ struct st_texture_object */ GLuint lastLevel; + /** The size of the level=0 mipmap image. + * Note that the number of 1D array layers will be in height0 and the + * number of 2D array layers will be in depth0, as in GL. + */ + GLuint width0, height0, depth0; + /* On validation any active images held in main memory or in other * textures will be copied to this texture and the old storage freed. */ @@ -76,8 +87,6 @@ struct st_texture_object */ struct pipe_sampler_view *sampler_view; - GLboolean teximage_realloc; - /* True if there is/was a surface bound to this texture object. It helps * track whether the texture object is surface based or not. */ @@ -119,9 +128,20 @@ st_create_texture_sampler_view(struct pipe_context *pipe, { struct pipe_sampler_view templ; - u_sampler_view_default_template(&templ, - texture, - texture->format); + u_sampler_view_default_template(&templ, texture, texture->format); + + return pipe->create_sampler_view(pipe, texture, &templ); +} + + +static INLINE struct pipe_sampler_view * +st_create_texture_sampler_view_format(struct pipe_context *pipe, + struct pipe_resource *texture, + enum pipe_format format) +{ + struct pipe_sampler_view templ; + + u_sampler_view_default_template(&templ, texture, format); return pipe->create_sampler_view(pipe, texture, &templ); } @@ -130,7 +150,6 @@ st_create_texture_sampler_view(struct pipe_context *pipe, static INLINE struct pipe_sampler_view * st_get_texture_sampler_view(struct st_texture_object *stObj, struct pipe_context *pipe) - { if (!stObj || !stObj->pt) { return NULL; @@ -152,9 +171,20 @@ st_texture_create(struct st_context *st, GLuint width0, GLuint height0, GLuint depth0, + GLuint layers, GLuint tex_usage ); +extern void +st_gl_texture_dims_to_pipe_dims(GLenum texture, + GLuint widthIn, + GLuint heightIn, + GLuint depthIn, + GLuint *widthOut, + GLuint *heightOut, + GLuint *depthOut, + GLuint *layersOut); + /* Check if an image fits into an existing texture object. */ extern GLboolean @@ -185,18 +215,6 @@ extern const GLuint * st_texture_depth_offsets(struct pipe_resource *pt, GLuint level); -/* Return the linear offset of an image relative to the start of its region. - */ -extern GLuint -st_texture_image_offset(const struct pipe_resource *pt, - GLuint face, GLuint level); - -extern GLuint -st_texture_texel_offset(const struct pipe_resource * pt, - GLuint face, GLuint level, - GLuint col, GLuint row, GLuint img); - - /* Upload an image into a texture */ extern void @@ -211,13 +229,7 @@ st_texture_image_data(struct st_context *st, extern void st_texture_image_copy(struct pipe_context *pipe, struct pipe_resource *dst, GLuint dstLevel, - struct pipe_resource *src, + struct pipe_resource *src, GLuint srcLevel, GLuint face); -extern void -st_teximage_flush_before_map(struct st_context *st, - struct pipe_resource *pt, - unsigned int face, - unsigned int level, - enum pipe_transfer_usage usage); #endif