2021-11-05 15:52:31 +01:00
|
|
|
// Copyright 2021 yuzu Emulator Project
|
2022-01-30 10:31:13 +01:00
|
|
|
// Licensed under GPLv3 or any later version
|
2021-11-05 15:52:31 +01:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#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:
|
|
|
|
Scheduler(GPU& gpu_);
|
|
|
|
~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
|