summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_tex.c
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2008-06-29 10:30:47 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2008-06-29 10:32:19 -0700
commita74d22ba715da5e52efb15aebd15a74851f87d43 (patch)
treee4df3b713a86f6793a55e2e7d723bf2a0a207033 /src/mesa/drivers/dri/r300/r300_tex.c
parent543893eefdc82ecd21e346320e89a471c5c12158 (diff)
r300: Change LOD bias emission to more closely follow per-tex rules.
Okay, this time it's for real, and for good. This should be a perma-fix.
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 505951329f..4ed71777d3 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;
}