Skip to content

Commit

Permalink
Adds option to enable/disable "Fix Upscale Bleeding Edge"
Browse files Browse the repository at this point in the history
Helps with texture bleeding case when upscaling. Disabling it can help if pixels are warping when upscaling in 2D games (MVC2, CVS, KOF, etc.)
  • Loading branch information
Immersion95 authored and flyinghead committed Feb 22, 2024
1 parent 44fa364 commit 67c4e62
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/cfg/option.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Option<bool> DupeFrames("rend.DupeFrames", false);
Option<int> PerPixelLayers("rend.PerPixelLayers", 32);
Option<bool> NativeDepthInterpolation("rend.NativeDepthInterpolation", false);
Option<bool> EmulateFramebuffer("rend.EmulateFramebuffer", false);
Option<bool> FixUpscaleBleedingEdge("rend.FixUpscaleBleedingEdge", true);
#ifdef VIDEO_ROUTING
Option<bool, false> VideoRouting("rend.VideoRouting", false);
Option<bool, false> VideoRoutingScale("rend.VideoRoutingScale", false);
Expand Down
1 change: 1 addition & 0 deletions core/cfg/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ extern Option<bool> ThreadedRendering;
extern Option<bool> DupeFrames;
extern Option<bool> NativeDepthInterpolation;
extern Option<bool> EmulateFramebuffer;
extern Option<bool> FixUpscaleBleedingEdge;
#ifdef VIDEO_ROUTING
extern Option<bool, false> VideoRouting;
extern Option<bool, false> VideoRoutingScale;
Expand Down
2 changes: 1 addition & 1 deletion core/hw/pvr/ta_vtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ static void parseRenderPass(RenderPass& pass, const RenderPass& previousPass, re
|| config::RendererType == RenderType::Vulkan_OIT;
const bool mergeTranslucent = config::PerStripSorting || perPixel;

if (config::RenderResolution > 480 && !config::EmulateFramebuffer)
if (config::RenderResolution > 480 && !config::EmulateFramebuffer && config::FixUpscaleBleedingEdge)
{
fix_texture_bleeding(ctx.global_param_op, previousPass.op_count, pass.op_count, ctx);
fix_texture_bleeding(ctx.global_param_pt, previousPass.pt_count, pass.pt_count, ctx);
Expand Down
2 changes: 2 additions & 0 deletions core/rend/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,8 @@ static void gui_display_settings()
OptionCheckbox("Rotate Screen 90°", config::Rotate90, "Rotate the screen 90° counterclockwise");
OptionCheckbox("Delay Frame Swapping", config::DelayFrameSwapping,
"Useful to avoid flashing screen or glitchy videos. Not recommended on slow platforms");
OptionCheckbox("Fix Upscale Bleeding Edge", config::FixUpscaleBleedingEdge,
"Helps with texture bleeding case when upscaling. Disabling it can help if pixels are warping when upscaling in 2D games (MVC2, CVS, KOF, etc.)");
OptionCheckbox("Native Depth Interpolation", config::NativeDepthInterpolation,
"Helps with texture corruption and depth issues on AMD GPUs. Can also help Intel GPUs in some cases.");
OptionCheckbox("Full Framebuffer Emulation", config::EmulateFramebuffer,
Expand Down
14 changes: 14 additions & 0 deletions shell/libretro/libretro_core_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,20 @@ struct retro_core_option_v2_definition option_defs_us[] = {
},
"disabled",
},
{
CORE_OPTION_NAME "_fix_upscale_bleeding_edge",
"Fix Upscale Bleeding Edge",
NULL,
"Helps with texture bleeding case when upscaling. Disabling it can help if pixels are warping when upscaling in 2D games (MVC2, CVS, KOF, etc.)",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"enabled",
},
{
CORE_OPTION_NAME "_threaded_rendering",
"Threaded Rendering",
Expand Down
1 change: 1 addition & 0 deletions shell/libretro/option.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Option<int64_t> PixelBufferSize("", 512_MB);
IntOption PerPixelLayers(CORE_OPTION_NAME "_oit_layers");
Option<bool> NativeDepthInterpolation(CORE_OPTION_NAME "_native_depth_interpolation");
Option<bool> EmulateFramebuffer(CORE_OPTION_NAME "_emulate_framebuffer", false);
Option<bool> FixUpscaleBleedingEdge(CORE_OPTION_NAME "_fix_upscale_bleeding_edge", true);

// Misc

Expand Down

0 comments on commit 67c4e62

Please sign in to comment.