mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
ir_to_mesa: Replace open-coded swizzle_for_size()
This commit is contained in:
parent
fbc2fcf685
commit
4c7e215c7b
1 changed files with 1 additions and 8 deletions
|
|
@ -641,8 +641,6 @@ src_reg
|
||||||
ir_to_mesa_visitor::get_temp(const glsl_type *type)
|
ir_to_mesa_visitor::get_temp(const glsl_type *type)
|
||||||
{
|
{
|
||||||
src_reg src;
|
src_reg src;
|
||||||
int swizzle[4];
|
|
||||||
int i;
|
|
||||||
|
|
||||||
src.file = PROGRAM_TEMPORARY;
|
src.file = PROGRAM_TEMPORARY;
|
||||||
src.index = next_temp;
|
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()) {
|
if (type->is_array() || type->is_record()) {
|
||||||
src.swizzle = SWIZZLE_NOOP;
|
src.swizzle = SWIZZLE_NOOP;
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < type->vector_elements; i++)
|
src.swizzle = swizzle_for_size(type->vector_elements);
|
||||||
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.negate = 0;
|
src.negate = 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue