diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.h b/rpcs3/Emu/RSX/GL/GLGSRender.h index 3d17fb96f8..baf9179aec 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.h +++ b/rpcs3/Emu/RSX/GL/GLGSRender.h @@ -18,6 +18,8 @@ #pragma comment(lib, "opengl32.lib") #endif +using namespace gl::upscaling_flags_; + namespace gl { using vertex_cache = rsx::vertex_cache::default_vertex_cache; diff --git a/rpcs3/Emu/RSX/GL/GLPresent.cpp b/rpcs3/Emu/RSX/GL/GLPresent.cpp index 422829c522..e2cadd3f6c 100644 --- a/rpcs3/Emu/RSX/GL/GLPresent.cpp +++ b/rpcs3/Emu/RSX/GL/GLPresent.cpp @@ -1,6 +1,8 @@ #include "stdafx.h" #include "GLGSRender.h" + #include "upscalers/bilinear_pass.hpp" +#include "upscalers/fsr_pass.h" #include "upscalers/nearest_pass.hpp" #include "Emu/Cell/Modules/cellVideoOut.h" @@ -309,8 +311,8 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info) m_upscaler = std::make_unique(); break; case output_scaling_mode::fsr: - // Unimplemented - [[ fallthrough ]]; + m_upscaler = std::make_unique(); + break; case output_scaling_mode::bilinear: default: m_upscaler = std::make_unique(); @@ -320,19 +322,26 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info) if (use_full_rgb_range_output && rsx::fcmp(avconfig.gamma, 1.f) && avconfig.stereo_mode == stereo_render_mode_options::disabled) { // Blit source image to the screen - m_upscaler->scale_output(cmd, image_to_flip, screen_area, aspect_ratio.flipped_vertical(), gl::UPSCALE_AND_COMMIT); + m_upscaler->scale_output(cmd, image_to_flip, screen_area, aspect_ratio.flipped_vertical(), UPSCALE_AND_COMMIT | UPSCALE_DEFAULT_VIEW); } else { const f32 gamma = avconfig.gamma; const bool limited_range = !use_full_rgb_range_output; - const rsx::simple_array images{ image_to_flip->id(), image_to_flip2->id() }; const auto filter = m_output_scaling == output_scaling_mode::nearest ? gl::filter::nearest : gl::filter::linear; + rsx::simple_array images{ image_to_flip, image_to_flip2 }; + + if (m_output_scaling == output_scaling_mode::fsr && avconfig.stereo_mode == stereo_render_mode_options::disabled) // 3D will be implemented later + { + for (unsigned i = 0; i < 2 && images[i]; ++i) + { + const rsx::flags32_t mode = (i == 0) ? UPSCALE_LEFT_VIEW : UPSCALE_RIGHT_VIEW; + images[i] = m_upscaler->scale_output(cmd, image_to_flip, screen_area, aspect_ratio.flipped_vertical(), mode); + } + } - // FIXME: Upscaling should optionally happen before this step. - // With linear and nearest scaling, it really doesn't matter here, but for FSR we cannot just bind the images and use a hardware filter. gl::screen.bind(); - m_video_output_pass.run(cmd, areau(aspect_ratio), images, gamma, limited_range, avconfig.stereo_mode, filter); + m_video_output_pass.run(cmd, areau(aspect_ratio), images.map(FN(x->id())), gamma, limited_range, avconfig.stereo_mode, filter); } } diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 81932bf31d..e031451729 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -865,11 +865,10 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std const auto apply_fsr_specific_options = [r_creator, this]() { - const bool is_vulkan = (ui->renderBox->currentText() == r_creator->Vulkan.name); const auto [text, value] = get_data(ui->outputScalingMode, ui->outputScalingMode->currentIndex()); const bool fsr_selected = static_cast(value) == output_scaling_mode::fsr; - ui->fsrSharpeningStrength->setEnabled(is_vulkan && fsr_selected); - ui->fsrSharpeningStrengthReset->setEnabled(is_vulkan && fsr_selected); + ui->fsrSharpeningStrength->setEnabled(fsr_selected); + ui->fsrSharpeningStrengthReset->setEnabled(fsr_selected); }; // Handle connects to disable specific checkboxes that depend on GUI state.