HLSL: Wrap the entry-point; need to write 'in' args, and support 'inout' args.

This needs some render testing, but is destined to be part of master.

This also leads to a variety of other simplifications.
 - IO are global symbols, so only need one list of linkage nodes (deferred)
 - no longer need parse-context-wide 'inEntryPoint' state, entry-point is localized
 - several parts of splitting/flattening are now localized
This commit is contained in:
John Kessenich 2017-01-19 15:41:47 -07:00
parent 18adbdbbb8
commit 02467d8d94
171 changed files with 37604 additions and 32679 deletions

View file

@ -1,7 +1,7 @@
hlsl.getdimensions.dx10.vert
Shader version: 450
0:? Sequence
0:11 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:11 Function Definition: @main( (temp structure{temp 4-component vector of float Position Pos})
0:11 Function Parameters:
0:? Sequence
0:21 Sequence
@ -36,19 +36,22 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:26 Sequence
0:26 Sequence
0:26 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:26 Pos: direct index for structure (temp 4-component vector of float)
0:26 'vsout' (temp structure{temp 4-component vector of float Pos})
0:26 Constant:
0:26 0 (const int)
0:26 Branch: Return
0:26 Branch: Return with expression
0:26 'vsout' (temp structure{temp 4-component vector of float Pos})
0:11 Function Definition: main( (temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput_Pos' (out 4-component vector of float Position)
0:11 Pos: direct index for structure (temp 4-component vector of float Position)
0:11 Function Call: @main( (temp structure{temp 4-component vector of float Position Pos})
0:11 Constant:
0:11 0 (const int)
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
0:? 'PerVertex_out' (out block{out 4-component vector of float Position Pos})
0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos})
Linked vertex stage:
@ -56,7 +59,7 @@ Linked vertex stage:
Shader version: 450
0:? Sequence
0:11 Function Definition: main( (temp structure{temp 4-component vector of float Position Pos})
0:11 Function Definition: @main( (temp structure{temp 4-component vector of float Position Pos})
0:11 Function Parameters:
0:? Sequence
0:21 Sequence
@ -91,100 +94,120 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:26 Sequence
0:26 Sequence
0:26 move second child to first child (temp 4-component vector of float)
0:? 'Pos' (out 4-component vector of float Position)
0:26 Pos: direct index for structure (temp 4-component vector of float)
0:26 'vsout' (temp structure{temp 4-component vector of float Pos})
0:26 Constant:
0:26 0 (const int)
0:26 Branch: Return
0:26 Branch: Return with expression
0:26 'vsout' (temp structure{temp 4-component vector of float Pos})
0:11 Function Definition: main( (temp void)
0:11 Function Parameters:
0:? Sequence
0:11 Sequence
0:11 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput_Pos' (out 4-component vector of float Position)
0:11 Pos: direct index for structure (temp 4-component vector of float Position)
0:11 Function Call: @main( (temp structure{temp 4-component vector of float Position Pos})
0:11 Constant:
0:11 0 (const int)
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
0:? 'PerVertex_out' (out block{out 4-component vector of float Position Pos})
0:? 'PerVertex_out' (out block{out 4-component vector of float Position @entryPointOutput_Pos})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 46
// Id's are bound by 57
Capability Shader
Capability Sampled1D
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 36 45
EntryPoint Vertex 4 "main" 48 56
Name 4 "main"
Name 8 "sizeQueryTemp"
Name 12 "g_tTex1df4"
Name 16 "WidthU"
Name 18 "sizeQueryTemp"
Name 23 "NumberOfLevelsU"
Name 27 "VS_OUTPUT"
MemberName 27(VS_OUTPUT) 0 "Pos"
Name 29 "vsout"
Name 36 "Pos"
Name 42 "g_sSamp"
Name 43 "PerVertex_out"
MemberName 43(PerVertex_out) 0 "Pos"
Name 45 "PerVertex_out"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 36(Pos) BuiltIn Position
Decorate 42(g_sSamp) DescriptorSet 0
Decorate 42(g_sSamp) Binding 0
MemberDecorate 43(PerVertex_out) 0 BuiltIn Position
Decorate 43(PerVertex_out) Block
Name 8 "VS_OUTPUT"
MemberName 8(VS_OUTPUT) 0 "Pos"
Name 10 "@main("
Name 14 "sizeQueryTemp"
Name 17 "g_tTex1df4"
Name 21 "WidthU"
Name 23 "sizeQueryTemp"
Name 28 "NumberOfLevelsU"
Name 31 "VS_OUTPUT"
MemberName 31(VS_OUTPUT) 0 "Pos"
Name 33 "vsout"
Name 48 "@entryPointOutput_Pos"
Name 53 "g_sSamp"
Name 54 "PerVertex_out"
MemberName 54(PerVertex_out) 0 "@entryPointOutput_Pos"
Name 56 "PerVertex_out"
MemberDecorate 8(VS_OUTPUT) 0 BuiltIn Position
Decorate 17(g_tTex1df4) DescriptorSet 0
Decorate 17(g_tTex1df4) Binding 0
Decorate 48(@entryPointOutput_Pos) BuiltIn Position
Decorate 53(g_sSamp) DescriptorSet 0
Decorate 53(g_sSamp) Binding 0
MemberDecorate 54(PerVertex_out) 0 BuiltIn Position
Decorate 54(PerVertex_out) Block
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypePointer Function 6(int)
9: TypeFloat 32
10: TypeImage 9(float) 1D sampled format:Unknown
11: TypePointer UniformConstant 10
12(g_tTex1df4): 11(ptr) Variable UniformConstant
14: TypeInt 32 1
20: 6(int) Constant 6
26: TypeVector 9(float) 4
27(VS_OUTPUT): TypeStruct 26(fvec4)
28: TypePointer Function 27(VS_OUTPUT)
30: 14(int) Constant 0
31: 9(float) Constant 0
32: 26(fvec4) ConstantComposite 31 31 31 31
33: TypePointer Function 26(fvec4)
35: TypePointer Output 26(fvec4)
36(Pos): 35(ptr) Variable Output
40: TypeSampler
41: TypePointer UniformConstant 40
42(g_sSamp): 41(ptr) Variable UniformConstant
43(PerVertex_out): TypeStruct 26(fvec4)
44: TypePointer Output 43(PerVertex_out)
45(PerVertex_out): 44(ptr) Variable Output
6: TypeFloat 32
7: TypeVector 6(float) 4
8(VS_OUTPUT): TypeStruct 7(fvec4)
9: TypeFunction 8(VS_OUTPUT)
12: TypeInt 32 0
13: TypePointer Function 12(int)
15: TypeImage 6(float) 1D sampled format:Unknown
16: TypePointer UniformConstant 15
17(g_tTex1df4): 16(ptr) Variable UniformConstant
19: TypeInt 32 1
25: 12(int) Constant 6
31(VS_OUTPUT): TypeStruct 7(fvec4)
32: TypePointer Function 31(VS_OUTPUT)
34: 19(int) Constant 0
35: 6(float) Constant 0
36: 7(fvec4) ConstantComposite 35 35 35 35
37: TypePointer Function 7(fvec4)
40: TypePointer Function 8(VS_OUTPUT)
47: TypePointer Output 7(fvec4)
48(@entryPointOutput_Pos): 47(ptr) Variable Output
51: TypeSampler
52: TypePointer UniformConstant 51
53(g_sSamp): 52(ptr) Variable UniformConstant
54(PerVertex_out): TypeStruct 7(fvec4)
55: TypePointer Output 54(PerVertex_out)
56(PerVertex_out): 55(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(sizeQueryTemp): 7(ptr) Variable Function
16(WidthU): 7(ptr) Variable Function
18(sizeQueryTemp): 7(ptr) Variable Function
23(NumberOfLevelsU): 7(ptr) Variable Function
29(vsout): 28(ptr) Variable Function
13: 10 Load 12(g_tTex1df4)
15: 14(int) ImageQuerySize 13
Store 8(sizeQueryTemp) 15
17: 6(int) Load 8(sizeQueryTemp)
Store 16(WidthU) 17
19: 10 Load 12(g_tTex1df4)
21: 14(int) ImageQuerySizeLod 19 20
Store 18(sizeQueryTemp) 21
22: 6(int) Load 18(sizeQueryTemp)
Store 16(WidthU) 22
24: 10 Load 12(g_tTex1df4)
25: 14(int) ImageQueryLevels 24
Store 23(NumberOfLevelsU) 25
34: 33(ptr) AccessChain 29(vsout) 30
Store 34 32
37: 33(ptr) AccessChain 29(vsout) 30
38: 26(fvec4) Load 37
Store 36(Pos) 38
49:8(VS_OUTPUT) FunctionCall 10(@main()
50: 7(fvec4) CompositeExtract 49 0
Store 48(@entryPointOutput_Pos) 50
Return
FunctionEnd
10(@main():8(VS_OUTPUT) Function None 9
11: Label
14(sizeQueryTemp): 13(ptr) Variable Function
21(WidthU): 13(ptr) Variable Function
23(sizeQueryTemp): 13(ptr) Variable Function
28(NumberOfLevelsU): 13(ptr) Variable Function
33(vsout): 32(ptr) Variable Function
41: 40(ptr) Variable Function
18: 15 Load 17(g_tTex1df4)
20: 19(int) ImageQuerySize 18
Store 14(sizeQueryTemp) 20
22: 12(int) Load 14(sizeQueryTemp)
Store 21(WidthU) 22
24: 15 Load 17(g_tTex1df4)
26: 19(int) ImageQuerySizeLod 24 25
Store 23(sizeQueryTemp) 26
27: 12(int) Load 23(sizeQueryTemp)
Store 21(WidthU) 27
29: 15 Load 17(g_tTex1df4)
30: 19(int) ImageQueryLevels 29
Store 28(NumberOfLevelsU) 30
38: 37(ptr) AccessChain 33(vsout) 34
Store 38 36
39:31(VS_OUTPUT) Load 33(vsout)
42: 7(fvec4) CompositeExtract 39 0
43: 37(ptr) AccessChain 41 34
Store 43 42
44:8(VS_OUTPUT) Load 41
ReturnValue 44
FunctionEnd