--- src/glsl/ir.h | 2 ++ src/glsl/ir_clone.cpp | 2 ++ src/glsl/opt_dead_code.cpp | 2 ++ 3 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 2e899f3..cf57b3e 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -394,6 +394,8 @@ public: * slot has not been assigned, the value will be -1. */ int location; + struct UBOVariableInfo* UBO; + bool removable_uniform; /** * Built-in state that backs this uniform diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp index f075736..f4848fb 100644 --- a/src/glsl/ir_clone.cpp +++ b/src/glsl/ir_clone.cpp @@ -53,6 +53,8 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const var->origin_upper_left = this->origin_upper_left; var->pixel_center_integer = this->pixel_center_integer; var->explicit_location = this->explicit_location; + var->UBO = this->UBO; + var->removable_uniform = this->removable_uniform; var->num_state_slots = this->num_state_slots; if (this->state_slots) { diff --git a/src/glsl/opt_dead_code.cpp b/src/glsl/opt_dead_code.cpp index cb500d2..ee57231 100644 --- a/src/glsl/opt_dead_code.cpp +++ b/src/glsl/opt_dead_code.cpp @@ -99,6 +99,8 @@ do_dead_code(exec_list *instructions) if (entry->var->mode == ir_var_uniform && entry->var->constant_value) continue; + if(entry->var->mode == ir_var_uniform && !(entry->var->removable_uniform) ) + continue; entry->var->remove(); progress = true; -- 1.7.6.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev