-/* $Id: t_imm_debug.c,v 1.7 2002/01/22 14:35:16 brianp Exp $ */
+/* $Id: t_imm_debug.c,v 1.10 2003/01/14 04:55:47 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 5.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
*/
#include "mtypes.h"
+#include "context.h"
+#include "imports.h"
#include "t_context.h"
#include "t_imm_debug.h"
+
void _tnl_print_vert_flags( const char *name, GLuint flags )
{
- fprintf(stderr,
+ _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%s%s\n",
name,
flags,
GLuint state = IM->BeginState;
GLuint req = ~0;
- fprintf(stderr, "Cassette id %d, %u rows.\n", IM->id,
+ _mesa_debug(NULL, "Cassette id %d, %u rows.\n", IM->id,
IM->Count - IM->CopyStart);
_tnl_print_vert_flags("Contains at least one", orflag);
{
_tnl_print_vert_flags("Contains a full complement of", andflag);
- fprintf(stderr, "Final begin/end state %s/%s, errors %s/%s\n",
+ _mesa_debug(NULL, "Final begin/end state %s/%s, errors %s/%s\n",
(state & VERT_BEGIN_0) ? "in" : "out",
(state & VERT_BEGIN_1) ? "in" : "out",
(state & VERT_ERROR_0) ? "y" : "n",
}
for (i = IM->CopyStart ; i <= IM->Count ; i++) {
- fprintf(stderr, "%u: ", i);
+ _mesa_debug(NULL, "%u: ", i);
if (req & VERT_BITS_OBJ_234) {
if (flags[i] & VERT_BIT_EVAL_C1)
- fprintf(stderr, "EvalCoord %f ",
+ _mesa_debug(NULL, "EvalCoord %f ",
IM->Attrib[VERT_ATTRIB_POS][i][0]);
else if (flags[i] & VERT_BIT_EVAL_P1)
- fprintf(stderr, "EvalPoint %.0f ",
+ _mesa_debug(NULL, "EvalPoint %.0f ",
IM->Attrib[VERT_ATTRIB_POS][i][0]);
else if (flags[i] & VERT_BIT_EVAL_C2)
- fprintf(stderr, "EvalCoord %f %f ",
+ _mesa_debug(NULL, "EvalCoord %f %f ",
IM->Attrib[VERT_ATTRIB_POS][i][0],
IM->Attrib[VERT_ATTRIB_POS][i][1]);
else if (flags[i] & VERT_BIT_EVAL_P2)
- fprintf(stderr, "EvalPoint %.0f %.0f ",
+ _mesa_debug(NULL, "EvalPoint %.0f %.0f ",
IM->Attrib[VERT_ATTRIB_POS][i][0],
IM->Attrib[VERT_ATTRIB_POS][i][1]);
else if (i < IM->Count && (flags[i] & VERT_BITS_OBJ_234)) {
- fprintf(stderr, "Obj %f %f %f %f",
+ _mesa_debug(NULL, "Obj %f %f %f %f",
IM->Attrib[VERT_ATTRIB_POS][i][0],
IM->Attrib[VERT_ATTRIB_POS][i][1],
IM->Attrib[VERT_ATTRIB_POS][i][2],
}
if (req & flags[i] & VERT_BIT_ELT)
- fprintf(stderr, " Elt %u\t", IM->Elt[i]);
+ _mesa_debug(NULL, " Elt %u\t", IM->Elt[i]);
if (req & flags[i] & VERT_BIT_NORMAL)
- fprintf(stderr, " Norm %f %f %f ",
+ _mesa_debug(NULL, " Norm %f %f %f ",
IM->Attrib[VERT_ATTRIB_NORMAL][i][0],
IM->Attrib[VERT_ATTRIB_NORMAL][i][1],
IM->Attrib[VERT_ATTRIB_NORMAL][i][2]);
if (req & flags[i] & VERT_BITS_TEX_ANY) {
GLuint j;
- for (j = 0 ; j < MAX_TEXTURE_UNITS ; j++) {
+ for (j = 0 ; j < MAX_TEXTURE_COORD_UNITS ; j++) {
if (req & flags[i] & VERT_BIT_TEX(j)) {
- fprintf(stderr, "TC%d %f %f %f %f", j,
+ _mesa_debug(NULL, "TC%d %f %f %f %f", j,
IM->Attrib[VERT_ATTRIB_TEX0 + j][i][0],
IM->Attrib[VERT_ATTRIB_TEX0 + j][i][1],
IM->Attrib[VERT_ATTRIB_TEX0 + j][i][2],
}
if (req & flags[i] & VERT_BIT_COLOR0)
- fprintf(stderr, " Rgba %f %f %f %f ",
+ _mesa_debug(NULL, " Rgba %f %f %f %f ",
IM->Attrib[VERT_ATTRIB_COLOR0][i][0],
IM->Attrib[VERT_ATTRIB_COLOR0][i][1],
IM->Attrib[VERT_ATTRIB_COLOR0][i][2],
IM->Attrib[VERT_ATTRIB_COLOR0][i][3]);
if (req & flags[i] & VERT_BIT_COLOR1)
- fprintf(stderr, " Spec %f %f %f ",
+ _mesa_debug(NULL, " Spec %f %f %f ",
IM->Attrib[VERT_ATTRIB_COLOR1][i][0],
IM->Attrib[VERT_ATTRIB_COLOR1][i][1],
IM->Attrib[VERT_ATTRIB_COLOR1][i][2]);
if (req & flags[i] & VERT_BIT_FOG)
- fprintf(stderr, " Fog %f ", IM->Attrib[VERT_ATTRIB_FOG][i][0]);
+ _mesa_debug(NULL, " Fog %f ", IM->Attrib[VERT_ATTRIB_FOG][i][0]);
if (req & flags[i] & VERT_BIT_INDEX)
- fprintf(stderr, " Index %u ", IM->Index[i]);
+ _mesa_debug(NULL, " Index %u ", IM->Index[i]);
if (req & flags[i] & VERT_BIT_EDGEFLAG)
- fprintf(stderr, " Edgeflag %d ", IM->EdgeFlag[i]);
+ _mesa_debug(NULL, " Edgeflag %d ", IM->EdgeFlag[i]);
if (req & flags[i] & VERT_BIT_MATERIAL)
- fprintf(stderr, " Material ");
+ _mesa_debug(NULL, " Material ");
/* The order of these two is not easily knowable, but this is
* the usually correct way to look at them.
*/
if (req & flags[i] & VERT_BIT_END)
- fprintf(stderr, " END ");
+ _mesa_debug(NULL, " END ");
if (req & flags[i] & VERT_BIT_BEGIN)
- fprintf(stderr, " BEGIN(%s) (%s%s%s%s)",
+ _mesa_debug(NULL, " BEGIN(%s) (%s%s%s%s)",
_mesa_prim_name[IM->Primitive[i] & PRIM_MODE_MASK],
(IM->Primitive[i] & PRIM_LAST) ? "LAST," : "",
(IM->Primitive[i] & PRIM_BEGIN) ? "BEGIN," : "",
(IM->Primitive[i] & PRIM_END) ? "END," : "",
(IM->Primitive[i] & PRIM_PARITY) ? "PARITY," : "");
- fprintf(stderr, "\n");
+ _mesa_debug(NULL, "\n");
}
}