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.samplelevel.offsetarray.dx10.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:20 Function Definition: main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Function Definition: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Function Parameters:
0:? Sequence
0:23 Sequence
@@ -112,24 +112,28 @@ gl_FragCoord origin is upper left
0:34 1 (const int)
0:34 Constant:
0:34 1.000000
0:36 Sequence
0:36 Sequence
0:36 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:36 Color: direct index for structure (temp 4-component vector of float)
0:36 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:36 Constant:
0:36 0 (const int)
0:36 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:36 Depth: direct index for structure (temp float)
0:36 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:36 Constant:
0:36 1 (const int)
0:36 Branch: Return
0:36 Branch: Return with expression
0:36 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Function Definition: main( (temp void)
0:20 Function Parameters:
0:? Sequence
0:20 Sequence
0:20 move second child to first child (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Function Call: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:20 Color: direct index for structure (temp 4-component vector of float)
0:20 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Constant:
0:20 0 (const int)
0:20 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:20 Depth: direct index for structure (temp float)
0:20 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Constant:
0:20 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 texture1DArray)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1DArray)
@@ -138,6 +142,8 @@ gl_FragCoord origin is upper left
0:? 'g_tTex2df4' (uniform texture2DArray)
0:? 'g_tTex2di4' (uniform itexture2DArray)
0:? 'g_tTex2du4' (uniform utexture2DArray)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
Linked fragment stage:
@@ -146,7 +152,7 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:20 Function Definition: main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Function Definition: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Function Parameters:
0:? Sequence
0:23 Sequence
@@ -256,24 +262,28 @@ gl_FragCoord origin is upper left
0:34 1 (const int)
0:34 Constant:
0:34 1.000000
0:36 Sequence
0:36 Sequence
0:36 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:36 Color: direct index for structure (temp 4-component vector of float)
0:36 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:36 Constant:
0:36 0 (const int)
0:36 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:36 Depth: direct index for structure (temp float)
0:36 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:36 Constant:
0:36 1 (const int)
0:36 Branch: Return
0:36 Branch: Return with expression
0:36 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Function Definition: main( (temp void)
0:20 Function Parameters:
0:? Sequence
0:20 Sequence
0:20 move second child to first child (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Function Call: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:20 Color: direct index for structure (temp 4-component vector of float)
0:20 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Constant:
0:20 0 (const int)
0:20 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:20 Depth: direct index for structure (temp float)
0:20 'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:20 Constant:
0:20 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 texture1DArray)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1DArray)
@@ -282,169 +292,182 @@ gl_FragCoord origin is upper left
0:? 'g_tTex2df4' (uniform texture2DArray)
0:? 'g_tTex2di4' (uniform itexture2DArray)
0:? 'g_tTex2du4' (uniform utexture2DArray)
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 112
// Id's are bound by 119
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 103 107
EntryPoint Fragment 4 "main" 111 115
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval10"
Name 12 "g_tTex1df4"
Name 16 "g_sSamp"
Name 30 "txval11"
Name 33 "g_tTex1di4"
Name 45 "txval12"
Name 48 "g_tTex1du4"
Name 57 "txval20"
Name 60 "g_tTex2df4"
Name 70 "txval21"
Name 73 "g_tTex2di4"
Name 81 "txval22"
Name 84 "g_tTex2du4"
Name 94 "PS_OUTPUT"
MemberName 94(PS_OUTPUT) 0 "Color"
MemberName 94(PS_OUTPUT) 1 "Depth"
Name 96 "psout"
Name 103 "Color"
Name 107 "Depth"
Name 111 "g_tTex1df4a"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 33(g_tTex1di4) DescriptorSet 0
Decorate 48(g_tTex1du4) DescriptorSet 0
Decorate 60(g_tTex2df4) DescriptorSet 0
Decorate 73(g_tTex2di4) DescriptorSet 0
Decorate 84(g_tTex2du4) DescriptorSet 0
Decorate 103(Color) Location 0
Decorate 107(Depth) BuiltIn FragDepth
Decorate 111(g_tTex1df4a) DescriptorSet 0
Decorate 111(g_tTex1df4a) Binding 1
Name 8 "PS_OUTPUT"
MemberName 8(PS_OUTPUT) 0 "Color"
MemberName 8(PS_OUTPUT) 1 "Depth"
Name 10 "@main("
Name 13 "txval10"
Name 16 "g_tTex1df4"
Name 20 "g_sSamp"
Name 34 "txval11"
Name 37 "g_tTex1di4"
Name 49 "txval12"
Name 52 "g_tTex1du4"
Name 61 "txval20"
Name 64 "g_tTex2df4"
Name 74 "txval21"
Name 77 "g_tTex2di4"
Name 85 "txval22"
Name 88 "g_tTex2du4"
Name 99 "psout"
Name 108 "flattenTemp"
Name 111 "Color"
Name 115 "Depth"
Name 118 "g_tTex1df4a"
Decorate 16(g_tTex1df4) DescriptorSet 0
Decorate 16(g_tTex1df4) Binding 0
Decorate 20(g_sSamp) DescriptorSet 0
Decorate 20(g_sSamp) Binding 0
Decorate 37(g_tTex1di4) DescriptorSet 0
Decorate 52(g_tTex1du4) DescriptorSet 0
Decorate 64(g_tTex2df4) DescriptorSet 0
Decorate 77(g_tTex2di4) DescriptorSet 0
Decorate 88(g_tTex2du4) DescriptorSet 0
Decorate 111(Color) Location 0
Decorate 115(Depth) BuiltIn FragDepth
Decorate 118(g_tTex1df4a) DescriptorSet 0
Decorate 118(g_tTex1df4a) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
10: TypeImage 6(float) 1D array sampled format:Unknown
11: TypePointer UniformConstant 10
12(g_tTex1df4): 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) 1D array 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: 6(float) Constant 1061158912
25: TypeInt 32 1
26: 25(int) Constant 0
28: TypeVector 25(int) 4
29: TypePointer Function 28(ivec4)
31: TypeImage 25(int) 1D array sampled format:Unknown
32: TypePointer UniformConstant 31
33(g_tTex1di4): 32(ptr) Variable UniformConstant
36: TypeSampledImage 31
38: 6(float) Constant 1050253722
39: 20(fvec2) ConstantComposite 22 38
40: 25(int) Constant 1
42: TypeInt 32 0
43: TypeVector 42(int) 4
44: TypePointer Function 43(ivec4)
46: TypeImage 42(int) 1D array sampled format:Unknown
47: TypePointer UniformConstant 46
48(g_tTex1du4): 47(ptr) Variable UniformConstant
51: TypeSampledImage 46
53: 6(float) Constant 1053609165
54: 20(fvec2) ConstantComposite 38 53
55: 25(int) Constant 2
58: TypeImage 6(float) 2D array sampled format:Unknown
59: TypePointer UniformConstant 58
60(g_tTex2df4): 59(ptr) Variable UniformConstant
63: TypeSampledImage 58
65: TypeVector 6(float) 3
66: 65(fvec3) ConstantComposite 21 22 38
67: TypeVector 25(int) 2
68: 67(ivec2) ConstantComposite 26 26
71: TypeImage 25(int) 2D array sampled format:Unknown
72: TypePointer UniformConstant 71
73(g_tTex2di4): 72(ptr) Variable UniformConstant
76: TypeSampledImage 71
78: 6(float) Constant 1056964608
79: 65(fvec3) ConstantComposite 38 53 78
82: TypeImage 42(int) 2D array sampled format:Unknown
83: TypePointer UniformConstant 82
84(g_tTex2du4): 83(ptr) Variable UniformConstant
87: TypeSampledImage 82
89: 6(float) Constant 1058642330
90: 6(float) Constant 1060320051
91: 65(fvec3) ConstantComposite 78 89 90
92: 67(ivec2) ConstantComposite 26 40
94(PS_OUTPUT): TypeStruct 7(fvec4) 6(float)
95: TypePointer Function 94(PS_OUTPUT)
97: 6(float) Constant 1065353216
98: 7(fvec4) ConstantComposite 97 97 97 97
100: TypePointer Function 6(float)
102: TypePointer Output 7(fvec4)
103(Color): 102(ptr) Variable Output
106: TypePointer Output 6(float)
107(Depth): 106(ptr) Variable Output
111(g_tTex1df4a): 11(ptr) Variable UniformConstant
16(g_tTex1df4): 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: 6(float) Constant 1061158912
29: TypeInt 32 1
30: 29(int) Constant 0
32: TypeVector 29(int) 4
33: TypePointer Function 32(ivec4)
35: TypeImage 29(int) 1D array sampled format:Unknown
36: TypePointer UniformConstant 35
37(g_tTex1di4): 36(ptr) Variable UniformConstant
40: TypeSampledImage 35
42: 6(float) Constant 1050253722
43: 24(fvec2) ConstantComposite 26 42
44: 29(int) Constant 1
46: TypeInt 32 0
47: TypeVector 46(int) 4
48: TypePointer Function 47(ivec4)
50: TypeImage 46(int) 1D array sampled format:Unknown
51: TypePointer UniformConstant 50
52(g_tTex1du4): 51(ptr) Variable UniformConstant
55: TypeSampledImage 50
57: 6(float) Constant 1053609165
58: 24(fvec2) ConstantComposite 42 57
59: 29(int) Constant 2
62: TypeImage 6(float) 2D array sampled format:Unknown
63: TypePointer UniformConstant 62
64(g_tTex2df4): 63(ptr) Variable UniformConstant
67: TypeSampledImage 62
69: TypeVector 6(float) 3
70: 69(fvec3) ConstantComposite 25 26 42
71: TypeVector 29(int) 2
72: 71(ivec2) ConstantComposite 30 30
75: TypeImage 29(int) 2D array sampled format:Unknown
76: TypePointer UniformConstant 75
77(g_tTex2di4): 76(ptr) Variable UniformConstant
80: TypeSampledImage 75
82: 6(float) Constant 1056964608
83: 69(fvec3) ConstantComposite 42 57 82
86: TypeImage 46(int) 2D array sampled format:Unknown
87: TypePointer UniformConstant 86
88(g_tTex2du4): 87(ptr) Variable UniformConstant
91: TypeSampledImage 86
93: 6(float) Constant 1058642330
94: 6(float) Constant 1060320051
95: 69(fvec3) ConstantComposite 82 93 94
96: 71(ivec2) ConstantComposite 30 44
98: TypePointer Function 8(PS_OUTPUT)
100: 6(float) Constant 1065353216
101: 7(fvec4) ConstantComposite 100 100 100 100
103: TypePointer Function 6(float)
110: TypePointer Output 7(fvec4)
111(Color): 110(ptr) Variable Output
114: TypePointer Output 6(float)
115(Depth): 114(ptr) Variable Output
118(g_tTex1df4a): 15(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function
30(txval11): 29(ptr) Variable Function
45(txval12): 44(ptr) Variable Function
57(txval20): 8(ptr) Variable Function
70(txval21): 29(ptr) Variable Function
81(txval22): 44(ptr) Variable Function
96(psout): 95(ptr) Variable Function
13: 10 Load 12(g_tTex1df4)
17: 14 Load 16(g_sSamp)
19: 18 SampledImage 13 17
27: 7(fvec4) ImageSampleExplicitLod 19 23 Lod ConstOffset 24 26
Store 9(txval10) 27
34: 31 Load 33(g_tTex1di4)
35: 14 Load 16(g_sSamp)
37: 36 SampledImage 34 35
41: 28(ivec4) ImageSampleExplicitLod 37 39 Lod ConstOffset 24 40
Store 30(txval11) 41
49: 46 Load 48(g_tTex1du4)
50: 14 Load 16(g_sSamp)
52: 51 SampledImage 49 50
56: 43(ivec4) ImageSampleExplicitLod 52 54 Lod ConstOffset 24 55
Store 45(txval12) 56
61: 58 Load 60(g_tTex2df4)
62: 14 Load 16(g_sSamp)
64: 63 SampledImage 61 62
69: 7(fvec4) ImageSampleExplicitLod 64 66 Lod ConstOffset 24 68
Store 57(txval20) 69
74: 71 Load 73(g_tTex2di4)
75: 14 Load 16(g_sSamp)
77: 76 SampledImage 74 75
80: 28(ivec4) ImageSampleExplicitLod 77 79 Lod ConstOffset 24 68
Store 70(txval21) 80
85: 82 Load 84(g_tTex2du4)
86: 14 Load 16(g_sSamp)
88: 87 SampledImage 85 86
93: 43(ivec4) ImageSampleExplicitLod 88 91 Lod ConstOffset 24 92
Store 81(txval22) 93
99: 8(ptr) AccessChain 96(psout) 26
Store 99 98
101: 100(ptr) AccessChain 96(psout) 40
Store 101 97
104: 8(ptr) AccessChain 96(psout) 26
105: 7(fvec4) Load 104
Store 103(Color) 105
108: 100(ptr) AccessChain 96(psout) 40
109: 6(float) Load 108
Store 107(Depth) 109
108(flattenTemp): 98(ptr) Variable Function
109:8(PS_OUTPUT) FunctionCall 10(@main()
Store 108(flattenTemp) 109
112: 12(ptr) AccessChain 108(flattenTemp) 30
113: 7(fvec4) Load 112
Store 111(Color) 113
116: 103(ptr) AccessChain 108(flattenTemp) 44
117: 6(float) Load 116
Store 115(Depth) 117
Return
FunctionEnd
10(@main():8(PS_OUTPUT) Function None 9
11: Label
13(txval10): 12(ptr) Variable Function
34(txval11): 33(ptr) Variable Function
49(txval12): 48(ptr) Variable Function
61(txval20): 12(ptr) Variable Function
74(txval21): 33(ptr) Variable Function
85(txval22): 48(ptr) Variable Function
99(psout): 98(ptr) Variable Function
17: 14 Load 16(g_tTex1df4)
21: 18 Load 20(g_sSamp)
23: 22 SampledImage 17 21
31: 7(fvec4) ImageSampleExplicitLod 23 27 Lod ConstOffset 28 30
Store 13(txval10) 31
38: 35 Load 37(g_tTex1di4)
39: 18 Load 20(g_sSamp)
41: 40 SampledImage 38 39
45: 32(ivec4) ImageSampleExplicitLod 41 43 Lod ConstOffset 28 44
Store 34(txval11) 45
53: 50 Load 52(g_tTex1du4)
54: 18 Load 20(g_sSamp)
56: 55 SampledImage 53 54
60: 47(ivec4) ImageSampleExplicitLod 56 58 Lod ConstOffset 28 59
Store 49(txval12) 60
65: 62 Load 64(g_tTex2df4)
66: 18 Load 20(g_sSamp)
68: 67 SampledImage 65 66
73: 7(fvec4) ImageSampleExplicitLod 68 70 Lod ConstOffset 28 72
Store 61(txval20) 73
78: 75 Load 77(g_tTex2di4)
79: 18 Load 20(g_sSamp)
81: 80 SampledImage 78 79
84: 32(ivec4) ImageSampleExplicitLod 81 83 Lod ConstOffset 28 72
Store 74(txval21) 84
89: 86 Load 88(g_tTex2du4)
90: 18 Load 20(g_sSamp)
92: 91 SampledImage 89 90
97: 47(ivec4) ImageSampleExplicitLod 92 95 Lod ConstOffset 28 96
Store 85(txval22) 97
102: 12(ptr) AccessChain 99(psout) 30
Store 102 101
104: 103(ptr) AccessChain 99(psout) 44
Store 104 100
105:8(PS_OUTPUT) Load 99(psout)
ReturnValue 105
FunctionEnd