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

@ -29,12 +29,12 @@ output primitive = triangle_strip
0:18 Constant:
0:18 0 (const int)
0:18 indirect index (temp 4-component vector of float Position)
0:18 'i.pos' (in 3-element array of 4-component vector of float Position)
0:18 'i_pos' (in 3-element array of 4-component vector of float Position)
0:18 'x' (temp int)
0:19 Sequence
0:19 Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:? 'ts.pos' (out 4-component vector of float Position)
0:? 'ts_pos' (out 4-component vector of float Position)
0:19 pos: direct index for structure (temp 4-component vector of float)
0:19 'o' (temp structure{temp 4-component vector of float pos})
0:19 Constant:
@ -44,8 +44,8 @@ output primitive = triangle_strip
0:17 Pre-Increment (temp int)
0:17 'x' (temp int)
0:? Linker Objects
0:? 'i.pos' (in 3-element array of 4-component vector of float Position)
0:? 'ts.pos' (out 4-component vector of float Position)
0:? 'PerVertex_in' (in 3-element array of block{in 4-component vector of float Position i_pos})
0:? 'PerVertex_out' (out block{out 4-component vector of float Position ts_pos})
Linked geometry stage:
@ -81,12 +81,12 @@ output primitive = triangle_strip
0:18 Constant:
0:18 0 (const int)
0:18 indirect index (temp 4-component vector of float Position)
0:18 'i.pos' (in 3-element array of 4-component vector of float Position)
0:18 'i_pos' (in 3-element array of 4-component vector of float Position)
0:18 'x' (temp int)
0:19 Sequence
0:19 Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:? 'ts.pos' (out 4-component vector of float Position)
0:? 'ts_pos' (out 4-component vector of float Position)
0:19 pos: direct index for structure (temp 4-component vector of float)
0:19 'o' (temp structure{temp 4-component vector of float pos})
0:19 Constant:
@ -96,17 +96,17 @@ output primitive = triangle_strip
0:17 Pre-Increment (temp int)
0:17 'x' (temp int)
0:? Linker Objects
0:? 'i.pos' (in 3-element array of 4-component vector of float Position)
0:? 'ts.pos' (out 4-component vector of float Position)
0:? 'PerVertex_in' (in 3-element array of block{in 4-component vector of float Position i_pos})
0:? 'PerVertex_out' (out block{out 4-component vector of float Position ts_pos})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 42
// Id's are bound by 49
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 28 36
EntryPoint Geometry 4 "main" 28 36 45 48
ExecutionMode 4 Triangles
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputTriangleStrip
@ -116,10 +116,20 @@ output primitive = triangle_strip
Name 21 "GS_OUT"
MemberName 21(GS_OUT) 0 "pos"
Name 23 "o"
Name 28 "i.pos"
Name 36 "ts.pos"
Decorate 28(i.pos) BuiltIn Position
Decorate 36(ts.pos) BuiltIn Position
Name 28 "i_pos"
Name 36 "ts_pos"
Name 42 "PerVertex_in"
MemberName 42(PerVertex_in) 0 "i_pos"
Name 45 "PerVertex_in"
Name 46 "PerVertex_out"
MemberName 46(PerVertex_out) 0 "ts_pos"
Name 48 "PerVertex_out"
Decorate 28(i_pos) BuiltIn Position
Decorate 36(ts_pos) BuiltIn Position
MemberDecorate 42(PerVertex_in) 0 BuiltIn Position
Decorate 42(PerVertex_in) Block
MemberDecorate 46(PerVertex_out) 0 BuiltIn Position
Decorate 46(PerVertex_out) Block
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -135,12 +145,19 @@ output primitive = triangle_strip
25: 24(int) Constant 3
26: TypeArray 20(fvec4) 25
27: TypePointer Input 26
28(i.pos): 27(ptr) Variable Input
28(i_pos): 27(ptr) Variable Input
30: TypePointer Input 20(fvec4)
33: TypePointer Function 20(fvec4)
35: TypePointer Output 20(fvec4)
36(ts.pos): 35(ptr) Variable Output
36(ts_pos): 35(ptr) Variable Output
40: 6(int) Constant 1
42(PerVertex_in): TypeStruct 20(fvec4)
43: TypeArray 42(PerVertex_in) 25
44: TypePointer Input 43
45(PerVertex_in): 44(ptr) Variable Input
46(PerVertex_out): TypeStruct 20(fvec4)
47: TypePointer Output 46(PerVertex_out)
48(PerVertex_out): 47(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(x): 7(ptr) Variable Function
@ -156,13 +173,13 @@ output primitive = triangle_strip
BranchConditional 18 11 12
11: Label
29: 6(int) Load 8(x)
31: 30(ptr) AccessChain 28(i.pos) 29
31: 30(ptr) AccessChain 28(i_pos) 29
32: 20(fvec4) Load 31
34: 33(ptr) AccessChain 23(o) 9
Store 34 32
37: 33(ptr) AccessChain 23(o) 9
38: 20(fvec4) Load 37
Store 36(ts.pos) 38
Store 36(ts_pos) 38
EmitVertex
Branch 13
13: Label