From 7a2c6a8c0e48f04e30dae753a3b3023f27ad3f39 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sat, 22 Feb 2020 11:09:06 +0300 Subject: [PATCH] Enables passing out built-in parameter from parent function in shaders --- servers/visual/shader_language.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 8cd0dc7937e..e32e7c093aa 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2198,6 +2198,14 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p valid = true; break; } + if (b->parent_function) { + for (int i = 0; i < b->parent_function->arguments.size(); i++) { + if (b->parent_function->arguments[i].name == var_name) { + valid = true; + break; + } + } + } b = b->parent_block; }