Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / mesa / state_tracker / st_texture.h
index 78f5f451ed62b1978a4687e1032a8a5153304e07..31f66ad52cf5abe4d6f726e4b22b44c3a57a5ffe 100644 (file)
@@ -68,14 +68,16 @@ struct st_texture_object
     */
    struct pipe_texture *pt;
 
-   GLboolean imageOverride;
-   GLint depthOverride;
-   GLuint pitchOverride;
-
-   GLboolean dirtyData;
+   GLboolean teximage_realloc;
 };
 
 
+static INLINE struct st_texture_image *
+st_texture_image(struct gl_texture_image *img)
+{
+   return (struct st_texture_image *) img;
+}
+
 static INLINE struct st_texture_object *
 st_texture_object(struct gl_texture_object *obj)
 {
@@ -97,6 +99,11 @@ st_get_stobj_texture(struct st_texture_object *stObj)
    return stObj ? stObj->pt : NULL;
 }
 
+static INLINE GLboolean pf_is_depth_stencil( enum pipe_format format )
+{
+   return (pf_get_component_bits( format, PIPE_FORMAT_COMP_Z ) +
+           pf_get_component_bits( format, PIPE_FORMAT_COMP_S )) != 0;
+}
 
 
 extern struct pipe_texture *
@@ -107,7 +114,8 @@ st_texture_create(struct st_context *st,
                   GLuint width0,
                   GLuint height0,
                   GLuint depth0,
-                  GLuint compress_byte);
+                  GLuint compress_byte,
+                  GLuint tex_usage );
 
 
 /* Check if an image fits into an existing texture object.
@@ -123,10 +131,12 @@ st_texture_match_image(const struct pipe_texture *pt,
 extern GLubyte *
 st_texture_image_map(struct st_context *st,
                      struct st_texture_image *stImage,
-                    GLuint zoffset);
+                    GLuint zoffset,
+                     GLuint flags);
 
 extern void
-st_texture_image_unmap(struct st_texture_image *stImage);
+st_texture_image_unmap(struct st_context *st,
+                       struct st_texture_image *stImage);
 
 
 /* Return pointers to each 2d slice within an image.  Indexed by depth