aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_fragprog.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-03 08:16:19 +0200
committermarha <marha@users.sourceforge.net>2012-08-03 09:35:02 +0200
commit18e75aa6ae27a6e44d93babd96afbbe0cd6077c8 (patch)
treea6124cc965bba51de50907418ce63ab4540f582d /mesalib/src/mesa/swrast/s_fragprog.c
parent49838240b7d4cff1ffed1bd91e495f6919061f90 (diff)
downloadvcxsrv-18e75aa6ae27a6e44d93babd96afbbe0cd6077c8.tar.gz
vcxsrv-18e75aa6ae27a6e44d93babd96afbbe0cd6077c8.tar.bz2
vcxsrv-18e75aa6ae27a6e44d93babd96afbbe0cd6077c8.zip
pixman mesa git update 3 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/swrast/s_fragprog.c')
-rw-r--r--mesalib/src/mesa/swrast/s_fragprog.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/mesalib/src/mesa/swrast/s_fragprog.c b/mesalib/src/mesa/swrast/s_fragprog.c
index 8d59371c8..812189f09 100644
--- a/mesalib/src/mesa/swrast/s_fragprog.c
+++ b/mesalib/src/mesa/swrast/s_fragprog.c
@@ -24,6 +24,7 @@
#include "main/glheader.h"
#include "main/colormac.h"
+#include "main/samplerobj.h"
#include "program/prog_instruction.h"
#include "s_context.h"
@@ -83,11 +84,12 @@ fetch_texel_lod( struct gl_context *ctx, const GLfloat texcoord[4], GLfloat lamb
if (texObj) {
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLfloat rgba[4];
+ const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, unit);
- lambda = CLAMP(lambda, texObj->Sampler.MinLod, texObj->Sampler.MaxLod);
+ lambda = CLAMP(lambda, samp->MinLod, samp->MaxLod);
- swrast->TextureSample[unit](ctx, texObj, 1,
- (const GLfloat (*)[4]) texcoord,
+ swrast->TextureSample[unit](ctx, samp, ctx->Texture.Unit[unit]._Current,
+ 1, (const GLfloat (*)[4]) texcoord,
&lambda, &rgba);
swizzle_texel(rgba, color, texObj->_Swizzle);
}
@@ -118,6 +120,7 @@ fetch_texel_deriv( struct gl_context *ctx, const GLfloat texcoord[4],
texObj->Image[0][texObj->BaseLevel];
const struct swrast_texture_image *swImg =
swrast_texture_image_const(texImg);
+ const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, unit);
const GLfloat texW = (GLfloat) swImg->WidthScale;
const GLfloat texH = (GLfloat) swImg->HeightScale;
GLfloat lambda;
@@ -130,12 +133,12 @@ fetch_texel_deriv( struct gl_context *ctx, const GLfloat texcoord[4],
texcoord[0], texcoord[1], texcoord[3],
1.0F / texcoord[3]);
- lambda += lodBias + texUnit->LodBias + texObj->Sampler.LodBias;
+ lambda += lodBias + texUnit->LodBias + samp->LodBias;
- lambda = CLAMP(lambda, texObj->Sampler.MinLod, texObj->Sampler.MaxLod);
+ lambda = CLAMP(lambda, samp->MinLod, samp->MaxLod);
- swrast->TextureSample[unit](ctx, texObj, 1,
- (const GLfloat (*)[4]) texcoord,
+ swrast->TextureSample[unit](ctx, samp, ctx->Texture.Unit[unit]._Current,
+ 1, (const GLfloat (*)[4]) texcoord,
&lambda, &rgba);
swizzle_texel(rgba, color, texObj->_Swizzle);
}