title: C++ Syntax for variable length array to be sent to GLSL in Vulkan
body: <p>So I've read about Storage Buffers being able to contain a variable length array at end:</p>
  
  <blockquote>
    <p>SSBOs can have variable storage, up to whatever buffer range was bound for that particular buffer; UBOs must have a specific, fixed storage size. This means that you can have an array of arbitrary length in an SSBO (at the end, rather). The actual size of the array, based on the range of the buffer bound, can be queried at runtime in the shader using the length function on the unbounded array variable</p>
  </blockquote>
  
  <p>I know how to pass a storage buffer as a struct with simple fields like this:</p>
  
  <pre><code>struct GPUStorage {
     glm::vec3 mesh_pos;
     glm::vec4 mesh_rot;
  };
  </code></pre>
  
  <p>And know how to pass a storage buffer as an array of structs by shoving them into a <code>vector</code> and do <code>memcpy</code> on <code>vector.data()</code> with copy length as <code>sizeof(GPUStorage) * vector.size()</code>.</p>
  
  <p>But I haven't found anywhere how does the C++ syntax look for a struct containing a variable length array ?</p>
  
  <pre><code>struct GPUMesh {
      glm::vec3 mesh_pos;
      glm::vec4 mesh_rot;
  };
  
  struct GPUStorage {
      ???  // variable length array of GPUMesh 
  };
  </code></pre>