baldurk | 15c37f7 | 2019-01-29 12:12:59 +0000 | [diff] [blame] | 1 | #version 440 core
|
| 2 |
|
| 3 | struct VertexInfo {
|
| 4 | float position[3];
|
| 5 | float normal[3];
|
| 6 | };
|
| 7 |
|
| 8 | struct TriangleInfo {
|
| 9 | VertexInfo v[3];
|
| 10 | };
|
| 11 |
|
| 12 | buffer VertexCollection {
|
| 13 | TriangleInfo t[5];
|
| 14 | };
|
| 15 |
|
baldurk | 4a2aa82 | 2019-01-29 19:10:56 +0000 | [diff] [blame^] | 16 | buffer MultipleArrays {
|
| 17 | TriangleInfo tri[5];
|
| 18 | VertexInfo vert[5];
|
| 19 | float f[5];
|
| 20 | } multiarray;
|
| 21 |
|
baldurk | 0af5e3e | 2019-01-29 16:04:44 +0000 | [diff] [blame] | 22 | out float outval;
|
| 23 |
|
baldurk | 15c37f7 | 2019-01-29 12:12:59 +0000 | [diff] [blame] | 24 | void main()
|
| 25 | {
|
| 26 | float f;
|
| 27 | f += t[0].v[0].position[0];
|
| 28 | f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID];
|
| 29 | f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID];
|
baldurk | 4a2aa82 | 2019-01-29 19:10:56 +0000 | [diff] [blame^] | 30 | f += multiarray.tri[gl_InstanceID].v[0].position[0];
|
| 31 | f += multiarray.vert[gl_InstanceID].position[0];
|
| 32 | f += multiarray.f[gl_InstanceID];
|
baldurk | 15c37f7 | 2019-01-29 12:12:59 +0000 | [diff] [blame] | 33 | TriangleInfo tlocal[5] = t;
|
baldurk | 0af5e3e | 2019-01-29 16:04:44 +0000 | [diff] [blame] | 34 | outval = f;
|
baldurk | 15c37f7 | 2019-01-29 12:12:59 +0000 | [diff] [blame] | 35 | }
|