summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_fsr.h
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-01-28 01:28:35 +0100
committerGitHub <noreply@github.com>2023-01-28 01:28:35 +0100
commit6fa86989f10ef9f87701147e4b4b426f309edac4 (patch)
treee4b3c203e4a2349ec8f72e5f5d162eab2a1d9ecd /src/video_core/renderer_opengl/gl_fsr.h
parentMerge pull request #9666 from liamwhite/wait-for-me (diff)
parentvideo_core/opengl: Add FSR upscaling filter to the OpenGL renderer (diff)
downloadyuzu-6fa86989f10ef9f87701147e4b4b426f309edac4.tar
yuzu-6fa86989f10ef9f87701147e4b4b426f309edac4.tar.gz
yuzu-6fa86989f10ef9f87701147e4b4b426f309edac4.tar.bz2
yuzu-6fa86989f10ef9f87701147e4b4b426f309edac4.tar.lz
yuzu-6fa86989f10ef9f87701147e4b4b426f309edac4.tar.xz
yuzu-6fa86989f10ef9f87701147e4b4b426f309edac4.tar.zst
yuzu-6fa86989f10ef9f87701147e4b4b426f309edac4.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_fsr.h')
-rw-r--r--src/video_core/renderer_opengl/gl_fsr.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_fsr.h b/src/video_core/renderer_opengl/gl_fsr.h
new file mode 100644
index 000000000..1f6ae3115
--- /dev/null
+++ b/src/video_core/renderer_opengl/gl_fsr.h
@@ -0,0 +1,43 @@
+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <string_view>
+
+#include "common/common_types.h"
+#include "common/math_util.h"
+#include "video_core/fsr.h"
+#include "video_core/renderer_opengl/gl_resource_manager.h"
+
+namespace OpenGL {
+
+class ProgramManager;
+
+class FSR {
+public:
+ explicit FSR(std::string_view fsr_vertex_source, std::string_view fsr_easu_source,
+ std::string_view fsr_rcas_source);
+ ~FSR();
+
+ void Draw(ProgramManager& program_manager, const Common::Rectangle<u32>& screen,
+ u32 input_image_width, u32 input_image_height,
+ const Common::Rectangle<int>& crop_rect);
+
+ void InitBuffers();
+
+ void ReleaseBuffers();
+
+ [[nodiscard]] const OGLProgram& GetPresentFragmentProgram() const noexcept;
+
+ [[nodiscard]] bool AreBuffersInitialized() const noexcept;
+
+private:
+ OGLFramebuffer fsr_framebuffer;
+ OGLProgram fsr_vertex;
+ OGLProgram fsr_easu_frag;
+ OGLProgram fsr_rcas_frag;
+ OGLTexture fsr_intermediate_tex;
+};
+
+} // namespace OpenGL