소스 검색

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.
Lioncash 8 년 전
부모
커밋
6ef027b958
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/video_core/renderer_opengl/gl_shader_decompiler.cpp

+ 2 - 0
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);
         }