diff options
| author | 2022-10-06 21:29:53 +0200 | |
|---|---|---|
| committer | 2022-10-06 21:29:53 +0200 | |
| commit | 1effa578f12f79d7816e3543291f302f126cc1d2 (patch) | |
| tree | 14803b31b6817294d40d57446f6fa94c5ff3fe9a /src/video_core/control/scheduler.cpp | |
| parent | Merge pull request #9025 from FernandoS27/slava-ukrayini (diff) | |
| parent | vulkan_blitter: Fix pool allocation double free. (diff) | |
| download | yuzu-1effa578f12f79d7816e3543291f302f126cc1d2.tar.gz yuzu-1effa578f12f79d7816e3543291f302f126cc1d2.tar.xz yuzu-1effa578f12f79d7816e3543291f302f126cc1d2.zip | |
Merge pull request #8467 from FernandoS27/yfc-rel-1
Project yuzu Fried Chicken (Y.F.C.) Part 1
Diffstat (limited to 'src/video_core/control/scheduler.cpp')
| -rw-r--r-- | src/video_core/control/scheduler.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/video_core/control/scheduler.cpp b/src/video_core/control/scheduler.cpp new file mode 100644 index 000000000..f7cbe204e --- /dev/null +++ b/src/video_core/control/scheduler.cpp | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2021 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 4 | #include <memory> | ||
| 5 | |||
| 6 | #include "common/assert.h" | ||
| 7 | #include "video_core/control/channel_state.h" | ||
| 8 | #include "video_core/control/scheduler.h" | ||
| 9 | #include "video_core/gpu.h" | ||
| 10 | |||
| 11 | namespace Tegra::Control { | ||
| 12 | Scheduler::Scheduler(GPU& gpu_) : gpu{gpu_} {} | ||
| 13 | |||
| 14 | Scheduler::~Scheduler() = default; | ||
| 15 | |||
| 16 | void Scheduler::Push(s32 channel, CommandList&& entries) { | ||
| 17 | std::unique_lock lk(scheduling_guard); | ||
| 18 | auto it = channels.find(channel); | ||
| 19 | ASSERT(it != channels.end()); | ||
| 20 | auto channel_state = it->second; | ||
| 21 | gpu.BindChannel(channel_state->bind_id); | ||
| 22 | channel_state->dma_pusher->Push(std::move(entries)); | ||
| 23 | channel_state->dma_pusher->DispatchCalls(); | ||
| 24 | } | ||
| 25 | |||
| 26 | void Scheduler::DeclareChannel(std::shared_ptr<ChannelState> new_channel) { | ||
| 27 | s32 channel = new_channel->bind_id; | ||
| 28 | std::unique_lock lk(scheduling_guard); | ||
| 29 | channels.emplace(channel, new_channel); | ||
| 30 | } | ||
| 31 | |||
| 32 | } // namespace Tegra::Control | ||