WIP: add other builtins to interstage IO

(Still adding tests: do not commit)

This fixes PR #632 so that:

(a) The 4 PerVertex builtins are added to an interface block for all stages except fragment.

(b) Other builtin qualified variables are added as "loose" linkage members.

(c) Arrayness from the PerVertex builtins is moved to the PerVertex block.

(d) Sometimes, two PerVertex blocks are created, one for in, one for out (e.g, for some GS that
    both reads and writes a Position)
This commit is contained in:
steve-lunarg 2017-01-07 09:07:14 -07:00
parent 5d89d4d483
commit 46d5428422
16 changed files with 519 additions and 196 deletions

View file

@ -26,7 +26,7 @@ Shader version: 450
0:? Linker Objects
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'Pos_loose' (in 4-component vector of float Position)
0:? 'Pos' (out 4-component vector of float Position)
0:? 'PerVertex_out' (out block{out 4-component vector of float Position Pos})
Linked vertex stage:
@ -59,16 +59,16 @@ Shader version: 450
0:? Linker Objects
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'Pos_loose' (in 4-component vector of float Position)
0:? 'Pos' (out 4-component vector of float Position)
0:? 'PerVertex_out' (out block{out 4-component vector of float Position Pos})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 26
// Id's are bound by 29
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 14 16 22
EntryPoint Vertex 4 "main" 14 16 22 28
Name 4 "main"
Name 8 "VS_OUTPUT"
MemberName 8(VS_OUTPUT) 0 "Pos"
@ -76,9 +76,14 @@ Shader version: 450
Name 14 "Pos_in"
Name 16 "Pos_loose"
Name 22 "Pos"
Name 26 "PerVertex_out"
MemberName 26(PerVertex_out) 0 "Pos"
Name 28 "PerVertex_out"
Decorate 14(Pos_in) BuiltIn Position
Decorate 16(Pos_loose) BuiltIn Position
Decorate 22(Pos) BuiltIn Position
MemberDecorate 26(PerVertex_out) 0 BuiltIn Position
Decorate 26(PerVertex_out) Block
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -93,6 +98,9 @@ Shader version: 450
19: TypePointer Function 7(fvec4)
21: TypePointer Output 7(fvec4)
22(Pos): 21(ptr) Variable Output
26(PerVertex_out): TypeStruct 7(fvec4)
27: TypePointer Output 26(PerVertex_out)
28(PerVertex_out): 27(ptr) Variable Output
4(main): 2 Function None 3
5: Label
10(vsout): 9(ptr) Variable Function