diff options
author | Pauli Nieminen <[email protected]> | 2012-06-12 21:38:56 +0300 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-08-01 15:55:51 -0700 |
commit | cbdc1d53542b3ecca0085399c4bb3b3371f94809 (patch) | |
tree | c835fd6c56f22692f8db127a882ae94e7a70d498 /src/mesa/swrast/s_span.c | |
parent | 8129dabb5f5ff717bb1ca32710ca6204d5345461 (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_span.c')
-rw-r--r-- | src/mesa/swrast/s_span.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 627ef1136aa..ef51479fdcf 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -38,6 +38,7 @@ #include "main/macros.h" #include "main/imports.h" #include "main/image.h" +#include "main/samplerobj.h" #include "s_atifragshader.h" #include "s_alpha.h" @@ -497,14 +498,15 @@ interpolate_texcoords(struct gl_context *ctx, SWspan *span) const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel]; const struct swrast_texture_image *swImg = swrast_texture_image_const(img); + const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, u); - needLambda = (obj->Sampler.MinFilter != obj->Sampler.MagFilter) + needLambda = (samp->MinFilter != samp->MagFilter) || _swrast_use_fragment_program(ctx); /* LOD is calculated directly in the ansiotropic filter, we can * skip the normal lambda function as the result is ignored. */ - if (obj->Sampler.MaxAnisotropy > 1.0 && - obj->Sampler.MinFilter == GL_LINEAR_MIPMAP_LINEAR) { + if (samp->MaxAnisotropy > 1.0 && + samp->MinFilter == GL_LINEAR_MIPMAP_LINEAR) { needLambda = GL_FALSE; } texW = swImg->WidthScale; |