st/mesa: call is_format_supported() for compressed formats
[mesa.git] / src / mesa / state_tracker / st_texture.h
index 12ef2d7d01c3f11e44972cc65716edf28ce5f1b5..416468478b11a46d9ea4970a6b5be3172d550c34 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "main/mtypes.h"
 
-struct pipe_context;
+
 struct pipe_resource;
 
 
@@ -76,8 +76,6 @@ struct st_texture_object
     */
    struct pipe_sampler_view *sampler_view;
 
-   struct pipe_context *pipe;
-
    GLboolean teximage_realloc;
 
    /* True if there is/was a surface bound to this texture object.  It helps
@@ -101,7 +99,7 @@ st_texture_object(struct gl_texture_object *obj)
 
 
 static INLINE struct pipe_resource *
-st_get_texobj_texture(struct gl_texture_object *texObj)
+st_get_texobj_resource(struct gl_texture_object *texObj)
 {
    struct st_texture_object *stObj = st_texture_object(texObj);
    return stObj ? stObj->pt : NULL;
@@ -109,15 +107,15 @@ st_get_texobj_texture(struct gl_texture_object *texObj)
 
 
 static INLINE struct pipe_resource *
-st_get_stobj_texture(struct st_texture_object *stObj)
+st_get_stobj_resource(struct st_texture_object *stObj)
 {
    return stObj ? stObj->pt : NULL;
 }
 
 
 static INLINE struct pipe_sampler_view *
-st_sampler_view_from_texture(struct pipe_context *pipe,
-                             struct pipe_resource *texture)
+st_create_texture_sampler_view(struct pipe_context *pipe,
+                               struct pipe_resource *texture)
 {
    struct pipe_sampler_view templ;
 
@@ -130,14 +128,16 @@ st_sampler_view_from_texture(struct pipe_context *pipe,
 
 
 static INLINE struct pipe_sampler_view *
-st_get_texture_sampler_view(struct st_texture_object *stObj)
+st_get_texture_sampler_view(struct st_texture_object *stObj,
+                            struct pipe_context *pipe)
+
 {
    if (!stObj || !stObj->pt) {
       return NULL;
    }
 
    if (!stObj->sampler_view) {
-      stObj->sampler_view = st_sampler_view_from_texture(stObj->pipe, stObj->pt);
+      stObj->sampler_view = st_create_texture_sampler_view(pipe, stObj->pt);
    }
 
    return stObj->sampler_view;