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

@ -323,12 +323,12 @@ Shader version: 500
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 120
// Id's are bound by 108
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 108 115
EntryPoint Vertex 4 "main" 96 103
Source HLSL 500
Name 4 "main"
Name 9 "VertexOut"
@ -342,21 +342,21 @@ Shader version: 500
Name 21 "r5("
Name 23 "@main("
Name 44 "f"
Name 56 "f"
Name 57 "scalarCopy"
Name 72 "f"
Name 73 "scalarCopy"
Name 88 "v0"
Name 90 "v1"
Name 92 "v2"
Name 94 "v3"
Name 96 "v4"
Name 98 "v5"
Name 105 "flattenTemp"
Name 108 "@entryPointOutput.position"
Name 115 "@entryPointOutput.texCoord"
Decorate 108(@entryPointOutput.position) BuiltIn Position
Decorate 115(@entryPointOutput.texCoord) Location 0
Name 52 "f"
Name 53 "scalarCopy"
Name 64 "f"
Name 65 "scalarCopy"
Name 76 "v0"
Name 78 "v1"
Name 80 "v2"
Name 82 "v3"
Name 84 "v4"
Name 86 "v5"
Name 93 "flattenTemp"
Name 96 "@entryPointOutput.position"
Name 103 "@entryPointOutput.texCoord"
Decorate 96(@entryPointOutput.position) BuiltIn Position
Decorate 103(@entryPointOutput.texCoord) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -377,31 +377,31 @@ Shader version: 500
39: 8(fvec2) ConstantComposite 37 37
40:9(VertexOut) ConstantComposite 38 39
43: TypePointer Function 6(float)
59: 6(float) Constant 1065353216
87: TypePointer Function 9(VertexOut)
100: 7(fvec4) ConstantComposite 59 59 59 59
101: 8(fvec2) ConstantComposite 59 59
102:9(VertexOut) ConstantComposite 100 101
107: TypePointer Output 7(fvec4)
108(@entryPointOutput.position): 107(ptr) Variable Output
109: TypeInt 32 1
110: 109(int) Constant 0
111: TypePointer Function 7(fvec4)
114: TypePointer Output 8(fvec2)
115(@entryPointOutput.texCoord): 114(ptr) Variable Output
116: 109(int) Constant 1
117: TypePointer Function 8(fvec2)
55: 6(float) Constant 1065353216
75: TypePointer Function 9(VertexOut)
88: 7(fvec4) ConstantComposite 55 55 55 55
89: 8(fvec2) ConstantComposite 55 55
90:9(VertexOut) ConstantComposite 88 89
95: TypePointer Output 7(fvec4)
96(@entryPointOutput.position): 95(ptr) Variable Output
97: TypeInt 32 1
98: 97(int) Constant 0
99: TypePointer Function 7(fvec4)
102: TypePointer Output 8(fvec2)
103(@entryPointOutput.texCoord): 102(ptr) Variable Output
104: 97(int) Constant 1
105: TypePointer Function 8(fvec2)
4(main): 2 Function None 3
5: Label
105(flattenTemp): 87(ptr) Variable Function
106:9(VertexOut) FunctionCall 23(@main()
Store 105(flattenTemp) 106
112: 111(ptr) AccessChain 105(flattenTemp) 110
113: 7(fvec4) Load 112
Store 108(@entryPointOutput.position) 113
118: 117(ptr) AccessChain 105(flattenTemp) 116
119: 8(fvec2) Load 118
Store 115(@entryPointOutput.texCoord) 119
93(flattenTemp): 75(ptr) Variable Function
94:9(VertexOut) FunctionCall 23(@main()
Store 93(flattenTemp) 94
100: 99(ptr) AccessChain 93(flattenTemp) 98
101: 7(fvec4) Load 100
Store 96(@entryPointOutput.position) 101
106: 105(ptr) AccessChain 93(flattenTemp) 104
107: 8(fvec2) Load 106
Store 103(@entryPointOutput.texCoord) 107
Return
FunctionEnd
11(r0():9(VertexOut) Function None 10
@ -421,73 +421,61 @@ Shader version: 500
44(f): 43(ptr) Variable Function
Store 44(f) 25
45: 6(float) Load 44(f)
46: 6(float) Load 44(f)
46: 7(fvec4) CompositeConstruct 45 45 45 45
47: 6(float) Load 44(f)
48: 6(float) Load 44(f)
49: 7(fvec4) CompositeConstruct 45 46 47 48
50: 6(float) Load 44(f)
51: 6(float) Load 44(f)
52: 8(fvec2) CompositeConstruct 50 51
53:9(VertexOut) CompositeConstruct 49 52
ReturnValue 53
48: 8(fvec2) CompositeConstruct 47 47
49:9(VertexOut) CompositeConstruct 46 48
ReturnValue 49
FunctionEnd
19(r4():9(VertexOut) Function None 10
20: Label
56(f): 43(ptr) Variable Function
57(scalarCopy): 43(ptr) Variable Function
Store 56(f) 25
58: 6(float) Load 56(f)
60: 6(float) FAdd 58 59
Store 57(scalarCopy) 60
61: 6(float) Load 57(scalarCopy)
62: 6(float) Load 57(scalarCopy)
63: 6(float) Load 57(scalarCopy)
64: 6(float) Load 57(scalarCopy)
65: 7(fvec4) CompositeConstruct 61 62 63 64
66: 6(float) Load 57(scalarCopy)
67: 6(float) Load 57(scalarCopy)
68: 8(fvec2) CompositeConstruct 66 67
69:9(VertexOut) CompositeConstruct 65 68
ReturnValue 69
52(f): 43(ptr) Variable Function
53(scalarCopy): 43(ptr) Variable Function
Store 52(f) 25
54: 6(float) Load 52(f)
56: 6(float) FAdd 54 55
Store 53(scalarCopy) 56
57: 6(float) Load 53(scalarCopy)
58: 7(fvec4) CompositeConstruct 57 57 57 57
59: 6(float) Load 53(scalarCopy)
60: 8(fvec2) CompositeConstruct 59 59
61:9(VertexOut) CompositeConstruct 58 60
ReturnValue 61
FunctionEnd
21(r5():9(VertexOut) Function None 10
22: Label
72(f): 43(ptr) Variable Function
73(scalarCopy): 43(ptr) Variable Function
Store 72(f) 25
74: 6(float) Load 72(f)
75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74
Store 73(scalarCopy) 75
76: 6(float) Load 73(scalarCopy)
77: 6(float) Load 73(scalarCopy)
78: 6(float) Load 73(scalarCopy)
79: 6(float) Load 73(scalarCopy)
80: 7(fvec4) CompositeConstruct 76 77 78 79
81: 6(float) Load 73(scalarCopy)
82: 6(float) Load 73(scalarCopy)
83: 8(fvec2) CompositeConstruct 81 82
84:9(VertexOut) CompositeConstruct 80 83
ReturnValue 84
64(f): 43(ptr) Variable Function
65(scalarCopy): 43(ptr) Variable Function
Store 64(f) 25
66: 6(float) Load 64(f)
67: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 66
Store 65(scalarCopy) 67
68: 6(float) Load 65(scalarCopy)
69: 7(fvec4) CompositeConstruct 68 68 68 68
70: 6(float) Load 65(scalarCopy)
71: 8(fvec2) CompositeConstruct 70 70
72:9(VertexOut) CompositeConstruct 69 71
ReturnValue 72
FunctionEnd
23(@main():9(VertexOut) Function None 10
24: Label
88(v0): 87(ptr) Variable Function
90(v1): 87(ptr) Variable Function
92(v2): 87(ptr) Variable Function
94(v3): 87(ptr) Variable Function
96(v4): 87(ptr) Variable Function
98(v5): 87(ptr) Variable Function
89:9(VertexOut) FunctionCall 11(r0()
Store 88(v0) 89
91:9(VertexOut) FunctionCall 13(r1()
Store 90(v1) 91
93:9(VertexOut) FunctionCall 15(r2()
Store 92(v2) 93
95:9(VertexOut) FunctionCall 17(r3()
Store 94(v3) 95
97:9(VertexOut) FunctionCall 19(r4()
Store 96(v4) 97
99:9(VertexOut) FunctionCall 21(r5()
Store 98(v5) 99
ReturnValue 102
76(v0): 75(ptr) Variable Function
78(v1): 75(ptr) Variable Function
80(v2): 75(ptr) Variable Function
82(v3): 75(ptr) Variable Function
84(v4): 75(ptr) Variable Function
86(v5): 75(ptr) Variable Function
77:9(VertexOut) FunctionCall 11(r0()
Store 76(v0) 77
79:9(VertexOut) FunctionCall 13(r1()
Store 78(v1) 79
81:9(VertexOut) FunctionCall 15(r2()
Store 80(v2) 81
83:9(VertexOut) FunctionCall 17(r3()
Store 82(v3) 83
85:9(VertexOut) FunctionCall 19(r4()
Store 84(v4) 85
87:9(VertexOut) FunctionCall 21(r5()
Store 86(v5) 87
ReturnValue 90
FunctionEnd