summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Wick <markus@selfnet.de>2018-09-04 13:54:50 +0200
committerMarkus Wick <markus@selfnet.de>2018-09-04 14:10:05 +0200
commit2081ed7db22d62b82acfddcd4b7c10a03bb3daaf (patch)
tree70d38dd3466dee6e9cd05ab83cedb7deb375a5af /src
parentMerge pull request #1231 from lioncash/global (diff)
downloadyuzu-2081ed7db22d62b82acfddcd4b7c10a03bb3daaf.tar
yuzu-2081ed7db22d62b82acfddcd4b7c10a03bb3daaf.tar.gz
yuzu-2081ed7db22d62b82acfddcd4b7c10a03bb3daaf.tar.bz2
yuzu-2081ed7db22d62b82acfddcd4b7c10a03bb3daaf.tar.lz
yuzu-2081ed7db22d62b82acfddcd4b7c10a03bb3daaf.tar.xz
yuzu-2081ed7db22d62b82acfddcd4b7c10a03bb3daaf.tar.zst
yuzu-2081ed7db22d62b82acfddcd4b7c10a03bb3daaf.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/command_processor.cpp4
-rw-r--r--src/video_core/gpu.h4
2 files changed, 4 insertions, 4 deletions
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)
"{:08X} remaining params {}",
method, subchannel, value, remaining_params);
+ ASSERT(subchannel < bound_engines.size());
+
if (method == static_cast<u32>(BufferMethods::BindObject)) {
// Bind the current subchannel to the desired engine id.
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)
return;
}
- ASSERT(bound_engines.find(subchannel) != bound_engines.end());
-
const EngineID engine = bound_engines[subchannel];
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 @@
#pragma once
+#include <array>
#include <memory>
-#include <unordered_map>
#include "common/common_types.h"
#include "core/hle/service/nvflinger/buffer_queue.h"
#include "video_core/memory_manager.h"
@@ -136,7 +136,7 @@ private:
std::unique_ptr<Tegra::MemoryManager> memory_manager;
/// Mapping of command subchannels to their bound engine ids.
- std::unordered_map<u32, EngineID> bound_engines;
+ std::array<EngineID, 8> bound_engines = {};
/// 3D engine
std::unique_ptr<Engines::Maxwell3D> maxwell_3d;