diff options
author | Pauli Nieminen <[email protected]> | 2010-02-07 02:50:48 +0200 |
---|---|---|
committer | Pauli Nieminen <[email protected]> | 2010-02-07 13:13:23 +0200 |
commit | 76a9831b2b20d59c49b5f25ba5275f17b4e2067b (patch) | |
tree | 73cc3a40eb279a296daa79ca9032c2a9b1018e89 /src/mesa/drivers/dri/r200/r200_tex.c | |
parent | bfa877cdd3a92695830034822ccd9e83cace55b2 (diff) |
r200: Fix lod bias correction.
glean/pointSprite shows that rv280 is trying to read from better
quality mipmap level. We have to correct default lod bias to match
required texture selection.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_tex.c')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_tex.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 85283a9d93b..6723b12bf49 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -324,18 +324,19 @@ static void r200TexEnv( GLcontext *ctx, GLenum target, case GL_TEXTURE_LOD_BIAS_EXT: { GLfloat bias, min; GLuint b; - const int fixed_one = 0x8000000; + const int fixed_one = R200_LOD_BIAS_FIXED_ONE; /* The R200's LOD bias is a signed 2's complement value with a * range of -16.0 <= bias < 16.0. * * NOTE: Add a small bias to the bias for conform mipsel.c test. */ - bias = *param + .01; + bias = *param; min = driQueryOptionb (&rmesa->radeon.optionCache, "no_neg_lod_bias") ? 0.0 : -16.0; bias = CLAMP( bias, min, 16.0 ); - b = (int)(bias * fixed_one) & R200_LOD_BIAS_MASK; + b = ((int)(bias * fixed_one) + + R200_LOD_BIAS_CORRECTION) & R200_LOD_BIAS_MASK; if ( (rmesa->hw.tex[unit].cmd[TEX_PP_TXFORMAT_X] & R200_LOD_BIAS_MASK) != b ) { R200_STATECHANGE( rmesa, tex[unit] ); |