softpipe: fix clears to only clear specified color buffers.
[mesa.git] / src / gallium / drivers / softpipe / sp_tex_sample.h
index 2e3976d803486fbf0dcddbd682dacd3003db65af..f7774f5e88363f50d2edcc52cc3788d792d359b2 100644 (file)
@@ -64,18 +64,19 @@ struct img_filter_args {
    int gather_comp;
 };
 
-typedef void (*img_filter_func)(struct sp_sampler_view *sp_sview,
-                                struct sp_sampler *sp_samp,
+typedef void (*img_filter_func)(const struct sp_sampler_view *sp_sview,
+                                const struct sp_sampler *sp_samp,
                                 const struct img_filter_args *args,
                                 float *rgba);
 
 struct filter_args {
    enum tgsi_sampler_control control;
    const int8_t *offset;
+   const uint *faces;
 };
 
-typedef void (*mip_filter_func)(struct sp_sampler_view *sp_sview,
-                                struct sp_sampler *sp_samp,
+typedef void (*mip_filter_func)(const struct sp_sampler_view *sp_sview,
+                                const struct sp_sampler *sp_samp,
                                 img_filter_func min_filter,
                                 img_filter_func mag_filter,
                                 const float s[TGSI_QUAD_SIZE],
@@ -86,6 +87,12 @@ typedef void (*mip_filter_func)(struct sp_sampler_view *sp_sview,
                                 const struct filter_args *args,
                                 float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE]);
 
+
+typedef void (*mip_level_func)(const struct sp_sampler_view *sp_sview,
+                               const struct sp_sampler *sp_samp,
+                               const float lod[TGSI_QUAD_SIZE],
+                               float level[TGSI_QUAD_SIZE]);
+
 typedef void (*fetch_func)(struct sp_sampler_view *sp_sview,
                            const int i[TGSI_QUAD_SIZE],
                            const int j[TGSI_QUAD_SIZE], const int k[TGSI_QUAD_SIZE],
@@ -106,9 +113,6 @@ struct sp_sampler_view
    boolean pot2d;
    boolean need_cube_convert;
 
-   /* this is just abusing the sampler_view object as local storage */
-   unsigned faces[TGSI_QUAD_SIZE];
-
    /* these are different per shader type */
    struct softpipe_tex_tile_cache *cache;
    compute_lambda_func compute_lambda;
@@ -116,6 +120,7 @@ struct sp_sampler_view
 };
 
 struct sp_filter_funcs {
+   mip_level_func relative_level;
    mip_filter_func filter;
 };
 
@@ -150,7 +155,8 @@ struct sp_tgsi_sampler
 };
 
 compute_lambda_func
-softpipe_get_lambda_func(const struct pipe_sampler_view *view, unsigned shader);
+softpipe_get_lambda_func(const struct pipe_sampler_view *view,
+                         enum pipe_shader_type shader);
 
 
 void *