mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Do not prioritize an exact match when looking up functions.
Native does not always do this. For example, functions whose parameters are float and float1 always result in an "ambiguous function call" error. This does not fix any tests, because the relevant tests previously (incorrectly) succeeded, and now fail with: E5017: Aborting due to not yet implemented feature: Prioritize between multiple compatible function overloads. when they should simply fail.
This commit is contained in:
parent
514d179b70
commit
fef118555c
Notes:
Alexandre Julliard
2023-11-10 00:10:07 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/454
@ -2325,21 +2325,6 @@ static struct hlsl_block *initialize_vars(struct hlsl_ctx *ctx, struct list *var
|
||||
return initializers;
|
||||
}
|
||||
|
||||
static bool func_is_exact_match(const struct hlsl_ir_function_decl *decl, const struct parse_initializer *args)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (decl->parameters.count != args->args_count)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < decl->parameters.count; ++i)
|
||||
{
|
||||
if (!hlsl_types_are_equal(decl->parameters.vars[i]->data_type, args->args[i]->data_type))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool func_is_compatible_match(struct hlsl_ctx *ctx,
|
||||
const struct hlsl_ir_function_decl *decl, const struct parse_initializer *args)
|
||||
{
|
||||
@ -2370,9 +2355,6 @@ static struct hlsl_ir_function_decl *find_function_call(struct hlsl_ctx *ctx,
|
||||
|
||||
LIST_FOR_EACH_ENTRY(decl, &func->overloads, struct hlsl_ir_function_decl, entry)
|
||||
{
|
||||
if (func_is_exact_match(decl, args))
|
||||
return decl;
|
||||
|
||||
if (func_is_compatible_match(ctx, decl, args))
|
||||
{
|
||||
if (compatible_match)
|
||||
|
Loading…
Reference in New Issue
Block a user