From 9f68b4fea36f384263916006ae3995f6d6415ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20=C3=82ngelo?= Date: Sat, 18 Dec 2021 17:50:58 -0300 Subject: [PATCH] Trunc shader function fixed the 'trunc' function was comparing integers with floats using the '>' operator, which is not supported in Android. This issue is now gone. --- drivers/gles2/shaders/stdlib.glsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gles2/shaders/stdlib.glsl b/drivers/gles2/shaders/stdlib.glsl index f8007f3175a..6e0486cdf19 100644 --- a/drivers/gles2/shaders/stdlib.glsl +++ b/drivers/gles2/shaders/stdlib.glsl @@ -259,19 +259,19 @@ bvec4 isnan(highp vec4 x) { #if defined(TRUNC_USED) highp float trunc(highp float x) { - return x < 0 ? -floor(-x) : floor(x); + return x < 0.0 ? -floor(-x) : floor(x); } highp vec2 trunc(highp vec2 x) { - return vec2(x.x < 0 ? -floor(-x.x) : floor(x.x), x.y < 0 ? -floor(-x.y) : floor(x.y)); + return vec2(x.x < 0.0 ? -floor(-x.x) : floor(x.x), x.y < 0.0 ? -floor(-x.y) : floor(x.y)); } highp vec3 trunc(highp vec3 x) { - return vec3(x.x < 0 ? -floor(-x.x) : floor(x.x), x.y < 0 ? -floor(-x.y) : floor(x.y), x.z < 0 ? -floor(-x.z) : floor(x.z)); + return vec3(x.x < 0.0 ? -floor(-x.x) : floor(x.x), x.y < 0.0 ? -floor(-x.y) : floor(x.y), x.z < 0.0 ? -floor(-x.z) : floor(x.z)); } highp vec4 trunc(highp vec4 x) { - return vec4(x.x < 0 ? -floor(-x.x) : floor(x.x), x.y < 0 ? -floor(-x.y) : floor(x.y), x.z < 0 ? -floor(-x.z) : floor(x.z), x.w < 0 ? -floor(-x.w) : floor(x.w)); + return vec4(x.x < 0.0 ? -floor(-x.x) : floor(x.x), x.y < 0.0 ? -floor(-x.y) : floor(x.y), x.z < 0.0 ? -floor(-x.z) : floor(x.z), x.w < 0.0 ? -floor(-x.w) : floor(x.w)); } #endif