From 8a98aabe0bcea42cfdc982001ae4876e3d9b1214 Mon Sep 17 00:00:00 2001 From: Andreas Faenger Date: Wed, 18 May 2011 08:14:33 -0600 Subject: swrast: anisotropic filtering extension Anisotropic filtering extension for swrast intended to be used by osmesa to create high quality renderings. Based on Higher Quality Elliptical Weighted Avarage Filter (EWA). A 2nd implementation using footprint assembly is also provided. Signed-off-by: Brian Paul --- src/mesa/swrast/s_texcombine.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/mesa/swrast/s_texcombine.c') diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c index 7f49b6ffa50..086ed0b33d7 100644 --- a/src/mesa/swrast/s_texcombine.c +++ b/src/mesa/swrast/s_texcombine.c @@ -710,6 +710,18 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span ) } } } + else if (curObj->Sampler.MaxAnisotropy > 1.0 && + curObj->Sampler.MinFilter == GL_LINEAR_MIPMAP_LINEAR) { + /* sample_lambda_2d_aniso is beeing used as texture_sample_func, + * it requires the current SWspan *span as an additional parameter. + * In order to keep the same function signature, the unused lambda + * parameter will be modified to actually contain the SWspan pointer. + * This is a Hack. To make it right, the texture_sample_func + * signature and all implementing functions need to be modified. + */ + /* "hide" SWspan struct; cast to (GLfloat *) to suppress warning */ + lambda = (GLfloat *)span; + } /* Sample the texture (span->end = number of fragments) */ swrast->TextureSample[unit]( ctx, texUnit->_Current, span->end, -- cgit v1.2.3