diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-13 14:04:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 14:04:00 +0100 |
commit | 99b46a2615905fa4b6af0cb78da3c8b1950d8b90 (patch) | |
tree | 58c7d4fce6a5d2b847c1f48fc8ebe611b63eb6be | |
parent | ae06511bf6f9d1b32d66cb24dc648c3b94d3851b (diff) | |
parent | b0356bcb72a4647699c8e9c7ab1370f563ef81bc (diff) |
Merge pull request #56750 from Chaosus/shader_fix_main_function_decl
-rw-r--r-- | servers/rendering/shader_language.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index adbcdedacc..c4d9ba4260 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -8774,6 +8774,13 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct } } + for (int i = 0; i < shader->functions.size(); i++) { + if (!shader->functions[i].callable && shader->functions[i].name == name) { + _set_error("Redefinition of '" + String(name) + "'"); + return ERR_PARSE_ERROR; + } + } + ShaderNode::Function function; function.callable = !p_functions.has(name); |