diff options
author | Brian <[email protected]> | 2007-11-19 13:05:00 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-11-20 08:24:46 -0700 |
commit | 827e72de7537e62cac9652f8b7344ff356de9bb1 (patch) | |
tree | 241bf6e892c4180d02062715ae27510f7e58aee1 /src | |
parent | 3821d15e06a62231b4a946d097d1455d7b0c5834 (diff) |
clamp lambda to Min/MaxLod
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/swrast/s_fragprog.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 6656ebc0d0c..474aab3aa26 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 + * Version: 7.0.3 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -41,9 +41,12 @@ fetch_texel( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, { GLchan rgba[4]; SWcontext *swrast = SWRAST_CONTEXT(ctx); + const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; + lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); + /* XXX use a float-valued TextureSample routine here!!! */ - swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current, + swrast->TextureSample[unit](ctx, texObj, 1, (const GLfloat (*)[4]) texcoord, &lambda, &rgba); color[0] = CHAN_TO_FLOAT(rgba[0]); |