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,12 +2,15 @@ hlsl.structarray.flatten.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:23 Function Definition: main(struct-PS_OUTPUT-vf41; (temp void)
0:23 Function Definition: @main(struct-PS_OUTPUT-vf41; (temp void)
0:23 Function Parameters:
0:23 'ps_output' (out structure{temp 4-component vector of float color})
0:? Sequence
0:24 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:24 color: direct index for structure (temp 4-component vector of float)
0:24 'ps_output' (out structure{temp 4-component vector of float color})
0:24 Constant:
0:24 0 (const int)
0:26 add (temp 4-component vector of float)
0:25 add (temp 4-component vector of float)
0:25 texture (temp 4-component vector of float)
@@ -28,8 +31,19 @@ gl_FragCoord origin is upper left
0:? 'g_texdata_array2[1].samp[0]' (uniform sampler)
0:27 Constant:
0:27 0.300000
0:23 Function Definition: main( (temp void)
0:23 Function Parameters:
0:? Sequence
0:23 Function Call: @main(struct-PS_OUTPUT-vf41; (temp void)
0:? 'ps_output' (temp structure{temp 4-component vector of float color})
0:23 Sequence
0:23 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:23 color: direct index for structure (temp 4-component vector of float)
0:? 'ps_output' (temp structure{temp 4-component vector of float color})
0:23 Constant:
0:23 0 (const int)
0:? Linker Objects
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:? 'g_samp' (uniform sampler)
0:? 'g_tex' (uniform texture1D)
0:? 'g_texdata_array2[0].samp[0]' (uniform sampler)
@@ -44,6 +58,7 @@ gl_FragCoord origin is upper left
0:? 'g_texdata_array2[2].samp[1]' (uniform sampler)
0:? 'g_texdata_array2[2].tex[0]' (uniform texture1D)
0:? 'g_texdata_array2[2].tex[1]' (uniform texture1D)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
Linked fragment stage:
@@ -52,12 +67,15 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:23 Function Definition: main(struct-PS_OUTPUT-vf41; (temp void)
0:23 Function Definition: @main(struct-PS_OUTPUT-vf41; (temp void)
0:23 Function Parameters:
0:23 'ps_output' (out structure{temp 4-component vector of float color})
0:? Sequence
0:24 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:24 color: direct index for structure (temp 4-component vector of float)
0:24 'ps_output' (out structure{temp 4-component vector of float color})
0:24 Constant:
0:24 0 (const int)
0:26 add (temp 4-component vector of float)
0:25 add (temp 4-component vector of float)
0:25 texture (temp 4-component vector of float)
@@ -78,8 +96,19 @@ gl_FragCoord origin is upper left
0:? 'g_texdata_array2[1].samp[0]' (uniform sampler)
0:27 Constant:
0:27 0.300000
0:23 Function Definition: main( (temp void)
0:23 Function Parameters:
0:? Sequence
0:23 Function Call: @main(struct-PS_OUTPUT-vf41; (temp void)
0:? 'ps_output' (temp structure{temp 4-component vector of float color})
0:23 Sequence
0:23 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:23 color: direct index for structure (temp 4-component vector of float)
0:? 'ps_output' (temp structure{temp 4-component vector of float color})
0:23 Constant:
0:23 0 (const int)
0:? Linker Objects
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:? 'g_samp' (uniform sampler)
0:? 'g_tex' (uniform texture1D)
0:? 'g_texdata_array2[0].samp[0]' (uniform sampler)
@@ -94,104 +123,131 @@ gl_FragCoord origin is upper left
0:? 'g_texdata_array2[2].samp[1]' (uniform sampler)
0:? 'g_texdata_array2[2].tex[0]' (uniform texture1D)
0:? 'g_texdata_array2[2].tex[1]' (uniform texture1D)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 50
// Id's are bound by 66
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9
EntryPoint Fragment 4 "main" 51
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "color"
Name 12 "tex"
Name 16 "samp"
Name 22 "g_texdata_array[1].tex"
Name 24 "g_texdata_array[1].samp"
Name 30 "g_texdata_array2[1].tex[0]"
Name 32 "g_texdata_array2[1].samp[0]"
Name 38 "g_samp"
Name 39 "g_tex"
Name 40 "g_texdata_array2[0].samp[0]"
Name 41 "g_texdata_array2[0].samp[1]"
Name 42 "g_texdata_array2[0].tex[0]"
Name 43 "g_texdata_array2[0].tex[1]"
Name 44 "g_texdata_array2[1].samp[1]"
Name 45 "g_texdata_array2[1].tex[1]"
Name 46 "g_texdata_array2[2].samp[0]"
Name 47 "g_texdata_array2[2].samp[1]"
Name 48 "g_texdata_array2[2].tex[0]"
Name 49 "g_texdata_array2[2].tex[1]"
Decorate 9(color) Location 0
Decorate 12(tex) DescriptorSet 0
Decorate 16(samp) DescriptorSet 0
Decorate 22(g_texdata_array[1].tex) DescriptorSet 0
Decorate 24(g_texdata_array[1].samp) DescriptorSet 0
Decorate 30(g_texdata_array2[1].tex[0]) DescriptorSet 0
Decorate 32(g_texdata_array2[1].samp[0]) DescriptorSet 0
Decorate 38(g_samp) DescriptorSet 0
Decorate 39(g_tex) DescriptorSet 0
Decorate 40(g_texdata_array2[0].samp[0]) DescriptorSet 0
Decorate 41(g_texdata_array2[0].samp[1]) DescriptorSet 0
Decorate 42(g_texdata_array2[0].tex[0]) DescriptorSet 0
Decorate 43(g_texdata_array2[0].tex[1]) DescriptorSet 0
Decorate 44(g_texdata_array2[1].samp[1]) DescriptorSet 0
Decorate 45(g_texdata_array2[1].tex[1]) DescriptorSet 0
Decorate 46(g_texdata_array2[2].samp[0]) DescriptorSet 0
Decorate 47(g_texdata_array2[2].samp[1]) DescriptorSet 0
Decorate 48(g_texdata_array2[2].tex[0]) DescriptorSet 0
Decorate 49(g_texdata_array2[2].tex[1]) DescriptorSet 0
Name 8 "PS_OUTPUT"
MemberName 8(PS_OUTPUT) 0 "color"
Name 12 "@main(struct-PS_OUTPUT-vf41;"
Name 11 "ps_output"
Name 18 "tex"
Name 22 "samp"
Name 28 "g_texdata_array[1].tex"
Name 30 "g_texdata_array[1].samp"
Name 36 "g_texdata_array2[1].tex[0]"
Name 38 "g_texdata_array2[1].samp[0]"
Name 46 "ps_output"
Name 47 "param"
Name 51 "color"
Name 54 "g_samp"
Name 55 "g_tex"
Name 56 "g_texdata_array2[0].samp[0]"
Name 57 "g_texdata_array2[0].samp[1]"
Name 58 "g_texdata_array2[0].tex[0]"
Name 59 "g_texdata_array2[0].tex[1]"
Name 60 "g_texdata_array2[1].samp[1]"
Name 61 "g_texdata_array2[1].tex[1]"
Name 62 "g_texdata_array2[2].samp[0]"
Name 63 "g_texdata_array2[2].samp[1]"
Name 64 "g_texdata_array2[2].tex[0]"
Name 65 "g_texdata_array2[2].tex[1]"
Decorate 18(tex) DescriptorSet 0
Decorate 22(samp) DescriptorSet 0
Decorate 28(g_texdata_array[1].tex) DescriptorSet 0
Decorate 30(g_texdata_array[1].samp) DescriptorSet 0
Decorate 36(g_texdata_array2[1].tex[0]) DescriptorSet 0
Decorate 38(g_texdata_array2[1].samp[0]) DescriptorSet 0
Decorate 51(color) Location 0
Decorate 54(g_samp) DescriptorSet 0
Decorate 55(g_tex) DescriptorSet 0
Decorate 56(g_texdata_array2[0].samp[0]) DescriptorSet 0
Decorate 57(g_texdata_array2[0].samp[1]) DescriptorSet 0
Decorate 58(g_texdata_array2[0].tex[0]) DescriptorSet 0
Decorate 59(g_texdata_array2[0].tex[1]) DescriptorSet 0
Decorate 60(g_texdata_array2[1].samp[1]) DescriptorSet 0
Decorate 61(g_texdata_array2[1].tex[1]) DescriptorSet 0
Decorate 62(g_texdata_array2[2].samp[0]) DescriptorSet 0
Decorate 63(g_texdata_array2[2].samp[1]) DescriptorSet 0
Decorate 64(g_texdata_array2[2].tex[0]) DescriptorSet 0
Decorate 65(g_texdata_array2[2].tex[1]) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(color): 8(ptr) Variable Output
10: TypeImage 6(float) 1D sampled format:Unknown
11: TypePointer UniformConstant 10
12(tex): 11(ptr) Variable UniformConstant
14: TypeSampler
15: TypePointer UniformConstant 14
16(samp): 15(ptr) Variable UniformConstant
18: TypeSampledImage 10
20: 6(float) Constant 1056964608
22(g_texdata_array[1].tex): 11(ptr) Variable UniformConstant
24(g_texdata_array[1].samp): 15(ptr) Variable UniformConstant
27: 6(float) Constant 1053609165
30(g_texdata_array2[1].tex[0]): 11(ptr) Variable UniformConstant
32(g_texdata_array2[1].samp[0]): 15(ptr) Variable UniformConstant
35: 6(float) Constant 1050253722
38(g_samp): 15(ptr) Variable UniformConstant
39(g_tex): 11(ptr) Variable UniformConstant
40(g_texdata_array2[0].samp[0]): 15(ptr) Variable UniformConstant
41(g_texdata_array2[0].samp[1]): 15(ptr) Variable UniformConstant
42(g_texdata_array2[0].tex[0]): 11(ptr) Variable UniformConstant
43(g_texdata_array2[0].tex[1]): 11(ptr) Variable UniformConstant
44(g_texdata_array2[1].samp[1]): 15(ptr) Variable UniformConstant
45(g_texdata_array2[1].tex[1]): 11(ptr) Variable UniformConstant
46(g_texdata_array2[2].samp[0]): 15(ptr) Variable UniformConstant
47(g_texdata_array2[2].samp[1]): 15(ptr) Variable UniformConstant
48(g_texdata_array2[2].tex[0]): 11(ptr) Variable UniformConstant
49(g_texdata_array2[2].tex[1]): 11(ptr) Variable UniformConstant
8(PS_OUTPUT): TypeStruct 7(fvec4)
9: TypePointer Function 8(PS_OUTPUT)
10: TypeFunction 2 9(ptr)
14: TypeInt 32 1
15: 14(int) Constant 0
16: TypeImage 6(float) 1D sampled format:Unknown
17: TypePointer UniformConstant 16
18(tex): 17(ptr) Variable UniformConstant
20: TypeSampler
21: TypePointer UniformConstant 20
22(samp): 21(ptr) Variable UniformConstant
24: TypeSampledImage 16
26: 6(float) Constant 1056964608
28(g_texdata_array[1].tex): 17(ptr) Variable UniformConstant
30(g_texdata_array[1].samp): 21(ptr) Variable UniformConstant
33: 6(float) Constant 1053609165
36(g_texdata_array2[1].tex[0]): 17(ptr) Variable UniformConstant
38(g_texdata_array2[1].samp[0]): 21(ptr) Variable UniformConstant
41: 6(float) Constant 1050253722
44: TypePointer Function 7(fvec4)
50: TypePointer Output 7(fvec4)
51(color): 50(ptr) Variable Output
54(g_samp): 21(ptr) Variable UniformConstant
55(g_tex): 17(ptr) Variable UniformConstant
56(g_texdata_array2[0].samp[0]): 21(ptr) Variable UniformConstant
57(g_texdata_array2[0].samp[1]): 21(ptr) Variable UniformConstant
58(g_texdata_array2[0].tex[0]): 17(ptr) Variable UniformConstant
59(g_texdata_array2[0].tex[1]): 17(ptr) Variable UniformConstant
60(g_texdata_array2[1].samp[1]): 21(ptr) Variable UniformConstant
61(g_texdata_array2[1].tex[1]): 17(ptr) Variable UniformConstant
62(g_texdata_array2[2].samp[0]): 21(ptr) Variable UniformConstant
63(g_texdata_array2[2].samp[1]): 21(ptr) Variable UniformConstant
64(g_texdata_array2[2].tex[0]): 17(ptr) Variable UniformConstant
65(g_texdata_array2[2].tex[1]): 17(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
13: 10 Load 12(tex)
17: 14 Load 16(samp)
19: 18 SampledImage 13 17
21: 7(fvec4) ImageSampleImplicitLod 19 20
23: 10 Load 22(g_texdata_array[1].tex)
25: 14 Load 24(g_texdata_array[1].samp)
26: 18 SampledImage 23 25
28: 7(fvec4) ImageSampleImplicitLod 26 27
29: 7(fvec4) FAdd 21 28
31: 10 Load 30(g_texdata_array2[1].tex[0])
33: 14 Load 32(g_texdata_array2[1].samp[0])
34: 18 SampledImage 31 33
36: 7(fvec4) ImageSampleImplicitLod 34 35
37: 7(fvec4) FAdd 29 36
Store 9(color) 37
46(ps_output): 9(ptr) Variable Function
47(param): 9(ptr) Variable Function
48: 2 FunctionCall 12(@main(struct-PS_OUTPUT-vf41;) 47(param)
49:8(PS_OUTPUT) Load 47(param)
Store 46(ps_output) 49
52: 44(ptr) AccessChain 46(ps_output) 15
53: 7(fvec4) Load 52
Store 51(color) 53
Return
FunctionEnd
12(@main(struct-PS_OUTPUT-vf41;): 2 Function None 10
11(ps_output): 9(ptr) FunctionParameter
13: Label
19: 16 Load 18(tex)
23: 20 Load 22(samp)
25: 24 SampledImage 19 23
27: 7(fvec4) ImageSampleImplicitLod 25 26
29: 16 Load 28(g_texdata_array[1].tex)
31: 20 Load 30(g_texdata_array[1].samp)
32: 24 SampledImage 29 31
34: 7(fvec4) ImageSampleImplicitLod 32 33
35: 7(fvec4) FAdd 27 34
37: 16 Load 36(g_texdata_array2[1].tex[0])
39: 20 Load 38(g_texdata_array2[1].samp[0])
40: 24 SampledImage 37 39
42: 7(fvec4) ImageSampleImplicitLod 40 41
43: 7(fvec4) FAdd 35 42
45: 44(ptr) AccessChain 11(ps_output) 15
Store 45 43
Return
FunctionEnd