mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-17 10:10:45 -04:00
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:
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user