-/* $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
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, " : "",
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, " : "",
(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, " : ""
);
}
-/* $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
/* 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
#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 | \
-/* $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
}
}
-
+#define SWRAST_DEBUG 0
/* Public entrypoints: See also s_accum.c, s_bitmap.c, etc.
*/
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 );
}
_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;
}
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;
}
{
GLuint i;
SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
+
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_CreateContext\n");
+ }
+
if (!swrast)
return GL_FALSE;
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ if (SWRAST_DEBUG) {
+ fprintf(stderr, "_swrast_DestroyContext\n");
+ }
+
FREE( swrast->PB );
FREE( swrast );
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");
+ }
}