mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
ir_to_mesa: Don't generate swizzles for record derefs of non-scalar/vectors
This is the same as what the array dereference handler does. Fixes piglit test glsl-link-struct-array (bugzilla #31648). NOTE: This is a candidate for the 7.9 and 7.10 branches.
This commit is contained in:
parent
cb2b547a47
commit
2d577ee730
1 changed files with 7 additions and 1 deletions
|
|
@ -1569,7 +1569,13 @@ ir_to_mesa_visitor::visit(ir_dereference_record *ir)
|
|||
break;
|
||||
offset += type_size(struct_type->fields.structure[i].type);
|
||||
}
|
||||
this->result.swizzle = swizzle_for_size(ir->type->vector_elements);
|
||||
|
||||
/* If the type is smaller than a vec4, replicate the last channel out. */
|
||||
if (ir->type->is_scalar() || ir->type->is_vector())
|
||||
this->result.swizzle = swizzle_for_size(ir->type->vector_elements);
|
||||
else
|
||||
this->result.swizzle = SWIZZLE_NOOP;
|
||||
|
||||
this->result.index += offset;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue