mesa: fix printing _NEW_* flags

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32685>
This commit is contained in:
Marek Olšák
2024-12-10 15:25:12 -05:00
committed by Marge Bot
parent b2ddf85591
commit e22b78a196

View File

@@ -76,31 +76,43 @@ void
_mesa_print_state( const char *msg, GLuint state )
{
_mesa_debug(NULL,
"%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\n",
msg,
state,
(state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "",
(state & _NEW_PROJECTION) ? "ctx->Projection, " : "",
(state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "",
(state & _NEW_COLOR) ? "ctx->Color, " : "",
(state & _NEW_DEPTH) ? "ctx->Depth, " : "",
(state & _NEW_FOG) ? "ctx->Fog, " : "",
(state & _NEW_HINT) ? "ctx->Hint, " : "",
(state & _NEW_LIGHT_CONSTANTS) ? "ctx->Light(Constants), " : "",
(state & _NEW_LIGHT_STATE) ? "ctx->Light(State), " : "",
(state & _NEW_LINE) ? "ctx->Line, " : "",
(state & _NEW_PIXEL) ? "ctx->Pixel, " : "",
(state & _NEW_POINT) ? "ctx->Point, " : "",
(state & _NEW_POLYGON) ? "ctx->Polygon, " : "",
(state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "",
(state & _NEW_SCISSOR) ? "ctx->Scissor, " : "",
(state & _NEW_STENCIL) ? "ctx->Stencil, " : "",
(state & _NEW_TEXTURE_OBJECT) ? "ctx->Texture(Object), " : "",
(state & _NEW_TRANSFORM) ? "ctx->Transform, " : "",
(state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "",
(state & _NEW_TEXTURE_STATE) ? "ctx->Texture(State), " : "",
(state & _NEW_RENDERMODE) ? "ctx->RenderMode, " : "",
(state & _NEW_BUFFERS) ? "ctx->Visual, ctx->DrawBuffer,, " : "");
"%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%s%s%s%s%s%s%s\n",
msg,
state,
#define S(def) (state & def) ? (#def ", ") + 5 : ""
S(_NEW_MODELVIEW),
S(_NEW_PROJECTION),
S(_NEW_TEXTURE_MATRIX),
S(_NEW_COLOR),
S(_NEW_DEPTH),
S(_NEW_TNL_SPACES),
S(_NEW_FOG),
S(_NEW_HINT),
S(_NEW_LIGHT_CONSTANTS),
S(_NEW_LINE),
S(_NEW_PIXEL),
S(_NEW_POINT),
S(_NEW_POLYGON),
S(_NEW_POLYGONSTIPPLE),
S(_NEW_SCISSOR),
S(_NEW_STENCIL),
S(_NEW_TEXTURE_OBJECT),
S(_NEW_TRANSFORM),
S(_NEW_VIEWPORT),
S(_NEW_TEXTURE_STATE),
S(_NEW_LIGHT_STATE),
S(_NEW_RENDERMODE),
S(_NEW_BUFFERS),
S(_NEW_CURRENT_ATTRIB),
S(_NEW_MULTISAMPLE),
S(_NEW_TRACK_MATRIX),
S(_NEW_PROGRAM),
S(_NEW_PROGRAM_CONSTANTS),
S(_NEW_FF_VERT_PROGRAM),
S(_NEW_FRAG_CLAMP),
S(_NEW_MATERIAL),
S(_NEW_FF_FRAG_PROGRAM));
#undef S
}