vkd3d-shader/hlsl: Use get_overloaded_func() only to find exact matches.

The parameters are specified as a list of hlsl_ir_var structures, but
add_call() is given an array of hlsl_ir_node pointers. Even if the former were
changed to use an array instead, it's not worth trying to reuse the same
function for both cases.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura
2021-09-01 17:20:53 -05:00
committed by Alexandre Julliard
parent 32ba154eb2
commit f86e4d6b92

View File

@ -790,24 +790,16 @@ static struct hlsl_reg_reservation parse_reg_reservation(const char *reg_string)
return reservation; return reservation;
} }
static const struct hlsl_ir_function_decl *get_overloaded_func(struct rb_tree *funcs, char *name, static const struct hlsl_ir_function_decl *get_func_decl(struct rb_tree *funcs, char *name, struct list *params)
struct list *params, bool exact_signature)
{ {
struct hlsl_ir_function *func; struct hlsl_ir_function *func;
struct rb_entry *entry; struct rb_entry *entry;
entry = rb_get(funcs, name); if ((entry = rb_get(funcs, name)))
if (entry)
{ {
func = RB_ENTRY_VALUE(entry, struct hlsl_ir_function, entry); func = RB_ENTRY_VALUE(entry, struct hlsl_ir_function, entry);
entry = rb_get(&func->overloads, params); if ((entry = rb_get(&func->overloads, params)))
if (!entry)
{
if (!exact_signature)
FIXME("No exact match, search for a compatible overloaded function (if any).\n");
return NULL;
}
return RB_ENTRY_VALUE(entry, struct hlsl_ir_function_decl, entry); return RB_ENTRY_VALUE(entry, struct hlsl_ir_function_decl, entry);
} }
return NULL; return NULL;
@ -1813,7 +1805,7 @@ hlsl_prog:
{ {
const struct hlsl_ir_function_decl *decl; const struct hlsl_ir_function_decl *decl;
decl = get_overloaded_func(&ctx->functions, $2.name, $2.decl->parameters, true); decl = get_func_decl(&ctx->functions, $2.name, $2.decl->parameters);
if (decl && !decl->func->intrinsic) if (decl && !decl->func->intrinsic)
{ {
if (decl->body && $2.decl->body) if (decl->body && $2.decl->body)