gl_shader_decompiler: add missing headers/rename GetXXX to MoveXXX to reflect that they move the data

This commit is contained in:
wwylele 2018-03-27 13:14:24 +03:00
parent 11c2f11872
commit 9ffd400685

View File

@ -3,8 +3,11 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <exception> #include <exception>
#include <map>
#include <set> #include <set>
#include <string> #include <string>
#include <tuple>
#include <utility>
#include <nihstro/shader_bytecode.h> #include <nihstro/shader_bytecode.h>
#include "common/assert.h" #include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
@ -64,7 +67,7 @@ public:
throw DecompileFail("Program does not always end"); throw DecompileFail("Program does not always end");
} }
std::set<Subroutine> GetSubroutines() { std::set<Subroutine> MoveSubroutines() {
return std::move(subroutines); return std::move(subroutines);
} }
@ -203,7 +206,7 @@ public:
shader_source += text + '\n'; shader_source += text + '\n';
} }
std::string GetResult() { std::string MoveResult() {
return std::move(shader_source); return std::move(shader_source);
} }
@ -256,8 +259,8 @@ public:
Generate(); Generate();
} }
std::string GetShaderCode() { std::string MoveShaderCode() {
return shader.GetResult(); return shader.MoveResult();
} }
private: private:
@ -910,10 +913,10 @@ boost::optional<std::string> DecompileProgram(const ProgramCode& program_code,
bool is_gs) { bool is_gs) {
try { try {
auto subroutines = ControlFlowAnalyzer(program_code, main_offset).GetSubroutines(); auto subroutines = ControlFlowAnalyzer(program_code, main_offset).MoveSubroutines();
GLSLGenerator generator(subroutines, program_code, swizzle_data, main_offset, GLSLGenerator generator(subroutines, program_code, swizzle_data, main_offset,
inputreg_getter, outputreg_getter, sanitize_mul, is_gs); inputreg_getter, outputreg_getter, sanitize_mul, is_gs);
return generator.GetShaderCode(); return generator.MoveShaderCode();
} catch (const DecompileFail& exception) { } catch (const DecompileFail& exception) {
LOG_ERROR(HW_GPU, "Shader decompilation failed: %s", exception.what()); LOG_ERROR(HW_GPU, "Shader decompilation failed: %s", exception.what());
return boost::none; return boost::none;