Dereference any array type before expanding root-level SSBO members

If we don't do this then we get reflection output like so:

ArrayedBind[0].a.a: offset 0, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].a.b: offset 4, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b.a: offset 4, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b.b: offset 8, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b: offset 4, type 1406, size 1, index 4, binding -1, stages 1

When the outer reflection loop that calls blowUpActiveAggregate incorrectly iterates over the struct members.
This commit is contained in:
baldurk 2019-08-26 12:41:53 +01:00
parent d6a5cc6580
commit 1f1e5369ce
3 changed files with 18 additions and 4 deletions

View file

@ -20,6 +20,11 @@ buffer MultipleArrays {
float f[5];
} multiarray;
buffer ArrayedBind {
float a;
float b;
} buffers[3];
uniform UBO {
VertexInfo verts[2];
float flt[8];
@ -52,6 +57,7 @@ void main()
f += ubo.flt[gl_InstanceID];
f += ubo.uniform_multi[0][0][0];
f += uniform_multi[gl_InstanceID][gl_InstanceID][gl_InstanceID];
f += buffers[gl_InstanceID].b;
TriangleInfo tlocal[5] = t;
outval.val = f;
outarr[2] = f;