diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-10-04 19:16:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 19:16:19 +0300 |
commit | 87e7f793e4852a6fda6a338b8abd0c5cda38ac25 (patch) | |
tree | 71017b13f1a773124d79027308f3235c6d74105f /tests | |
parent | 073db835692f0bef9e09a98ccd322f1c3c54acd4 (diff) | |
parent | 6873ecaaf9b2c5ad35487b1ff1d4be17770d7aab (diff) |
Merge pull request #49485 from Chaosus/shader_uniform_arrays
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_shader_lang.cpp | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/tests/test_shader_lang.cpp b/tests/test_shader_lang.cpp index 6d58eb63cc..5598852f29 100644 --- a/tests/test_shader_lang.cpp +++ b/tests/test_shader_lang.cpp @@ -125,23 +125,28 @@ static String dump_node_code(SL::Node *p_node, int p_level) { ucode += _prestr(E.value.precision); ucode += _typestr(E.value.type); ucode += " " + String(E.key); + if (E.value.array_size > 0) { + ucode += "["; + ucode += itos(E.value.array_size); + ucode += "]"; + } else { + if (E.value.default_value.size()) { + ucode += " = " + get_constant_text(E.value.type, E.value.default_value); + } - if (E.value.default_value.size()) { - ucode += " = " + get_constant_text(E.value.type, E.value.default_value); - } - - static const char *hint_name[SL::ShaderNode::Uniform::HINT_MAX] = { - "", - "color", - "range", - "albedo", - "normal", - "black", - "white" - }; - - if (E.value.hint) { - ucode += " : " + String(hint_name[E.value.hint]); + static const char *hint_name[SL::ShaderNode::Uniform::HINT_MAX] = { + "", + "color", + "range", + "albedo", + "normal", + "black", + "white" + }; + + if (E.value.hint) { + ucode += " : " + String(hint_name[E.value.hint]); + } } code += ucode + "\n"; |