mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
glsl2: Keep the same number of components in implicit conversions.
Fixes piglit test glsl-implicit-conversion-01.
This commit is contained in:
parent
22971e922a
commit
506199b852
1 changed files with 6 additions and 0 deletions
|
|
@ -109,6 +109,12 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
|
|||
if (!to->is_float() || !from->type->is_numeric())
|
||||
return false;
|
||||
|
||||
/* Convert to a floating point type with the same number of components
|
||||
* as the original type - i.e. int to float, not int to vec4.
|
||||
*/
|
||||
to = glsl_type::get_instance(GLSL_TYPE_FLOAT, from->type->vector_elements,
|
||||
from->type->matrix_columns);
|
||||
|
||||
switch (from->type->base_type) {
|
||||
case GLSL_TYPE_INT:
|
||||
from = new(ctx) ir_expression(ir_unop_i2f, to, from, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue