opened
syoyo
username_0
When compiling generated cpp code from this shader https://github.com/KhronosGroup/SPIRV-Cross/issues/17

Two compilation error happens.

```
ao.cc:147:43: error: 'basis' declared as array of references of type 'vec3 &' (aka 'tvec3<float, highp> &')
        inline void orthoBasis(vec3& basis[3], const vec3& n)
                                          ^
ao.cc:224:18: error: array initializer must be an initializer list
            vec3 basis[3] = param;
                 ^
```

In the former case, removing '&' will solve the issue.
In the latter case, we may need to emit c++ code like this:

```
vec3 basis[3];
basis[0] = param[0];
basis[1] = param[1];
basis[2] = param[2];
```
[CPP] Invalid syntax is generated for array variable.
issue
created
HansKristian-ARM
username_1
I think the ideal way to deal with this is to use std::array since it has closer semantics to GLSL arrays for purposes of copying objects and so on.
comment
created
HansKristian-ARM
username_1
ao.comp shader compiles now in this PR: https://github.com/KhronosGroup/SPIRV-Cross/pull/20.
Please verify that it works on your end and I'll merge.
comment
created
syoyo
username_0
Thanks! I have confirmed #20 works well on my side.
comment
created
HansKristian-ARM
username_1
Merged.
comment
closed
HansKristian-ARM
username_1
issue