vkd3d-shader/hlsl: Preserve doubles in elementwise_intrinsic_float_convert_args().

This commit is contained in:
Elizabeth Figura 2024-09-04 22:47:05 -05:00 committed by Henri Verbeet
parent ebaf877b62
commit 1176aaad22
Notes: Henri Verbeet 2024-09-12 18:57:51 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1064

View File

@ -3132,14 +3132,12 @@ static bool elementwise_intrinsic_convert_args(struct hlsl_ctx *ctx,
static bool elementwise_intrinsic_float_convert_args(struct hlsl_ctx *ctx, static bool elementwise_intrinsic_float_convert_args(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc) const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
{ {
enum hlsl_base_type base_type;
struct hlsl_type *type; struct hlsl_type *type;
if (!(type = elementwise_intrinsic_get_common_type(ctx, params, loc))) if (!(type = elementwise_intrinsic_get_common_type(ctx, params, loc)))
return false; return false;
if (type_is_integer(type->e.numeric.type))
base_type = type->e.numeric.type == HLSL_TYPE_HALF ? HLSL_TYPE_HALF : HLSL_TYPE_FLOAT; type = hlsl_get_numeric_type(ctx, type->class, HLSL_TYPE_FLOAT, type->dimx, type->dimy);
type = hlsl_get_numeric_type(ctx, type->class, base_type, type->dimx, type->dimy);
return convert_args(ctx, params, type, loc); return convert_args(ctx, params, type, loc);
} }