Browse Source

[Vulkan] Implement shader array support for varyings

Remake of #32175
Yuri Roubinsky 6 năm trước cách đây
mục cha
commit
bfa834a78a
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      servers/visual/rasterizer_rd/shader_compiler_rd.cpp

+ 5 - 0
servers/visual/rasterizer_rd/shader_compiler_rd.cpp

@@ -461,6 +461,11 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge
 				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 += "layout(location=" + itos(index) + ") " + interp_mode + "out " + vcode;
 				r_gen_code.fragment_global += "layout(location=" + itos(index) + ") " + interp_mode + "in " + vcode;