Allow passing non-variable constant to const function param in shaders

This commit is contained in:
Yuri Roubinsky 2021-11-19 11:25:23 +03:00
parent 0deccc550c
commit f4c0e90fd9
3 changed files with 26 additions and 17 deletions

View file

@ -4920,7 +4920,9 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
bool error = false;
Node *n = func->arguments[argidx];
if (n->type == Node::TYPE_CONSTANT || n->type == Node::TYPE_OPERATOR) {
error = true;
if (!call_function->arguments[i].is_const) {
error = true;
}
} else if (n->type == Node::TYPE_ARRAY) {
ArrayNode *an = static_cast<ArrayNode *>(n);
if (an->call_expression != nullptr || an->is_const) {