diff options
author | Liam <byteslice@airmail.cc> | 2024-01-15 21:08:21 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-31 17:27:21 +0100 |
commit | d4de04584f14f3ea8fde4cd79102b887c084fbc2 (patch) | |
tree | 72581b4240726f72d769319f3b5e1b2ece6c8e58 /src/video_core/renderer_opengl/present/filters.cpp | |
parent | renderer_opengl: move out ownership of FSR resources (diff) | |
download | yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.gz yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.bz2 yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.lz yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.xz yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.tar.zst yuzu-d4de04584f14f3ea8fde4cd79102b887c084fbc2.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/present/filters.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/present/filters.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/present/filters.cpp b/src/video_core/renderer_opengl/present/filters.cpp new file mode 100644 index 000000000..819e5d77f --- /dev/null +++ b/src/video_core/renderer_opengl/present/filters.cpp @@ -0,0 +1,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 |