diff options
Diffstat (limited to 'src/video_core/control/scheduler.h')
| -rw-r--r-- | src/video_core/control/scheduler.h | 38 |
1 files changed, 38 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..802e9caff --- /dev/null +++ b/src/video_core/control/scheduler.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | #include <mutex> | ||
| 9 | #include <unordered_map> | ||
| 10 | |||
| 11 | #include "video_core/dma_pusher.h" | ||
| 12 | |||
| 13 | namespace Tegra { | ||
| 14 | |||
| 15 | class GPU; | ||
| 16 | |||
| 17 | namespace Control { | ||
| 18 | |||
| 19 | struct ChannelState; | ||
| 20 | |||
| 21 | class Scheduler { | ||
| 22 | public: | ||
| 23 | Scheduler(GPU& gpu_); | ||
| 24 | ~Scheduler(); | ||
| 25 | |||
| 26 | void Push(s32 channel, CommandList&& entries); | ||
| 27 | |||
| 28 | void DeclareChannel(std::shared_ptr<ChannelState> new_channel); | ||
| 29 | |||
| 30 | private: | ||
| 31 | std::unordered_map<s32, std::shared_ptr<ChannelState>> channels; | ||
| 32 | std::mutex scheduling_guard; | ||
| 33 | GPU& gpu; | ||
| 34 | }; | ||
| 35 | |||
| 36 | } // namespace Control | ||
| 37 | |||
| 38 | } // namespace Tegra | ||