From: Kenneth Graunke Date: Tue, 29 Jun 2010 18:31:04 +0000 (-0700) Subject: glsl2: Preprocessed source doesn't need to live past compile time. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=629198b96a8f471c48932d6af56184b6c33b5fe5;p=mesa.git glsl2: Preprocessed source doesn't need to live past compile time. --- diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index 8b2eeaa13ab..fa63853b476 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -129,11 +129,8 @@ compile_shader(struct gl_shader *shader) state->Const.MaxDrawBuffers = 2; - /* Create a new context for the preprocessor output. Ultimately, this - * should probably be the parser context, but there isn't one yet. - */ const char *source = shader->Source; - state->error = preprocess(shader, &source, &state->info_log); + state->error = preprocess(state, &source, &state->info_log); if (!state->error) { _mesa_glsl_lexer_ctor(state, source); diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp index c3de3aae05b..4eac810679f 100644 --- a/src/mesa/shader/ir_to_mesa.cpp +++ b/src/mesa/shader/ir_to_mesa.cpp @@ -1679,11 +1679,8 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader) state->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers; - /* Create a new context for the preprocessor output. Ultimately, this - * should probably be the parser context, but there isn't one yet. - */ const char *source = shader->Source; - state->error = preprocess(shader, &source, &state->info_log); + state->error = preprocess(state, &source, &state->info_log); if (!state->error) { _mesa_glsl_lexer_ctor(state, source);