mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 09:12:46 +01:00
Merge pull request #2496 from lioncash/move-con
gl_shader_gen: std::move objects where applicable
This commit is contained in:
commit
b42ca9888d
1 changed files with 7 additions and 7 deletions
|
@ -33,14 +33,14 @@ layout (std140, binding = EMULATION_UBO_BINDING) uniform vs_config {
|
||||||
};
|
};
|
||||||
|
|
||||||
)";
|
)";
|
||||||
ShaderIR program_ir(setup.program.code, PROGRAM_OFFSET);
|
const ShaderIR program_ir(setup.program.code, PROGRAM_OFFSET);
|
||||||
ProgramResult program =
|
ProgramResult program =
|
||||||
Decompile(device, program_ir, Maxwell3D::Regs::ShaderStage::Vertex, "vertex");
|
Decompile(device, program_ir, Maxwell3D::Regs::ShaderStage::Vertex, "vertex");
|
||||||
|
|
||||||
out += program.first;
|
out += program.first;
|
||||||
|
|
||||||
if (setup.IsDualProgram()) {
|
if (setup.IsDualProgram()) {
|
||||||
ShaderIR program_ir_b(setup.program.code_b, PROGRAM_OFFSET);
|
const ShaderIR program_ir_b(setup.program.code_b, PROGRAM_OFFSET);
|
||||||
ProgramResult program_b =
|
ProgramResult program_b =
|
||||||
Decompile(device, program_ir_b, Maxwell3D::Regs::ShaderStage::Vertex, "vertex_b");
|
Decompile(device, program_ir_b, Maxwell3D::Regs::ShaderStage::Vertex, "vertex_b");
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void main() {
|
||||||
}
|
}
|
||||||
})";
|
})";
|
||||||
|
|
||||||
return {out, program.second};
|
return {std::move(out), std::move(program.second)};
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgramResult GenerateGeometryShader(const Device& device, const ShaderSetup& setup) {
|
ProgramResult GenerateGeometryShader(const Device& device, const ShaderSetup& setup) {
|
||||||
|
@ -97,7 +97,7 @@ layout (std140, binding = EMULATION_UBO_BINDING) uniform gs_config {
|
||||||
};
|
};
|
||||||
|
|
||||||
)";
|
)";
|
||||||
ShaderIR program_ir(setup.program.code, PROGRAM_OFFSET);
|
const ShaderIR program_ir(setup.program.code, PROGRAM_OFFSET);
|
||||||
ProgramResult program =
|
ProgramResult program =
|
||||||
Decompile(device, program_ir, Maxwell3D::Regs::ShaderStage::Geometry, "geometry");
|
Decompile(device, program_ir, Maxwell3D::Regs::ShaderStage::Geometry, "geometry");
|
||||||
out += program.first;
|
out += program.first;
|
||||||
|
@ -107,7 +107,7 @@ void main() {
|
||||||
execute_geometry();
|
execute_geometry();
|
||||||
};)";
|
};)";
|
||||||
|
|
||||||
return {out, program.second};
|
return {std::move(out), std::move(program.second)};
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgramResult GenerateFragmentShader(const Device& device, const ShaderSetup& setup) {
|
ProgramResult GenerateFragmentShader(const Device& device, const ShaderSetup& setup) {
|
||||||
|
@ -160,7 +160,7 @@ bool AlphaFunc(in float value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
)";
|
)";
|
||||||
ShaderIR program_ir(setup.program.code, PROGRAM_OFFSET);
|
const ShaderIR program_ir(setup.program.code, PROGRAM_OFFSET);
|
||||||
ProgramResult program =
|
ProgramResult program =
|
||||||
Decompile(device, program_ir, Maxwell3D::Regs::ShaderStage::Fragment, "fragment");
|
Decompile(device, program_ir, Maxwell3D::Regs::ShaderStage::Fragment, "fragment");
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ void main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
)";
|
)";
|
||||||
return {out, program.second};
|
return {std::move(out), std::move(program.second)};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace OpenGL::GLShader
|
} // namespace OpenGL::GLShader
|
||||||
|
|
Loading…
Reference in a new issue