1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Implement custom function overloading in shading language

This commit is contained in:
Yuri Rubinsky
2024-05-27 22:16:54 +03:00
committed by Chaosus
parent db66bd35af
commit 1c86feee0a
3 changed files with 259 additions and 143 deletions

View File

@@ -427,6 +427,7 @@ public:
struct VariableNode : public Node {
DataType datatype_cache = TYPE_VOID;
StringName name;
StringName rname;
StringName struct_name;
bool is_const = false;
bool is_local = false;
@@ -604,6 +605,7 @@ public:
struct Function {
StringName name;
StringName rname;
FunctionNode *function = nullptr;
HashSet<StringName> uses_function;
bool callable;
@@ -729,6 +731,7 @@ public:
};
StringName name;
StringName rname;
DataType return_type = TYPE_VOID;
StringName return_struct_name;
DataPrecision return_precision = PRECISION_DEFAULT;
@@ -944,6 +947,7 @@ private:
Vector<FilePosition> include_positions;
HashSet<String> include_markers_handled;
HashMap<StringName, int> function_overload_count;
// Additional function information (eg. call hierarchy). No need to expose it to compiler.
struct CallInfo {