Browse Source

gallium: pass the filter mode to util_gen_mipmap().

Remove util_gen_mipmap_filter() when no longer used.
tags/mesa_20090313
Brian 17 years ago
parent
commit
110b63d00f

+ 10
- 15
src/gallium/auxiliary/util/u_gen_mipmap.c View File

ctx->sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE; ctx->sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
ctx->sampler.wrap_r = 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.min_mip_filter = PIPE_TEX_MIPFILTER_NEAREST;
ctx->sampler.mag_img_filter = PIPE_TEX_FILTER_LINEAR;
ctx->sampler.normalized_coords = 1; ctx->sampler.normalized_coords = 1;




* \param baseLevel the first mipmap level to use as a src * \param baseLevel the first mipmap level to use as a src
* \param lastLevel the last mipmap level to generate * \param lastLevel the last mipmap level to generate
* \param filter the minification filter used to generate mipmap levels with * \param filter the minification filter used to generate mipmap levels with
* \param filter one of PIPE_TEX_FILTER_LINEAR, PIPE_TEX_FILTER_NEAREST
*/ */
void 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_context *pipe = ctx->pipe;
struct pipe_screen *screen = pipe->screen; struct pipe_screen *screen = pipe->screen;
*/ */
ctx->sampler.min_lod = ctx->sampler.max_lod = (float) srcLevel; ctx->sampler.min_lod = ctx->sampler.max_lod = (float) srcLevel;
ctx->sampler.lod_bias = (float) srcLevel; ctx->sampler.lod_bias = (float) srcLevel;
ctx->sampler.mag_img_filter = filter;
ctx->sampler.min_img_filter = filter; ctx->sampler.min_img_filter = filter;
cso_single_sampler(ctx->cso, 0, &ctx->sampler); cso_single_sampler(ctx->cso, 0, &ctx->sampler);
cso_single_sampler_done(ctx->cso); cso_single_sampler_done(ctx->cso);




/** /**
* 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 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 );
} }

+ 1
- 1
src/gallium/auxiliary/util/u_gen_mipmap.h View File

extern void extern void
util_gen_mipmap(struct gen_mipmap_state *ctx, util_gen_mipmap(struct gen_mipmap_state *ctx,
struct pipe_texture *pt, struct pipe_texture *pt,
uint face, uint baseLevel, uint lastLevel);
uint face, uint baseLevel, uint lastLevel, uint filter);


extern void extern void
util_gen_mipmap_filter(struct gen_mipmap_state *ctx, util_gen_mipmap_filter(struct gen_mipmap_state *ctx,

+ 2
- 1
src/mesa/state_tracker/st_gen_mipmap.c View File

return FALSE; 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 */ /* shaders don't go through CSO yet */
if (st->fp) if (st->fp)

Loading…
Cancel
Save