diff options
author | Ian Romanick <[email protected]> | 2016-09-15 11:37:32 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-11-10 14:30:49 -0800 |
commit | e9acae8486fff4f9fe6aa111c6fa5652ebb9f8bf (patch) | |
tree | 9b1f70a7d3670c0334e6f2e25bf5d08444c235b2 /src/compiler/glsl/standalone.cpp | |
parent | 191d9a5195c0d4871e264a73781dbf8b4368fcb7 (diff) |
glsl/standalone: Add the ability to generate ir_builder code
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/compiler/glsl/standalone.cpp')
-rw-r--r-- | src/compiler/glsl/standalone.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp index 73c7408a96b..6aecd22eb6f 100644 --- a/src/compiler/glsl/standalone.cpp +++ b/src/compiler/glsl/standalone.cpp @@ -40,6 +40,7 @@ #include "util/set.h" #include "linker.h" #include "glsl_parser_extras.h" +#include "ir_builder_print_visitor.h" #include "opt_add_neg_to_sub.h" class dead_variable_visitor : public ir_hierarchical_visitor { @@ -550,6 +551,17 @@ standalone_compile_shader(const struct standalone_options *_options, shader->Program = rzalloc(shader, gl_program); init_gl_program(shader->Program, shader->Stage); } + + if (options->dump_builder) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + struct gl_linked_shader *shader = whole_program->_LinkedShaders[i]; + + if (!shader) + continue; + + _mesa_print_builder_for_ir(stdout, shader->ir); + } + } } return whole_program; |