summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/present/filters.cpp
blob: 819e5d77f4b6c4c4070245f0613920e4d070c7f3 (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
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#include "video_core/host_shaders/opengl_present_frag.h"
#include "video_core/host_shaders/opengl_present_scaleforce_frag.h"
#include "video_core/host_shaders/present_bicubic_frag.h"
#include "video_core/host_shaders/present_gaussian_frag.h"
#include "video_core/renderer_opengl/present/filters.h"
#include "video_core/renderer_opengl/present/util.h"

namespace OpenGL {

std::unique_ptr<WindowAdaptPass> MakeNearestNeighbor(const Device& device) {
    return std::make_unique<WindowAdaptPass>(device, CreateNearestNeighborSampler(),
                                             HostShaders::OPENGL_PRESENT_FRAG);
}

std::unique_ptr<WindowAdaptPass> MakeBilinear(const Device& device) {
    return std::make_unique<WindowAdaptPass>(device, CreateBilinearSampler(),
                                             HostShaders::OPENGL_PRESENT_FRAG);
}

std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device) {
    return std::make_unique<WindowAdaptPass>(device, CreateBilinearSampler(),
                                             HostShaders::PRESENT_BICUBIC_FRAG);
}

std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device) {
    return std::make_unique<WindowAdaptPass>(device, CreateBilinearSampler(),
                                             HostShaders::PRESENT_GAUSSIAN_FRAG);
}

std::unique_ptr<WindowAdaptPass> MakeScaleForce(const Device& device) {
    return std::make_unique<WindowAdaptPass>(
        device, CreateBilinearSampler(),
        fmt::format("#version 460\n{}", HostShaders::OPENGL_PRESENT_SCALEFORCE_FRAG));
}

} // namespace OpenGL