From 046bef235744e891e4a48076e1a3ff9a61a63092 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Aug 2010 20:33:57 -0700 Subject: glsl2: Remove the shader_in/shader_out tracking separate from var->mode. I introduced this for ir_dead_code to distinguish function parameter outvals from varying outputs. Only, since ast_to_hir's current_function is unset when setting up function parameters (they're needed for making the function signature in the first place), all function parameter outvals were marked as shader outputs anyway. This meant that an inlined function's cloned outval was marked as a shader output and couldn't be dead-code eliminated. Instead, since ir_dead_code doesn't even look at function parameters, just use var->mode. The longest Mesa IR coming out of ir_to_mesa for Yo Frankie drops from 725 instructions to 636. --- src/glsl/ir_variable.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/glsl/ir_variable.cpp') diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp index 478cefc5a6c..d9a16d42879 100644 --- a/src/glsl/ir_variable.cpp +++ b/src/glsl/ir_variable.cpp @@ -43,22 +43,12 @@ add_variable(const char *name, enum ir_variable_mode mode, int slot, switch (var->mode) { case ir_var_auto: - var->read_only = true; - break; case ir_var_in: - var->shader_in = true; + case ir_var_uniform: var->read_only = true; break; case ir_var_inout: - var->shader_in = true; - var->shader_out = true; - break; case ir_var_out: - var->shader_out = true; - break; - case ir_var_uniform: - var->shader_in = true; - var->read_only = true; break; default: assert(0); -- cgit v1.2.3