aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/control/channel_state.h
blob: 80811c145883c46f6c42e1455f604a41cad63e57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later

// SPDX-FileCopyrightText: 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once

#include <memory>

#include "common/common_types.h"
#include "video_core/engines/fermi_2d.h"
#include "video_core/engines/kepler_memory.h"
#include "video_core/engines/kepler_compute.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/engines/maxwell_dma.h"
#include "video_core/engines/nv01_timer.h"
#include "video_core/dma_pusher.h"

namespace Core {
class System;
}

namespace VideoCore {
class RasterizerInterface;
}

namespace Tegra {

class GPU;
class MemoryManager;

namespace Control {

struct ChannelState {
    explicit ChannelState(s32 bind_id);

    void Init(Core::System& system, u64 program_id);

    void BindRasterizer(VideoCore::RasterizerInterface* rasterizer);

    struct Payload {
        explicit Payload(Core::System& system, MemoryManager& memory_manager, ChannelState& channel_state);

        /// 3D engine
        Engines::Maxwell3D maxwell_3d;
        /// 2D engine
        Engines::Fermi2D fermi_2d;
        /// Compute engine
        Engines::KeplerCompute kepler_compute;
        /// DMA engine
        Engines::MaxwellDMA maxwell_dma;
        /// Inline memory engine
        Engines::KeplerMemory kepler_memory;
        /// NV01 Timer
        Engines::Nv01Timer nv01_timer;
        DmaPusher dma_pusher;
    };
    std::optional<Payload> payload;
    MemoryManager* memory_manager = nullptr;

    s32 bind_id = -1;
    u64 program_id = 0;
    bool initialized = false;
};

} // namespace Control

} // namespace Tegra