diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-18 14:49:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-18 14:49:39 +0200 |
commit | 3a8389156c5f90c4a13d270ba7b680dde76402cf (patch) | |
tree | 1df6ceccc593c509d86d96a847653ef81ca75531 /servers/rendering | |
parent | 22b225395cda3b6f27f6017fa860a1b863f09f9f (diff) | |
parent | f68d3f67b53980d3f712ddee419e6ec8f62b6871 (diff) |
Merge pull request #52818 from Chaosus/fix_shader_crash
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/shader_language.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 4218214fda..89537f8b7c 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -2384,6 +2384,10 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, const FunctionI failed_builtin = true; bool fail = false; for (int i = 0; i < argcount; i++) { + if (p_func->arguments[i + 1]->type == Node::TYPE_ARRAY && !static_cast<const ArrayNode *>(p_func->arguments[i + 1])->is_indexed()) { + fail = true; + break; + } if (get_scalar_type(args[i]) == args[i] && p_func->arguments[i + 1]->type == Node::TYPE_CONSTANT && convert_constant(static_cast<ConstantNode *>(p_func->arguments[i + 1]), builtin_func_defs[idx].args[i])) { //all good, but needs implicit conversion later } else if (args[i] != builtin_func_defs[idx].args[i]) { @@ -2560,6 +2564,11 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, const FunctionI } else { arg_name = get_datatype_name(args[i]); } + if (args3[i] > 0) { + arg_name += "["; + arg_name += itos(args3[i]); + arg_name += "]"; + } err += arg_name; } err += ")"; |