diff options
author | Bryan Cain <[email protected]> | 2011-08-05 14:37:33 -0500 |
---|---|---|
committer | Bryan Cain <[email protected]> | 2011-08-05 14:39:18 -0500 |
commit | 5164244df02f33d6ad9e0a286f4b6d6af2dfbc75 (patch) | |
tree | 3cfed540d6529804e6619db531021567810b15db /src/mesa/state_tracker | |
parent | b44648c9186d403abaeeeb3190d6759f951a49e4 (diff) |
glsl_to_tgsi: replace open-coded swizzle_for_size()
This is a port of commit 4c7e215c7bb to glsl_to_tgsi.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index e10243add8a..d7a1ba80e1d 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -949,8 +949,6 @@ st_src_reg glsl_to_tgsi_visitor::get_temp(const glsl_type *type) { st_src_reg src; - int swizzle[4]; - int i; src.type = glsl_version >= 130 ? type->base_type : GLSL_TYPE_FLOAT; src.file = PROGRAM_TEMPORARY; @@ -961,12 +959,7 @@ glsl_to_tgsi_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; |