diff options
Diffstat (limited to 'src/compiler/glsl/glsl_parser_extras.cpp')
-rw-r--r-- | src/compiler/glsl/glsl_parser_extras.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index ca74b559dc..eb12efff8a 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -2005,18 +2005,9 @@ void _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, bool dump_ast, bool dump_hir, bool force_recompile) { - struct _mesa_glsl_parse_state *state = - new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader); const char *source = force_recompile && shader->FallbackSource ? shader->FallbackSource : shader->Source; - if (ctx->Const.GenerateTemporaryNames) - (void) p_atomic_cmpxchg(&ir_variable::temporaries_allocate_names, - false, true); - - state->error = glcpp_preprocess(state, &source, &state->info_log, - add_builtin_defines, state, ctx); - if (!force_recompile) { if (ctx->Cache) { char buf[41]; @@ -2050,6 +2041,16 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, } } + struct _mesa_glsl_parse_state *state = + new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader); + + if (ctx->Const.GenerateTemporaryNames) + (void) p_atomic_cmpxchg(&ir_variable::temporaries_allocate_names, + false, true); + + state->error = glcpp_preprocess(state, &source, &state->info_log, + add_builtin_defines, state, ctx); + if (!state->error) { _mesa_glsl_lexer_ctor(state, source); _mesa_glsl_parse(state); |