From 79bcaf266f99e7a3ce2c6492aff0308a87c72eea Mon Sep 17 00:00:00 2001 From: Eblo <7004497+Eblo@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:15:00 -0400 Subject: [PATCH] Fix precision issues in vertex shaders Restore conditional that makes mediump declaration only apply to fragment shaders This was erroneously removed to make the Lanczos3 shader link properly, but it resulted in vertex shaders incorrectly defaulting to mediump Add highp precision declaration to Lanczos3 fragment shader so that it can link --- shader/common.h | 3 +++ shader/lanczos3.frag | 1 + 2 files changed, 4 insertions(+) diff --git a/shader/common.h b/shader/common.h index 16704c4..a34ef54 100644 --- a/shader/common.h +++ b/shader/common.h @@ -1,6 +1,9 @@ #ifdef GLSLES +#ifdef FRAGMENT_SHADER +/* Only the fragment shader has no default float precision */ precision mediump float; +#endif #else diff --git a/shader/lanczos3.frag b/shader/lanczos3.frag index 2f84ae8..8122592 100644 --- a/shader/lanczos3.frag +++ b/shader/lanczos3.frag @@ -2,6 +2,7 @@ // Copyright 2020 Lilian Gimenez (Sentmoraap). // MIT license. +precision highp float; uniform sampler2D texture; uniform vec2 sourceSize; uniform vec2 texSizeInv;