mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
gl: Allow selecting FSR1 upscaling from the settings
This commit is contained in:
parent
188f5c7c3c
commit
f748fe688c
3 changed files with 20 additions and 10 deletions
|
@ -18,6 +18,8 @@
|
||||||
#pragma comment(lib, "opengl32.lib")
|
#pragma comment(lib, "opengl32.lib")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
using namespace gl::upscaling_flags_;
|
||||||
|
|
||||||
namespace gl
|
namespace gl
|
||||||
{
|
{
|
||||||
using vertex_cache = rsx::vertex_cache::default_vertex_cache<rsx::vertex_cache::uploaded_range>;
|
using vertex_cache = rsx::vertex_cache::default_vertex_cache<rsx::vertex_cache::uploaded_range>;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "GLGSRender.h"
|
#include "GLGSRender.h"
|
||||||
|
|
||||||
#include "upscalers/bilinear_pass.hpp"
|
#include "upscalers/bilinear_pass.hpp"
|
||||||
|
#include "upscalers/fsr_pass.h"
|
||||||
#include "upscalers/nearest_pass.hpp"
|
#include "upscalers/nearest_pass.hpp"
|
||||||
|
|
||||||
#include "Emu/Cell/Modules/cellVideoOut.h"
|
#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<gl::nearest_upscale_pass>();
|
m_upscaler = std::make_unique<gl::nearest_upscale_pass>();
|
||||||
break;
|
break;
|
||||||
case output_scaling_mode::fsr:
|
case output_scaling_mode::fsr:
|
||||||
// Unimplemented
|
m_upscaler = std::make_unique<gl::fsr_upscale_pass>();
|
||||||
[[ fallthrough ]];
|
break;
|
||||||
case output_scaling_mode::bilinear:
|
case output_scaling_mode::bilinear:
|
||||||
default:
|
default:
|
||||||
m_upscaler = std::make_unique<gl::bilinear_upscale_pass>();
|
m_upscaler = std::make_unique<gl::bilinear_upscale_pass>();
|
||||||
|
@ -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)
|
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
|
// 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
|
else
|
||||||
{
|
{
|
||||||
const f32 gamma = avconfig.gamma;
|
const f32 gamma = avconfig.gamma;
|
||||||
const bool limited_range = !use_full_rgb_range_output;
|
const bool limited_range = !use_full_rgb_range_output;
|
||||||
const rsx::simple_array<GLuint> 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;
|
const auto filter = m_output_scaling == output_scaling_mode::nearest ? gl::filter::nearest : gl::filter::linear;
|
||||||
|
rsx::simple_array<gl::texture*> 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();
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -865,11 +865,10 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
||||||
|
|
||||||
const auto apply_fsr_specific_options = [r_creator, this]()
|
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 auto [text, value] = get_data(ui->outputScalingMode, ui->outputScalingMode->currentIndex());
|
||||||
const bool fsr_selected = static_cast<output_scaling_mode>(value) == output_scaling_mode::fsr;
|
const bool fsr_selected = static_cast<output_scaling_mode>(value) == output_scaling_mode::fsr;
|
||||||
ui->fsrSharpeningStrength->setEnabled(is_vulkan && fsr_selected);
|
ui->fsrSharpeningStrength->setEnabled(fsr_selected);
|
||||||
ui->fsrSharpeningStrengthReset->setEnabled(is_vulkan && fsr_selected);
|
ui->fsrSharpeningStrengthReset->setEnabled(fsr_selected);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle connects to disable specific checkboxes that depend on GUI state.
|
// Handle connects to disable specific checkboxes that depend on GUI state.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue