glsl: Don't dead-code eliminate a uniform initializer.

Partial fix for glsl-uniform-initializer-5.
This commit is contained in:
Eric Anholt
2010-08-24 15:30:42 -07:00
parent 37f0654fa5
commit 7de4d8fe11
+8
View File
@@ -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;