summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_context.c41
-rw-r--r--src/mesa/swrast/s_copypix.c6
-rw-r--r--src/mesa/swrast/s_drawpix.c6
-rw-r--r--src/mesa/swrast/swrast.h7
4 files changed, 48 insertions, 12 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);
+}
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index e1ae060ee2..cf87b96bc0 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -1,4 +1,4 @@
-/* $Id: s_copypix.c,v 1.7 2000/11/28 22:34:46 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.8 2000/12/26 05:09:32 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -244,7 +244,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
MEMCPY(primary_rgba, rgba, 4 * width * sizeof(GLchan));
- for (unit = 0; unit < MAX_TEXTURE_UNITS; unit++) {
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
_mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
s, t, r, q);
gl_texture_pixels(ctx, unit, width, s, t, r, NULL,
@@ -490,7 +490,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
MEMCPY(primary_rgba, rgba, 4 * width * sizeof(GLchan));
- for (unit = 0; unit < MAX_TEXTURE_UNITS; unit++) {
+ for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
_mesa_pixeltexgen(ctx, width, (const GLchan (*)[4]) rgba,
s, t, r, q);
gl_texture_pixels(ctx, unit, width, s, t, r, NULL,
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index dc15e598f5..ccb48a7ef9 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -1,4 +1,4 @@
-/* $Id: s_drawpix.c,v 1.4 2000/11/13 20:02:57 keithw Exp $ */
+/* $Id: s_drawpix.c,v 1.5 2000/12/26 05:09:32 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -104,10 +104,6 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
GLchan rgb[MAX_WIDTH][3];
GLchan rgba[MAX_WIDTH][4];
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glDrawPixels",
- GL_FALSE);
-
-
if (!ctx->Current.RasterPosValid) {
return GL_TRUE; /* no-op */
}
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index f3820a68b8..d07f30a5ab 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -124,6 +124,10 @@ _swrast_Accum( GLcontext *ctx, GLenum op,
extern GLuint *
_swrast_get_stipple_counter_ref( GLcontext *ctx );
+/* Reset the stipple pointer via a function call
+ */
+extern void
+_swrast_ResetLineStipple( GLcontext *ctx );
/* These will always render the correct point/line/triangle for the
* current state.
@@ -160,4 +164,7 @@ _swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value );
extern void
_swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value );
+extern void
+_swrast_print_vertex( GLcontext *ctx, const SWvertex *v );
+
#endif