projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b10bb52
)
glsl2: Don't consider uniform initializers as constant expressions.
author
Eric Anholt
<eric@anholt.net>
Mon, 2 Aug 2010 22:31:28 +0000
(15:31 -0700)
committer
Eric Anholt
<eric@anholt.net>
Tue, 3 Aug 2010 00:47:35 +0000
(17:47 -0700)
We were happily optimizing away the body of
glsl-uniform-initializer-* to never use the uniforms.
src/glsl/ir_constant_expression.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ir_constant_expression.cpp
b/src/glsl/ir_constant_expression.cpp
index f02cd3127eeeb4baf39c63600d45167117e09147..915d362b15243ff49d91001116fc2dfd574df483 100644
(file)
--- a/
src/glsl/ir_constant_expression.cpp
+++ b/
src/glsl/ir_constant_expression.cpp
@@
-674,6
+674,12
@@
ir_dereference_variable::constant_expression_value()
if (!var)
return NULL;
+ /* The constant_value of a uniform variable is its initializer,
+ * not the lifetime constant value of the uniform.
+ */
+ if (var->mode == ir_var_uniform)
+ return NULL;
+
return var->constant_value ? var->constant_value->clone(NULL) : NULL;
}