diff options
author | Brian Paul <[email protected]> | 2010-12-10 10:02:33 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-12-10 10:02:37 -0700 |
commit | 2a4df8933eaeb0bd0d6e63fee3d23a47c4b3adb7 (patch) | |
tree | ef3f7a3ca89731a0c09d92a1939970e6e053f570 /src/mesa/drivers/common | |
parent | b22c8e8bbcdff7933b0354197c101738c99ea7d0 (diff) |
mesa/meta: fix broken assertion, rename stack depth var
assert(current_save_state < MAX_META_OPS_DEPTH) did not compile.
Rename current_save_state to SaveStackDepth to be more consistent with
the style of the other fields.
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index cbc0512b580..cdb2500f7c2 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -272,8 +272,10 @@ struct gen_mipmap_state */ struct gl_meta_state { - struct save_state Save[MAX_META_OPS_DEPTH]; /**< state saved during meta-ops */ - int current_save_state; + /** Stack of state saved during meta-ops */ + struct save_state Save[MAX_META_OPS_DEPTH]; + /** Save stack depth */ + GLuint SaveStackDepth; struct temp_texture TempTex; @@ -328,9 +330,9 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) struct save_state *save; /* hope MAX_META_OPS_DEPTH is large enough */ - assert(current_save_state < MAX_META_OPS_DEPTH); + assert(ctx->Meta->SaveStackDepth < MAX_META_OPS_DEPTH); - save = &ctx->Meta->Save[ctx->Meta->current_save_state++]; + save = &ctx->Meta->Save[ctx->Meta->SaveStackDepth++]; memset(save, 0, sizeof(*save)); save->SavedState = state; @@ -581,7 +583,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) static void _mesa_meta_end(struct gl_context *ctx) { - struct save_state *save = &ctx->Meta->Save[--ctx->Meta->current_save_state]; + struct save_state *save = &ctx->Meta->Save[--ctx->Meta->SaveStackDepth]; const GLbitfield state = save->SavedState; if (state & META_ALPHA_TEST) { |