From: Zebediah Figura zfigura@codeweavers.com
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. --- libs/vkd3d-shader/hlsl.c | 12 ------------ libs/vkd3d-shader/hlsl.h | 1 - libs/vkd3d-shader/hlsl.y | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index f44f3a03..b7f222cc 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -2191,17 +2191,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))) { @@ -2236,7 +2225,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); }
diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 14835c7c..3c62342b 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -276,7 +276,6 @@ struct hlsl_ir_function struct rb_entry entry; const char *name; struct rb_tree overloads; - bool intrinsic; };
struct hlsl_ir_function_decl diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 86d9b384..75e54aec 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -3324,7 +3324,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) {