try and force a log message
[mesa.git] / src / mesa / main / debug.c
1 #include "mtypes.h"
2 #include "debug.h"
3
4
5 void gl_print_state( const char *msg, GLuint state )
6 {
7 fprintf(stderr,
8 "%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",
9 msg,
10 state,
11 (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
12 (state & _NEW_PROJECTION) ? "ctx->Projection, " : "",
13 (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "",
14 (state & _NEW_COLOR_MATRIX) ? "ctx->ColorMatrix, " : "",
15 (state & _NEW_ACCUM) ? "ctx->Accum, " : "",
16 (state & _NEW_COLOR) ? "ctx->Color, " : "",
17 (state & _NEW_DEPTH) ? "ctx->Depth, " : "",
18 (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "",
19 (state & _NEW_FOG) ? "ctx->Fog, " : "",
20 (state & _NEW_HINT) ? "ctx->Hint, " : "",
21 (state & _NEW_LIGHT) ? "ctx->Light, " : "",
22 (state & _NEW_LINE) ? "ctx->Line, " : "",
23 (state & _NEW_PIXEL) ? "ctx->Pixel, " : "",
24 (state & _NEW_POINT) ? "ctx->Point, " : "",
25 (state & _NEW_POLYGON) ? "ctx->Polygon, " : "",
26 (state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "",
27 (state & _NEW_SCISSOR) ? "ctx->Scissor, " : "",
28 (state & _NEW_TEXTURE) ? "ctx->Texture, " : "",
29 (state & _NEW_TRANSFORM) ? "ctx->Transform, " : "",
30 (state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "",
31 (state & _NEW_PACKUNPACK) ? "ctx->Pack/Unpack, " : "",
32 (state & _NEW_ARRAY) ? "ctx->Array, " : "",
33 (state & _NEW_COLORTABLE) ? "ctx->{*}ColorTable, " : "",
34 (state & _NEW_RENDERMODE) ? "ctx->RenderMode, " : "",
35 (state & _NEW_BUFFERS) ? "ctx->Visual, ctx->DrawBuffer,, " : "");
36 }
37
38
39 void gl_print_enable_flags( const char *msg, GLuint flags )
40 {
41 fprintf(stderr,
42 "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
43 msg,
44 flags,
45 (flags & ENABLE_LIGHT) ? "light, " : "",
46 (flags & ENABLE_FOG) ? "fog, " : "",
47 (flags & ENABLE_USERCLIP) ? "userclip, " : "",
48 (flags & ENABLE_TEXGEN0) ? "tex-gen-0, " : "",
49 (flags & ENABLE_TEXGEN1) ? "tex-gen-1, " : "",
50 (flags & ENABLE_TEXGEN2) ? "tex-gen-2, " : "",
51 (flags & ENABLE_TEXGEN3) ? "tex-gen-3, " : "",
52 (flags & ENABLE_TEXGEN4) ? "tex-gen-4, " : "",
53 (flags & ENABLE_TEXGEN5) ? "tex-gen-5, " : "",
54 (flags & ENABLE_TEXGEN6) ? "tex-gen-6, " : "",
55 (flags & ENABLE_TEXGEN7) ? "tex-gen-7, " : "",
56 (flags & ENABLE_TEXMAT0) ? "tex-mat-0, " : "",
57 (flags & ENABLE_TEXMAT1) ? "tex-mat-1, " : "",
58 (flags & ENABLE_TEXMAT2) ? "tex-mat-2, " : "",
59 (flags & ENABLE_TEXMAT3) ? "tex-mat-3, " : "",
60 (flags & ENABLE_TEXMAT4) ? "tex-mat-4, " : "",
61 (flags & ENABLE_TEXMAT5) ? "tex-mat-5, " : "",
62 (flags & ENABLE_TEXMAT6) ? "tex-mat-6, " : "",
63 (flags & ENABLE_TEXMAT7) ? "tex-mat-7, " : "",
64 (flags & ENABLE_NORMALIZE) ? "normalize, " : "",
65 (flags & ENABLE_RESCALE) ? "rescale, " : "");
66 }
67
68 void gl_print_tri_caps( const char *name, GLuint flags )
69 {
70 fprintf(stderr,
71 "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
72 name,
73 flags,
74 (flags & DD_FEEDBACK) ? "feedback, " : "",
75 (flags & DD_SELECT) ? "select, " : "",
76 (flags & DD_FLATSHADE) ? "flat-shade, " : "",
77 (flags & DD_SEPERATE_SPECULAR) ? "seperate-specular, " : "",
78 (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "",
79 (flags & DD_TRI_UNFILLED) ? "tri-unfilled, " : "",
80 (flags & DD_TRI_STIPPLE) ? "tri-stipple, " : "",
81 (flags & DD_TRI_OFFSET) ? "tri-offset, " : "",
82 (flags & DD_TRI_SMOOTH) ? "tri-smooth, " : "",
83 (flags & DD_LINE_SMOOTH) ? "line-smooth, " : "",
84 (flags & DD_LINE_STIPPLE) ? "line-stipple, " : "",
85 (flags & DD_LINE_WIDTH) ? "line-wide, " : "",
86 (flags & DD_POINT_SMOOTH) ? "point-smooth, " : "",
87 (flags & DD_POINT_SIZE) ? "point-size, " : "",
88 (flags & DD_POINT_ATTEN) ? "point-atten, " : "",
89 (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : "",
90 (flags & DD_STENCIL) ? "stencil, " : ""
91 );
92 }