(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)
117 lines
5.5 KiB
Plaintext
117 lines
5.5 KiB
Plaintext
hlsl.struct.split.trivial.vert
|
|
Shader version: 450
|
|
0:? Sequence
|
|
0:16 Function Definition: main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
|
|
0:16 Function Parameters:
|
|
0:16 'vsin' (in structure{temp 4-component vector of float Pos_in})
|
|
0:16 'Pos_loose' (in 4-component vector of float Position)
|
|
0:? Sequence
|
|
0:19 move second child to first child (temp 4-component vector of float)
|
|
0:19 Pos: direct index for structure (temp 4-component vector of float)
|
|
0:19 'vsout' (temp structure{temp 4-component vector of float Pos})
|
|
0:19 Constant:
|
|
0:19 0 (const int)
|
|
0:19 add (temp 4-component vector of float)
|
|
0:? 'Pos_in' (in 4-component vector of float Position)
|
|
0:19 'Pos_loose' (in 4-component vector of float Position)
|
|
0:21 Sequence
|
|
0:21 Sequence
|
|
0:21 move second child to first child (temp 4-component vector of float)
|
|
0:? 'Pos' (out 4-component vector of float Position)
|
|
0:21 Pos: direct index for structure (temp 4-component vector of float)
|
|
0:21 'vsout' (temp structure{temp 4-component vector of float Pos})
|
|
0:21 Constant:
|
|
0:21 0 (const int)
|
|
0:21 Branch: Return
|
|
0:? Linker Objects
|
|
0:? 'Pos_in' (in 4-component vector of float Position)
|
|
0:? 'Pos_loose' (in 4-component vector of float Position)
|
|
0:? 'PerVertex_out' (out block{out 4-component vector of float Position Pos})
|
|
|
|
|
|
Linked vertex stage:
|
|
|
|
|
|
Shader version: 450
|
|
0:? Sequence
|
|
0:16 Function Definition: main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
|
|
0:16 Function Parameters:
|
|
0:16 'vsin' (in structure{temp 4-component vector of float Pos_in})
|
|
0:16 'Pos_loose' (in 4-component vector of float Position)
|
|
0:? Sequence
|
|
0:19 move second child to first child (temp 4-component vector of float)
|
|
0:19 Pos: direct index for structure (temp 4-component vector of float)
|
|
0:19 'vsout' (temp structure{temp 4-component vector of float Pos})
|
|
0:19 Constant:
|
|
0:19 0 (const int)
|
|
0:19 add (temp 4-component vector of float)
|
|
0:? 'Pos_in' (in 4-component vector of float Position)
|
|
0:19 'Pos_loose' (in 4-component vector of float Position)
|
|
0:21 Sequence
|
|
0:21 Sequence
|
|
0:21 move second child to first child (temp 4-component vector of float)
|
|
0:? 'Pos' (out 4-component vector of float Position)
|
|
0:21 Pos: direct index for structure (temp 4-component vector of float)
|
|
0:21 'vsout' (temp structure{temp 4-component vector of float Pos})
|
|
0:21 Constant:
|
|
0:21 0 (const int)
|
|
0:21 Branch: Return
|
|
0:? Linker Objects
|
|
0:? 'Pos_in' (in 4-component vector of float Position)
|
|
0:? 'Pos_loose' (in 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 29
|
|
|
|
Capability Shader
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint Vertex 4 "main" 14 16 22 28
|
|
Name 4 "main"
|
|
Name 8 "VS_OUTPUT"
|
|
MemberName 8(VS_OUTPUT) 0 "Pos"
|
|
Name 10 "vsout"
|
|
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
|
|
7: TypeVector 6(float) 4
|
|
8(VS_OUTPUT): TypeStruct 7(fvec4)
|
|
9: TypePointer Function 8(VS_OUTPUT)
|
|
11: TypeInt 32 1
|
|
12: 11(int) Constant 0
|
|
13: TypePointer Input 7(fvec4)
|
|
14(Pos_in): 13(ptr) Variable Input
|
|
16(Pos_loose): 13(ptr) Variable Input
|
|
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
|
|
15: 7(fvec4) Load 14(Pos_in)
|
|
17: 7(fvec4) Load 16(Pos_loose)
|
|
18: 7(fvec4) FAdd 15 17
|
|
20: 19(ptr) AccessChain 10(vsout) 12
|
|
Store 20 18
|
|
23: 19(ptr) AccessChain 10(vsout) 12
|
|
24: 7(fvec4) Load 23
|
|
Store 22(Pos) 24
|
|
Return
|
|
FunctionEnd
|