You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Prevent redefinition of main functions in shader
This commit is contained in:
@@ -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;
|
ShaderNode::Function function;
|
||||||
|
|
||||||
function.callable = !p_functions.has(name);
|
function.callable = !p_functions.has(name);
|
||||||
|
|||||||
Reference in New Issue
Block a user