Fix few places in shaders where const passing still incorrect

This commit is contained in:
Yuri Roubinsky 2020-06-25 10:40:19 +03:00
parent 4dede9e644
commit b6ca9536f2

View file

@ -3560,7 +3560,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
error = true;
} else if (n->type == Node::TYPE_ARRAY) {
ArrayNode *an = static_cast<ArrayNode *>(n);
if (an->call_expression != nullptr) {
if (an->call_expression != nullptr || an->is_const) {
error = true;
}
} else if (n->type == Node::TYPE_VARIABLE) {
@ -3569,7 +3569,9 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
error = true;
} else {
StringName varname = vn->name;
if (shader->uniforms.has(varname)) {
if (shader->constants.has(varname)) {
error = true;
} else if (shader->uniforms.has(varname)) {
error = true;
} else {
if (p_builtin_types.has(varname)) {