diff options
author | keithw <keithw@keithw-laptop.(none)> | 2007-08-25 22:00:36 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-25 22:01:32 +0100 |
commit | 4185da4681405f3cc4d0cc601d428f2f44d0dda8 (patch) | |
tree | 9640d32ac9034035269bcb81973114a2c91969b0 | |
parent | 07d97e80e616d9fdc437d3b41055c347d5c54932 (diff) |
add names to tracked state atoms to improve debug
-rw-r--r-- | src/mesa/state_tracker/st_atom.c | 9 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_alphatest.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_blend.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_clear_color.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_clip.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_depth.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_framebuffer.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_fs.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_sampler.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_scissor.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_setup.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_stencil.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_stipple.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_viewport.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_vs.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 1 |
17 files changed, 24 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 99fcbdfda7..66ab5d7c3a 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -155,6 +155,8 @@ void st_validate_state( struct st_context *st ) if (state->st == 0) return; +// _mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st); + if (1) { /* Debug version which enforces various sanity checks on the * 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]; 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) || !atom->update) { - _mesa_printf("malformed atom %d\n", i); + _mesa_printf("malformed atom %s\n", atom->name); assert(0); } if (check_state(state, &atom->dirty)) { st->atoms[i]->update( st ); +// _mesa_printf("after: %x\n", atom->dirty.mesa); } accumulate_state(&examined, &atom->dirty); @@ -188,6 +193,8 @@ void st_validate_state( struct st_context *st ) assert(!check_state(&examined, &generated)); prev = *state; } +// _mesa_printf("\n"); + } else { const GLuint nr = st->nr_atoms; diff --git a/src/mesa/state_tracker/st_atom_alphatest.c b/src/mesa/state_tracker/st_atom_alphatest.c index 1e2e449795..4378154053 100644 --- a/src/mesa/state_tracker/st_atom_alphatest.c +++ b/src/mesa/state_tracker/st_atom_alphatest.c @@ -81,6 +81,7 @@ update_alpha_test( struct st_context *st ) const struct st_tracked_state st_update_alpha_test = { + .name = "st_update_alpha_test", .dirty = { .mesa = (_NEW_COLOR), .st = 0, diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c index 256f13471a..afd21a6141 100644 --- a/src/mesa/state_tracker/st_atom_blend.c +++ b/src/mesa/state_tracker/st_atom_blend.c @@ -227,6 +227,7 @@ update_blend( struct st_context *st ) const struct st_tracked_state st_update_blend = { + .name = "st_update_blend", .dirty = { .mesa = (_NEW_COLOR), /* XXX _NEW_BLEND someday? */ .st = 0, diff --git a/src/mesa/state_tracker/st_atom_clear_color.c b/src/mesa/state_tracker/st_atom_clear_color.c index adf730cd8c..ce3431c5d3 100644 --- a/src/mesa/state_tracker/st_atom_clear_color.c +++ b/src/mesa/state_tracker/st_atom_clear_color.c @@ -54,6 +54,7 @@ update_clear_color_state( struct st_context *st ) const struct st_tracked_state st_update_clear_color = { + .name = "st_update_clear_color", .dirty = { .mesa = _NEW_COLOR, .st = 0, diff --git a/src/mesa/state_tracker/st_atom_clip.c b/src/mesa/state_tracker/st_atom_clip.c index 8ccad637d5..a6f0568660 100644 --- a/src/mesa/state_tracker/st_atom_clip.c +++ b/src/mesa/state_tracker/st_atom_clip.c @@ -62,6 +62,7 @@ static void update_clip( struct st_context *st ) const struct st_tracked_state st_update_clip = { + .name = "st_update_clip", .dirty = { .mesa = (_NEW_TRANSFORM), .st = 0, diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index 7fc51953dc..df05c79e36 100644 --- a/src/mesa/state_tracker/st_atom_depth.c +++ b/src/mesa/state_tracker/st_atom_depth.c @@ -84,6 +84,7 @@ update_depth( struct st_context *st ) const struct st_tracked_state st_update_depth = { + .name = "st_update_depth", .dirty = { .mesa = (_NEW_DEPTH), .st = 0, diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index f054eb8f21..3c4b37e7c5 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -82,6 +82,7 @@ update_framebuffer_state( struct st_context *st ) const struct st_tracked_state st_update_framebuffer = { + .name = "st_update_framebuffer", .dirty = { .mesa = _NEW_BUFFERS, .st = 0, diff --git a/src/mesa/state_tracker/st_atom_fs.c b/src/mesa/state_tracker/st_atom_fs.c index f706761198..767816bf23 100644 --- a/src/mesa/state_tracker/st_atom_fs.c +++ b/src/mesa/state_tracker/st_atom_fs.c @@ -99,6 +99,7 @@ static void update_fs( struct st_context *st ) const struct st_tracked_state st_update_fs = { + .name = "st_update_fs", .dirty = { .mesa = 0, .st = ST_NEW_FRAGMENT_PROGRAM, diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 7d568baf9e..d65565f991 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -152,6 +152,7 @@ update_samplers(struct st_context *st) const struct st_tracked_state st_update_sampler = { + .name = "st_update_sampler", .dirty = { .mesa = _NEW_TEXTURE, .st = 0, diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c index 2bf633828e..59601e91a1 100644 --- a/src/mesa/state_tracker/st_atom_scissor.c +++ b/src/mesa/state_tracker/st_atom_scissor.c @@ -83,6 +83,7 @@ update_scissor( struct st_context *st ) const struct st_tracked_state st_update_scissor = { + .name = "st_update_scissor", .dirty = { .mesa = (_NEW_SCISSOR | _NEW_BUFFERS), .st = 0, diff --git a/src/mesa/state_tracker/st_atom_setup.c b/src/mesa/state_tracker/st_atom_setup.c index 3eac2588df..09d921560d 100644 --- a/src/mesa/state_tracker/st_atom_setup.c +++ b/src/mesa/state_tracker/st_atom_setup.c @@ -211,6 +211,7 @@ static void update_setup_state( struct st_context *st ) } const struct st_tracked_state st_update_setup = { + .name = "st_update_setup", .dirty = { .mesa = (_NEW_LIGHT | _NEW_POLYGON | _NEW_LINE | _NEW_SCISSOR | _NEW_POINT | _NEW_BUFFERS | _NEW_MULTISAMPLE), diff --git a/src/mesa/state_tracker/st_atom_stencil.c b/src/mesa/state_tracker/st_atom_stencil.c index d037335e9e..b8aec0b3b6 100644 --- a/src/mesa/state_tracker/st_atom_stencil.c +++ b/src/mesa/state_tracker/st_atom_stencil.c @@ -127,6 +127,7 @@ update_stencil( struct st_context *st ) const struct st_tracked_state st_update_stencil = { + .name = "st_update_stencil", .dirty = { .mesa = (_NEW_STENCIL), .st = 0, diff --git a/src/mesa/state_tracker/st_atom_stipple.c b/src/mesa/state_tracker/st_atom_stipple.c index dd04d2158c..c91214059a 100644 --- a/src/mesa/state_tracker/st_atom_stipple.c +++ b/src/mesa/state_tracker/st_atom_stipple.c @@ -54,6 +54,7 @@ update_stipple( struct st_context *st ) const struct st_tracked_state st_update_polygon_stipple = { + .name = "st_update_polygon_stipple", .dirty = { .mesa = (_NEW_POLYGONSTIPPLE), .st = 0, diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index bafd38695f..7970bcf2b8 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -72,6 +72,7 @@ update_textures(struct st_context *st) const struct st_tracked_state st_update_texture = { + .name = "st_update_texture", .dirty = { .mesa = _NEW_TEXTURE, .st = 0, diff --git a/src/mesa/state_tracker/st_atom_viewport.c b/src/mesa/state_tracker/st_atom_viewport.c index a70f4c7434..147aa3c51a 100644 --- a/src/mesa/state_tracker/st_atom_viewport.c +++ b/src/mesa/state_tracker/st_atom_viewport.c @@ -86,6 +86,7 @@ update_viewport( struct st_context *st ) const struct st_tracked_state st_update_viewport = { + .name = "st_update_viewport", .dirty = { .mesa = _NEW_BUFFERS | _NEW_VIEWPORT, .st = 0, diff --git a/src/mesa/state_tracker/st_atom_vs.c b/src/mesa/state_tracker/st_atom_vs.c index ab7e2ae4be..a1e6117bde 100644 --- a/src/mesa/state_tracker/st_atom_vs.c +++ b/src/mesa/state_tracker/st_atom_vs.c @@ -116,6 +116,7 @@ static void update_vs( struct st_context *st ) const struct st_tracked_state st_update_vs = { + .name = "st_update_vs", .dirty = { .mesa = 0, .st = ST_NEW_VERTEX_PROGRAM, diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 9e8015d4c7..cb34994d77 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -48,6 +48,7 @@ struct st_state_flags { }; struct st_tracked_state { + const char *name; struct st_state_flags dirty; void (*update)( struct st_context *st ); }; |