X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fshader%2Farbprogparse.c;h=6373529e4e86c4665e58e38089dd1fcd5a3f22b6;hb=df20c3943ab4e20055f8e731f112aa9fd8d66068;hp=05ee4f563eb7a2fe8b40bb8c1ab76e03a882da98;hpb=ba002eb1965ccdb09d7c3657d32e22e71ed4096a;p=mesa.git diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 05ee4f563eb..6373529e4e8 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -54,11 +54,8 @@ having three separate program parameter arrays. #include "main/glheader.h" #include "main/imports.h" #include "main/context.h" -#include "main/macros.h" #include "main/mtypes.h" -#include "shader/grammar/grammar_mesa.h" #include "arbprogparse.h" -#include "program.h" #include "programopt.h" #include "prog_parameter.h" #include "prog_statevars.h" @@ -87,6 +84,9 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, return; } + if (program->Base.String != NULL) + free(program->Base.String); + /* Copy the relevant contents of the arb_program struct into the * fragment_program struct. */ @@ -121,6 +121,8 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, case OPTION_FOG_LINEAR: program->FogOption = GL_LINEAR; break; default: program->FogOption = GL_NONE; break; } + program->OriginUpperLeft = state.option.OriginUpperLeft; + program->PixelCenterInteger = state.option.PixelCenterInteger; program->UsesKill = state.fragment.UsesKill; @@ -128,7 +130,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, program->Base.InputsRead |= FRAG_BIT_FOGC; if (program->Base.Instructions) - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); program->Base.Instructions = prog.Instructions; if (program->Base.Parameters) @@ -146,7 +148,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, } #if DEBUG_FP - _mesa_printf("____________Fragment program %u ________\n", program->Base.Id); + printf("____________Fragment program %u ________\n", program->Base.Id); _mesa_print_program(&program->Base); #endif } @@ -178,6 +180,9 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, return; } + if (program->Base.String != NULL) + free(program->Base.String); + /* Copy the relevant contents of the arb_program struct into the * vertex_program struct. */ @@ -198,7 +203,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, ? GL_TRUE : GL_FALSE; if (program->Base.Instructions) - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); program->Base.Instructions = prog.Instructions; if (program->Base.Parameters) @@ -206,7 +211,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, program->Base.Parameters = prog.Parameters; #if DEBUG_VP - _mesa_printf("____________Vertex program %u __________\n", program->Base.Id); + printf("____________Vertex program %u __________\n", program->Base.Id); _mesa_print_program(&program->Base); #endif }