diff options
| author | 2018-09-04 12:16:06 -0400 | |
|---|---|---|
| committer | 2018-09-04 12:16:06 -0400 | |
| commit | 9a07e9f8057323dbec477a8e90e626bf80fc1a61 (patch) | |
| tree | 12fa8788cbe0e913bbcbee452ccbac65fdef742f /src | |
| parent | Merge pull request #1223 from DarkLordZach/custom-nand-sd-dirs (diff) | |
| parent | core: Use a raw pointer in GetGPUDebugContext. (diff) | |
| download | yuzu-9a07e9f8057323dbec477a8e90e626bf80fc1a61.tar.gz yuzu-9a07e9f8057323dbec477a8e90e626bf80fc1a61.tar.xz yuzu-9a07e9f8057323dbec477a8e90e626bf80fc1a61.zip | |
Merge pull request #1237 from degasus/optimizations
Optimizations
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/core.cpp | 4 | ||||
| -rw-r--r-- | src/core/core.h | 2 | ||||
| -rw-r--r-- | src/video_core/command_processor.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 29983b9b4..cbab80881 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -441,8 +441,8 @@ void System::SetGPUDebugContext(std::shared_ptr<Tegra::DebugContext> context) { | |||
| 441 | impl->debug_context = std::move(context); | 441 | impl->debug_context = std::move(context); |
| 442 | } | 442 | } |
| 443 | 443 | ||
| 444 | std::shared_ptr<Tegra::DebugContext> System::GetGPUDebugContext() const { | 444 | Tegra::DebugContext* System::GetGPUDebugContext() const { |
| 445 | return impl->debug_context; | 445 | return impl->debug_context.get(); |
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | void System::SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs) { | 448 | void System::SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs) { |
diff --git a/src/core/core.h b/src/core/core.h index eee1fecc1..5c3c0e2a1 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -209,7 +209,7 @@ public: | |||
| 209 | 209 | ||
| 210 | void SetGPUDebugContext(std::shared_ptr<Tegra::DebugContext> context); | 210 | void SetGPUDebugContext(std::shared_ptr<Tegra::DebugContext> context); |
| 211 | 211 | ||
| 212 | std::shared_ptr<Tegra::DebugContext> GetGPUDebugContext() const; | 212 | Tegra::DebugContext* GetGPUDebugContext() const; |
| 213 | 213 | ||
| 214 | void SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs); | 214 | void SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs); |
| 215 | 215 | ||
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index dc485e811..d5831e752 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -34,6 +34,8 @@ void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params) | |||
| 34 | "{:08X} remaining params {}", | 34 | "{:08X} remaining params {}", |
| 35 | method, subchannel, value, remaining_params); | 35 | method, subchannel, value, remaining_params); |
| 36 | 36 | ||
| 37 | ASSERT(subchannel < bound_engines.size()); | ||
| 38 | |||
| 37 | if (method == static_cast<u32>(BufferMethods::BindObject)) { | 39 | if (method == static_cast<u32>(BufferMethods::BindObject)) { |
| 38 | // Bind the current subchannel to the desired engine id. | 40 | // Bind the current subchannel to the desired engine id. |
| 39 | LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", subchannel, value); | 41 | LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", subchannel, value); |
| @@ -47,8 +49,6 @@ void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params) | |||
| 47 | return; | 49 | return; |
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | ASSERT(bound_engines.find(subchannel) != bound_engines.end()); | ||
| 51 | |||
| 52 | const EngineID engine = bound_engines[subchannel]; | 52 | const EngineID engine = bound_engines[subchannel]; |
| 53 | 53 | ||
| 54 | switch (engine) { | 54 | switch (engine) { |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 2c3dbd97b..d29f31f52 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 7 | #include <memory> | 8 | #include <memory> |
| 8 | #include <unordered_map> | ||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "core/hle/service/nvflinger/buffer_queue.h" | 10 | #include "core/hle/service/nvflinger/buffer_queue.h" |
| 11 | #include "video_core/memory_manager.h" | 11 | #include "video_core/memory_manager.h" |
| @@ -136,7 +136,7 @@ private: | |||
| 136 | std::unique_ptr<Tegra::MemoryManager> memory_manager; | 136 | std::unique_ptr<Tegra::MemoryManager> memory_manager; |
| 137 | 137 | ||
| 138 | /// Mapping of command subchannels to their bound engine ids. | 138 | /// Mapping of command subchannels to their bound engine ids. |
| 139 | std::unordered_map<u32, EngineID> bound_engines; | 139 | std::array<EngineID, 8> bound_engines = {}; |
| 140 | 140 | ||
| 141 | /// 3D engine | 141 | /// 3D engine |
| 142 | std::unique_ptr<Engines::Maxwell3D> maxwell_3d; | 142 | std::unique_ptr<Engines::Maxwell3D> maxwell_3d; |