diff options
Diffstat (limited to 'src/video_core/control/scheduler.h')
| -rw-r--r-- | src/video_core/control/scheduler.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/video_core/control/scheduler.h b/src/video_core/control/scheduler.h new file mode 100644 index 000000000..44addf61c --- /dev/null +++ b/src/video_core/control/scheduler.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2021 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <memory> | ||
| 7 | #include <mutex> | ||
| 8 | #include <unordered_map> | ||
| 9 | |||
| 10 | #include "video_core/dma_pusher.h" | ||
| 11 | |||
| 12 | namespace Tegra { | ||
| 13 | |||
| 14 | class GPU; | ||
| 15 | |||
| 16 | namespace Control { | ||
| 17 | |||
| 18 | struct ChannelState; | ||
| 19 | |||
| 20 | class Scheduler { | ||
| 21 | public: | ||
| 22 | explicit Scheduler(GPU& gpu_); | ||
| 23 | ~Scheduler(); | ||
| 24 | |||
| 25 | void Push(s32 channel, CommandList&& entries); | ||
| 26 | |||
| 27 | void DeclareChannel(std::shared_ptr<ChannelState> new_channel); | ||
| 28 | |||
| 29 | private: | ||
| 30 | std::unordered_map<s32, std::shared_ptr<ChannelState>> channels; | ||
| 31 | std::mutex scheduling_guard; | ||
| 32 | GPU& gpu; | ||
| 33 | }; | ||
| 34 | |||
| 35 | } // namespace Control | ||
| 36 | |||
| 37 | } // namespace Tegra | ||