diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2019-09-17 09:01:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-17 09:01:45 +0300 |
commit | 2861fd9552c242ef7a98f63312f253e6534c5b34 (patch) | |
tree | 00888add205a2578305d249db9125ef94c0403fd /drivers | |
parent | 3e782c78ae46dd3452e7a61a52c65a69f09b8413 (diff) | |
parent | 1333ea2a2d70d45a295702c2d941e7bfb00bfe94 (diff) |
Implement shader array support for varyings (#30925)
Implement shader array support for varyings
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles2/shader_compiler_gles2.cpp | 5 | ||||
-rw-r--r-- | drivers/gles3/shader_compiler_gles3.cpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 640d45ae65..92bf0e29e2 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -353,6 +353,11 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener varying_code += _typestr(E->get().type); varying_code += " "; varying_code += _mkid(E->key()); + if (E->get().array_size > 0) { + varying_code += "["; + varying_code += itos(E->get().array_size); + varying_code += "]"; + } varying_code += ";\n"; String final_code = varying_code.as_string(); diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index 0121d88f4d..3f21be8dd3 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -467,6 +467,11 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener vcode += _prestr(E->get().precision); vcode += _typestr(E->get().type); vcode += " " + _mkid(E->key()); + if (E->get().array_size > 0) { + vcode += "["; + vcode += itos(E->get().array_size); + vcode += "]"; + } vcode += ";\n"; r_gen_code.vertex_global += interp_mode + "out " + vcode; r_gen_code.fragment_global += interp_mode + "in " + vcode; |