diff options
| author | 2018-08-09 17:29:09 -0400 | |
|---|---|---|
| committer | 2018-08-09 17:29:11 -0400 | |
| commit | 6ef027b958471dbd67dadbad5838f9cd246177ae (patch) | |
| tree | ee18894d54973d9f1ac913545641cf30a5c0534e /src | |
| parent | Merge pull request #992 from bunnei/declr-pred (diff) | |
| download | yuzu-6ef027b958471dbd67dadbad5838f9cd246177ae.tar.gz yuzu-6ef027b958471dbd67dadbad5838f9cd246177ae.tar.xz yuzu-6ef027b958471dbd67dadbad5838f9cd246177ae.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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: | |||
| 507 | 507 | ||
| 508 | /// Build the GLSL register list. | 508 | /// Build the GLSL register list. |
| 509 | void BuildRegisterList() { | 509 | void BuildRegisterList() { |
| 510 | regs.reserve(Register::NumRegisters); | ||
| 511 | |||
| 510 | for (size_t index = 0; index < Register::NumRegisters; ++index) { | 512 | for (size_t index = 0; index < Register::NumRegisters; ++index) { |
| 511 | regs.emplace_back(index, suffix); | 513 | regs.emplace_back(index, suffix); |
| 512 | } | 514 | } |