Added support for constants in shader case and array size declaration

This commit is contained in:
Yuri Roubinsky 2020-12-16 20:13:56 +03:00
parent 9e49dbda2a
commit fe4c8e387b
3 changed files with 119 additions and 28 deletions

View file

@ -930,7 +930,11 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge
}
declaration += _mkid(adnode->declarations[i].name);
declaration += "[";
declaration += itos(adnode->declarations[i].size);
if (adnode->size_expression != nullptr) {
declaration += _dump_node_code(adnode->size_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
} else {
declaration += itos(adnode->declarations[i].size);
}
declaration += "]";
int sz = adnode->declarations[i].initializer.size();
if (sz > 0) {