diff options
author | Brian <[email protected]> | 2008-03-27 15:48:54 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2008-03-27 15:48:54 -0600 |
commit | 7b91d875401e039635718d1bc1e96d37ec66777c (patch) | |
tree | de449dbcd9e0d78c8e888a702e2f245b45c56e5d /src/mesa/shader/arbprogparse.c | |
parent | 6f8286163c79a8187c2912a9b673a6f11f4f60c6 (diff) |
Fix state.texgen parsing error (bug 12313).
Replace *(*inst++) with *(*inst)++ in a few places.
Cherry-picked from master.
Diffstat (limited to 'src/mesa/shader/arbprogparse.c')
-rw-r--r-- | src/mesa/shader/arbprogparse.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 6648ed7b719..83fc1951424 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1227,10 +1227,10 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, state_tokens[1] = coord; /* EYE or OBJECT */ - type = *(*inst++); + type = *(*inst)++; /* 0 - s, 1 - t, 2 - r, 3 - q */ - coord = *(*inst++); + coord = *(*inst)++; if (type == TEX_GEN_EYE) { switch (coord) { @@ -1246,6 +1246,9 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, case COMPONENT_W: state_tokens[2] = STATE_TEXGEN_EYE_Q; break; + default: + _mesa_problem(ctx, "bad texgen component in " + "parse_state_single_item()"); } } else { @@ -1262,6 +1265,9 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, case COMPONENT_W: state_tokens[2] = STATE_TEXGEN_OBJECT_Q; break; + default: + _mesa_problem(ctx, "bad texgen component in " + "parse_state_single_item()"); } } } @@ -1284,7 +1290,7 @@ parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, break; case STATE_POINT: - switch (*(*inst++)) { + switch (*(*inst)++) { case POINT_SIZE: state_tokens[0] = STATE_POINT_SIZE; break; @@ -2455,8 +2461,9 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst, Program->Position = parse_position (inst); if (!found) { - program_error(ctx, Program->Position, - "2: Undefined variable"); /* src->name */ + char s[1000]; + sprintf(s, "Undefined variable: %s", src->name); + program_error(ctx, Program->Position, s); return 1; } |