Forbid function declaration with a const qualifier in shaders

This commit is contained in:
Chaosus 2024-08-08 11:23:27 +03:00
parent 9221294653
commit dc6f90acd8

View File

@ -9640,6 +9640,11 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f
break;
}
if (is_constant) {
_set_error(vformat(RTR("'%s' qualifier cannot be used with a function return type."), "const"));
return ERR_PARSE_ERROR;
}
FunctionInfo builtins;
if (p_functions.has(name)) {
builtins = p_functions[name];