Reflect pipeline outputs as well as inputs, optionally from other stages

* We add an option to reflect inputs from other stages than vertex, if only a
  later subset of the stages is linked into the program.
This commit is contained in:
baldurk 2019-01-29 16:04:44 +00:00
parent edf8212ab8
commit 0af5e3e346
17 changed files with 149 additions and 32 deletions

View file

@ -25,5 +25,8 @@ u6: offset -1, type ffffffff, size 0, index -1, binding 46, stages 0
cb: offset -1, type ffffffff, size 4, index -1, binding 51, stages 0
tb: offset -1, type ffffffff, size 4, index -1, binding 17, stages 0
Vertex attribute reflection:
Pipeline input reflection:
Pipeline output reflection:
@entryPointOutput: offset 0, type 8b52, size 0, index 0, binding -1, stages 0

View file

@ -15,5 +15,8 @@ Uniform block reflection:
cbuff1: offset -1, type ffffffff, size 24, index -1, binding 2, stages 0
cbuff2: offset -1, type ffffffff, size 24, index -1, binding 3, stages 0
Vertex attribute reflection:
Pipeline input reflection:
Pipeline output reflection:
psout.Color: offset 0, type 8b52, size 0, index 0, binding -1, stages 0

View file

@ -67,10 +67,12 @@ nested: offset -1, type ffffffff, size 32, index -1, binding -1, stages 0
abl: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
abl2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
Vertex attribute 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
attributeFloat3: offset 0, type 8b51, size 0, index 0, binding -1, stages 0
attributeFloat4: offset 0, type 8b52, size 0, index 0, binding -1, stages 0
attributeMat4: offset 0, type 8b5c, size 0, index 0, binding -1, stages 0
Pipeline output reflection:

View file

@ -226,5 +226,8 @@ u6: offset -1, type ffffffff, size 0, index -1, binding 34, stages 0
cb: offset -1, type ffffffff, size 4, index -1, binding 51, stages 0
tb: offset -1, type ffffffff, size 4, index -1, binding 27, stages 0
Vertex attribute reflection:
Pipeline input reflection:
Pipeline output reflection:
@entryPointOutput: offset 0, type 8b52, size 0, index 0, binding -1, stages 0

View file

@ -0,0 +1,9 @@
reflection.frag
Uniform reflection:
Uniform block reflection:
Pipeline input reflection:
Pipeline output reflection:

View file

@ -0,0 +1,10 @@
reflection.frag
Uniform reflection:
Uniform block reflection:
Pipeline input reflection:
inval: offset 0, type 1406, size 0, index 0, binding -1, stages 0
Pipeline output reflection:

View file

@ -10,6 +10,9 @@ t[0].v[2].normal[0]: 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:
Pipeline input reflection:
gl_InstanceID: offset 0, type 1404, size 0, index 0, binding -1, stages 0
Pipeline output reflection:
outval: offset 0, type 1406, size 0, index 0, binding -1, stages 0

View file

@ -146,7 +146,7 @@ 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:
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
attributeFloat3: offset 0, type 8b51, size 0, index 0, binding -1, stages 0
@ -154,3 +154,5 @@ attributeFloat4: offset 0, type 8b52, size 0, index 0, binding -1, stages 0
attributeMat4: offset 0, type 8b5c, size 0, index 0, binding -1, stages 0
gl_InstanceID: offset 0, type 1404, size 0, index 0, binding -1, stages 0
Pipeline output reflection:

8
Test/reflection.frag Normal file
View file

@ -0,0 +1,8 @@
#version 440 core
in float inval;
void main()
{
float f = inval;
}

View file

@ -13,6 +13,8 @@ buffer VertexCollection {
TriangleInfo t[5];
};
out float outval;
void main()
{
float f;
@ -20,4 +22,5 @@ void main()
f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID];
f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID];
TriangleInfo tlocal[5] = t;
outval = f;
}

View file

@ -174,6 +174,8 @@ buffer VertexCollection {
TriangleInfo t[5];
};
out float outval;
void main()
{
liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray);
@ -234,4 +236,6 @@ void main()
f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID];
f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID];
TriangleInfo tlocal[5] = t;
outval = f;
}

View file

@ -32,8 +32,12 @@ 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 reflection.options.vert > $TARGETDIR/reflection.options.vert.out
$EXE -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io 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
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
$EXE -D -Od -e main -l -q -C -V -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out