varjo icon indicating copy to clipboard operation
varjo copied to clipboard

Array of array in struct

Open Polyrhythm opened this issue 5 years ago • 0 comments

The documentation says that multidimensional arrays are not supported but that arrays of arrays work fine.

I can't figure out how to generate the following glsl:

struct thing
{
    float[100][100][3] data;
};

Any permutation of (vector (vector ...)) or other nested array structure seems not allowed by the define-vari-struct macro. The closest I can seem to get is defining an array of another defined struct:

(v-defstruct some-data ()
  (ints (:int 1000)))

(v-defstruct outer-one ()
  (data (some-data 10)))

But this is much too unwieldy to actually be usable for my intended use case of a simple array of array of floats.

Polyrhythm avatar Sep 17 '20 02:09 Polyrhythm