Add Shared/Std140 SSBO process & top-level array elements related (#2231)

* Add Shared/Std140 SSBO process & top-level array elements related
process

1.Add process options for shared/std140 ssbo, following ubo process
2.Add IO Variables reflection option, would keep all input/output
variables in reflection
3.Add Top-level related process, fix top-level array size issues,
following spec
4.Split ssbo/ubo reflection options, merge blowup expanding all into
function blowupActiveAggregate to allow other functions keep same entry
format.

Add options in StandAlone and test symbols.

1. Add options in StandAlone for std140/shared ubo/ssbo and all io variables reflection.
2. Add test for ssbo. When EShReflectionSharedStd140SSBO turns on, generated symbol and output would be different, to remind the difference. Defaultly disabled and nothing would change, nor blocking normal test.

* Add options in runtest script, refresh test results.

Add options in StandAlone:
--reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo

refresh test results.
Now the index, size of unsized array are expected.
This commit is contained in:
Chow
2020-06-04 15:47:18 +08:00
committed by GitHub
parent ff6dcca575
commit 8111268575
17 changed files with 222 additions and 161 deletions

View File

@@ -34,6 +34,21 @@ void atomicOpPass()
origu = atomicCompSwap(atomu, 10u, 8u);
}
layout(binding = 2,std430) buffer ssboElem01
{
int member01;
int memberArr01[2];
int memberUnsizedArr01[];
} ssboStd430Arr[2];
// if turns on EShReflectionSharedStd140SSBO, SPIR-V would be different
layout(binding = 3,shared) buffer ssboElem02
{
int member02;
int memberArr02[2];
int memberUnsizedArr02[];
} ssboSharedArr[2];
#extension GL_ARB_shader_storage_buffer_object : disable
layout(binding = 1,std430) buffer BufferFail // Error std430 and "buffer" block support disabled

View File

@@ -4,8 +4,8 @@ ERROR: 0:11: 'layout qualifier' : can only apply depth layout to gl_FragDepth
ERROR: 0:12: 'gl_FragDepth' : cannot redeclare after use
ERROR: 0:14: 'atomic_uint' : array must be explicitly sized
ERROR: 0:17: 'imageSize' : required extension not requested: GL_ARB_shader_image_size
ERROR: 0:39: 'std430' : not supported for this version or the enabled extensions
ERROR: 0:39: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:54: 'std430' : not supported for this version or the enabled extensions
ERROR: 0:54: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 7 compilation errors. No code generated.
@@ -82,6 +82,8 @@ ERROR: node is still EOpNull!
0:? 'iv2dim' ( global 2-component vector of int)
0:? 'iv2dim1' ( global 2-component vector of int)
0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer int atomi, layout( column_major std430 offset=4) buffer uint atomu})
0:? 'ssboStd430Arr' (layout( binding=2 column_major std430) buffer 2-element array of block{layout( column_major std430 offset=0) buffer int member01, layout( column_major std430 offset=4) buffer 2-element array of int memberArr01, layout( column_major std430 offset=12) buffer unsized 1-element array of int memberUnsizedArr01})
0:? 'ssboSharedArr' (layout( binding=3 column_major shared) buffer 2-element array of block{layout( column_major shared) buffer int member02, layout( column_major shared) buffer 2-element array of int memberArr02, layout( column_major shared) buffer unsized 1-element array of int memberUnsizedArr02})
Linked fragment stage:
@@ -117,4 +119,6 @@ ERROR: node is still EOpNull!
0:? 'iv2dim' ( global 2-component vector of int)
0:? 'iv2dim1' ( global 2-component vector of int)
0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer int atomi, layout( column_major std430 offset=4) buffer uint atomu})
0:? 'ssboStd430Arr' (layout( binding=2 column_major std430) buffer 2-element array of block{layout( column_major std430 offset=0) buffer int member01, layout( column_major std430 offset=4) buffer 2-element array of int memberArr01, layout( column_major std430 offset=12) buffer unsized 1-element array of int memberUnsizedArr01})
0:? 'ssboSharedArr' (layout( binding=3 column_major shared) buffer 2-element array of block{layout( column_major shared) buffer int member02, layout( column_major shared) buffer 2-element array of int memberArr02, layout( column_major shared) buffer unsized 1-element array of int memberUnsizedArr02})

