From: Eric Anholt Date: Tue, 24 Aug 2010 22:30:42 +0000 (-0700) Subject: glsl: Don't dead-code eliminate a uniform initializer. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7de4d8fe11c53e59265b8a4252ab9940ffcc9929;p=mesa.git glsl: Don't dead-code eliminate a uniform initializer. Partial fix for glsl-uniform-initializer-5. --- diff --git a/src/glsl/ir_dead_code.cpp b/src/glsl/ir_dead_code.cpp index 7ff580d5380..5cf5e99add4 100644 --- a/src/glsl/ir_dead_code.cpp +++ b/src/glsl/ir_dead_code.cpp @@ -92,6 +92,14 @@ do_dead_code(exec_list *instructions) /* If there are no assignments or references to the variable left, * then we can remove its declaration. */ + + /* uniform initializers are precious, and could get used by another + * stage. + */ + if (entry->var->mode == ir_var_uniform && + entry->var->constant_value) + continue; + entry->var->remove(); progress = true;