mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #35266 from Chaosus/shader_fix_arrays
Added missing form of array constructor in shaders
This commit is contained in:
commit
82482a7db8
@ -3964,6 +3964,14 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
|
||||
|
||||
tk = _get_token();
|
||||
if (tk.type == TK_BRACKET_OPEN) {
|
||||
TkPos pos2 = _get_tkpos();
|
||||
tk = _get_token();
|
||||
if (tk.type == TK_BRACKET_CLOSE) {
|
||||
array_size2 = var.array_size;
|
||||
tk = _get_token();
|
||||
} else {
|
||||
_set_tkpos(pos2);
|
||||
|
||||
Node *n = _parse_and_reduce_expression(p_block, p_builtin_types);
|
||||
if (!n || n->type != Node::TYPE_CONSTANT || n->get_datatype() != TYPE_INT) {
|
||||
_set_error("Expected single integer constant > 0");
|
||||
@ -3984,13 +3992,14 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
|
||||
|
||||
tk = _get_token();
|
||||
if (tk.type != TK_BRACKET_CLOSE) {
|
||||
_set_error("Expected ']");
|
||||
_set_error("Expected ']'");
|
||||
return ERR_PARSE_ERROR;
|
||||
} else {
|
||||
tk = _get_token();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_set_error("Expected '[");
|
||||
_set_error("Expected '['");
|
||||
return ERR_PARSE_ERROR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user