Initialize the shader info log
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 19 Jun 2010 08:39:14 +0000 (01:39 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 19 Jun 2010 18:36:15 +0000 (11:36 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
main.cpp

index f6e5e95fcbe84ce367fa80dfd8dd8815b15d15e3..a613334d5cd20349de49f1363361d27caa908997 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -118,6 +118,7 @@ compile_shader(struct glsl_shader *shader)
    state.scanner = NULL;
    state.translation_unit.make_empty();
    state.symbols = new glsl_symbol_table;
+   state.info_log = talloc_strdup(shader, "");
    state.error = false;
    state.temp_index = 0;
    state.loop_or_switch_nesting = NULL;
@@ -164,6 +165,12 @@ compile_shader(struct glsl_shader *shader)
 
    shader->symbols = state.symbols;
    shader->CompileStatus = !state.error;
+
+   if (shader->InfoLog)
+      talloc_free(shader->InfoLog);
+
+   shader->InfoLog = state.info_log;
+
    return;
 }