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

@ -92,7 +92,7 @@ Shader version: 450
0:? 'x0_in' (layout(location=0 ) in int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'x1_in' (layout(location=1 ) in int)
0:? 'Pos_out' (out 4-component vector of float Position)
0:? 'PerVertex_out' (out block{out 4-component vector of float Position Pos_out})
Linked vertex stage:
@ -191,16 +191,16 @@ Shader version: 450
0:? 'x0_in' (layout(location=0 ) in int)
0:? 'Pos_in' (in 4-component vector of float Position)
0:? 'x1_in' (layout(location=1 ) in int)
0:? 'Pos_out' (out 4-component vector of float Position)
0:? 'PerVertex_out' (out block{out 4-component vector of float Position Pos_out})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 69
// Id's are bound by 72
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 28 33 37 56 62
EntryPoint Vertex 4 "main" 28 33 37 56 62 71
Name 4 "main"
Name 9 "VS_INPUT"
MemberName 9(VS_INPUT) 0 "x0_in"
@ -229,11 +229,16 @@ Shader version: 450
MemberName 54(VS_OUTPUT) 1 "x1_out"
Name 56 "@entryPointOutput"
Name 62 "Pos_out"
Name 69 "PerVertex_out"
MemberName 69(PerVertex_out) 0 "Pos_out"
Name 71 "PerVertex_out"
Decorate 28(x0_in) Location 0
Decorate 33(Pos_in) BuiltIn Position
Decorate 37(x1_in) Location 1
Decorate 56(@entryPointOutput) Location 0
Decorate 62(Pos_out) BuiltIn Position
MemberDecorate 69(PerVertex_out) 0 BuiltIn Position
Decorate 69(PerVertex_out) Block
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -262,6 +267,9 @@ Shader version: 450
59: TypePointer Output 6(int)
61: TypePointer Output 8(fvec4)
62(Pos_out): 61(ptr) Variable Output
69(PerVertex_out): TypeStruct 8(fvec4)
70: TypePointer Output 69(PerVertex_out)
71(PerVertex_out): 70(ptr) Variable Output
4(main): 2 Function None 3
5: Label
25(vsout): 12(ptr) Variable Function