diff options
| author | 2020-04-17 20:47:00 -0400 | |
|---|---|---|
| committer | 2020-04-17 20:48:52 -0400 | |
| commit | bf328ed35a13b6a024c11cb209da5de09cabf3b0 (patch) | |
| tree | 8d3ab7e9fc2b4f4e5eb4cf5f04c27ef4dd7306a6 /src | |
| parent | Merge pull request #3704 from lioncash/fmt (diff) | |
| download | yuzu-bf328ed35a13b6a024c11cb209da5de09cabf3b0.tar.gz yuzu-bf328ed35a13b6a024c11cb209da5de09cabf3b0.tar.xz yuzu-bf328ed35a13b6a024c11cb209da5de09cabf3b0.zip | |
gl_shader_decompiler: Avoid copies where applicable
Avoids unnecessary reference count increments where applicable and also
avoids reallocating a vector.
Unlikely to make a huge difference, but given how trivial of an
amendment it is, why not?
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 6 |
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 9495f48a2..4c7808a67 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: | |||
| 484 | code.AddLine("switch (jmp_to) {{"); | 484 | code.AddLine("switch (jmp_to) {{"); |
| 485 | 485 | ||
| 486 | for (const auto& pair : ir.GetBasicBlocks()) { | 486 | for (const auto& pair : ir.GetBasicBlocks()) { |
| 487 | const auto [address, bb] = pair; | 487 | const auto& [address, bb] = pair; |
| 488 | code.AddLine("case 0x{:X}U: {{", address); | 488 | code.AddLine("case 0x{:X}U: {{", address); |
| 489 | ++code.scope; | 489 | ++code.scope; |
| 490 | 490 | ||
| @@ -1483,8 +1483,8 @@ private: | |||
| 1483 | dy += '('; | 1483 | dy += '('; |
| 1484 | 1484 | ||
| 1485 | for (std::size_t index = 0; index < components; ++index) { | 1485 | for (std::size_t index = 0; index < components; ++index) { |
| 1486 | const auto operand_x{derivates.at(index * 2)}; | 1486 | const auto& operand_x{derivates.at(index * 2)}; |
| 1487 | const auto operand_y{derivates.at(index * 2 + 1)}; | 1487 | const auto& operand_y{derivates.at(index * 2 + 1)}; |
| 1488 | dx += Visit(operand_x).AsFloat(); | 1488 | dx += Visit(operand_x).AsFloat(); |
| 1489 | dy += Visit(operand_y).AsFloat(); | 1489 | dy += Visit(operand_y).AsFloat(); |
| 1490 | 1490 | ||