Merge pull request #95274 from Chaosus/shader_forbind_const_func_decl

Forbid function declaration with a const qualifier in shaders
This commit is contained in:
Rémi Verschelde 2024-08-25 20:18:10 +02:00
commit cbe1d6f7af
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -9755,6 +9755,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];