aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/main.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-06-26 15:01:24 +0200
committermarha <marha@users.sourceforge.net>2013-06-26 15:01:24 +0200
commit2fe2056807d1304de86deb2b59992d51d9252ad0 (patch)
tree665d730ee19df03e4dfca01371009ec778a343af /mesalib/src/glsl/main.cpp
parentfa791414601df61d20d860299dba80fdb62565df (diff)
downloadvcxsrv-2fe2056807d1304de86deb2b59992d51d9252ad0.tar.gz
vcxsrv-2fe2056807d1304de86deb2b59992d51d9252ad0.tar.bz2
vcxsrv-2fe2056807d1304de86deb2b59992d51d9252ad0.zip
libXext mesa git update 29 June 20013
libXext commit 7378d4bdbd33ed49ed6cfa5c4f73d7527982aab4 mesa commit 9aebad618c0aab527a0b838ce0a79ffa6dd426bb
Diffstat (limited to 'mesalib/src/glsl/main.cpp')
-rw-r--r--mesalib/src/glsl/main.cpp60
1 files changed, 1 insertions, 59 deletions
diff --git a/mesalib/src/glsl/main.cpp b/mesalib/src/glsl/main.cpp
index d7e35bcb3..60bc62827 100644
--- a/mesalib/src/glsl/main.cpp
+++ b/mesalib/src/glsl/main.cpp
@@ -34,7 +34,6 @@
#include "ast.h"
#include "glsl_parser_extras.h"
#include "ir_optimization.h"
-#include "ir_print_visitor.h"
#include "program.h"
#include "loop_analysis.h"
#include "standalone_scaffolding.h"
@@ -144,70 +143,13 @@ compile_shader(struct gl_context *ctx, struct gl_shader *shader)
struct _mesa_glsl_parse_state *state =
new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
- const char *source = shader->Source;
- state->error = glcpp_preprocess(state, &source, &state->info_log,
- state->extensions, ctx) != 0;
-
- if (!state->error) {
- _mesa_glsl_lexer_ctor(state, source);
- _mesa_glsl_parse(state);
- _mesa_glsl_lexer_dtor(state);
- }
-
- if (dump_ast) {
- foreach_list_const(n, &state->translation_unit) {
- ast_node *ast = exec_node_data(ast_node, n, link);
- ast->print();
- }
- printf("\n\n");
- }
-
- shader->ir = new(shader) exec_list;
- if (!state->error && !state->translation_unit.is_empty())
- _mesa_ast_to_hir(shader->ir, state);
-
- /* Print out the unoptimized IR. */
- if (!state->error && dump_hir) {
- validate_ir_tree(shader->ir);
- _mesa_print_ir(shader->ir, state);
- }
-
- /* Optimization passes */
- if (!state->error && !shader->ir->is_empty()) {
- const struct gl_shader_compiler_options *opts =
- &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader->Type)];
- bool progress;
- do {
- progress = do_common_optimization(shader->ir, false, false, 32, opts);
- } while (progress);
-
- validate_ir_tree(shader->ir);
- }
-
+ _mesa_glsl_compile_shader(ctx, shader, dump_ast, dump_hir);
/* Print out the resulting IR */
if (!state->error && dump_lir) {
_mesa_print_ir(shader->ir, state);
}
- shader->symbols = state->symbols;
- shader->CompileStatus = !state->error;
- shader->Version = state->language_version;
- shader->IsES = state->es_shader;
- memcpy(shader->builtins_to_link, state->builtins_to_link,
- sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
- shader->num_builtins_to_link = state->num_builtins_to_link;
-
- if (shader->InfoLog)
- ralloc_free(shader->InfoLog);
-
- shader->InfoLog = state->info_log;
-
- /* Retain any live IR, but trash the rest. */
- reparent_ir(shader->ir, shader);
-
- ralloc_free(state);
-
return;
}