summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_constant_expression.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-07-07 12:08:23 -0700
committerIan Romanick <[email protected]>2010-07-07 12:41:26 -0700
commitacf88f2769c15c9185abe5bd76a885218f431e58 (patch)
tree70232f04aab419485ed423f7574fd532d7c6f5c5 /src/glsl/ir_constant_expression.cpp
parent388ab9fa6b468d8c162dd4fc645d2f758c49051c (diff)
ir_constant_expression: Fix loop increments.
Diffstat (limited to 'src/glsl/ir_constant_expression.cpp')
-rw-r--r--src/glsl/ir_constant_expression.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 98cbb6cec6c..0fe93adcead 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -149,8 +149,8 @@ ir_constant_visitor::visit(ir_expression *ir)
/* When iterating over a vector or matrix's components, we want to increase
* the loop counter. However, for scalars, we want to stay at 0.
*/
- unsigned c0_inc = op0_scalar ? 1 : 0;
- unsigned c1_inc = op1_scalar ? 1 : 0;
+ unsigned c0_inc = op0_scalar ? 0 : 1;
+ unsigned c1_inc = op1_scalar ? 0 : 1;
unsigned components;
if (op1_scalar || !op[1]) {
components = op[0]->type->components();