View File

@@ -18,12 +18,12 @@ cb1: offset 0, type 1404, size 1, index 4, binding -1, stages 16
tb1: offset 0, type 1404, size 1, index 5, binding -1, stages 16
Uniform block reflection:
t4: offset -1, type ffffffff, size 0, index -1, binding 14, stages 16, numMembers 1
t5: offset -1, type ffffffff, size 0, index -1, binding 15, stages 16, numMembers 1
u5: offset -1, type ffffffff, size 0, index -1, binding 45, stages 16, numMembers 1
u6: offset -1, type ffffffff, size 0, index -1, binding 46, stages 16, numMembers 1
cb: offset -1, type ffffffff, size 4, index -1, binding 51, stages 16, numMembers 1
tb: offset -1, type ffffffff, size 4, index -1, binding 17, stages 16, numMembers 1
t4: offset -1, type ffffffff, size 16, index 0, binding 14, stages 16, numMembers 1
t5: offset -1, type ffffffff, size 4, index 1, binding 15, stages 16, numMembers 1
u5: offset -1, type ffffffff, size 4, index 2, binding 45, stages 16, numMembers 1
u6: offset -1, type ffffffff, size 4, index 3, binding 46, stages 16, numMembers 1
cb: offset -1, type ffffffff, size 4, index 4, binding 51, stages 16, numMembers 1
tb: offset -1, type ffffffff, size 4, index 5, binding 17, stages 16, numMembers 1
Buffer variable reflection:

View File

@@ -12,8 +12,8 @@ c2_b: offset 16, type 1404, size 1, index 1, binding -1, stages 16
c2_c: offset 20, type 1406, size 1, index 1, binding -1, stages 16
Uniform block reflection:
cbuff1: offset -1, type ffffffff, size 24, index -1, binding 2, stages 16, numMembers 3
cbuff2: offset -1, type ffffffff, size 24, index -1, binding 3, stages 16, numMembers 3
cbuff1: offset -1, type ffffffff, size 24, index 0, binding 2, stages 16, numMembers 3
cbuff2: offset -1, type ffffffff, size 24, index 1, binding 3, stages 16, numMembers 3
Buffer variable reflection:

View File

@@ -63,12 +63,12 @@ foo1: offset 0, type 1406, size 1, index 4, binding -1, stages 1
foo2: offset 0, type 1406, size 1, index 5, binding -1, stages 1
Uniform block reflection:
nameless: offset -1, type ffffffff, size 496, index -1, binding -1, stages 1, numMembers 9
$Global: offset -1, type ffffffff, size 3088, index -1, binding -1, stages 1, numMembers 106
c_nameless: offset -1, type ffffffff, size 96, index -1, binding -1, stages 1, numMembers 5
nested: offset -1, type ffffffff, size 32, index -1, binding -1, stages 1, numMembers 4
abl: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
abl2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
nameless: offset -1, type ffffffff, size 496, index 0, binding -1, stages 1, numMembers 9
$Global: offset -1, type ffffffff, size 3088, index 1, binding -1, stages 1, numMembers 106
c_nameless: offset -1, type ffffffff, size 96, index 2, binding -1, stages 1, numMembers 5
nested: offset -1, type ffffffff, size 32, index 3, binding -1, stages 1, numMembers 4
abl: offset -1, type ffffffff, size 4, index 4, binding -1, stages 1, numMembers 1
abl2: offset -1, type ffffffff, size 4, index 5, binding -1, stages 1, numMembers 1
Buffer variable reflection:

