HLSL: Pass opaques by local copy, instead of by interface original.

Also, remove assumption that if something is opaque that it
must be in the UniformConstant storage class.

This allows function declarations to know all parameters will
be in the Function storage class.
This commit is contained in:
John Kessenich 2017-09-08 02:38:07 -06:00 committed by GregF
parent 15fa7ef5f5
commit bed4e4f7e4
12 changed files with 976 additions and 841 deletions

View file

@ -179,12 +179,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 85
// Id's are bound by 99
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 83
EntryPoint Fragment 4 "main" 97
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
@ -201,22 +201,28 @@ gl_FragCoord origin is upper left
Name 30 "s.tex"
Name 31 "f2"
Name 35 "@main("
Name 37 "tex"
Name 68 "s.s2D"
Name 70 "param"
Name 73 "s2.s2D"
Name 74 "s2.tex"
Name 77 "param"
Name 83 "@entryPointOutput"
Decorate 37(tex) DescriptorSet 0
Decorate 68(s.s2D) DescriptorSet 0
Decorate 73(s2.s2D) DescriptorSet 0
Decorate 74(s2.tex) DescriptorSet 0
Decorate 83(@entryPointOutput) Location 0
Name 38 "tex"
Name 70 "s.s2D"
Name 71 "param"
Name 74 "param"
Name 76 "param"
Name 79 "s2.s2D"
Name 80 "s2.tex"
Name 81 "param"
Name 83 "param"
Name 87 "param"
Name 89 "param"
Name 91 "param"
Name 97 "@entryPointOutput"
Decorate 38(tex) DescriptorSet 0
Decorate 70(s.s2D) DescriptorSet 0
Decorate 79(s2.s2D) DescriptorSet 0
Decorate 80(s2.tex) DescriptorSet 0
Decorate 97(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
7: TypePointer UniformConstant 6
7: TypePointer Function 6
8: TypeFloat 32
9: TypeVector 8(float) 4
10: TypeFunction 9(fvec4) 7(ptr)
@ -224,80 +230,100 @@ gl_FragCoord origin is upper left
15: TypePointer Function 14(fvec2)
16: TypeFunction 9(fvec4) 7(ptr) 15(ptr)
21: TypeImage 8(float) 2D sampled format:Unknown
22: TypePointer UniformConstant 21
22: TypePointer Function 21
23: TypeFunction 9(fvec4) 7(ptr) 22(ptr)
28: TypeFunction 9(fvec4) 7(ptr) 22(ptr) 15(ptr)
34: TypeFunction 9(fvec4)
37(tex): 22(ptr) Variable UniformConstant
40: TypeSampledImage 21
42: 8(float) Constant 1045220557
43: 8(float) Constant 1050253722
44: 14(fvec2) ConstantComposite 42 43
68(s.s2D): 7(ptr) Variable UniformConstant
73(s2.s2D): 7(ptr) Variable UniformConstant
74(s2.tex): 22(ptr) Variable UniformConstant
82: TypePointer Output 9(fvec4)
83(@entryPointOutput): 82(ptr) Variable Output
37: TypePointer UniformConstant 21
38(tex): 37(ptr) Variable UniformConstant
41: TypeSampledImage 21
43: 8(float) Constant 1045220557
44: 8(float) Constant 1050253722
45: 14(fvec2) ConstantComposite 43 44
69: TypePointer UniformConstant 6
70(s.s2D): 69(ptr) Variable UniformConstant
79(s2.s2D): 69(ptr) Variable UniformConstant
80(s2.tex): 37(ptr) Variable UniformConstant
96: TypePointer Output 9(fvec4)
97(@entryPointOutput): 96(ptr) Variable Output
4(main): 2 Function None 3
5: Label
84: 9(fvec4) FunctionCall 35(@main()
Store 83(@entryPointOutput) 84
98: 9(fvec4) FunctionCall 35(@main()
Store 97(@entryPointOutput) 98
Return
FunctionEnd
12(osCall1(struct-os-p11;): 9(fvec4) Function None 10
11(s.s2D): 7(ptr) FunctionParameter
13: Label
38: 21 Load 37(tex)
39: 6 Load 11(s.s2D)
41: 40 SampledImage 38 39
45: 9(fvec4) ImageSampleImplicitLod 41 44
ReturnValue 45
39: 21 Load 38(tex)
40: 6 Load 11(s.s2D)
42: 41 SampledImage 39 40
46: 9(fvec4) ImageSampleImplicitLod 42 45
ReturnValue 46
FunctionEnd
19(osCall2(struct-os-p11;vf2;): 9(fvec4) Function None 16
17(s.s2D): 7(ptr) FunctionParameter
18(f2): 15(ptr) FunctionParameter
20: Label
48: 21 Load 37(tex)
49: 6 Load 17(s.s2D)
50: 40 SampledImage 48 49
51: 14(fvec2) Load 18(f2)
52: 9(fvec4) ImageSampleImplicitLod 50 51
ReturnValue 52
49: 21 Load 38(tex)
50: 6 Load 17(s.s2D)
51: 41 SampledImage 49 50
52: 14(fvec2) Load 18(f2)
53: 9(fvec4) ImageSampleImplicitLod 51 52
ReturnValue 53
FunctionEnd
26(os2Call1(struct-os2-p1-t211;): 9(fvec4) Function None 23
24(s.s2D): 7(ptr) FunctionParameter
25(s.tex): 22(ptr) FunctionParameter
27: Label
55: 21 Load 25(s.tex)
56: 6 Load 24(s.s2D)
57: 40 SampledImage 55 56
58: 9(fvec4) ImageSampleImplicitLod 57 44
ReturnValue 58
56: 21 Load 25(s.tex)
57: 6 Load 24(s.s2D)
58: 41 SampledImage 56 57
59: 9(fvec4) ImageSampleImplicitLod 58 45
ReturnValue 59
FunctionEnd
32(os2Call2(struct-os2-p1-t211;vf2;): 9(fvec4) Function None 28
29(s.s2D): 7(ptr) FunctionParameter
30(s.tex): 22(ptr) FunctionParameter
31(f2): 15(ptr) FunctionParameter
33: Label
61: 21 Load 30(s.tex)
62: 6 Load 29(s.s2D)
63: 40 SampledImage 61 62
64: 14(fvec2) Load 31(f2)
65: 9(fvec4) ImageSampleImplicitLod 63 64
ReturnValue 65
62: 21 Load 30(s.tex)
63: 6 Load 29(s.s2D)
64: 41 SampledImage 62 63
65: 14(fvec2) Load 31(f2)
66: 9(fvec4) ImageSampleImplicitLod 64 65
ReturnValue 66
FunctionEnd
35(@main(): 9(fvec4) Function None 34
36: Label
70(param): 15(ptr) Variable Function
77(param): 15(ptr) Variable Function
69: 9(fvec4) FunctionCall 12(osCall1(struct-os-p11;) 68(s.s2D)
Store 70(param) 44
71: 9(fvec4) FunctionCall 19(osCall2(struct-os-p11;vf2;) 68(s.s2D) 70(param)
72: 9(fvec4) FAdd 69 71
75: 9(fvec4) FunctionCall 26(os2Call1(struct-os2-p1-t211;) 73(s2.s2D) 74(s2.tex)
76: 9(fvec4) FAdd 72 75
Store 77(param) 44
78: 9(fvec4) FunctionCall 32(os2Call2(struct-os2-p1-t211;vf2;) 73(s2.s2D) 74(s2.tex) 77(param)
79: 9(fvec4) FAdd 76 78
ReturnValue 79
71(param): 7(ptr) Variable Function
74(param): 7(ptr) Variable Function
76(param): 15(ptr) Variable Function
81(param): 7(ptr) Variable Function
83(param): 22(ptr) Variable Function
87(param): 7(ptr) Variable Function
89(param): 22(ptr) Variable Function
91(param): 15(ptr) Variable Function
72: 6 Load 70(s.s2D)
Store 71(param) 72
73: 9(fvec4) FunctionCall 12(osCall1(struct-os-p11;) 71(param)
75: 6 Load 70(s.s2D)
Store 74(param) 75
Store 76(param) 45
77: 9(fvec4) FunctionCall 19(osCall2(struct-os-p11;vf2;) 74(param) 76(param)
78: 9(fvec4) FAdd 73 77
82: 6 Load 79(s2.s2D)
Store 81(param) 82
84: 21 Load 80(s2.tex)
Store 83(param) 84
85: 9(fvec4) FunctionCall 26(os2Call1(struct-os2-p1-t211;) 81(param) 83(param)
86: 9(fvec4) FAdd 78 85
88: 6 Load 79(s2.s2D)
Store 87(param) 88
90: 21 Load 80(s2.tex)
Store 89(param) 90
Store 91(param) 45
92: 9(fvec4) FunctionCall 32(os2Call2(struct-os2-p1-t211;vf2;) 87(param) 89(param) 91(param)
93: 9(fvec4) FAdd 86 92
ReturnValue 93
FunctionEnd