struct gl_debug_group *Groups[MAX_DEBUG_GROUP_STACK_DEPTH];
struct gl_debug_message GroupMessages[MAX_DEBUG_GROUP_STACK_DEPTH];
- GLint GroupStackDepth;
+ GLint CurrentGroup; // GroupStackDepth - 1
struct gl_debug_log Log;
};
static bool
debug_is_group_read_only(const struct gl_debug_state *debug)
{
- const GLint gstack = debug->GroupStackDepth;
+ const GLint gstack = debug->CurrentGroup;
return (gstack > 0 && debug->Groups[gstack] == debug->Groups[gstack - 1]);
}
static bool
debug_make_group_writable(struct gl_debug_state *debug)
{
- const GLint gstack = debug->GroupStackDepth;
+ const GLint gstack = debug->CurrentGroup;
const struct gl_debug_group *src = debug->Groups[gstack];
struct gl_debug_group *dst;
int s, t;
static void
debug_clear_group(struct gl_debug_state *debug)
{
- const GLint gstack = debug->GroupStackDepth;
+ const GLint gstack = debug->CurrentGroup;
if (!debug_is_group_read_only(debug)) {
struct gl_debug_group *grp = debug->Groups[gstack];
static void
debug_destroy(struct gl_debug_state *debug)
{
- while (debug->GroupStackDepth > 0) {
+ while (debug->CurrentGroup > 0) {
debug_clear_group(debug);
- debug->GroupStackDepth--;
+ debug->CurrentGroup--;
}
debug_clear_group(debug);
enum mesa_debug_type type,
GLuint id, GLboolean enabled)
{
- const GLint gstack = debug->GroupStackDepth;
+ const GLint gstack = debug->CurrentGroup;
struct gl_debug_namespace *ns;
debug_make_group_writable(debug);
enum mesa_debug_severity severity,
GLboolean enabled)
{
- const GLint gstack = debug->GroupStackDepth;
+ const GLint gstack = debug->CurrentGroup;
int s, t, smax, tmax;
if (source == MESA_DEBUG_SOURCE_COUNT) {
GLuint id,
enum mesa_debug_severity severity)
{
- const GLint gstack = debug->GroupStackDepth;
+ const GLint gstack = debug->CurrentGroup;
struct gl_debug_group *grp = debug->Groups[gstack];
struct gl_debug_namespace *nspace = &grp->Namespaces[source][type];
static struct gl_debug_message *
debug_get_group_message(struct gl_debug_state *debug)
{
- return &debug->GroupMessages[debug->GroupStackDepth];
+ return &debug->GroupMessages[debug->CurrentGroup];
}
static void
debug_push_group(struct gl_debug_state *debug)
{
- const GLint gstack = debug->GroupStackDepth;
+ const GLint gstack = debug->CurrentGroup;
/* just point to the previous stack */
debug->Groups[gstack + 1] = debug->Groups[gstack];
- debug->GroupStackDepth++;
+ debug->CurrentGroup++;
}
static void
debug_pop_group(struct gl_debug_state *debug)
{
debug_clear_group(debug);
- debug->GroupStackDepth--;
+ debug->CurrentGroup--;
}
debug->Log.Messages[debug->Log.NextMessage].length : 0;
break;
case GL_DEBUG_GROUP_STACK_DEPTH:
- val = debug->GroupStackDepth;
+ val = debug->CurrentGroup;
break;
default:
assert(!"unknown debug output param");
if (!debug)
return;
- if (debug->GroupStackDepth >= MAX_DEBUG_GROUP_STACK_DEPTH-1) {
+ if (debug->CurrentGroup >= MAX_DEBUG_GROUP_STACK_DEPTH-1) {
_mesa_unlock_debug_state(ctx);
_mesa_error(ctx, GL_STACK_OVERFLOW, "%s", callerstr);
return;
if (!debug)
return;
- if (debug->GroupStackDepth <= 0) {
+ if (debug->CurrentGroup <= 0) {
_mesa_unlock_debug_state(ctx);
_mesa_error(ctx, GL_STACK_UNDERFLOW, "%s", callerstr);
return;