On Tue Dec 13 23:44:40 2022 +0000, Francisco Casas wrote:
changed this line in [version 3 of the diff](/wine/vkd3d/-/merge_requests/53/diffs?diff_id=24727&start_sha=ca9b09ece63a38caf890e49c9e2c4cd74b2973ee#9155b9453b4ec8ea0b9b025dfb55c061bd931610_2707_2684)
I hate to bikeshed this more, but I feel like this could be prettier. Partly because elementwise_intrinsic_convert_args() has a bool argument that's not maximally intuitive, but also because now it's not as modular as it could be. How about something like this?
``` void convert_args(ctx, params, type, loc) { for (...) params->args[i] = add_implicit_conversion(...); }
struct hlsl_type *elementwise_intrinsic_get_common_type(ctx, params, loc) { ... }
void elementwise_intrinsic_convert_args(ctx, params, loc) { type = elementwise_intrinsic_get_common_type(ctx, params, loc);
return convert_args(ctx, params, type); }
void elementwise_intrinsic_float_convert_args(ctx, params, loc) { type = elementwise_intrinsic_get_common_type(ctx, params, loc);
type = hlsl_get_numeric_type(ctx, type->type, HLSL_TYPE_FLOAT, type->dimx, type->dimy);
return convert_args(ctx, params, type); } ```
Not dissimilar from the way parts of the current code are organized, in particular intrinsic_float_convert_arg().