Include array index in reflected uniform names more consistently

* This comes from the resolution of issues 4, 5 & 6 in
  ARB_program_interface_query, stating that uniform buffers should have their
  members expanded out as normal and arrays should have elements added.
* If a buffer block has a large array e.g. [10000] we don't want to iterate over
  every array element. Instead we should only expand out the first [0] element,
  then expand as normal from there.
* The array name should still be appended with [0] to indicate that it's an
  array.
This commit is contained in:
baldurk 2019-01-29 12:12:59 +00:00
parent 6d47785825
commit 15c37f79a9
8 changed files with 124 additions and 3 deletions

View file

@ -0,0 +1,15 @@
reflection.options.vert
Uniform reflection:
t[0].v[0].position: offset 0, type 1406, size 3, index 0, binding -1, stages 1
t[0].v[1].position: offset 24, type 1406, size 3, index 0, binding -1, stages 1
t[0].v[2].position: offset 48, type 1406, size 3, index 0, binding -1, stages 1
t[0].v[0].normal: offset 12, type 1406, size 3, index 0, binding -1, stages 1
t[0].v[1].normal: offset 36, type 1406, size 3, index 0, binding -1, stages 1
t[0].v[2].normal: offset 60, type 1406, size 3, index 0, binding -1, stages 1
Uniform block reflection:
VertexCollection: offset -1, type ffffffff, size 360, index -1, binding -1, stages 0
Vertex attribute reflection:
gl_InstanceID: offset 0, type 1404, size 0, index 0, binding -1, stages 0

View file

@ -84,6 +84,43 @@ nested2.b[2].a: offset 80, type 1406, size 1, index 16, binding -1, stages 1
nested2.b[3].a: offset 96, type 1406, size 1, index 16, binding -1, stages 1
nested2.c.a: offset 112, type 1406, size 1, index 16, binding -1, stages 1
nested2.d.a: offset 144, type 1406, size 1, index 16, binding -1, stages 1
t.v.position: offset 0, type 1406, size 1, index 17, binding -1, stages 1
t.v[0].position: offset 0, type 1406, size 3, index 17, binding -1, stages 1
t.v[1].position: offset 24, type 1406, size 3, index 17, binding -1, stages 1
t.v[2].position: offset 48, type 1406, size 3, index 17, binding -1, stages 1
t.v[0].normal: offset 12, type 1406, size 3, index 17, binding -1, stages 1
t.v[1].normal: offset 36, type 1406, size 3, index 17, binding -1, stages 1
t.v[2].normal: offset 60, type 1406, size 3, index 17, binding -1, stages 1
t[0].v[0].position: offset 0, type 1406, size 3, index 17, binding -1, stages 1
t[0].v[0].normal: offset 12, type 1406, size 3, index 17, binding -1, stages 1
t[0].v[1].position: offset 24, type 1406, size 3, index 17, binding -1, stages 1
t[0].v[1].normal: offset 36, type 1406, size 3, index 17, binding -1, stages 1
t[0].v[2].position: offset 48, type 1406, size 3, index 17, binding -1, stages 1
t[0].v[2].normal: offset 60, type 1406, size 3, index 17, binding -1, stages 1
t[1].v[0].position: offset 72, type 1406, size 3, index 17, binding -1, stages 1
t[1].v[0].normal: offset 84, type 1406, size 3, index 17, binding -1, stages 1
t[1].v[1].position: offset 96, type 1406, size 3, index 17, binding -1, stages 1
t[1].v[1].normal: offset 108, type 1406, size 3, index 17, binding -1, stages 1
t[1].v[2].position: offset 120, type 1406, size 3, index 17, binding -1, stages 1
t[1].v[2].normal: offset 132, type 1406, size 3, index 17, binding -1, stages 1
t[2].v[0].position: offset 144, type 1406, size 3, index 17, binding -1, stages 1
t[2].v[0].normal: offset 156, type 1406, size 3, index 17, binding -1, stages 1
t[2].v[1].position: offset 168, type 1406, size 3, index 17, binding -1, stages 1
t[2].v[1].normal: offset 180, type 1406, size 3, index 17, binding -1, stages 1
t[2].v[2].position: offset 192, type 1406, size 3, index 17, binding -1, stages 1
t[2].v[2].normal: offset 204, type 1406, size 3, index 17, binding -1, stages 1
t[3].v[0].position: offset 216, type 1406, size 3, index 17, binding -1, stages 1
t[3].v[0].normal: offset 228, type 1406, size 3, index 17, binding -1, stages 1
t[3].v[1].position: offset 240, type 1406, size 3, index 17, binding -1, stages 1
t[3].v[1].normal: offset 252, type 1406, size 3, index 17, binding -1, stages 1
t[3].v[2].position: offset 264, type 1406, size 3, index 17, binding -1, stages 1
t[3].v[2].normal: offset 276, type 1406, size 3, index 17, binding -1, stages 1
t[4].v[0].position: offset 288, type 1406, size 3, index 17, binding -1, stages 1
t[4].v[0].normal: offset 300, type 1406, size 3, index 17, binding -1, stages 1
t[4].v[1].position: offset 312, type 1406, size 3, index 17, binding -1, stages 1
t[4].v[1].normal: offset 324, type 1406, size 3, index 17, binding -1, stages 1
t[4].v[2].position: offset 336, type 1406, size 3, index 17, binding -1, stages 1
t[4].v[2].normal: offset 348, type 1406, size 3, index 17, binding -1, stages 1
anonMember1: offset 0, type 8b51, size 1, index 0, binding -1, stages 1
uf1: offset -1, type 1406, size 1, index -1, binding -1, stages 1
uf2: offset -1, type 1406, size 1, index -1, binding -1, stages 1
@ -107,6 +144,7 @@ buf2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
buf3: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
buf4: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
nested2: offset -1, type ffffffff, size 208, index -1, binding -1, stages 0
VertexCollection: offset -1, type ffffffff, size 360, index -1, binding -1, stages 0
Vertex attribute reflection:
attributeFloat: offset 0, type 1406, size 0, index 0, binding -1, stages 0