diff options
| author | 2021-11-05 15:52:31 +0100 | |
|---|---|---|
| committer | 2022-10-06 21:00:51 +0200 | |
| commit | 139ea93512aeead8a4aee3910a3de86eb109a838 (patch) | |
| tree | 857643fc08617b7035656a51728c399f30c8c2cb /src/video_core/control/scheduler.cpp | |
| parent | NVASGPU: Fix Remap. (diff) | |
| download | yuzu-139ea93512aeead8a4aee3910a3de86eb109a838.tar.gz yuzu-139ea93512aeead8a4aee3910a3de86eb109a838.tar.xz yuzu-139ea93512aeead8a4aee3910a3de86eb109a838.zip | |
VideoCore: implement channels on gpu caches.
Diffstat (limited to 'src/video_core/control/scheduler.cpp')
| -rw-r--r-- | src/video_core/control/scheduler.cpp | 31 |
1 files changed, 31 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..e1abcb188 --- /dev/null +++ b/src/video_core/control/scheduler.cpp | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <memory> | ||
| 6 | |||
| 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<std::mutex> lk(scheduling_guard); | ||
| 18 | auto it = channels.find(channel); | ||
| 19 | auto channel_state = it->second; | ||
| 20 | gpu.BindChannel(channel_state->bind_id); | ||
| 21 | channel_state->dma_pusher->Push(std::move(entries)); | ||
| 22 | channel_state->dma_pusher->DispatchCalls(); | ||
| 23 | } | ||
| 24 | |||
| 25 | void Scheduler::DeclareChannel(std::shared_ptr<ChannelState> new_channel) { | ||
| 26 | s32 channel = new_channel->bind_id; | ||
| 27 | std::unique_lock<std::mutex> lk(scheduling_guard); | ||
| 28 | channels.emplace(channel, new_channel); | ||
| 29 | } | ||
| 30 | |||
| 31 | } // namespace Tegra::Control | ||