summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-04 12:57:58 -0700
committerEric Anholt <[email protected]>2010-08-04 12:57:58 -0700
commit952d0f88e1741d51b641be75f7c5a6565e245a69 (patch)
tree6f5db4785da76588eb645a21c54c635a88a67a96 /src
parent8273bd46877e2ea2b8a02b87a11c68102d07e1f2 (diff)
glsl2: Skip talloc_parent in constant_expression of non-constant arrays.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ir_constant_expression.cpp2
-rw-r--r--src/mesa/program/ir_to_mesa.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 677353e5424..0a924246da1 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -690,11 +690,11 @@ ir_dereference_variable::constant_expression_value()
ir_constant *
ir_dereference_array::constant_expression_value()
{
- void *ctx = talloc_parent(this);
ir_constant *array = this->array->constant_expression_value();
ir_constant *idx = this->array_index->constant_expression_value();
if ((array != NULL) && (idx != NULL)) {
+ void *ctx = talloc_parent(this);
if (array->type->is_matrix()) {
/* Array access of a matrix results in a vector.
*/
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index ba0934c446d..dcf8c497c66 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2622,7 +2622,7 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
progress = do_constant_folding(shader->ir) || progress;
progress = do_algebraic(shader->ir) || progress;
progress = do_if_return(shader->ir) || progress;
- if (ctx->Shader.EmitNoIfs)
+ if (1 || ctx->Shader.EmitNoIfs)
progress = do_if_to_cond_assign(shader->ir) || progress;
progress = do_vec_index_to_swizzle(shader->ir) || progress;