summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/sw_blitter/converter.h
blob: 03337e906c3c1098d732cce9f65541b971aacc10 (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
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later

#include <memory>
#include <span>

#include "common/common_types.h"

#pragma once

#include "video_core/gpu.h"

namespace Tegra::Engines::Blitter {

class Converter {
public:
    virtual void ConvertTo(std::span<u8> input, std::span<f32> output) = 0;
    virtual void ConvertFrom(std::span<f32> input, std::span<u8> output) = 0;
};

class ConverterFactory {
public:
    ConverterFactory();
    ~ConverterFactory();

    Converter* GetFormatConverter(RenderTargetFormat format);

private:
    Converter* BuildConverter(RenderTargetFormat format);

    struct ConverterFactoryImpl;
    std::unique_ptr<ConverterFactoryImpl> impl;
};

} // namespace Tegra::Engines::Blitter