diff options
Diffstat (limited to 'src/mesa/shader/arbfragparse.c')
-rw-r--r-- | src/mesa/shader/arbfragparse.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mesa/shader/arbfragparse.c b/src/mesa/shader/arbfragparse.c index d876946a251..7192156463e 100644 --- a/src/mesa/shader/arbfragparse.c +++ b/src/mesa/shader/arbfragparse.c @@ -192,9 +192,19 @@ _mesa_parse_arb_fragment_program(GLcontext * ctx, GLenum target, retval = _mesa_parse_arb_program(ctx, str, len, &ap); + /* XXX: Parse error. Cleanup things and return */ + if (retval) + { + program->Instructions = (struct fp_instruction *) _mesa_malloc ( + sizeof(struct fp_instruction) ); + program->Instructions[0].Opcode = FP_OPCODE_END; + return; + } + /* copy the relvant contents of the arb_program struct into the * fragment_program struct */ + program->Base.String = ap.Base.String; program->Base.NumInstructions = ap.Base.NumInstructions; program->Base.NumTemporaries = ap.Base.NumTemporaries; program->Base.NumParameters = ap.Base.NumParameters; @@ -211,15 +221,6 @@ _mesa_parse_arb_fragment_program(GLcontext * ctx, GLenum target, program->Parameters = ap.Parameters; program->FogOption = ap.FogOption; - /* XXX: Parse error. Cleanup things and return */ - if (retval) - { - program->Instructions = (struct fp_instruction *) _mesa_malloc ( - sizeof(struct fp_instruction) ); - program->Instructions[0].Opcode = FP_OPCODE_END; - return; - } - /* XXX: Eh.. we parsed something that wasn't a fragment program. doh! */ /* this wont happen any more */ /* |