From 85df49dc96770da69825cd31bfae19f647d11fc2 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 23 Dec 2018 06:04:35 +0900 Subject: [PATCH] graphicsdriver/opengl: Bug fix: variables can be optimized out --- internal/graphicsdriver/opengl/shader.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/graphicsdriver/opengl/shader.go b/internal/graphicsdriver/opengl/shader.go index 90719e227..7eb07b021 100644 --- a/internal/graphicsdriver/opengl/shader.go +++ b/internal/graphicsdriver/opengl/shader.go @@ -157,6 +157,8 @@ void main(void) { #if defined(FILTER_SCREEN) highp vec2 p0 = pos - texel_size / 2.0 / scale; highp vec2 p1 = pos + texel_size / 2.0 / scale; + // Prevent this variable from being optimized out. + p0 += varying_tex_region.xy - varying_tex_region.xy; p1 = adjustTexel(p0, p1);