diff options
| author | 2019-05-19 04:01:59 -0400 | |
|---|---|---|
| committer | 2019-05-19 04:02:02 -0400 | |
| commit | ce04ab38bbcd3b33ef9860b7631c7de8f9f2ebc2 (patch) | |
| tree | 2dc100fc5752284fef023af7c642b76b7b0660f9 /src | |
| parent | Merge pull request #2457 from lioncash/about (diff) | |
| download | yuzu-ce04ab38bbcd3b33ef9860b7631c7de8f9f2ebc2.tar.gz yuzu-ce04ab38bbcd3b33ef9860b7631c7de8f9f2ebc2.tar.xz yuzu-ce04ab38bbcd3b33ef9860b7631c7de8f9f2ebc2.zip | |
shader/shader_ir: Place implementations of constructor and destructor in cpp file
Given the class contains quite a lot of non-trivial types, place the
constructor and destructor within the cpp file to avoid inlining
construction and destruction code everywhere the class is used.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_ir.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/shader/shader_ir.h | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index e4eb0dfd9..196235e5d 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp | |||
| @@ -21,6 +21,13 @@ using Tegra::Shader::PredCondition; | |||
| 21 | using Tegra::Shader::PredOperation; | 21 | using Tegra::Shader::PredOperation; |
| 22 | using Tegra::Shader::Register; | 22 | using Tegra::Shader::Register; |
| 23 | 23 | ||
| 24 | ShaderIR::ShaderIR(const ProgramCode& program_code, u32 main_offset) | ||
| 25 | : program_code{program_code}, main_offset{main_offset} { | ||
| 26 | Decode(); | ||
| 27 | } | ||
| 28 | |||
| 29 | ShaderIR::~ShaderIR() = default; | ||
| 30 | |||
| 24 | Node ShaderIR::StoreNode(NodeData&& node_data) { | 31 | Node ShaderIR::StoreNode(NodeData&& node_data) { |
| 25 | auto store = std::make_unique<NodeData>(node_data); | 32 | auto store = std::make_unique<NodeData>(node_data); |
| 26 | const Node node = store.get(); | 33 | const Node node = store.get(); |
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 65f1e1de9..3fab404f4 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h | |||
| @@ -567,11 +567,8 @@ private: | |||
| 567 | 567 | ||
| 568 | class ShaderIR final { | 568 | class ShaderIR final { |
| 569 | public: | 569 | public: |
| 570 | explicit ShaderIR(const ProgramCode& program_code, u32 main_offset) | 570 | explicit ShaderIR(const ProgramCode& program_code, u32 main_offset); |
| 571 | : program_code{program_code}, main_offset{main_offset} { | 571 | ~ShaderIR(); |
| 572 | |||
| 573 | Decode(); | ||
| 574 | } | ||
| 575 | 572 | ||
| 576 | const std::map<u32, NodeBlock>& GetBasicBlocks() const { | 573 | const std::map<u32, NodeBlock>& GetBasicBlocks() const { |
| 577 | return basic_blocks; | 574 | return basic_blocks; |