i965: add and fix fallthrough comments
[mesa.git] / src / mesa / program / arbprogparse.c
index 07bdf1603efac8f59cbdf4def8e70a9981af6560..42f84944a1efe23b8cba865a18ba2034c01a7794 100644 (file)
@@ -52,7 +52,7 @@ having three separate program parameter arrays.
 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+
 #include "main/context.h"
 #include "main/mtypes.h"
 #include "arbprogparse.h"
@@ -78,6 +78,7 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
    memset(&prog, 0, sizeof(prog));
    memset(&state, 0, sizeof(state));
    state.prog = &prog;
+   state.mem_ctx = program;
 
    if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len,
                                &state)) {
@@ -116,8 +117,8 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
          program->SamplersUsed |= (1 << i);
    }
    program->ShadowSamplers = prog.ShadowSamplers;
-   program->OriginUpperLeft = state.option.OriginUpperLeft;
-   program->PixelCenterInteger = state.option.PixelCenterInteger;
+   program->info.fs.origin_upper_left = state.option.OriginUpperLeft;
+   program->info.fs.pixel_center_integer = state.option.PixelCenterInteger;
 
    program->info.fs.uses_discard = state.fragment.UsesKill;
 
@@ -174,17 +175,15 @@ _mesa_parse_arb_vertex_program(struct gl_context *ctx, GLenum target,
 
    if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len,
                                &state)) {
-      ralloc_free(prog.arb.Instructions);
-      ralloc_free(prog.String);
       _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramString(bad program)");
       return;
    }
 
-   _mesa_optimize_program(ctx, &prog, program);
+   _mesa_optimize_program(&prog, program);
 
    ralloc_free(program->String);
 
-   /* Copy the relevant contents of the arb_program struct into the 
+   /* Copy the relevant contents of the arb_program struct into the
     * vertex_program struct.
     */
    program->String          = prog.String;