aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2001-03-29 17:08:26 +0000
committerKeith Whitwell <[email protected]>2001-03-29 17:08:26 +0000
commit3d5815f4636be0aa9f1788ca80908d5809d26481 (patch)
tree2baa067035e821888f265f4e4d8b66e4336ba11a /src
parentee403ff0ba272f5be539ddc921d3fffb3d250cc4 (diff)
Removed DD_STENCIL, DD_FEEDBACK, DD_SELECT.
Added some switchable debug to s_context.c
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/debug.c11
-rw-r--r--src/mesa/main/enable.c3
-rw-r--r--src/mesa/main/feedback.c5
-rw-r--r--src/mesa/main/mtypes.h39
-rw-r--r--src/mesa/main/state.c7
-rw-r--r--src/mesa/swrast/s_context.c91
6 files changed, 87 insertions, 69 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index f0e1e6ce2b9..ee52963d34b 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -1,4 +1,4 @@
-/* $Id: debug.c,v 1.10 2001/03/29 16:50:31 brianp Exp $ */
+/* $Id: debug.c,v 1.11 2001/03/29 17:08:26 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -30,7 +30,7 @@
void _mesa_print_state( const char *msg, GLuint state )
{
fprintf(stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
msg,
state,
(state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
@@ -92,11 +92,9 @@ void _mesa_print_enable_flags( const char *msg, GLuint flags )
void _mesa_print_tri_caps( const char *name, GLuint flags )
{
fprintf(stderr,
- "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
name,
flags,
- (flags & DD_FEEDBACK) ? "feedback, " : "",
- (flags & DD_SELECT) ? "select, " : "",
(flags & DD_FLATSHADE) ? "flat-shade, " : "",
(flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "",
(flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "",
@@ -110,7 +108,6 @@ void _mesa_print_tri_caps( const char *name, GLuint flags )
(flags & DD_POINT_SMOOTH) ? "point-smooth, " : "",
(flags & DD_POINT_SIZE) ? "point-size, " : "",
(flags & DD_POINT_ATTEN) ? "point-atten, " : "",
- (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : "",
- (flags & DD_STENCIL) ? "stencil, " : ""
+ (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : ""
);
}
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index fcae15ea3b1..4eff8043bcb 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.46 2001/03/29 16:50:32 brianp Exp $ */
+/* $Id: enable.c,v 1.47 2001/03/29 17:08:26 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -497,7 +497,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
return;
FLUSH_VERTICES(ctx, _NEW_STENCIL);
ctx->Stencil.Enabled = state;
- ctx->_TriangleCaps ^= DD_STENCIL;
break;
case GL_TEXTURE_1D: {
const GLuint curr = ctx->Texture.CurrentUnit;
diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index 85363b11d6f..fcd87146524 100644
--- a/src/mesa/main/feedback.c
+++ b/src/mesa/main/feedback.c
@@ -1,4 +1,4 @@
-/* $Id: feedback.c,v 1.23 2001/03/12 00:48:37 gareth Exp $ */
+/* $Id: feedback.c,v 1.24 2001/03/29 17:08:26 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -343,7 +343,6 @@ _mesa_RenderMode( GLenum mode )
fprintf(stderr, "glRenderMode %s\n", _mesa_lookup_enum_by_nr(mode));
FLUSH_VERTICES(ctx, _NEW_RENDERMODE);
- ctx->_TriangleCaps &= ~(DD_FEEDBACK|DD_SELECT);
switch (ctx->RenderMode) {
case GL_RENDER:
@@ -386,14 +385,12 @@ _mesa_RenderMode( GLenum mode )
case GL_RENDER:
break;
case GL_SELECT:
- ctx->_TriangleCaps |= DD_SELECT;
if (ctx->Select.BufferSize==0) {
/* haven't called glSelectBuffer yet */
_mesa_error( ctx, GL_INVALID_OPERATION, "glRenderMode" );
}
break;
case GL_FEEDBACK:
- ctx->_TriangleCaps |= DD_FEEDBACK;
if (ctx->Feedback.BufferSize==0) {
/* haven't called glFeedbackBuffer yet */
_mesa_error( ctx, GL_INVALID_OPERATION, "glRenderMode" );
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index ea5049f08a3..66290fd7fa8 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.36 2001/03/29 16:50:32 brianp Exp $ */
+/* $Id: mtypes.h,v 1.37 2001/03/29 17:08:26 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -1327,31 +1327,26 @@ struct gl_extensions {
/* A bunch of flags that we think might be useful to drivers.
*/
-#define DD_FEEDBACK 0x1
-#define DD_SELECT 0x2
-#define DD_FLATSHADE 0x4
-#define DD_SEPARATE_SPECULAR 0x10
-#define DD_TRI_LIGHT_TWOSIDE 0x20
-#define DD_TRI_UNFILLED 0x40
-#define DD_TRI_SMOOTH 0x80
-#define DD_TRI_STIPPLE 0x100
-#define DD_TRI_OFFSET 0x200
-#define DD_LINE_SMOOTH 0x800
-#define DD_LINE_STIPPLE 0x1000
-#define DD_LINE_WIDTH 0x2000
-#define DD_POINT_SMOOTH 0x4000
-#define DD_POINT_SIZE 0x8000
-#define DD_POINT_ATTEN 0x10000
-#define DD_TRI_CULL_FRONT_BACK 0x400000 /* special case on some hw */
-#define DD_STENCIL 0x800000
+#define DD_FLATSHADE 0x1
+#define DD_SEPARATE_SPECULAR 0x2
+#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */
+#define DD_TRI_LIGHT_TWOSIDE 0x8
+#define DD_TRI_UNFILLED 0x10
+#define DD_TRI_SMOOTH 0x20
+#define DD_TRI_STIPPLE 0x40
+#define DD_TRI_OFFSET 0x80
+#define DD_LINE_SMOOTH 0x100
+#define DD_LINE_STIPPLE 0x200
+#define DD_LINE_WIDTH 0x400
+#define DD_POINT_SMOOTH 0x800
+#define DD_POINT_SIZE 0x1000
+#define DD_POINT_ATTEN 0x2000
/* Define the state changes under which each of these bits might change
*/
-#define _DD_NEW_FEEDBACK _NEW_RENDERMODE
-#define _DD_NEW_SELECT _NEW_RENDERMODE
#define _DD_NEW_FLATSHADE _NEW_LIGHT
-#define _DD_NEW_MULTIDRAW _NEW_COLOR
#define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG)
+#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON
#define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT
#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON
#define _DD_NEW_TRI_SMOOTH _NEW_POLYGON
@@ -1363,8 +1358,6 @@ struct gl_extensions {
#define _DD_NEW_POINT_SMOOTH _NEW_POINT
#define _DD_NEW_POINT_SIZE _NEW_POINT
#define _DD_NEW_POINT_ATTEN _NEW_POINT
-#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON
-#define _DD_NEW_STENCIL _NEW_STENCIL
#define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \
_NEW_TEXTURE | \
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 11de54ac35a..4ba7776f4a9 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1,4 +1,4 @@
-/* $Id: state.c,v 1.62 2001/03/19 02:25:35 keithw Exp $ */
+/* $Id: state.c,v 1.63 2001/03/29 17:08:26 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -949,11 +949,6 @@ void _mesa_update_state( GLcontext *ctx )
/* At this point we can do some assertions to be sure the required
* device driver function pointers are all initialized.
- *
- * KW: Moved the some of these asserts to t_vb_render.c, as they
- * are strictly only required for that stage. The Driver struct
- * should probably be split; the read/write span/pixels functions
- * should be referenced only from swrast, for instance.
*/
ASSERT(ctx->Driver.GetString);
ASSERT(ctx->Driver.UpdateState);
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index c018bfc0a56..d994e60029d 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.19 2001/03/29 16:50:32 brianp Exp $ */
+/* $Id: s_context.c,v 1.20 2001/03/29 17:08:27 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -367,7 +367,7 @@ _swrast_validate_derived( GLcontext *ctx )
}
}
-
+#define SWRAST_DEBUG 0
/* Public entrypoints: See also s_accum.c, s_bitmap.c, etc.
*/
@@ -376,6 +376,13 @@ _swrast_Quad( GLcontext *ctx,
const SWvertex *v0, const SWvertex *v1,
const SWvertex *v2, const SWvertex *v3 )
{
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_Quad\n");
+ _swrast_print_vertex( ctx, v0 );
+ _swrast_print_vertex( ctx, v1 );
+ _swrast_print_vertex( ctx, v2 );
+ _swrast_print_vertex( ctx, v3 );
+ }
SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v2 );
SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v2, v3 );
}
@@ -384,45 +391,60 @@ 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 ); */
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_Triangle\n");
+ _swrast_print_vertex( ctx, v0 );
+ _swrast_print_vertex( ctx, v1 );
+ _swrast_print_vertex( ctx, v2 );
+ }
SWRAST_CONTEXT(ctx)->Triangle( ctx, v0, v1, v2 );
}
void
_swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-/* _swrast_print_vertex( ctx, v0 ); */
-/* _swrast_print_vertex( ctx, v1 ); */
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_Line\n");
+ _swrast_print_vertex( ctx, v0 );
+ _swrast_print_vertex( ctx, v1 );
+ }
SWRAST_CONTEXT(ctx)->Line( ctx, v0, v1 );
}
void
_swrast_Point( GLcontext *ctx, const SWvertex *v0 )
{
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
-/* _swrast_print_vertex( ctx, v0 ); */
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_Point\n");
+ _swrast_print_vertex( ctx, v0 );
+ }
SWRAST_CONTEXT(ctx)->Point( ctx, v0 );
}
void
_swrast_InvalidateState( GLcontext *ctx, GLuint new_state )
{
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_InvalidateState\n");
+ }
SWRAST_CONTEXT(ctx)->InvalidateState( ctx, new_state );
}
void
_swrast_ResetLineStipple( GLcontext *ctx )
{
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_ResetLineStipple\n");
+ }
SWRAST_CONTEXT(ctx)->StippleCounter = 0;
}
void
_swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
{
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_allow_vertex_fog %d\n", value);
+ }
SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
SWRAST_CONTEXT(ctx)->AllowVertexFog = value;
}
@@ -430,6 +452,9 @@ _swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
void
_swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value )
{
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_allow_pixel_fog %d\n", value);
+ }
SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
SWRAST_CONTEXT(ctx)->AllowPixelFog = value;
}
@@ -440,6 +465,11 @@ _swrast_CreateContext( GLcontext *ctx )
{
GLuint i;
SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
+
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_CreateContext\n");
+ }
+
if (!swrast)
return GL_FALSE;
@@ -485,6 +515,10 @@ _swrast_DestroyContext( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_DestroyContext\n");
+ }
+
FREE( swrast->PB );
FREE( swrast );
@@ -499,26 +533,29 @@ _swrast_GetDeviceDriverReference( GLcontext *ctx )
return &swrast->Driver;
}
+#define SWRAST_DEBUG_VERTICES 0
void
_swrast_print_vertex( GLcontext *ctx, const SWvertex *v )
{
GLuint i;
- 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);
- fprintf(stderr, "\n");
+ if (SWRAST_DEBUG_VERTICES) {
+ 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);
+ fprintf(stderr, "\n");
+ }
}