View File

@@ -219,12 +219,12 @@ tb1: offset 0, type 1404, size 1, index 5, binding -1, stages 16
ts6: offset -1, type 8b5f, size 1, index -1, binding 71, stages 16
Uniform block reflection:
t4: offset -1, type ffffffff, size 0, index -1, binding 21, stages 16, numMembers 1
t5: offset -1, type ffffffff, size 0, index -1, binding 22, stages 16, numMembers 1
u5: offset -1, type ffffffff, size 0, index -1, binding 44, stages 16, numMembers 1
u6: offset -1, type ffffffff, size 0, index -1, binding 34, stages 16, numMembers 1
cb: offset -1, type ffffffff, size 4, index -1, binding 51, stages 16, numMembers 1
tb: offset -1, type ffffffff, size 4, index -1, binding 27, stages 16, numMembers 1
t4: offset -1, type ffffffff, size 16, index 0, binding 21, stages 16, numMembers 1
t5: offset -1, type ffffffff, size 4, index 1, binding 22, stages 16, numMembers 1
u5: offset -1, type ffffffff, size 4, index 2, binding 44, stages 16, numMembers 1
u6: offset -1, type ffffffff, size 4, index 3, binding 34, stages 16, numMembers 1
cb: offset -1, type ffffffff, size 4, index 4, binding 51, stages 16, numMembers 1
tb: offset -1, type ffffffff, size 4, index 5, binding 27, stages 16, numMembers 1
Buffer variable reflection:

View File

@@ -7,7 +7,7 @@ ubo_block.vsonly_uniform: offset 8, type 1406, size 1, index 0, binding -1, stag
ubo_block.fsonly_uniform: offset 12, type 1406, size 1, index 0, binding -1, stages 16
Uniform block reflection:
ubo_block: offset -1, type ffffffff, size 16, index -1, binding 0, stages 17, numMembers 4
ubo_block: offset -1, type ffffffff, size 16, index 0, binding 0, stages 17, numMembers 4
Buffer variable reflection:
@@ -15,6 +15,8 @@ Buffer block reflection:
Pipeline input reflection:
vertin: offset 0, type 1406, size 1, index 0, binding -1, stages 1
gl_VertexID: offset 0, type 1404, size 1, index 0, binding -1, stages 1
gl_InstanceID: offset 0, type 1404, size 1, index 0, binding -1, stages 1
Pipeline output reflection:
fragout: offset 0, type 1406, size 1, index 0, binding -1, stages 16

View File

@@ -6,7 +6,7 @@ ubo_block.vsonly_uniform: offset 8, type 1406, size 1, index 0, binding -1, stag
ubo_block.fsonly_uniform: offset 12, type 1406, size 1, index 0, binding -1, stages 16
Uniform block reflection:
ubo_block: offset -1, type ffffffff, size 16, index -1, binding 0, stages 17, numMembers 4
ubo_block: offset -1, type ffffffff, size 16, index 0, binding 0, stages 17, numMembers 4
Buffer variable reflection:

View File

