From ac9afbfede0050d3579cf751b581fad863027a03 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 31 Jan 2024 15:18:38 +0100 Subject: [PATCH] glsl: use fragCoord to decide interlacing --- rpcs3/Emu/RSX/Program/GLSLCommon.cpp | 2 +- .../RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/RSX/Program/GLSLCommon.cpp b/rpcs3/Emu/RSX/Program/GLSLCommon.cpp index 610d629cc7..e0ce1481a0 100644 --- a/rpcs3/Emu/RSX/Program/GLSLCommon.cpp +++ b/rpcs3/Emu/RSX/Program/GLSLCommon.cpp @@ -158,7 +158,7 @@ namespace glsl ; } - void insert_rop(std::ostream& OS, const shader_properties& props) + void insert_rop(std::ostream& OS, const shader_properties& /*props*/) { OS << #include "GLSLSnippets//RSXProg/RSXROPEpilogue.glsl" diff --git a/rpcs3/Emu/RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl index 989cb550b6..6769514a41 100644 --- a/rpcs3/Emu/RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl +++ b/rpcs3/Emu/RSX/Program/GLSLSnippets/VideoOutCalibrationPass.glsl @@ -99,7 +99,7 @@ vec4 read_source() ? texture(fs0, tc0 * ou_single_matrix) : texture(fs0, (tc0 * ou_single_matrix) + vec2(0.f, 0.020408f)); case STEREO_MODE_INTERLACED: - return (mod(textureSize(fs0, 0).y * tc0.y, 2.f) < 1.f) + return ((int(gl_FragCoord.y) & 1) > 0) ? texture(fs0, tc0 * left_single_matrix) : texture(fs0, (tc0 * left_single_matrix) + right_single_matrix); default: // undefined behavior @@ -122,11 +122,11 @@ vec4 read_source() ? texture(fs0, (tc0 * sbs_multi_matrix)) : texture(fs1, (tc0 * sbs_multi_matrix) + vec2(-1.f, 0.f)); case STEREO_MODE_OVER_UNDER: - return (tc0.y < 0.5) + return (tc0.y < 0.5) ? texture(fs0, (tc0 * ou_multi_matrix)) : texture(fs1, (tc0 * ou_multi_matrix) + vec2(0.f, -1.f)); case STEREO_MODE_INTERLACED: - return (mod(textureSize(fs0, 0).y * tc0.y, 2.f) < 1.f) + return ((int(gl_FragCoord.y) & 1) > 0) ? texture(fs0, tc0) : texture(fs1, tc0); default: // undefined behavior