projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37f0654
)
glsl: Don't dead-code eliminate a uniform initializer.
author
Eric Anholt
<eric@anholt.net>
Tue, 24 Aug 2010 22:30:42 +0000
(15:30 -0700)
committer
Eric Anholt
<eric@anholt.net>
Tue, 24 Aug 2010 23:37:02 +0000
(16:37 -0700)
Partial fix for glsl-uniform-initializer-5.
src/glsl/ir_dead_code.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ir_dead_code.cpp
b/src/glsl/ir_dead_code.cpp
index 7ff580d538057a10ae434a4f069066b066933b07..5cf5e99add42e85a24298de5d4b6764c78b1e61d 100644
(file)
--- 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;