mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Get rid of the "intrinsic" field of struct hlsl_ir_function.
We have a different system of generating intrinsics, which makes it easier to deal with "polymorphic" arithmetic functions. Defining and storing intrinsics as hlsl_ir_function_decls would also require more space in memory (and more optimization passes to get rid of the parameter variables), and doesn't really save us any effort in terms of source code.
This commit is contained in:
parent
9cc7aaf5a1
commit
61f0d6d151
Notes:
Alexandre Julliard
2023-01-13 22:23:38 +01:00
Approved-by: Francisco Casas (@fcasas) 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/47
@ -2194,17 +2194,6 @@ void hlsl_add_function(struct hlsl_ctx *ctx, char *name, struct hlsl_ir_function
|
||||
if (func_entry)
|
||||
{
|
||||
func = RB_ENTRY_VALUE(func_entry, struct hlsl_ir_function, entry);
|
||||
if (intrinsic != func->intrinsic)
|
||||
{
|
||||
if (intrinsic)
|
||||
{
|
||||
ERR("Redeclaring a user defined function as an intrinsic.\n");
|
||||
return;
|
||||
}
|
||||
func->intrinsic = intrinsic;
|
||||
rb_destroy(&func->overloads, free_function_decl_rb, NULL);
|
||||
rb_init(&func->overloads, compare_function_decl_rb);
|
||||
}
|
||||
decl->func = func;
|
||||
if ((old_entry = rb_get(&func->overloads, decl->parameters)))
|
||||
{
|
||||
@ -2239,7 +2228,6 @@ void hlsl_add_function(struct hlsl_ctx *ctx, char *name, struct hlsl_ir_function
|
||||
rb_init(&func->overloads, compare_function_decl_rb);
|
||||
decl->func = func;
|
||||
rb_put(&func->overloads, decl->parameters, &decl->entry);
|
||||
func->intrinsic = intrinsic;
|
||||
rb_put(&ctx->functions, func->name, &func->entry);
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,6 @@ struct hlsl_ir_function
|
||||
struct rb_entry entry;
|
||||
const char *name;
|
||||
struct rb_tree overloads;
|
||||
bool intrinsic;
|
||||
};
|
||||
|
||||
struct hlsl_ir_function_decl
|
||||
|
@ -3594,7 +3594,7 @@ hlsl_prog:
|
||||
const struct hlsl_ir_function_decl *decl;
|
||||
|
||||
decl = get_func_decl(&ctx->functions, $2.name, $2.decl->parameters);
|
||||
if (decl && !decl->func->intrinsic)
|
||||
if (decl)
|
||||
{
|
||||
if (decl->has_body && $2.decl->has_body)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user