cdma_pusher: Remove unnecessary intermediate std::vector in Step()

We can use the underlying raw u32 instead of copying all command headers
to another vector as u32s before using them.
This commit is contained in:
Lioncash
2020-11-16 03:04:44 -05:00
parent 54ff51d6b7
commit 105f14a015
2 changed files with 5 additions and 6 deletions

View File

@@ -52,10 +52,9 @@ void CDmaPusher::Step() {
const auto entries{cdma_queue.front()};
cdma_queue.pop();
std::vector<u32> values(entries.size());
std::memcpy(values.data(), entries.data(), entries.size() * sizeof(u32));
for (const auto entry : entries) {
const u32 value = entry.raw;
for (const u32 value : values) {
if (mask != 0) {
const u32 lbs = Common::CountTrailingZeroes32(mask);
mask &= ~(1U << lbs);
@@ -72,7 +71,7 @@ void CDmaPusher::Step() {
continue;
}
const auto mode = static_cast<ChSubmissionMode>((value >> 28) & 0xf);
const auto mode = entry.submission_mode.Value();
switch (mode) {
case ChSubmissionMode::SetClass: {
mask = value & 0x3f;

View File

@@ -67,8 +67,8 @@ struct ChCommand {
std::vector<u32> arguments;
};
using ChCommandHeaderList = std::vector<Tegra::ChCommandHeader>;
using ChCommandList = std::vector<Tegra::ChCommand>;
using ChCommandHeaderList = std::vector<ChCommandHeader>;
using ChCommandList = std::vector<ChCommand>;
struct ThiRegisters {
u32_le increment_syncpt{};