Add option to reflect buffer blocks & variables separately to uniforms

* Also note the uniform indices of atomic counter buffers
This commit is contained in:
baldurk 2019-01-30 14:18:43 +00:00
parent 4a2aa82236
commit 657acc0c40
15 changed files with 158 additions and 29 deletions

View file

@ -25,6 +25,10 @@ u6: offset -1, type ffffffff, size 0, index -1, binding 46, stages 0, numMembers
cb: offset -1, type ffffffff, size 4, index -1, binding 51, stages 0, numMembers 1
tb: offset -1, type ffffffff, size 4, index -1, binding 17, stages 0, numMembers 1
Buffer variable reflection:
Buffer block reflection:
Pipeline input reflection:
Pipeline output reflection:

View file

@ -15,6 +15,10 @@ Uniform block reflection:
cbuff1: offset -1, type ffffffff, size 24, index -1, binding 2, stages 0, numMembers 3
cbuff2: offset -1, type ffffffff, size 24, index -1, binding 3, stages 0, numMembers 3
Buffer variable reflection:
Buffer block reflection:
Pipeline input reflection:
Pipeline output reflection:

View file

@ -67,6 +67,10 @@ nested: offset -1, type ffffffff, size 32, index -1, binding -1, stages 0, numMe
abl: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0, numMembers 1
abl2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0, numMembers 1
Buffer variable reflection:
Buffer block reflection:
Pipeline input reflection:
attributeFloat: offset 0, type 1406, size 0, index 0, binding -1, stages 0
attributeFloat2: offset 0, type 8b50, size 0, index 0, binding -1, stages 0

View file

@ -226,6 +226,10 @@ u6: offset -1, type ffffffff, size 0, index -1, binding 34, stages 0, numMembers
cb: offset -1, type ffffffff, size 4, index -1, binding 51, stages 0, numMembers 1
tb: offset -1, type ffffffff, size 4, index -1, binding 27, stages 0, numMembers 1
Buffer variable reflection:
Buffer block reflection:
Pipeline input reflection:
Pipeline output reflection:

View file

@ -3,6 +3,10 @@ Uniform reflection:
Uniform block reflection:
Buffer variable reflection:
Buffer block reflection:
Pipeline input reflection:
Pipeline output reflection:

View file

@ -3,6 +3,10 @@ Uniform reflection:
Uniform block reflection:
Buffer variable reflection:
Buffer block reflection:
Pipeline input reflection:
inval: offset 0, type 1406, size 0, index 0, binding -1, stages 0

View file

@ -1,5 +1,13 @@
reflection.options.vert
Uniform reflection:
UBO.verts[0].position[0]: offset 0, type 1406, size 1, index 0, binding -1, stages 1, arrayStride 4, topLevelArrayStride 24
UBO.verts[1].position[0]: offset 24, type 1406, size 1, index 0, binding -1, stages 1, arrayStride 4, topLevelArrayStride 24
UBO.flt[0]: offset 48, type 1406, size 8, index 0, binding -1, stages 1, arrayStride 4, topLevelArrayStride 4
Uniform block reflection:
UBO: offset -1, type ffffffff, size 80, index -1, binding -1, stages 0, numMembers 5
Buffer variable reflection:
t[0].v[0].position[0]: offset 0, type 1406, size 3, index 0, binding -1, stages 1, arrayStride 4, topLevelArrayStride 72
t[0].v[1].position[0]: offset 24, type 1406, size 3, index 0, binding -1, stages 1, arrayStride 4, topLevelArrayStride 72
t[0].v[2].position[0]: offset 48, type 1406, size 3, index 0, binding -1, stages 1, arrayStride 4, topLevelArrayStride 72
@ -10,7 +18,7 @@ MultipleArrays.tri[0].v[0].position[0]: offset 0, type 1406, size 1, index 1, bi
MultipleArrays.vert[0].position[0]: offset 360, type 1406, size 1, index 1, binding -1, stages 1, arrayStride 4, topLevelArrayStride 24
MultipleArrays.f[0]: offset 480, type 1406, size 5, index 1, binding -1, stages 1, arrayStride 4, topLevelArrayStride 4
Uniform block reflection:
Buffer block reflection:
VertexCollection: offset -1, type ffffffff, size 360, index -1, binding -1, stages 0, numMembers 6
MultipleArrays: offset -1, type ffffffff, size 500, index -1, binding -1, stages 0, numMembers 9

View file

@ -146,6 +146,10 @@ buf4: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0, numMembe
nested2: offset -1, type ffffffff, size 208, index -1, binding -1, stages 0, numMembers 15
VertexCollection: offset -1, type ffffffff, size 360, index -1, binding -1, stages 0, numMembers 30
Buffer variable reflection:
Buffer block reflection:
Pipeline input reflection:
attributeFloat: offset 0, type 1406, size 0, index 0, binding -1, stages 0
attributeFloat2: offset 0, type 8b50, size 0, index 0, binding -1, stages 0

View file

@ -19,6 +19,11 @@ buffer MultipleArrays {
float f[5];
} multiarray;
uniform UBO {
VertexInfo verts[2];
float flt[8];
} ubo;
out float outval;
void main()
@ -30,6 +35,8 @@ void main()
f += multiarray.tri[gl_InstanceID].v[0].position[0];
f += multiarray.vert[gl_InstanceID].position[0];
f += multiarray.f[gl_InstanceID];
f += ubo.verts[gl_InstanceID].position[0];
f += ubo.flt[gl_InstanceID];
TriangleInfo tlocal[5] = t;
outval = f;
}

View file

@ -32,11 +32,11 @@ diff -b $BASEDIR/badMacroArgs.frag.out $TARGETDIR/badMacroArgs.frag.out || HASER
echo Running reflection...
$EXE -l -q -C reflection.vert > $TARGETDIR/reflection.vert.out
diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io reflection.options.vert > $TARGETDIR/reflection.options.vert.out
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers reflection.options.vert > $TARGETDIR/reflection.options.vert.out
diff -b $BASEDIR/reflection.options.vert.out $TARGETDIR/reflection.options.vert.out || HASERROR=1
$EXE -l -q -C reflection.frag > $TARGETDIR/reflection.frag.out
diff -b $BASEDIR/reflection.frag.out $TARGETDIR/reflection.frag.out || HASERROR=1
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io reflection.frag > $TARGETDIR/reflection.options.frag.out
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers reflection.frag > $TARGETDIR/reflection.options.frag.out
diff -b $BASEDIR/reflection.options.frag.out $TARGETDIR/reflection.options.frag.out || HASERROR=1
$EXE -D -Od -e flizv -l -q -C -V -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out
diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1