From ac47303a5bde2d4a74e4852ee3b7ba34f83854b6 Mon Sep 17 00:00:00 2001 From: Bin Jin Date: Wed, 10 Jan 2024 10:52:11 +0000 Subject: [PATCH] ravu-zoom: address potential float precision issue While I couldn't reproduce this issue using mpv, it has been observed in the HLSL port of RAVU-Zoom for Magpie. Instead of digging and trying to figure out how different shader compilers handle floats differently, it's always easier just to stay on the safe side. Thanks to @hauuau for report and testing work. ref: Blinue/Magpie#803 --- ravu-zoom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ravu-zoom.py b/ravu-zoom.py index 8207182..00fef6b 100755 --- a/ravu-zoom.py +++ b/ravu-zoom.py @@ -399,7 +399,7 @@ def generate_compute(self, block_size): GLSL("ivec2 group_begin = ivec2(gl_WorkGroupID) * ivec2(gl_WorkGroupSize);") GLSL("ivec2 group_end = group_begin + ivec2(gl_WorkGroupSize) - ivec2(1);") GLSL("ivec2 rectl = ivec2(floor(HOOKED_size * HOOKED_map(group_begin) - 0.5)) - %d;" % (self.radius - 1)) - GLSL("ivec2 rectr = ivec2(floor(HOOKED_size * HOOKED_map(group_end) - 0.5)) + %d;" % self.radius) + GLSL("ivec2 rectr = ivec2(floor(HOOKED_size * HOOKED_map(group_end) - 0.4999)) + %d;" % self.radius) GLSL("ivec2 rect = rectr - rectl + 1;") GLSL("""