glsl2: Preprocessed source doesn't need to live past compile time.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 29 Jun 2010 18:31:04 +0000 (11:31 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 30 Jun 2010 20:52:24 +0000 (13:52 -0700)
src/glsl/main.cpp
src/mesa/shader/ir_to_mesa.cpp

index 8b2eeaa13ab8e9068e98cf7e4ee4b230c10d86e5..fa63853b47687e755937d9597e467c910fc19989 100644 (file)
@@ -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);
index c3de3aae05b9c4ae8196774fd299766e3a9fc45c..4eac810679ffbda05ac3634c7e1954bfff1395c0 100644 (file)
@@ -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);