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

@ -2,7 +2,7 @@ hlsl.gather.offset.dx10.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:28 Function Definition: main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Function Definition: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Function Parameters:
0:? Sequence
0:33 Sequence
@ -61,24 +61,28 @@ gl_FragCoord origin is upper left
0:41 1 (const int)
0:41 Constant:
0:41 1.000000
0:43 Sequence
0:43 Sequence
0:43 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:43 Color: direct index for structure (temp 4-component vector of float)
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:43 Constant:
0:43 0 (const int)
0:43 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:43 Depth: direct index for structure (temp float)
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:43 Constant:
0:43 1 (const int)
0:43 Branch: Return
0:43 Branch: Return with expression
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Function Definition: main( (temp void)
0:28 Function Parameters:
0:? Sequence
0:28 Sequence
0:28 move second child to first child (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Function Call: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:28 Color: direct index for structure (temp 4-component vector of float)
0:28 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Constant:
0:28 0 (const int)
0:28 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:28 Depth: direct index for structure (temp float)
0:28 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Constant:
0:28 1 (const int)
0:? Linker Objects
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@ -93,6 +97,8 @@ gl_FragCoord origin is upper left
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
Linked fragment stage:
@ -101,7 +107,7 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:28 Function Definition: main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Function Definition: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Function Parameters:
0:? Sequence
0:33 Sequence
@ -160,24 +166,28 @@ gl_FragCoord origin is upper left
0:41 1 (const int)
0:41 Constant:
0:41 1.000000
0:43 Sequence
0:43 Sequence
0:43 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:43 Color: direct index for structure (temp 4-component vector of float)
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:43 Constant:
0:43 0 (const int)
0:43 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:43 Depth: direct index for structure (temp float)
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:43 Constant:
0:43 1 (const int)
0:43 Branch: Return
0:43 Branch: Return with expression
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Function Definition: main( (temp void)
0:28 Function Parameters:
0:? Sequence
0:28 Sequence
0:28 move second child to first child (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Function Call: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:28 Color: direct index for structure (temp 4-component vector of float)
0:28 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Constant:
0:28 0 (const int)
0:28 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:28 Depth: direct index for structure (temp float)
0:28 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:28 Constant:
0:28 1 (const int)
0:? Linker Objects
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@ -192,170 +202,183 @@ gl_FragCoord origin is upper left
0:? 'g_tTexcdf4' (uniform textureCube)
0:? 'g_tTexcdi4' (uniform itextureCube)
0:? 'g_tTexcdu4' (uniform utextureCube)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 107
// Id's are bound by 114
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 71 75
EntryPoint Fragment 4 "main" 79 83
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval20"
Name 12 "g_tTex2df4"
Name 16 "g_sSamp"
Name 32 "txval21"
Name 35 "g_tTex2di4"
Name 48 "txval22"
Name 51 "g_tTex2du4"
Name 62 "PS_OUTPUT"
MemberName 62(PS_OUTPUT) 0 "Color"
MemberName 62(PS_OUTPUT) 1 "Depth"
Name 64 "psout"
Name 71 "Color"
Name 75 "Depth"
Name 81 "g_tTex1df4a"
Name 82 "g_tTex1df4"
Name 85 "g_tTex1di4"
Name 88 "g_tTex1du4"
Name 91 "g_tTex3df4"
Name 94 "g_tTex3di4"
Name 97 "g_tTex3du4"
Name 100 "g_tTexcdf4"
Name 103 "g_tTexcdi4"
Name 106 "g_tTexcdu4"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 35(g_tTex2di4) DescriptorSet 0
Decorate 51(g_tTex2du4) DescriptorSet 0
Decorate 71(Color) Location 0
Decorate 75(Depth) BuiltIn FragDepth
Decorate 81(g_tTex1df4a) DescriptorSet 0
Decorate 81(g_tTex1df4a) Binding 1
Decorate 82(g_tTex1df4) DescriptorSet 0
Decorate 82(g_tTex1df4) Binding 0
Decorate 85(g_tTex1di4) DescriptorSet 0
Decorate 88(g_tTex1du4) DescriptorSet 0
Decorate 91(g_tTex3df4) DescriptorSet 0
Decorate 94(g_tTex3di4) DescriptorSet 0
Decorate 97(g_tTex3du4) DescriptorSet 0
Decorate 100(g_tTexcdf4) DescriptorSet 0
Decorate 103(g_tTexcdi4) DescriptorSet 0
Decorate 106(g_tTexcdu4) DescriptorSet 0
Name 8 "PS_OUTPUT"
MemberName 8(PS_OUTPUT) 0 "Color"
MemberName 8(PS_OUTPUT) 1 "Depth"
Name 10 "@main("
Name 13 "txval20"
Name 16 "g_tTex2df4"
Name 20 "g_sSamp"
Name 36 "txval21"
Name 39 "g_tTex2di4"
Name 52 "txval22"
Name 55 "g_tTex2du4"
Name 67 "psout"
Name 76 "flattenTemp"
Name 79 "Color"
Name 83 "Depth"
Name 88 "g_tTex1df4a"
Name 89 "g_tTex1df4"
Name 92 "g_tTex1di4"
Name 95 "g_tTex1du4"
Name 98 "g_tTex3df4"
Name 101 "g_tTex3di4"
Name 104 "g_tTex3du4"
Name 107 "g_tTexcdf4"
Name 110 "g_tTexcdi4"
Name 113 "g_tTexcdu4"
Decorate 16(g_tTex2df4) DescriptorSet 0
Decorate 20(g_sSamp) DescriptorSet 0
Decorate 20(g_sSamp) Binding 0
Decorate 39(g_tTex2di4) DescriptorSet 0
Decorate 55(g_tTex2du4) DescriptorSet 0
Decorate 79(Color) Location 0
Decorate 83(Depth) BuiltIn FragDepth
Decorate 88(g_tTex1df4a) DescriptorSet 0
Decorate 88(g_tTex1df4a) Binding 1
Decorate 89(g_tTex1df4) DescriptorSet 0
Decorate 89(g_tTex1df4) Binding 0
Decorate 92(g_tTex1di4) DescriptorSet 0
Decorate 95(g_tTex1du4) DescriptorSet 0
Decorate 98(g_tTex3df4) DescriptorSet 0
Decorate 101(g_tTex3di4) DescriptorSet 0
Decorate 104(g_tTex3du4) DescriptorSet 0
Decorate 107(g_tTexcdf4) DescriptorSet 0
Decorate 110(g_tTexcdi4) DescriptorSet 0
Decorate 113(g_tTexcdu4) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
10: TypeImage 6(float) 2D sampled format:Unknown
11: TypePointer UniformConstant 10
12(g_tTex2df4): 11(ptr) Variable UniformConstant
14: TypeSampler
8(PS_OUTPUT): TypeStruct 7(fvec4) 6(float)
9: TypeFunction 8(PS_OUTPUT)
12: TypePointer Function 7(fvec4)
14: TypeImage 6(float) 2D sampled format:Unknown
15: TypePointer UniformConstant 14
16(g_sSamp): 15(ptr) Variable UniformConstant
18: TypeSampledImage 10
20: TypeVector 6(float) 2
21: 6(float) Constant 1036831949
22: 6(float) Constant 1045220557
23: 20(fvec2) ConstantComposite 21 22
24: TypeInt 32 1
25: TypeVector 24(int) 2
26: 24(int) Constant 1
27: 24(int) Constant 0
28: 25(ivec2) ConstantComposite 26 27
30: TypeVector 24(int) 4
31: TypePointer Function 30(ivec4)
33: TypeImage 24(int) 2D sampled format:Unknown
34: TypePointer UniformConstant 33
35(g_tTex2di4): 34(ptr) Variable UniformConstant
38: TypeSampledImage 33
40: 6(float) Constant 1050253722
41: 6(float) Constant 1053609165
42: 20(fvec2) ConstantComposite 40 41
43: 25(ivec2) ConstantComposite 26 26
45: TypeInt 32 0
46: TypeVector 45(int) 4
47: TypePointer Function 46(ivec4)
49: TypeImage 45(int) 2D sampled format:Unknown
50: TypePointer UniformConstant 49
51(g_tTex2du4): 50(ptr) Variable UniformConstant
54: TypeSampledImage 49
56: 6(float) Constant 1056964608
57: 6(float) Constant 1058642330
58: 20(fvec2) ConstantComposite 56 57
59: 24(int) Constant 4294967295
60: 25(ivec2) ConstantComposite 26 59
62(PS_OUTPUT): TypeStruct 7(fvec4) 6(float)
63: TypePointer Function 62(PS_OUTPUT)
65: 6(float) Constant 1065353216
66: 7(fvec4) ConstantComposite 65 65 65 65
68: TypePointer Function 6(float)
70: TypePointer Output 7(fvec4)
71(Color): 70(ptr) Variable Output
74: TypePointer Output 6(float)
75(Depth): 74(ptr) Variable Output
79: TypeImage 6(float) 1D sampled format:Unknown
80: TypePointer UniformConstant 79
81(g_tTex1df4a): 80(ptr) Variable UniformConstant
82(g_tTex1df4): 80(ptr) Variable UniformConstant
83: TypeImage 24(int) 1D sampled format:Unknown
84: TypePointer UniformConstant 83
85(g_tTex1di4): 84(ptr) Variable UniformConstant
86: TypeImage 45(int) 1D sampled format:Unknown
16(g_tTex2df4): 15(ptr) Variable UniformConstant
18: TypeSampler
19: TypePointer UniformConstant 18
20(g_sSamp): 19(ptr) Variable UniformConstant
22: TypeSampledImage 14
24: TypeVector 6(float) 2
25: 6(float) Constant 1036831949
26: 6(float) Constant 1045220557
27: 24(fvec2) ConstantComposite 25 26
28: TypeInt 32 1
29: TypeVector 28(int) 2
30: 28(int) Constant 1
31: 28(int) Constant 0
32: 29(ivec2) ConstantComposite 30 31
34: TypeVector 28(int) 4
35: TypePointer Function 34(ivec4)
37: TypeImage 28(int) 2D sampled format:Unknown
38: TypePointer UniformConstant 37
39(g_tTex2di4): 38(ptr) Variable UniformConstant
42: TypeSampledImage 37
44: 6(float) Constant 1050253722
45: 6(float) Constant 1053609165
46: 24(fvec2) ConstantComposite 44 45
47: 29(ivec2) ConstantComposite 30 30
49: TypeInt 32 0
50: TypeVector 49(int) 4
51: TypePointer Function 50(ivec4)
53: TypeImage 49(int) 2D sampled format:Unknown
54: TypePointer UniformConstant 53
55(g_tTex2du4): 54(ptr) Variable UniformConstant
58: TypeSampledImage 53
60: 6(float) Constant 1056964608
61: 6(float) Constant 1058642330
62: 24(fvec2) ConstantComposite 60 61
63: 28(int) Constant 4294967295
64: 29(ivec2) ConstantComposite 30 63
66: TypePointer Function 8(PS_OUTPUT)
68: 6(float) Constant 1065353216
69: 7(fvec4) ConstantComposite 68 68 68 68
71: TypePointer Function 6(float)
78: TypePointer Output 7(fvec4)
79(Color): 78(ptr) Variable Output
82: TypePointer Output 6(float)
83(Depth): 82(ptr) Variable Output
86: TypeImage 6(float) 1D sampled format:Unknown
87: TypePointer UniformConstant 86
88(g_tTex1du4): 87(ptr) Variable UniformConstant
89: TypeImage 6(float) 3D sampled format:Unknown
90: TypePointer UniformConstant 89
91(g_tTex3df4): 90(ptr) Variable UniformConstant
92: TypeImage 24(int) 3D sampled format:Unknown
93: TypePointer UniformConstant 92
94(g_tTex3di4): 93(ptr) Variable UniformConstant
95: TypeImage 45(int) 3D sampled format:Unknown
96: TypePointer UniformConstant 95
97(g_tTex3du4): 96(ptr) Variable UniformConstant
98: TypeImage 6(float) Cube sampled format:Unknown
99: TypePointer UniformConstant 98
100(g_tTexcdf4): 99(ptr) Variable UniformConstant
101: TypeImage 24(int) Cube sampled format:Unknown
102: TypePointer UniformConstant 101
103(g_tTexcdi4): 102(ptr) Variable UniformConstant
104: TypeImage 45(int) Cube sampled format:Unknown
105: TypePointer UniformConstant 104
106(g_tTexcdu4): 105(ptr) Variable UniformConstant
88(g_tTex1df4a): 87(ptr) Variable UniformConstant
89(g_tTex1df4): 87(ptr) Variable UniformConstant
90: TypeImage 28(int) 1D sampled format:Unknown
91: TypePointer UniformConstant 90
92(g_tTex1di4): 91(ptr) Variable UniformConstant
93: TypeImage 49(int) 1D sampled format:Unknown
94: TypePointer UniformConstant 93
95(g_tTex1du4): 94(ptr) Variable UniformConstant
96: TypeImage 6(float) 3D sampled format:Unknown
97: TypePointer UniformConstant 96
98(g_tTex3df4): 97(ptr) Variable UniformConstant
99: TypeImage 28(int) 3D sampled format:Unknown
100: TypePointer UniformConstant 99
101(g_tTex3di4): 100(ptr) Variable UniformConstant
102: TypeImage 49(int) 3D sampled format:Unknown
103: TypePointer UniformConstant 102
104(g_tTex3du4): 103(ptr) Variable UniformConstant
105: TypeImage 6(float) Cube sampled format:Unknown
106: TypePointer UniformConstant 105
107(g_tTexcdf4): 106(ptr) Variable UniformConstant
108: TypeImage 28(int) Cube sampled format:Unknown
109: TypePointer UniformConstant 108
110(g_tTexcdi4): 109(ptr) Variable UniformConstant
111: TypeImage 49(int) Cube sampled format:Unknown
112: TypePointer UniformConstant 111
113(g_tTexcdu4): 112(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function
32(txval21): 31(ptr) Variable Function
48(txval22): 47(ptr) Variable Function
64(psout): 63(ptr) Variable Function
13: 10 Load 12(g_tTex2df4)
17: 14 Load 16(g_sSamp)
19: 18 SampledImage 13 17
29: 7(fvec4) ImageGather 19 23 27 ConstOffset 28
Store 9(txval20) 29
36: 33 Load 35(g_tTex2di4)
37: 14 Load 16(g_sSamp)
39: 38 SampledImage 36 37
44: 30(ivec4) ImageGather 39 42 27 ConstOffset 43
Store 32(txval21) 44
52: 49 Load 51(g_tTex2du4)
53: 14 Load 16(g_sSamp)
55: 54 SampledImage 52 53
61: 46(ivec4) ImageGather 55 58 27 ConstOffset 60
Store 48(txval22) 61
67: 8(ptr) AccessChain 64(psout) 27
Store 67 66
69: 68(ptr) AccessChain 64(psout) 26
Store 69 65
72: 8(ptr) AccessChain 64(psout) 27
73: 7(fvec4) Load 72
Store 71(Color) 73
76: 68(ptr) AccessChain 64(psout) 26
77: 6(float) Load 76
Store 75(Depth) 77
76(flattenTemp): 66(ptr) Variable Function
77:8(PS_OUTPUT) FunctionCall 10(@main()
Store 76(flattenTemp) 77
80: 12(ptr) AccessChain 76(flattenTemp) 31
81: 7(fvec4) Load 80
Store 79(Color) 81
84: 71(ptr) AccessChain 76(flattenTemp) 30
85: 6(float) Load 84
Store 83(Depth) 85
Return
FunctionEnd
10(@main():8(PS_OUTPUT) Function None 9
11: Label
13(txval20): 12(ptr) Variable Function
36(txval21): 35(ptr) Variable Function
52(txval22): 51(ptr) Variable Function
67(psout): 66(ptr) Variable Function
17: 14 Load 16(g_tTex2df4)
21: 18 Load 20(g_sSamp)
23: 22 SampledImage 17 21
33: 7(fvec4) ImageGather 23 27 31 ConstOffset 32
Store 13(txval20) 33
40: 37 Load 39(g_tTex2di4)
41: 18 Load 20(g_sSamp)
43: 42 SampledImage 40 41
48: 34(ivec4) ImageGather 43 46 31 ConstOffset 47
Store 36(txval21) 48
56: 53 Load 55(g_tTex2du4)
57: 18 Load 20(g_sSamp)
59: 58 SampledImage 56 57
65: 50(ivec4) ImageGather 59 62 31 ConstOffset 64
Store 52(txval22) 65
70: 12(ptr) AccessChain 67(psout) 31
Store 70 69
72: 71(ptr) AccessChain 67(psout) 30
Store 72 68
73:8(PS_OUTPUT) Load 67(psout)
ReturnValue 73
FunctionEnd