summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2000-12-26 05:09:27 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2000-12-26 05:09:27 +0000
commitcab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290 (patch)
tree45385bd755d8e3876c54b2b0113636f5ceb7976a /src/mesa/swrast/s_context.c
parentd1ff1f6798b003a820f5de9fad835ff352f31afe (diff)
Major rework of tnl module
New array_cache module Support 8 texture units in core mesa (now support 8 everywhere) Rework core mesa statechange operations to avoid flushing on many noop statechanges.
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 0017784947..63771d9b07 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.7 2000/12/09 22:09:50 brianp Exp $ */
+/* $Id: s_context.c,v 1.8 2000/12/26 05:09:32 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -309,7 +309,7 @@ _swrast_invalidate_state( GLcontext *ctx, GLuint new_state )
swrast->BlendFunc = _swrast_validate_blend_func;
if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC)
- for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
swrast->TextureSample[i] = _swrast_validate_texture_sample;
}
@@ -326,8 +326,8 @@ _swrast_validate_derived( GLcontext *ctx )
_swrast_update_rasterflags( ctx );
if (swrast->NewState & _NEW_TEXTURE)
- swrast->_MultiTextureEnabled =
- (ctx->Texture._ReallyEnabled > ENABLE_TEX0);
+ swrast->_MultiTextureEnabled = (ctx->Texture._ReallyEnabled &
+ ~TEXTURE0_ANY);
if (swrast->NewState & _NEW_POLYGON)
_swrast_update_polygon( ctx );
@@ -357,6 +357,10 @@ void
_swrast_Triangle( GLcontext *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2 )
{
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
+/* _swrast_print_vertex( ctx, v0 ); */
+/* _swrast_print_vertex( ctx, v1 ); */
+/* _swrast_print_vertex( ctx, v2 ); */
SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v2 );
}
@@ -386,6 +390,12 @@ _swrast_get_stipple_counter_ref( GLcontext *ctx )
}
void
+_swrast_ResetLineStipple( GLcontext *ctx )
+{
+ SWRAST_CONTEXT(ctx)->StippleCounter = 0;
+}
+
+void
_swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
{
SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
@@ -459,3 +469,26 @@ _swrast_DestroyContext( GLcontext *ctx )
ctx->swrast_context = 0;
}
+
+void
+_swrast_print_vertex( GLcontext *ctx, const SWvertex *v )
+{
+ GLuint i;
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "win %f %f %f %f\n",
+ v->win[0], v->win[1], v->win[2], v->win[3]);
+
+ for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ fprintf(stderr, "texcoord[%d] %f %f %f %f\n", i,
+ v->texcoord[i][0], v->texcoord[i][1],
+ v->texcoord[i][2], v->texcoord[i][3]);
+
+ fprintf(stderr, "color %d %d %d %d\n",
+ v->color[0], v->color[1], v->color[2], v->color[3]);
+ fprintf(stderr, "spec %d %d %d %d\n",
+ v->specular[0], v->specular[1], v->specular[2], v->specular[3]);
+ fprintf(stderr, "fog %f\n", v->fog);
+ fprintf(stderr, "index %d\n", v->index);
+ fprintf(stderr, "pointsize %f\n", v->pointSize);
+}