On Mon Aug 28 23:51:53 2023 +0000, Francisco Casas wrote:
Do we need to manually define the internal function with a new name for each overload? I see that this is currently the case because hlsl_compile_internal_function() uses hlsl_get_func_decl() internally. But, since we are compiling the function once for each call to the intrinsic anyways, what if we change hlsl_compile_internal_function() slightly so that it only expects the return type, the clean name of the function (e.g. just "smoothstep") and the body without the signature? This so that only hlsl_compile_internal_function() has to care about the real internal name of the compiled function, maybe using an internal counter to give them a unique name e.g. `<internal-42>smoothstep`. That way we don't have to care about overloads.
I think I would also be in favor of generating a new name each time an internal function is parsed.