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.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:25 Sequence
@@ -64,24 +64,28 @@ gl_FragCoord origin is upper left
0:33 1 (const int)
0:33 Constant:
0:33 1.000000
0:35 Sequence
0:35 Sequence
0:35 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:35 Color: direct index for structure (temp 4-component vector of float)
0:35 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:35 Constant:
0:35 0 (const int)
0:35 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:35 Depth: direct index for structure (temp float)
0:35 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:35 Constant:
0:35 1 (const int)
0:35 Branch: Return
0:35 Branch: Return with expression
0:35 '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)
@@ -90,6 +94,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:
@@ -98,7 +104,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:25 Sequence
@@ -160,24 +166,28 @@ gl_FragCoord origin is upper left
0:33 1 (const int)
0:33 Constant:
0:33 1.000000
0:35 Sequence
0:35 Sequence
0:35 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:35 Color: direct index for structure (temp 4-component vector of float)
0:35 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:35 Constant:
0:35 0 (const int)
0:35 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:35 Depth: direct index for structure (temp float)
0:35 'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
0:35 Constant:
0:35 1 (const int)
0:35 Branch: Return
0:35 Branch: Return with expression
0:35 '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)
@@ -186,141 +196,154 @@ 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 90
// Id's are bound by 97
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 72 76
EntryPoint Fragment 4 "main" 80 84
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval20"
Name 12 "g_tTex2df4"
Name 16 "g_sSamp"
Name 33 "txval21"
Name 36 "g_tTex2di4"
Name 48 "txval22"
Name 51 "g_tTex2du4"
Name 63 "PS_OUTPUT"
MemberName 63(PS_OUTPUT) 0 "Color"
MemberName 63(PS_OUTPUT) 1 "Depth"
Name 65 "psout"
Name 72 "Color"
Name 76 "Depth"
Name 82 "g_tTex1df4a"
Name 83 "g_tTex1df4"
Name 86 "g_tTex1di4"
Name 89 "g_tTex1du4"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 36(g_tTex2di4) DescriptorSet 0
Decorate 51(g_tTex2du4) DescriptorSet 0
Decorate 72(Color) Location 0
Decorate 76(Depth) BuiltIn FragDepth
Decorate 82(g_tTex1df4a) DescriptorSet 0
Decorate 82(g_tTex1df4a) Binding 1
Decorate 83(g_tTex1df4) DescriptorSet 0
Decorate 83(g_tTex1df4) Binding 0
Decorate 86(g_tTex1di4) DescriptorSet 0
Decorate 89(g_tTex1du4) 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 37 "txval21"
Name 40 "g_tTex2di4"
Name 52 "txval22"
Name 55 "g_tTex2du4"
Name 68 "psout"
Name 77 "flattenTemp"
Name 80 "Color"
Name 84 "Depth"
Name 89 "g_tTex1df4a"
Name 90 "g_tTex1df4"
Name 93 "g_tTex1di4"
Name 96 "g_tTex1du4"
Decorate 16(g_tTex2df4) DescriptorSet 0
Decorate 20(g_sSamp) DescriptorSet 0
Decorate 20(g_sSamp) Binding 0
Decorate 40(g_tTex2di4) DescriptorSet 0
Decorate 55(g_tTex2du4) DescriptorSet 0
Decorate 80(Color) Location 0
Decorate 84(Depth) BuiltIn FragDepth
Decorate 89(g_tTex1df4a) DescriptorSet 0
Decorate 89(g_tTex1df4a) Binding 1
Decorate 90(g_tTex1df4) DescriptorSet 0
Decorate 90(g_tTex1df4) Binding 0
Decorate 93(g_tTex1di4) DescriptorSet 0
Decorate 96(g_tTex1du4) 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 array 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 array sampled format:Unknown
15: TypePointer UniformConstant 14
16(g_sSamp): 15(ptr) Variable UniformConstant
18: TypeSampledImage 10
20: TypeVector 6(float) 3
21: 6(float) Constant 1036831949
22: 6(float) Constant 1045220557
23: 6(float) Constant 1050253722
24: 20(fvec3) ConstantComposite 21 22 23
25: TypeInt 32 1
26: TypeVector 25(int) 2
27: 25(int) Constant 1
28: 25(int) Constant 0
29: 26(ivec2) ConstantComposite 27 28
31: TypeVector 25(int) 4
32: TypePointer Function 31(ivec4)
34: TypeImage 25(int) 2D array sampled format:Unknown
35: TypePointer UniformConstant 34
36(g_tTex2di4): 35(ptr) Variable UniformConstant
39: TypeSampledImage 34
41: 6(float) Constant 1053609165
42: 20(fvec3) ConstantComposite 23 41 41
43: 26(ivec2) ConstantComposite 27 27
45: TypeInt 32 0
46: TypeVector 45(int) 4
47: TypePointer Function 46(ivec4)
49: TypeImage 45(int) 2D array 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: 6(float) Constant 1060320051
59: 20(fvec3) ConstantComposite 56 57 58
60: 25(int) Constant 4294967295
61: 26(ivec2) ConstantComposite 27 60
63(PS_OUTPUT): TypeStruct 7(fvec4) 6(float)
64: TypePointer Function 63(PS_OUTPUT)
66: 6(float) Constant 1065353216
67: 7(fvec4) ConstantComposite 66 66 66 66
69: TypePointer Function 6(float)
71: TypePointer Output 7(fvec4)
72(Color): 71(ptr) Variable Output
75: TypePointer Output 6(float)
76(Depth): 75(ptr) Variable Output
80: TypeImage 6(float) 1D array sampled format:Unknown
81: TypePointer UniformConstant 80
82(g_tTex1df4a): 81(ptr) Variable UniformConstant
83(g_tTex1df4): 81(ptr) Variable UniformConstant
84: TypeImage 25(int) 1D array sampled format:Unknown
85: TypePointer UniformConstant 84
86(g_tTex1di4): 85(ptr) Variable UniformConstant
87: TypeImage 45(int) 1D array 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) 3
25: 6(float) Constant 1036831949
26: 6(float) Constant 1045220557
27: 6(float) Constant 1050253722
28: 24(fvec3) ConstantComposite 25 26 27
29: TypeInt 32 1
30: TypeVector 29(int) 2
31: 29(int) Constant 1
32: 29(int) Constant 0
33: 30(ivec2) ConstantComposite 31 32
35: TypeVector 29(int) 4
36: TypePointer Function 35(ivec4)
38: TypeImage 29(int) 2D array sampled format:Unknown
39: TypePointer UniformConstant 38
40(g_tTex2di4): 39(ptr) Variable UniformConstant
43: TypeSampledImage 38
45: 6(float) Constant 1053609165
46: 24(fvec3) ConstantComposite 27 45 45
47: 30(ivec2) ConstantComposite 31 31
49: TypeInt 32 0
50: TypeVector 49(int) 4
51: TypePointer Function 50(ivec4)
53: TypeImage 49(int) 2D array 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: 6(float) Constant 1060320051
63: 24(fvec3) ConstantComposite 60 61 62
64: 29(int) Constant 4294967295
65: 30(ivec2) ConstantComposite 31 64
67: TypePointer Function 8(PS_OUTPUT)
69: 6(float) Constant 1065353216
70: 7(fvec4) ConstantComposite 69 69 69 69
72: TypePointer Function 6(float)
79: TypePointer Output 7(fvec4)
80(Color): 79(ptr) Variable Output
83: TypePointer Output 6(float)
84(Depth): 83(ptr) Variable Output
87: TypeImage 6(float) 1D array sampled format:Unknown
88: TypePointer UniformConstant 87
89(g_tTex1du4): 88(ptr) Variable UniformConstant
89(g_tTex1df4a): 88(ptr) Variable UniformConstant
90(g_tTex1df4): 88(ptr) Variable UniformConstant
91: TypeImage 29(int) 1D array sampled format:Unknown
92: TypePointer UniformConstant 91
93(g_tTex1di4): 92(ptr) Variable UniformConstant
94: TypeImage 49(int) 1D array sampled format:Unknown
95: TypePointer UniformConstant 94
96(g_tTex1du4): 95(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function
33(txval21): 32(ptr) Variable Function
48(txval22): 47(ptr) Variable Function
65(psout): 64(ptr) Variable Function
13: 10 Load 12(g_tTex2df4)
17: 14 Load 16(g_sSamp)
19: 18 SampledImage 13 17
30: 7(fvec4) ImageGather 19 24 28 ConstOffset 29
Store 9(txval20) 30
37: 34 Load 36(g_tTex2di4)
38: 14 Load 16(g_sSamp)
40: 39 SampledImage 37 38
44: 31(ivec4) ImageGather 40 42 28 ConstOffset 43
Store 33(txval21) 44
52: 49 Load 51(g_tTex2du4)
53: 14 Load 16(g_sSamp)
55: 54 SampledImage 52 53
62: 46(ivec4) ImageGather 55 59 28 ConstOffset 61
Store 48(txval22) 62
68: 8(ptr) AccessChain 65(psout) 28
Store 68 67
70: 69(ptr) AccessChain 65(psout) 27
Store 70 66
73: 8(ptr) AccessChain 65(psout) 28
74: 7(fvec4) Load 73
Store 72(Color) 74
77: 69(ptr) AccessChain 65(psout) 27
78: 6(float) Load 77
Store 76(Depth) 78
77(flattenTemp): 67(ptr) Variable Function
78:8(PS_OUTPUT) FunctionCall 10(@main()
Store 77(flattenTemp) 78
81: 12(ptr) AccessChain 77(flattenTemp) 32
82: 7(fvec4) Load 81
Store 80(Color) 82
85: 72(ptr) AccessChain 77(flattenTemp) 31
86: 6(float) Load 85
Store 84(Depth) 86
Return
FunctionEnd
10(@main():8(PS_OUTPUT) Function None 9
11: Label
13(txval20): 12(ptr) Variable Function
37(txval21): 36(ptr) Variable Function
52(txval22): 51(ptr) Variable Function
68(psout): 67(ptr) Variable Function
17: 14 Load 16(g_tTex2df4)
21: 18 Load 20(g_sSamp)
23: 22 SampledImage 17 21
34: 7(fvec4) ImageGather 23 28 32 ConstOffset 33
Store 13(txval20) 34
41: 38 Load 40(g_tTex2di4)
42: 18 Load 20(g_sSamp)
44: 43 SampledImage 41 42
48: 35(ivec4) ImageGather 44 46 32 ConstOffset 47
Store 37(txval21) 48
56: 53 Load 55(g_tTex2du4)
57: 18 Load 20(g_sSamp)
59: 58 SampledImage 56 57
66: 50(ivec4) ImageGather 59 63 32 ConstOffset 65
Store 52(txval22) 66
71: 12(ptr) AccessChain 68(psout) 32
Store 71 70
73: 72(ptr) AccessChain 68(psout) 31
Store 73 69
74:8(PS_OUTPUT) Load 68(psout)
ReturnValue 74
FunctionEnd