Generate vector constructions more efficiently when sizes match

When two vectors are the same size, there is no need to extract the
components and construct a new vector.
This commit is contained in:
Arcady Goldmints-Orlov 2024-06-21 14:07:50 -04:00 committed by arcady-lunarg
parent 2d8b71fc63
commit 33d517470e
13 changed files with 1777 additions and 1867 deletions

View file

@ -1,10 +1,9 @@
spv.16bitstorage-uint.frag
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 189
// Id's are bound by 182
Capability Shader
Capability Int16
Capability StorageUniformBufferBlock16
Capability StorageUniform16
Extension "SPV_KHR_16bit_storage"
@ -344,18 +343,11 @@ spv.16bitstorage-uint.frag
Store 175 174
176: 42(ptr) AccessChain 27(b1) 32
177: 7(i16vec2) Load 176
178: 6(int16_t) CompositeExtract 177 0
179: 6(int16_t) CompositeExtract 177 1
180: 7(i16vec2) CompositeConstruct 178 179
181: 42(ptr) AccessChain 19(b2) 32
178: 42(ptr) AccessChain 19(b2) 32
Store 178 177
179: 34(ptr) AccessChain 27(b1) 33
180: 8(i16vec3) Load 179
181: 34(ptr) AccessChain 19(b2) 33
Store 181 180
182: 34(ptr) AccessChain 27(b1) 33
183: 8(i16vec3) Load 182
184: 6(int16_t) CompositeExtract 183 0
185: 6(int16_t) CompositeExtract 183 1
186: 6(int16_t) CompositeExtract 183 2
187: 8(i16vec3) CompositeConstruct 184 185 186
188: 34(ptr) AccessChain 19(b2) 33
Store 188 187
Return
FunctionEnd