feat(renderer): Add ScaleFX pixel art upscaling filter

Implements ScaleFX algorithm for pixel art upscaling with edge
preservation. Supports both OpenGL and Vulkan with FP16/FP32
variants for hardware optimization.

ScaleFX is designed to reduce pixelation while preserving sharp
edges, ideal for low-resolution and pixel art games.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-10-11 13:35:19 +10:00
parent 0c5c1bbf7f
commit 568ab699f6
12 changed files with 201 additions and 0 deletions

View File

@@ -90,6 +90,9 @@ void BlitScreen::CreateWindowAdapt() {
case Settings::ScalingFilter::ScaleForce:
window_adapt = MakeScaleForce(device);
break;
case Settings::ScalingFilter::ScaleFx:
window_adapt = MakeScaleFx(device);
break;
case Settings::ScalingFilter::Fsr:
case Settings::ScalingFilter::Fsr2:
case Settings::ScalingFilter::Bilinear:

View File

@@ -4,6 +4,7 @@
#include "video_core/host_shaders/opengl_present_frag.h"
#include "video_core/host_shaders/opengl_present_scaleforce_frag.h"
#include "video_core/host_shaders/opengl_present_scalefx_frag.h"
#include "video_core/host_shaders/present_bicubic_frag.h"
#include "video_core/host_shaders/present_lanczos_frag.h"
#include "video_core/host_shaders/present_gaussian_frag.h"
@@ -38,6 +39,12 @@ std::unique_ptr<WindowAdaptPass> MakeScaleForce(const Device& device) {
fmt::format("#version 460\n{}", HostShaders::OPENGL_PRESENT_SCALEFORCE_FRAG));
}
std::unique_ptr<WindowAdaptPass> MakeScaleFx(const Device& device) {
return std::make_unique<WindowAdaptPass>(
device, CreateBilinearSampler(),
fmt::format("#version 460\n{}", HostShaders::OPENGL_PRESENT_SCALEFX_FRAG));
}
std::unique_ptr<WindowAdaptPass> MakeLanczos(const Device& device) {
return std::make_unique<WindowAdaptPass>(device, CreateNearestNeighborSampler(),
HostShaders::PRESENT_LANCZOS_FRAG);

View File

@@ -15,5 +15,6 @@ std::unique_ptr<WindowAdaptPass> MakeBicubic(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeLanczos(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeGaussian(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeScaleForce(const Device& device);
std::unique_ptr<WindowAdaptPass> MakeScaleFx(const Device& device);
} // namespace OpenGL