2022-06-29 19:27:49 -04:00
|
|
|
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2021-11-05 10:52:31 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <mutex>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
#include "video_core/dma_pusher.h"
|
|
|
|
|
|
|
|
namespace Tegra {
|
|
|
|
|
|
|
|
class GPU;
|
|
|
|
|
|
|
|
namespace Control {
|
|
|
|
|
|
|
|
struct ChannelState;
|
|
|
|
|
|
|
|
class Scheduler {
|
|
|
|
public:
|
2022-08-31 23:45:22 -04:00
|
|
|
explicit Scheduler(GPU& gpu_);
|
2021-11-05 10:52:31 -04:00
|
|
|
~Scheduler();
|
|
|
|
|
|
|
|
void Push(s32 channel, CommandList&& entries);
|
|
|
|
|
|
|
|
void DeclareChannel(std::shared_ptr<ChannelState> new_channel);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unordered_map<s32, std::shared_ptr<ChannelState>> channels;
|
|
|
|
std::mutex scheduling_guard;
|
|
|
|
GPU& gpu;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Control
|
|
|
|
|
|
|
|
} // namespace Tegra
|