add names to tracked state atoms to improve debug
This commit is contained in:
@@ -155,6 +155,8 @@ void st_validate_state( struct st_context *st )
|
|||||||
if (state->st == 0)
|
if (state->st == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// _mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);
|
||||||
|
|
||||||
if (1) {
|
if (1) {
|
||||||
/* Debug version which enforces various sanity checks on the
|
/* Debug version which enforces various sanity checks on the
|
||||||
* state flags which are generated and checked to help ensure
|
* state flags which are generated and checked to help ensure
|
||||||
@@ -168,14 +170,17 @@ void st_validate_state( struct st_context *st )
|
|||||||
const struct st_tracked_state *atom = st->atoms[i];
|
const struct st_tracked_state *atom = st->atoms[i];
|
||||||
struct st_state_flags generated;
|
struct st_state_flags generated;
|
||||||
|
|
||||||
|
// _mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);
|
||||||
|
|
||||||
if (!(atom->dirty.mesa || atom->dirty.st) ||
|
if (!(atom->dirty.mesa || atom->dirty.st) ||
|
||||||
!atom->update) {
|
!atom->update) {
|
||||||
_mesa_printf("malformed atom %d\n", i);
|
_mesa_printf("malformed atom %s\n", atom->name);
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (check_state(state, &atom->dirty)) {
|
if (check_state(state, &atom->dirty)) {
|
||||||
st->atoms[i]->update( st );
|
st->atoms[i]->update( st );
|
||||||
|
// _mesa_printf("after: %x\n", atom->dirty.mesa);
|
||||||
}
|
}
|
||||||
|
|
||||||
accumulate_state(&examined, &atom->dirty);
|
accumulate_state(&examined, &atom->dirty);
|
||||||
@@ -188,6 +193,8 @@ void st_validate_state( struct st_context *st )
|
|||||||
assert(!check_state(&examined, &generated));
|
assert(!check_state(&examined, &generated));
|
||||||
prev = *state;
|
prev = *state;
|
||||||
}
|
}
|
||||||
|
// _mesa_printf("\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const GLuint nr = st->nr_atoms;
|
const GLuint nr = st->nr_atoms;
|
||||||
|
@@ -81,6 +81,7 @@ update_alpha_test( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_alpha_test = {
|
const struct st_tracked_state st_update_alpha_test = {
|
||||||
|
.name = "st_update_alpha_test",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = (_NEW_COLOR),
|
.mesa = (_NEW_COLOR),
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -227,6 +227,7 @@ update_blend( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_blend = {
|
const struct st_tracked_state st_update_blend = {
|
||||||
|
.name = "st_update_blend",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = (_NEW_COLOR), /* XXX _NEW_BLEND someday? */
|
.mesa = (_NEW_COLOR), /* XXX _NEW_BLEND someday? */
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -54,6 +54,7 @@ update_clear_color_state( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_clear_color = {
|
const struct st_tracked_state st_update_clear_color = {
|
||||||
|
.name = "st_update_clear_color",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = _NEW_COLOR,
|
.mesa = _NEW_COLOR,
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -62,6 +62,7 @@ static void update_clip( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_clip = {
|
const struct st_tracked_state st_update_clip = {
|
||||||
|
.name = "st_update_clip",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = (_NEW_TRANSFORM),
|
.mesa = (_NEW_TRANSFORM),
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -84,6 +84,7 @@ update_depth( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_depth = {
|
const struct st_tracked_state st_update_depth = {
|
||||||
|
.name = "st_update_depth",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = (_NEW_DEPTH),
|
.mesa = (_NEW_DEPTH),
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -82,6 +82,7 @@ update_framebuffer_state( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_framebuffer = {
|
const struct st_tracked_state st_update_framebuffer = {
|
||||||
|
.name = "st_update_framebuffer",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = _NEW_BUFFERS,
|
.mesa = _NEW_BUFFERS,
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -99,6 +99,7 @@ static void update_fs( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_fs = {
|
const struct st_tracked_state st_update_fs = {
|
||||||
|
.name = "st_update_fs",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = 0,
|
.mesa = 0,
|
||||||
.st = ST_NEW_FRAGMENT_PROGRAM,
|
.st = ST_NEW_FRAGMENT_PROGRAM,
|
||||||
|
@@ -152,6 +152,7 @@ update_samplers(struct st_context *st)
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_sampler = {
|
const struct st_tracked_state st_update_sampler = {
|
||||||
|
.name = "st_update_sampler",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = _NEW_TEXTURE,
|
.mesa = _NEW_TEXTURE,
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -83,6 +83,7 @@ update_scissor( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_scissor = {
|
const struct st_tracked_state st_update_scissor = {
|
||||||
|
.name = "st_update_scissor",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = (_NEW_SCISSOR | _NEW_BUFFERS),
|
.mesa = (_NEW_SCISSOR | _NEW_BUFFERS),
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -211,6 +211,7 @@ static void update_setup_state( struct st_context *st )
|
|||||||
}
|
}
|
||||||
|
|
||||||
const struct st_tracked_state st_update_setup = {
|
const struct st_tracked_state st_update_setup = {
|
||||||
|
.name = "st_update_setup",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = (_NEW_LIGHT | _NEW_POLYGON | _NEW_LINE | _NEW_SCISSOR |
|
.mesa = (_NEW_LIGHT | _NEW_POLYGON | _NEW_LINE | _NEW_SCISSOR |
|
||||||
_NEW_POINT | _NEW_BUFFERS | _NEW_MULTISAMPLE),
|
_NEW_POINT | _NEW_BUFFERS | _NEW_MULTISAMPLE),
|
||||||
|
@@ -127,6 +127,7 @@ update_stencil( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_stencil = {
|
const struct st_tracked_state st_update_stencil = {
|
||||||
|
.name = "st_update_stencil",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = (_NEW_STENCIL),
|
.mesa = (_NEW_STENCIL),
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -54,6 +54,7 @@ update_stipple( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_polygon_stipple = {
|
const struct st_tracked_state st_update_polygon_stipple = {
|
||||||
|
.name = "st_update_polygon_stipple",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = (_NEW_POLYGONSTIPPLE),
|
.mesa = (_NEW_POLYGONSTIPPLE),
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -72,6 +72,7 @@ update_textures(struct st_context *st)
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_texture = {
|
const struct st_tracked_state st_update_texture = {
|
||||||
|
.name = "st_update_texture",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = _NEW_TEXTURE,
|
.mesa = _NEW_TEXTURE,
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -86,6 +86,7 @@ update_viewport( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_viewport = {
|
const struct st_tracked_state st_update_viewport = {
|
||||||
|
.name = "st_update_viewport",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = _NEW_BUFFERS | _NEW_VIEWPORT,
|
.mesa = _NEW_BUFFERS | _NEW_VIEWPORT,
|
||||||
.st = 0,
|
.st = 0,
|
||||||
|
@@ -116,6 +116,7 @@ static void update_vs( struct st_context *st )
|
|||||||
|
|
||||||
|
|
||||||
const struct st_tracked_state st_update_vs = {
|
const struct st_tracked_state st_update_vs = {
|
||||||
|
.name = "st_update_vs",
|
||||||
.dirty = {
|
.dirty = {
|
||||||
.mesa = 0,
|
.mesa = 0,
|
||||||
.st = ST_NEW_VERTEX_PROGRAM,
|
.st = ST_NEW_VERTEX_PROGRAM,
|
||||||
|
@@ -48,6 +48,7 @@ struct st_state_flags {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct st_tracked_state {
|
struct st_tracked_state {
|
||||||
|
const char *name;
|
||||||
struct st_state_flags dirty;
|
struct st_state_flags dirty;
|
||||||
void (*update)( struct st_context *st );
|
void (*update)( struct st_context *st );
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user