glsl: add param to force shader recompile
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 22 Nov 2016 05:56:21 +0000 (16:56 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 9 Feb 2017 01:22:56 +0000 (12:22 +1100)
This will be used to skip checking the cache and force a recompile.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/program.h
src/compiler/glsl/standalone.cpp
src/mesa/main/shaderapi.c

index 59787bd..6fe1dd9 100644 (file)
@@ -1911,7 +1911,7 @@ do_late_parsing_checks(struct _mesa_glsl_parse_state *state)
 
 void
 _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
-                          bool dump_ast, bool dump_hir)
+                          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);
index 8f5a31b..58a7069 100644 (file)
@@ -33,7 +33,7 @@ struct gl_shader_program;
 
 extern void
 _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
-                         bool dump_ast, bool dump_hir);
+                         bool dump_ast, bool dump_hir, bool force_recompile);
 
 #ifdef __cplusplus
 } /* extern "C" */
index 7a2d3d2..521964b 100644 (file)
@@ -381,7 +381,8 @@ 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);
 
-   _mesa_glsl_compile_shader(ctx, shader, options->dump_ast, options->dump_hir);
+   _mesa_glsl_compile_shader(ctx, shader, options->dump_ast,
+                             options->dump_hir, true);
 
    /* Print out the resulting IR */
    if (!state->error && options->dump_lir) {
index 4406aaa..3de0a7e 100644 (file)
@@ -1036,7 +1036,7 @@ _mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh)
       /* this call will set the shader->CompileStatus field to indicate if
        * compilation was successful.
        */
-      _mesa_glsl_compile_shader(ctx, sh, false, false);
+      _mesa_glsl_compile_shader(ctx, sh, false, false, false);
 
       if (ctx->_Shader->Flags & GLSL_LOG) {
          _mesa_write_shader_to_file(sh);