summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_atifragshader.c
diff options
context:
space:
mode:
authorPauli Nieminen <[email protected]>2012-06-12 21:38:56 +0300
committerEric Anholt <[email protected]>2012-08-01 15:55:51 -0700
commitcbdc1d53542b3ecca0085399c4bb3b3371f94809 (patch)
treec835fd6c56f22692f8db127a882ae94e7a70d498 /src/mesa/swrast/s_atifragshader.c
parent8129dabb5f5ff717bb1ca32710ca6204d5345461 (diff)
swrast: Support sampler object for texture fetching state
swrast needs to pass sampler object into all texture fetching functions to use correct sampling state when sampler object is bound to the unit. The changes were made using half manual regular expression replace. v2: Fix NULL deref in _swrast_choose_triangle(), because the _Current values aren't set yet, so we need to look at our texObj2D. (anholt) Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_atifragshader.c')
-rw-r--r--src/mesa/swrast/s_atifragshader.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index 1eb026e0092..394fac50b66 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -23,6 +23,7 @@
#include "main/colormac.h"
#include "main/macros.h"
#include "main/atifragshader.h"
+#include "main/samplerobj.h"
#include "swrast/s_atifragshader.h"
#include "swrast/s_context.h"
@@ -49,8 +50,9 @@ fetch_texel(struct gl_context * ctx, const GLfloat texcoord[4], GLfloat lambda,
SWcontext *swrast = SWRAST_CONTEXT(ctx);
/* XXX use a float-valued TextureSample routine here!!! */
- swrast->TextureSample[unit](ctx, ctx->Texture.Unit[unit]._Current,
- 1, (const GLfloat(*)[4]) texcoord,
+ swrast->TextureSample[unit](ctx, _mesa_get_samplerobj(ctx, unit),
+ ctx->Texture.Unit[unit]._Current,
+ 1, (const GLfloat(*)[4]) texcoord,
&lambda, (GLfloat (*)[4]) color);
}