summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-08-28 23:31:00 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-08-28 23:31:00 +0000
commitf5515cb4af6a4d745e4764d4ca1ed2eb30932319 (patch)
tree4a580c463d52da96099a4af1b242d9f5cfeb8761 /src/mesa/swrast
parent760960028f189e3afcbfef1f877dbd5b86fd1ae4 (diff)
Move clamping of texture LOD bias to texture application time.
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_texture.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index b9e08148ec..36f2975312 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -4200,9 +4200,12 @@ _swrast_texture_span( GLcontext *ctx, struct sw_span *span )
if (span->arrayMask & SPAN_LAMBDA) {
if (texUnit->LodBias + curObj->LodBias != 0.0F) {
/* apply LOD bias, but don't clamp yet */
+ const GLfloat bias = CLAMP(texUnit->LodBias + curObj->LodBias,
+ -ctx->Const.MaxTextureLodBias,
+ ctx->Const.MaxTextureLodBias);
GLuint i;
for (i = 0; i < span->end; i++) {
- lambda[i] += (texUnit->LodBias + curObj->LodBias);
+ lambda[i] += bias;
}
}