vkd3d-shader/hlsl: Prefer overload candidates without component count widening.

This commit is contained in:
Henri Verbeet
2024-12-10 22:56:44 +01:00
parent 64bb4150f0
commit c4f69f4d3d
Notes: Henri Verbeet 2024-12-16 17:26:51 +01:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1313
2 changed files with 5 additions and 3 deletions

View File

@@ -3088,7 +3088,9 @@ static int function_parameter_compare(const struct hlsl_ir_var *candidate,
if ((ret = (a.width > r.width) - (a.width > c.width)))
return ret;
return 0;
/* Prefer candidates without component count widening. E.g. given a float
* argument, float is a better match than float2. */
return (a.count < r.count) - (a.count < c.count);
}
static int function_compare(const struct hlsl_ir_function_decl *candidate,