@@ -32,7 +32,7 @@ uniform_multi[3][1][0]: offset -1, type 1406, size 2, index -1, binding -1, stag
uniform_multi[3][2][0]: offset -1, type 1406, size 2, index -1, binding -1, stages 1, arrayStride 4, topLevelArrayStride 24
Uniform block reflection:
UBO: offset -1, type ffffffff, size 192, index -1, binding -1, stages 1, numMembers 7
UBO: offset -1, type ffffffff, size 192, index 0, binding -1, stages 1, numMembers 7
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
@@ -51,18 +51,19 @@ MultipleArrays.tri[0].v[2].normal[0]: offset 60, type 1406, size 3, index 1, bin
MultipleArrays.vert[0].position[0]: offset 360, type 1406, size 3, index 1, binding -1, stages 1, arrayStride 4, topLevelArrayStride 24
MultipleArrays.vert[0].normal[0]: offset 372, type 1406, size 3, index 1, binding -1, stages 0, arrayStride 4, topLevelArrayStride 24
MultipleArrays.f[0]: offset 480, type 1406, size 5, index 1, binding -1, stages 1, arrayStride 4, topLevelArrayStride 4
ArrayedBind[0].a: offset 0, 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
ArrayedBind.a: offset 0, type 1406, size 1, index 2, binding -1, stages 0
ArrayedBind.b: offset 4, type 1406, size 1, index 2, binding -1, stages 1
Buffer block reflection:
VertexCollection: offset -1, type ffffffff, size 400, index -1, binding -1, stages 1, numMembers 7
MultipleArrays: offset -1, type ffffffff, size 500, index -1, binding -1, stages 1, numMembers 9
ArrayedBind[0]: offset -1, type ffffffff, size 8, index -1, binding -1, stages 1, numMembers 2
ArrayedBind[1]: offset -1, type ffffffff, size 8, index -1, binding -1, stages 1, numMembers 2
ArrayedBind[2]: offset -1, type ffffffff, size 8, index -1, binding -1, stages 1, numMembers 2
VertexCollection: offset -1, type ffffffff, size 400, index 0, binding -1, stages 1, numMembers 7
MultipleArrays: offset -1, type ffffffff, size 500, index 1, binding -1, stages 1, numMembers 9
ArrayedBind[0]: offset -1, type ffffffff, size 8, index 2, binding -1, stages 1, numMembers 2
ArrayedBind[1]: offset -1, type ffffffff, size 8, index 3, binding -1, stages 1, numMembers 2
ArrayedBind[2]: offset -1, type ffffffff, size 8, index 4, binding -1, stages 1, numMembers 2
Pipeline input reflection:
gl_InstanceID: offset 0, type 1404, size 1, index 0, binding -1, stages 1
gl_VertexID: offset 0, type 1404, size 1, index 0, binding -1, stages 1
Pipeline output reflection:
outval.val: offset 0, type 1406, size 1, index 0, binding -1, stages 1

View File

