summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/r300_tex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_tex.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_tex.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c
index 505951329fe..4ed71777d39 100644
--- a/src/mesa/drivers/dri/r300/r300_tex.c
+++ b/src/mesa/drivers/dri/r300/r300_tex.c
@@ -955,7 +955,6 @@ static void r300TexEnv(GLcontext * ctx, GLenum target,
*/
switch (pname) {
case GL_TEXTURE_LOD_BIAS_EXT: {
- /* Needs to be relocated in order to make sure we got the right tmu */
GLfloat bias, min;
/* The R300's LOD bias is a signed 2's complement value with a
@@ -968,7 +967,14 @@ static void r300TexEnv(GLcontext * ctx, GLenum target,
"no_neg_lod_bias") ? 0.0 : -16.0;
bias = CLAMP(bias, min, 16.0);
- rmesa->LODBias = bias;
+ /* There's probably a magic Mesa method for finding the REAL
+ * texture unit. I don't know it, though. */
+ if (!(ctx->Texture._EnabledUnits & (1 << ctx->Texture.CurrentUnit))) {
+ break;
+ }
+
+ /* Save our newly clamped LOD bias. */
+ ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias = bias;
break;
}