aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-04-21 20:16:02 -0400
committerGitHub <noreply@github.com>2020-04-21 20:16:02 -0400
commitd64290884a3f07971e5432f24a984d997bf8aba0 (patch)
tree56842a9ec3209326393061b992749d07698977cd
parentcd47ccec496c9a961abf1dc58f8d2a4165c1bf2b (diff)
parentbf328ed35a13b6a024c11cb209da5de09cabf3b0 (diff)
Merge pull request #3714 from lioncash/copies
gl_shader_decompiler: Avoid copies where applicable
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 22242cce93..0cd3ad7e13 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -484,7 +484,7 @@ private:
code.AddLine("switch (jmp_to) {{");
for (const auto& pair : ir.GetBasicBlocks()) {
- const auto [address, bb] = pair;
+ const auto& [address, bb] = pair;
code.AddLine("case 0x{:X}U: {{", address);
++code.scope;
@@ -1484,8 +1484,8 @@ private:
dy += '(';
for (std::size_t index = 0; index < components; ++index) {
- const auto operand_x{derivates.at(index * 2)};
- const auto operand_y{derivates.at(index * 2 + 1)};
+ const auto& operand_x{derivates.at(index * 2)};
+ const auto& operand_y{derivates.at(index * 2 + 1)};
dx += Visit(operand_x).AsFloat();
dy += Visit(operand_y).AsFloat();