summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/control_flow.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-10-05 18:02:51 +0200
committerGitHub <noreply@github.com>2019-10-05 18:02:51 +0200
commit47ccfabe18db3691a09f211fc4aec465ee186c2a (patch)
tree8bd02e8d5e16dee8522e29d21c711ef98282bb52 /src/video_core/shader/control_flow.cpp
parentMerge pull request #2888 from FernandoS27/decompiler2 (diff)
parentvideo_core/control_flow: Eliminate variable shadowing warnings (diff)
downloadyuzu-47ccfabe18db3691a09f211fc4aec465ee186c2a.tar
yuzu-47ccfabe18db3691a09f211fc4aec465ee186c2a.tar.gz
yuzu-47ccfabe18db3691a09f211fc4aec465ee186c2a.tar.bz2
yuzu-47ccfabe18db3691a09f211fc4aec465ee186c2a.tar.lz
yuzu-47ccfabe18db3691a09f211fc4aec465ee186c2a.tar.xz
yuzu-47ccfabe18db3691a09f211fc4aec465ee186c2a.tar.zst
yuzu-47ccfabe18db3691a09f211fc4aec465ee186c2a.zip
Diffstat (limited to 'src/video_core/shader/control_flow.cpp')
-rw-r--r--src/video_core/shader/control_flow.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp
index 3c3a41ba6..268d1aed0 100644
--- a/src/video_core/shader/control_flow.cpp
+++ b/src/video_core/shader/control_flow.cpp
@@ -479,7 +479,7 @@ std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code,
auto result_out = std::make_unique<ShaderCharacteristics>();
if (settings.depth == CompileDepth::BruteForce) {
result_out->settings.depth = CompileDepth::BruteForce;
- return std::move(result_out);
+ return result_out;
}
CFGRebuildState state{program_code, program_size, start_address};
@@ -490,7 +490,7 @@ std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code,
while (!state.inspect_queries.empty()) {
if (!TryInspectAddress(state)) {
result_out->settings.depth = CompileDepth::BruteForce;
- return std::move(result_out);
+ return result_out;
}
}
@@ -530,14 +530,15 @@ std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code,
state.manager->ShowCurrentState("Of Shader");
state.manager->Clear();
} else {
- auto result_out = std::make_unique<ShaderCharacteristics>();
- result_out->start = start_address;
- result_out->settings.depth = settings.depth;
- result_out->manager = std::move(manager);
- result_out->end = state.block_info.back().end + 1;
- return std::move(result_out);
+ auto characteristics = std::make_unique<ShaderCharacteristics>();
+ characteristics->start = start_address;
+ characteristics->settings.depth = settings.depth;
+ characteristics->manager = std::move(manager);
+ characteristics->end = state.block_info.back().end + 1;
+ return characteristics;
}
}
+
result_out->start = start_address;
result_out->settings.depth =
use_flow_stack ? CompileDepth::FlowStack : CompileDepth::NoFlowStack;
@@ -557,8 +558,9 @@ std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code,
}
if (!use_flow_stack) {
result_out->labels = std::move(state.labels);
- return std::move(result_out);
+ return result_out;
}
+
auto back = result_out->blocks.begin();
auto next = std::next(back);
while (next != result_out->blocks.end()) {
@@ -570,6 +572,7 @@ std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code,
back = next;
++next;
}
- return std::move(result_out);
+
+ return result_out;
}
} // namespace VideoCommon::Shader