@@ -90,8 +90,8 @@ deepA[1].d2.d1[2].b: offset -1, type 8b56, size 1, index -1, binding -1, stages
deepA[1].d2.d1[3].va: offset -1, type 8b50, size 3, index -1, binding -1, stages 1, arrayStride 8, topLevelArrayStride 176
deepA[1].d2.d1[3].b: offset -1, type 8b56, size 1, index -1, binding -1, stages 1, topLevelArrayStride 176
ufDead3: offset -1, type 1406, size 1, index -1, binding -1, stages 1
abl.foo: offset 0, type 1406, size 1, index 7, binding -1, stages 1
abl2.foo: offset 0, type 1406, size 1, index 11, binding -1, stages 1
abl.foo: offset 0, type 1406, size 1, index 4, binding -1, stages 1
abl2.foo: offset 0, type 1406, size 1, index 8, binding -1, stages 1
buf1.runtimeArray: offset 4, type 1406, size 4, index 12, binding -1, stages 1, arrayStride 4, topLevelArrayStride 4
buf2.runtimeArray.c: offset 8, type 1406, size 1, index 13, binding -1, stages 1, topLevelArrayStride 12
buf3.runtimeArray: offset 4, type 1406, size 0, index 14, binding -1, stages 1, arrayStride 4, topLevelArrayStride 4
@@ -145,24 +145,24 @@ t[4].v[2].position: offset 336, type 1406, size 3, index 17, binding -1, stages
t[4].v[2].normal: offset 348, type 1406, size 3, index 17, binding -1, stages 1, arrayStride 4, topLevelArrayStride 72
Uniform block reflection:
named: offset -1, type ffffffff, size 304, index -1, binding -1, stages 1, numMembers 10
nameless: offset -1, type ffffffff, size 496, index -1, binding -1, stages 1, numMembers 9
c_nameless: offset -1, type ffffffff, size 112, index -1, binding -1, stages 1, numMembers 5
nested: offset -1, type ffffffff, size 32, index -1, binding -1, stages 1, numMembers 4
abl[0]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
abl[1]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
abl[2]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
abl[3]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
abl2[0]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
abl2[1]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
abl2[2]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
abl2[3]: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 1
buf1: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 2
buf2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 4
buf3: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 2
buf4: offset -1, type ffffffff, size 4, index -1, binding -1, stages 1, numMembers 4
nested2: offset -1, type ffffffff, size 208, index -1, binding -1, stages 1, numMembers 15
VertexCollection: offset -1, type ffffffff, size 400, index -1, binding -1, stages 1, numMembers 31
named: offset -1, type ffffffff, size 304, index 0, binding -1, stages 1, numMembers 10
nameless: offset -1, type ffffffff, size 496, index 1, binding -1, stages 1, numMembers 9
c_nameless: offset -1, type ffffffff, size 112, index 2, binding -1, stages 1, numMembers 5
nested: offset -1, type ffffffff, size 32, index 3, binding -1, stages 1, numMembers 4
abl[0]: offset -1, type ffffffff, size 4, index 4, binding -1, stages 1, numMembers 1
abl[1]: offset -1, type ffffffff, size 4, index 5, binding -1, stages 1, numMembers 1
abl[2]: offset -1, type ffffffff, size 4, index 6, binding -1, stages 1, numMembers 1
abl[3]: offset -1, type ffffffff, size 4, index 7, binding -1, stages 1, numMembers 1
abl2[0]: offset -1, type ffffffff, size 4, index 8, binding -1, stages 1, numMembers 1
abl2[1]: offset -1, type ffffffff, size 4, index 9, binding -1, stages 1, numMembers 1
abl2[2]: offset -1, type ffffffff, size 4, index 10, binding -1, stages 1, numMembers 1
abl2[3]: offset -1, type ffffffff, size 4, index 11, binding -1, stages 1, numMembers 1
buf1: offset -1, type ffffffff, size 8, index 12, binding -1, stages 1, numMembers 2
buf2: offset -1, type ffffffff, size 16, index 13, binding -1, stages 1, numMembers 4
buf3: offset -1, type ffffffff, size 8, index 14, binding -1, stages 1, numMembers 2
buf4: offset -1, type ffffffff, size 16, index 15, binding -1, stages 1, numMembers 4
nested2: offset -1, type ffffffff, size 208, index 16, binding -1, stages 1, numMembers 15
VertexCollection: offset -1, type ffffffff, size 400, index 17, binding -1, stages 1, numMembers 31
Buffer variable reflection:

View File

@@ -37,17 +37,17 @@ 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 --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks 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 --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo 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 --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks 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 --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.frag > $TARGETDIR/reflection.options.frag.out
diff -b $BASEDIR/reflection.options.frag.out $TARGETDIR/reflection.options.frag.out || HASERROR=1
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks reflection.options.geom > $TARGETDIR/reflection.options.geom.out
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.options.geom > $TARGETDIR/reflection.options.geom.out
diff -b $BASEDIR/reflection.options.geom.out $TARGETDIR/reflection.options.geom.out || HASERROR=1
$EXE -l -q -C reflection.linked.vert reflection.linked.frag > $TARGETDIR/reflection.linked.out
diff -b $BASEDIR/reflection.linked.out $TARGETDIR/reflection.linked.out || HASERROR=1
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks reflection.linked.vert reflection.linked.frag > $TARGETDIR/reflection.linked.options.out
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.linked.vert reflection.linked.frag > $TARGETDIR/reflection.linked.options.out
diff -b $BASEDIR/reflection.linked.options.out $TARGETDIR/reflection.linked.options.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