summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-02-23 04:10:54 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-02-23 04:10:54 +0000
commitb8d6607acd3b6d18dab0c7247d5e0fc72e98ceae (patch)
treea146f6d4b57ace61c62b1464fbd059bf8f387870 /src/mesa/swrast/s_context.c
parent4e44d8c4c68c8a4e68b42f1fb2689d348369da86 (diff)
Move span stuff from swrast.h to s_context.h (it's private).
Implemented remaining fragment program instructions. Initial changes to implement fragment program texture sampling.
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 89427578e6..2c3ffbedd7 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 );