summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 89427578e6d..2c3ffbedd77 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -1,4 +1,4 @@
-/* $Id: s_context.c,v 1.44 2003/01/26 14:37:16 brianp Exp $ */
+/* $Id: s_context.c,v 1.45 2003/02/23 04:10:54 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -267,6 +267,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
swrast->Point( ctx, v0 );
}
+
static void
_swrast_validate_blend_func( GLcontext *ctx, GLuint n,
const GLubyte mask[],
@@ -285,13 +286,27 @@ _swrast_validate_blend_func( GLcontext *ctx, GLuint n,
static void
_swrast_validate_texture_sample( GLcontext *ctx, GLuint texUnit,
const struct gl_texture_object *tObj,
- GLuint n, GLfloat texcoords[][4],
+ GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLchan rgba[][4] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
_swrast_validate_derived( ctx );
- _swrast_choose_texture_sample_func( ctx, texUnit, tObj );
+
+ /* Compute min/mag filter threshold */
+ if (tObj->MinFilter != tObj->MagFilter) {
+ if (tObj->MagFilter == GL_LINEAR
+ && (tObj->MinFilter == GL_NEAREST_MIPMAP_NEAREST ||
+ tObj->MinFilter == GL_NEAREST_MIPMAP_LINEAR)) {
+ swrast->_MinMagThresh[texUnit] = 0.5F;
+ }
+ else {
+ swrast->_MinMagThresh[texUnit] = 0.0F;
+ }
+ }
+
+ swrast->TextureSample[texUnit] =
+ _swrast_choose_texture_sample_func( ctx, tObj );
swrast->TextureSample[texUnit]( ctx, texUnit, tObj, n, texcoords,
lambda, rgba );