vkd3d-shader/hlsl: Emit half results when operating on half arguments.

This commit is contained in:
Giovanni Mascellani 2024-04-08 12:51:34 +02:00 committed by Alexandre Julliard
parent 280bea9033
commit ecad299ba4
Notes: Alexandre Julliard 2024-04-11 17:05:13 -05:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/769

View File

@ -2682,12 +2682,14 @@ 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;
type = hlsl_get_numeric_type(ctx, type->class, HLSL_TYPE_FLOAT, type->dimx, type->dimy); base_type = type->base_type == HLSL_TYPE_HALF ? HLSL_TYPE_HALF : HLSL_TYPE_FLOAT;
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);
} }