aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/command_processor.cpp
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/video_core/command_processor.cpp
parent1c5636e690ca5844b396f97adc0a094558edc56f (diff)
command_processor: Use std::array for bound_engines.
subchannel is a 3 bit field. So there must not be more than 8 bound engines. And using a hashmap for up to 8 values is a bit overpowered.
Diffstat (limited to 'src/video_core/command_processor.cpp')
-rw-r--r--src/video_core/command_processor.cpp4
1 files changed, 2 insertions, 2 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) {