summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-05-02 16:27:46 -0700
committerEric Anholt <[email protected]>2011-08-05 10:37:15 -0700
commit4c7e215c7bb09f827df630cbfc80e87869351f18 (patch)
tree755abb42a23198deddb692d48c2117029d3a2957 /src/mesa/program/ir_to_mesa.cpp
parentfbc2fcf685d22ec9bc9465e1f731529979497eaa (diff)
ir_to_mesa: Replace open-coded swizzle_for_size()
Diffstat (limited to 'src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 9b615b68a23..1ef609fe15d 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -641,8 +641,6 @@ src_reg
ir_to_mesa_visitor::get_temp(const glsl_type *type)
{
src_reg src;
- int swizzle[4];
- int i;
src.file = PROGRAM_TEMPORARY;
src.index = next_temp;
@@ -652,12 +650,7 @@ ir_to_mesa_visitor::get_temp(const glsl_type *type)
if (type->is_array() || type->is_record()) {
src.swizzle = SWIZZLE_NOOP;
} else {
- for (i = 0; i < type->vector_elements; i++)
- swizzle[i] = i;
- for (; i < 4; i++)
- swizzle[i] = type->vector_elements - 1;
- src.swizzle = MAKE_SWIZZLE4(swizzle[0], swizzle[1],
- swizzle[2], swizzle[3]);
+ src.swizzle = swizzle_for_size(type->vector_elements);
}
src.negate = 0;