glsl: call set_shader_inout_layout() earlier
authorTimothy Arceri <timothy.arceri@collabora.com>
Sat, 14 Nov 2015 03:05:30 +0000 (14:05 +1100)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Fri, 20 Nov 2015 20:27:49 +0000 (07:27 +1100)
This will allow us to add error checking to this function
in a later patch, if we don't move it the error messages
will go missing.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/glsl/glsl_parser_extras.cpp

index c54dcfdab7bc8197fea326497f27b30d14637521..13a3c941e6aebeef4a58316a6bb2509994fcc7e3 100644 (file)
@@ -1799,6 +1799,9 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
    if (shader->InfoLog)
       ralloc_free(shader->InfoLog);
 
+   if (!state->error)
+      set_shader_inout_layout(shader, state);
+
    shader->symbols = new(shader->ir) glsl_symbol_table;
    shader->CompileStatus = !state->error;
    shader->InfoLog = state->info_log;
@@ -1806,9 +1809,6 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
    shader->IsES = state->es_shader;
    shader->uses_builtin_functions = state->uses_builtin_functions;
 
-   if (!state->error)
-      set_shader_inout_layout(shader, state);
-
    /* Retain any live IR, but trash the rest. */
    reparent_ir(shader->ir, shader->ir);