Reuse loads generated for repeated function arguments

This commit is contained in:
Jeff Bolz 2024-05-31 11:46:03 -05:00 committed by arcady-lunarg
parent 0e311906b9
commit 6a8b2b2439
11 changed files with 9106 additions and 9441 deletions

View file

@ -291,12 +291,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 126
// Id's are bound by 117
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 112 116 119
EntryPoint Fragment 4 "PixelShaderFunction" 103 107 110
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "PixelShaderFunction"
@ -306,39 +306,39 @@ gl_FragCoord origin is upper left
Name 20 "C"
Name 29 "c2"
Name 35 "b"
Name 48 "tmp"
Name 54 ""
MemberName 54 0 "m"
Name 60 "$Global"
MemberName 60($Global) 0 "a"
MemberName 60($Global) 1 "s"
MemberName 60($Global) 2 "a1"
MemberName 60($Global) 3 "a2"
Name 62 ""
Name 110 "i"
Name 112 "i"
Name 114 "input"
Name 116 "input"
Name 119 "@entryPointOutput"
Name 120 "param"
Name 122 "param"
Decorate 51 ArrayStride 16
Decorate 53 ArrayStride 16
MemberDecorate 54 0 Offset 0
Decorate 56 ArrayStride 112
Decorate 58 ArrayStride 16
Decorate 59 ArrayStride 16
MemberDecorate 60($Global) 0 Offset 0
MemberDecorate 60($Global) 1 Offset 64
MemberDecorate 60($Global) 2 Offset 1296
MemberDecorate 60($Global) 3 Offset 1312
Decorate 60($Global) Block
Decorate 62 DescriptorSet 0
Decorate 62 Binding 0
Decorate 112(i) Flat
Decorate 112(i) Location 0
Decorate 116(input) Location 1
Decorate 119(@entryPointOutput) Location 0
Name 39 "tmp"
Name 45 ""
MemberName 45 0 "m"
Name 51 "$Global"
MemberName 51($Global) 0 "a"
MemberName 51($Global) 1 "s"
MemberName 51($Global) 2 "a1"
MemberName 51($Global) 3 "a2"
Name 53 ""
Name 101 "i"
Name 103 "i"
Name 105 "input"
Name 107 "input"
Name 110 "@entryPointOutput"
Name 111 "param"
Name 113 "param"
Decorate 42 ArrayStride 16
Decorate 44 ArrayStride 16
MemberDecorate 45 0 Offset 0
Decorate 47 ArrayStride 112
Decorate 49 ArrayStride 16
Decorate 50 ArrayStride 16
MemberDecorate 51($Global) 0 Offset 0
MemberDecorate 51($Global) 1 Offset 64
MemberDecorate 51($Global) 2 Offset 1296
MemberDecorate 51($Global) 3 Offset 1312
Decorate 51($Global) Block
Decorate 53 DescriptorSet 0
Decorate 53 Binding 0
Decorate 103(i) Flat
Decorate 103(i) Location 0
Decorate 107(input) Location 1
Decorate 110(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -364,53 +364,53 @@ gl_FragCoord origin is upper left
32: 10(int) Constant 10
33: TypeArray 9(fvec4) 32
34: TypePointer Function 33
47: TypePointer Function 9(fvec4)
50: 10(int) Constant 4
51: TypeArray 9(fvec4) 50
52: 10(int) Constant 7
53: TypeArray 9(fvec4) 52
54: TypeStruct 53
55: 10(int) Constant 11
56: TypeArray 54(struct) 55
57: 10(int) Constant 1
58: TypeArray 9(fvec4) 57
59: TypeArray 9(fvec4) 26
60($Global): TypeStruct 51 56 58 59
61: TypePointer Uniform 60($Global)
62: 61(ptr) Variable Uniform
63: 6(int) Constant 2
64: 6(int) Constant 0
65: TypePointer Uniform 9(fvec4)
70: 6(int) Constant 3
79: 6(int) Constant 1
93: 6(int) Constant 5
111: TypePointer Input 6(int)
112(i): 111(ptr) Variable Input
115: TypePointer Input 12
116(input): 115(ptr) Variable Input
118: TypePointer Output 9(fvec4)
119(@entryPointOutput): 118(ptr) Variable Output
125: 58 ConstantComposite 25
38: TypePointer Function 9(fvec4)
41: 10(int) Constant 4
42: TypeArray 9(fvec4) 41
43: 10(int) Constant 7
44: TypeArray 9(fvec4) 43
45: TypeStruct 44
46: 10(int) Constant 11
47: TypeArray 45(struct) 46
48: 10(int) Constant 1
49: TypeArray 9(fvec4) 48
50: TypeArray 9(fvec4) 26
51($Global): TypeStruct 42 47 49 50
52: TypePointer Uniform 51($Global)
53: 52(ptr) Variable Uniform
54: 6(int) Constant 2
55: 6(int) Constant 0
56: TypePointer Uniform 9(fvec4)
61: 6(int) Constant 3
70: 6(int) Constant 1
84: 6(int) Constant 5
102: TypePointer Input 6(int)
103(i): 102(ptr) Variable Input
106: TypePointer Input 12
107(input): 106(ptr) Variable Input
109: TypePointer Output 9(fvec4)
110(@entryPointOutput): 109(ptr) Variable Output
116: 49 ConstantComposite 25
4(PixelShaderFunction): 2 Function None 3
5: Label
110(i): 7(ptr) Variable Function
114(input): 13(ptr) Variable Function
120(param): 7(ptr) Variable Function
122(param): 13(ptr) Variable Function
101(i): 7(ptr) Variable Function
105(input): 13(ptr) Variable Function
111(param): 7(ptr) Variable Function
113(param): 13(ptr) Variable Function
Store 20(C) 25
30: 9(fvec4) Load 20(C)
31: 27 CompositeConstruct 30 25
Store 29(c2) 31
113: 6(int) Load 112(i)
Store 110(i) 113
117: 12 Load 116(input)
Store 114(input) 117
121: 6(int) Load 110(i)
Store 120(param) 121
123: 12 Load 114(input)
Store 122(param) 123
124: 9(fvec4) FunctionCall 17(@PixelShaderFunction(i1;vf4[3];) 120(param) 122(param)
Store 119(@entryPointOutput) 124
104: 6(int) Load 103(i)
Store 101(i) 104
108: 12 Load 107(input)
Store 105(input) 108
112: 6(int) Load 101(i)
Store 111(param) 112
114: 12 Load 105(input)
Store 113(param) 114
115: 9(fvec4) FunctionCall 17(@PixelShaderFunction(i1;vf4[3];) 111(param) 113(param)
Store 110(@entryPointOutput) 115
Return
FunctionEnd
17(@PixelShaderFunction(i1;vf4[3];): 9(fvec4) Function None 14
@ -418,59 +418,50 @@ gl_FragCoord origin is upper left
16(input): 13(ptr) FunctionParameter
18: Label
35(b): 34(ptr) Variable Function
48(tmp): 47(ptr) Variable Function
39(tmp): 38(ptr) Variable Function
36: 9(fvec4) Load 20(C)
37: 9(fvec4) Load 20(C)
38: 9(fvec4) Load 20(C)
39: 9(fvec4) Load 20(C)
37: 33 CompositeConstruct 36 36 36 36 36 36 36 36 36 36
Store 35(b) 37
40: 9(fvec4) Load 20(C)
41: 9(fvec4) Load 20(C)
42: 9(fvec4) Load 20(C)
43: 9(fvec4) Load 20(C)
44: 9(fvec4) Load 20(C)
45: 9(fvec4) Load 20(C)
46: 33 CompositeConstruct 36 37 38 39 40 41 42 43 44 45
Store 35(b) 46
49: 9(fvec4) Load 20(C)
66: 65(ptr) AccessChain 62 63 64
67: 9(fvec4) Load 66
68: 9(fvec4) FAdd 49 67
69: 9(fvec4) FAdd 68 25
71: 6(int) Load 15(i)
72: 65(ptr) AccessChain 62 70 71
73: 9(fvec4) Load 72
74: 9(fvec4) FAdd 69 73
75: 6(int) Load 15(i)
76: 19(ptr) AccessChain 29(c2) 75
77: 9(fvec4) Load 76
78: 9(fvec4) FAdd 74 77
Store 48(tmp) 78
80: 65(ptr) AccessChain 62 64 79
81: 9(fvec4) Load 80
82: 6(int) Load 15(i)
83: 65(ptr) AccessChain 62 64 82
84: 9(fvec4) Load 83
85: 9(fvec4) FAdd 81 84
86: 47(ptr) AccessChain 16(input) 63
87: 9(fvec4) Load 86
88: 9(fvec4) FAdd 85 87
89: 6(int) Load 15(i)
90: 47(ptr) AccessChain 16(input) 89
91: 9(fvec4) Load 90
92: 9(fvec4) FAdd 88 91
94: 47(ptr) AccessChain 35(b) 93
57: 56(ptr) AccessChain 53 54 55
58: 9(fvec4) Load 57
59: 9(fvec4) FAdd 40 58
60: 9(fvec4) FAdd 59 25
62: 6(int) Load 15(i)
63: 56(ptr) AccessChain 53 61 62
64: 9(fvec4) Load 63
65: 9(fvec4) FAdd 60 64
66: 6(int) Load 15(i)
67: 19(ptr) AccessChain 29(c2) 66
68: 9(fvec4) Load 67
69: 9(fvec4) FAdd 65 68
Store 39(tmp) 69
71: 56(ptr) AccessChain 53 55 70
72: 9(fvec4) Load 71
73: 6(int) Load 15(i)
74: 56(ptr) AccessChain 53 55 73
75: 9(fvec4) Load 74
76: 9(fvec4) FAdd 72 75
77: 38(ptr) AccessChain 16(input) 54
78: 9(fvec4) Load 77
79: 9(fvec4) FAdd 76 78
80: 6(int) Load 15(i)
81: 38(ptr) AccessChain 16(input) 80
82: 9(fvec4) Load 81
83: 9(fvec4) FAdd 79 82
85: 38(ptr) AccessChain 35(b) 84
86: 9(fvec4) Load 85
87: 9(fvec4) FAdd 83 86
88: 6(int) Load 15(i)
89: 38(ptr) AccessChain 35(b) 88
90: 9(fvec4) Load 89
91: 9(fvec4) FAdd 87 90
92: 6(int) Load 15(i)
93: 6(int) Load 15(i)
94: 56(ptr) AccessChain 53 70 92 55 93
95: 9(fvec4) Load 94
96: 9(fvec4) FAdd 92 95
97: 6(int) Load 15(i)
98: 47(ptr) AccessChain 35(b) 97
99: 9(fvec4) Load 98
100: 9(fvec4) FAdd 96 99
101: 6(int) Load 15(i)
102: 6(int) Load 15(i)
103: 65(ptr) AccessChain 62 79 101 64 102
104: 9(fvec4) Load 103
105: 9(fvec4) FAdd 100 104
106: 9(fvec4) Load 48(tmp)
107: 9(fvec4) FAdd 105 106
ReturnValue 107
96: 9(fvec4) FAdd 91 95
97: 9(fvec4) Load 39(tmp)
98: 9(fvec4) FAdd 96 97
ReturnValue 98
FunctionEnd