Set the debugging flags.
{
#ifdef DEBUG
struct debug_option {
const char *name;
GLbitfield flag;
};
static const struct debug_option debug_opt[] = {
{ "varray", VERBOSE_VARRAY },
{ "tex", VERBOSE_TEXTURE },
{ "imm", VERBOSE_IMMEDIATE },
{ "pipe", VERBOSE_PIPELINE },
{ "driver", VERBOSE_DRIVER },
{ "state", VERBOSE_STATE },
{ "api", VERBOSE_API },
{ "list", VERBOSE_DISPLAY_LIST },
{ "lighting", VERBOSE_LIGHTING },
{ "disassem", VERBOSE_DISASSEM },
{ "glsl", VERBOSE_GLSL },
{ "glsl_dump", VERBOSE_GLSL_DUMP }
};
GLuint i;
MESA_VERBOSE = 0x0;
for (i = 0; i < Elements(debug_opt); i++) {
if (_mesa_strstr(debug, debug_opt[i].name))
MESA_VERBOSE |= debug_opt[i].flag;
}
if (_mesa_strstr(debug, "flush"))
MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH;
#if defined(_FPU_GETCW) && defined(_FPU_SETCW)
if (_mesa_strstr(debug, "fpexceptions")) {
fpu_control_t mask;
_FPU_GETCW(mask);
mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM
| _FPU_MASK_OM | _FPU_MASK_UM);
_FPU_SETCW(mask);
}
#endif
#else
(void) debug;
#endif
}