KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.9k stars 816 forks source link

Using reserve() in GlslangToSpv.cpp #3564

Closed GermanAizek closed 2 months ago

GermanAizek commented 3 months ago

We know the count inserted elements, we can optimize codegeneration.

GermanAizek commented 3 months ago

Seems okay to me but, out of curiosity, did you encounter this as a result of a performance measurement?

hi, I'm from PPSSPP project, PSP emulator runs on android and any lags/delays on weak devices are very noticeable there.

arcady-lunarg commented 3 months ago

I would still be interested in concrete benchmark numbers if you can get them. Should this be done more broadly in the SPIR-V builder? It seems kind of odd that it's just those two opcodes that get a reserve() call, but it certainly doesn't hurt to do it.