Skip to content

Commit

Permalink
ravu-zoom: address potential float precision issue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bjin committed Jan 10, 2024
1 parent d5d4300 commit ac47303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ravu-zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("""
Expand Down

0 comments on commit ac47303

Please sign in to comment.