diff options
Diffstat (limited to 'src/mesa/shader/arbvertparse.c')
-rw-r--r-- | src/mesa/shader/arbvertparse.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mesa/shader/arbvertparse.c b/src/mesa/shader/arbvertparse.c index 5f011106ef5..cfad87b5b1b 100644 --- a/src/mesa/shader/arbvertparse.c +++ b/src/mesa/shader/arbvertparse.c @@ -181,9 +181,19 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, retval = _mesa_parse_arb_program(ctx, str, len, &ap); + /* Parse error. Allocate a dummy program and return */ + if (retval) + { + program->Instructions = (struct vp_instruction *) _mesa_malloc ( + sizeof(struct vp_instruction) ); + program->Instructions[0].Opcode = VP_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; @@ -195,15 +205,6 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, program->OutputsWritten = ap.OutputsWritten; program->Parameters = ap.Parameters; - /* Parse error. Allocate a dummy program and return */ - if (retval) - { - program->Instructions = (struct vp_instruction *) _mesa_malloc ( - sizeof(struct vp_instruction) ); - program->Instructions[0].Opcode = VP_OPCODE_END; - return; - } - /* Eh.. we parsed something that wasn't a vertex program. doh! */ /* this wont happen any more */ /* |