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.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/glsl/ir.cpp') diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index c3bade8d54..dd059e470d 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -902,7 +902,6 @@ ir_swizzle::variable_referenced() ir_variable::ir_variable(const struct glsl_type *type, const char *name, ir_variable_mode mode) : max_array_access(0), read_only(false), centroid(false), invariant(false), - shader_in(false), shader_out(false), mode(mode), interpolation(ir_var_smooth), array_lvalue(false) { this->ir_type = ir_type_variable; @@ -922,9 +921,6 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name, const char * ir_variable::interpolation_string() const { - if (!this->shader_in && !this->shader_out) - return ""; - switch (this->interpolation) { case ir_var_smooth: return "smooth"; case ir_var_flat: return "flat"; -- cgit v1.2.3