From a2ab6930df2c26e19a723b43a757718ecbc89bcd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 17 Mar 2008 09:42:08 -0600 Subject: gallium: in gen_mipmap, also set sampler lod_bias and do a flush() after rendering each level --- src/mesa/state_tracker/st_gen_mipmap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 9c4e1032ef..6ae235df6f 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -282,8 +282,13 @@ st_render_mipmap(struct st_context *st, /* * Setup sampler state + * Note: we should only have to set the min/max LOD clamps to ensure + * we grab texels from the right mipmap level. But some hardware + * has trouble with min clamping so we also setting the lod_bias to + * try to work around that. */ sampler.min_lod = sampler.max_lod = srcLevel; + sampler.lod_bias = srcLevel; sampler_cso = pipe->create_sampler_state(pipe, &sampler); pipe->bind_sampler_states(pipe, 1, &sampler_cso); @@ -298,6 +303,7 @@ st_render_mipmap(struct st_context *st, draw_quad(st->ctx); + pipe->flush(pipe, PIPE_FLUSH_WAIT); pipe->delete_sampler_state(pipe, sampler_cso); } -- cgit v1.2.3