From 6ef027b958471dbd67dadbad5838f9cd246177ae Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 9 Aug 2018 17:29:09 -0400 Subject: gl_shader_decompiler: Reserve element memory beforehand in BuildRegisterList() Avoids potentially perfoming multiple reallocations when we know the total amount of memory we need beforehand. --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index ea7779429..32f06f409 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -507,6 +507,8 @@ private: /// Build the GLSL register list. void BuildRegisterList() { + regs.reserve(Register::NumRegisters); + for (size_t index = 0; index < Register::NumRegisters; ++index) { regs.emplace_back(index, suffix); } -- cgit v1.2.3