summaryrefslogtreecommitdiffstats
path: root/ir_reader.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-04-21 23:15:08 -0700
committerIan Romanick <[email protected]>2010-04-28 18:14:54 -0700
commit951632253f4f37ce058e2466bca5b96bb43ccfbf (patch)
treeee37b9da5b41bfdad5029494c726317b5ce87edd /ir_reader.cpp
parent8df335d7f9ab8b3699c312f2b4b42be2e8eeba27 (diff)
ir_reader: Fix for swizzles.
Diffstat (limited to 'ir_reader.cpp')
-rw-r--r--ir_reader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ir_reader.cpp b/ir_reader.cpp
index 44fbb33a5d4..976af2ab128 100644
--- a/ir_reader.cpp
+++ b/ir_reader.cpp
@@ -645,8 +645,7 @@ read_swizzle(_mesa_glsl_parse_state *st, s_list *list)
return NULL;
}
- unsigned num_components = strlen(swiz->value());
- if (num_components > 4) {
+ if (strlen(swiz->value()) > 4) {
ir_read_error(st, list, "expected a valid swizzle; found %s",
swiz->value());
return NULL;
@@ -663,7 +662,8 @@ read_swizzle(_mesa_glsl_parse_state *st, s_list *list)
if (rvalue == NULL)
return NULL;
- return ir_swizzle::create(rvalue, swiz->value(), num_components);
+ return ir_swizzle::create(rvalue, swiz->value(),
+ rvalue->type->vector_elements);
}
static ir_constant *