gallium: pass the filter mode to util_gen_mipmap().
authorBrian <brian.paul@tungstengraphics.com>
Mon, 24 Mar 2008 14:53:16 +0000 (08:53 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 24 Mar 2008 14:53:16 +0000 (08:53 -0600)
Remove util_gen_mipmap_filter() when no longer used.

src/gallium/auxiliary/util/u_gen_mipmap.c
src/gallium/auxiliary/util/u_gen_mipmap.h
src/mesa/state_tracker/st_gen_mipmap.c

index 13e4531d4a6855c6d2e2f4d451290c1b53c2cb70..26df5f29f8b3f5508793e2a7668617d56b4ecf6f 100644 (file)
@@ -719,7 +719,6 @@ util_create_gen_mipmap(struct pipe_context *pipe,
    ctx->sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
    ctx->sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
    ctx->sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NEAREST;
-   ctx->sampler.mag_img_filter = PIPE_TEX_FILTER_LINEAR;
    ctx->sampler.normalized_coords = 1;
 
 
@@ -849,11 +848,12 @@ simple_viewport(struct pipe_context *pipe, uint width, uint height)
  * \param baseLevel  the first mipmap level to use as a src
  * \param lastLevel  the last mipmap level to generate
  * \param filter  the minification filter used to generate mipmap levels with
+ * \param filter  one of PIPE_TEX_FILTER_LINEAR, PIPE_TEX_FILTER_NEAREST
  */
 void
-util_gen_mipmap_filter(struct gen_mipmap_state *ctx,
-                       struct pipe_texture *pt,
-                       uint face, uint baseLevel, uint lastLevel, uint filter)
+util_gen_mipmap(struct gen_mipmap_state *ctx,
+                struct pipe_texture *pt,
+                uint face, uint baseLevel, uint lastLevel, uint filter)
 {
    struct pipe_context *pipe = ctx->pipe;
    struct pipe_screen *screen = pipe->screen;
@@ -914,6 +914,7 @@ util_gen_mipmap_filter(struct gen_mipmap_state *ctx,
        */
       ctx->sampler.min_lod = ctx->sampler.max_lod = (float) srcLevel;
       ctx->sampler.lod_bias = (float) srcLevel;
+      ctx->sampler.mag_img_filter = filter;
       ctx->sampler.min_img_filter = filter;
       cso_single_sampler(ctx->cso, 0, &ctx->sampler);
       cso_single_sampler_done(ctx->cso);
@@ -949,18 +950,12 @@ util_gen_mipmap_filter(struct gen_mipmap_state *ctx,
 
 
 /**
- * Generate mipmap images with a linear minification filter.
- * See util_gen_mipmap_filter for more info.
- *
- * \param pt  the texture to generate mipmap levels for
- * \param face  which cube face to generate mipmaps for (0 for non-cube maps)
- * \param baseLevel  the first mipmap level to use as a src
- * \param lastLevel  the last mipmap level to generate
+ * XXX remove this
  */
 void
-util_gen_mipmap(struct gen_mipmap_state *ctx,
-                struct pipe_texture *pt,
-                uint face, uint baseLevel, uint lastLevel)
+util_gen_mipmap_filter(struct gen_mipmap_state *ctx,
+                       struct pipe_texture *pt,
+                       uint face, uint baseLevel, uint lastLevel, uint filter)
 {
-   util_gen_mipmap_filter( ctx, pt, face, baseLevel, lastLevel, PIPE_TEX_FILTER_LINEAR );
+   util_gen_mipmap_filter( ctx, pt, face, baseLevel, lastLevel, filter );
 }
index 64abdeae98ffca4e2d3284cf4cb5a1c52932d65b..a5df8481bf8dcf8165e8648b8144d5970fbc84bf 100644 (file)
@@ -50,7 +50,7 @@ util_destroy_gen_mipmap(struct gen_mipmap_state *ctx);
 extern void
 util_gen_mipmap(struct gen_mipmap_state *ctx,
                 struct pipe_texture *pt,
-                uint face, uint baseLevel, uint lastLevel);
+                uint face, uint baseLevel, uint lastLevel, uint filter);
 
 extern void
 util_gen_mipmap_filter(struct gen_mipmap_state *ctx,
index 61e1d9621c15110c424c03945610a6fab7539db0..a931911227601c8d3f28d95a93563dc7f4dbc3e3 100644 (file)
@@ -92,7 +92,8 @@ st_render_mipmap(struct st_context *st,
       return FALSE;
    }
 
-   util_gen_mipmap(st->gen_mipmap, pt, face, baseLevel, lastLevel);
+   util_gen_mipmap(st->gen_mipmap, pt, face, baseLevel, lastLevel,
+                   PIPE_TEX_FILTER_LINEAR);
 
    /* shaders don't go through CSO yet */
    if (st->fp)