From c9afb3daaa43224626fa38a62d495188d878a2de Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 9 Aug 2021 19:53:25 +0300 Subject: [PATCH] rsx: Significantly reduce the applied subpixel bias when handling unnormalized access - If a large value is set (e.g 0.5) rounding will sample 'up' and we can read the wrong texel --- rpcs3/Emu/RSX/RSXThread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 9ddf1f1948..9f53a660bf 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -1907,8 +1907,9 @@ namespace rsx if (tex.min_filter() == rsx::texture_minify_filter::nearest || tex.mag_filter() == rsx::texture_magnify_filter::nearest) { - // Subpixel offset so that (X + bias) * scale will round correctly - current_fragment_program.texture_params[i].subpixel_bias = 0.5f; + // Subpixel offset so that (X + bias) * scale will round correctly. + // This is done to work around fdiv precision issues in some GPUs (NVIDIA) + current_fragment_program.texture_params[i].subpixel_bias = 0.01f; } }