[Mesa-dev] [PATCH 07/37] glsl: add param to force shader recompile

Timothy Arceri t_arceri at yahoo.com.au
Mon Jan 23 23:12:46 UTC 2017


From: Timothy Arceri <timothy.arceri at collabora.com>

This will be used to skip checking the cache and force a recompile.
---
 src/compiler/glsl/glsl_parser_extras.cpp | 2 +-
 src/compiler/glsl/program.h              | 2 +-
 src/compiler/glsl/standalone.cpp         | 3 ++-
 src/mesa/main/shaderapi.c                | 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index e888090..f75165d 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1910,7 +1910,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);
diff --git a/src/compiler/glsl/program.h b/src/compiler/glsl/program.h
index 8f5a31b..58a7069 100644
--- a/src/compiler/glsl/program.h
+++ b/src/compiler/glsl/program.h
@@ -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" */
diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
index 44f2c0f..e7ba780 100644
--- a/src/compiler/glsl/standalone.cpp
+++ b/src/compiler/glsl/standalone.cpp
@@ -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) {
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c4ea79f..c31c170 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -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);
-- 
2.9.3



More information about the mesa-dev mailing list