Restore mediump float precision and fast-math C flag

This commit is contained in:
Lubos 2022-03-30 18:27:12 +02:00
parent bcf9287a85
commit 25154e5b9f
2 changed files with 2 additions and 10 deletions

View file

@ -442,11 +442,8 @@ ifeq ($(PLATFORM),android)
-fno-builtin-cos -fno-builtin-sin -fPIC -DARCH_STRING=\\\"$(ARCH)\\\"
CLIENT_CFLAGS += $(SDL_CFLAGS) -DSDL_DISABLE_IMMINTRIN_H -fno-builtin-cos -fno-builtin-sin
# Flag -ffast-math replacement: https://pspdfkit.com/blog/2021/understanding-fast-math/
# Flags -ffp-contract=fast -fno-trapping-math are unused because they are causing lightmap issues
OPTIMIZEFASTMATH = -ffinite-math-only -fno-math-errno -fassociative-math -freciprocal-math -fno-signed-zeros
OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer
OPTIMIZE = $(OPTIMIZEVM) $(OPTIMIZEFASTMATH)
OPTIMIZE = $(OPTIMIZEVM) $(OPTIMIZEFASTMATH) -ffast-math
HAVE_VM_COMPILED = false

View file

@ -243,12 +243,7 @@ static void GLSL_GetShaderHeader( GLenum shaderType, const GLchar *extra, char *
// HACK: abuse the GLSL preprocessor to turn GLSL 1.20 shaders into 1.30 ones
#ifdef __ANDROID__
Q_strcat(dest, size, "#version 300 es\n");
// HACK: use in main menu medium float precision (to prevent issue with missing models textures)
if (Cvar_Get("r_uiFullScreen", "1", 0)->integer)
Q_strcat(dest, size, "precision mediump float;\n");
else
Q_strcat(dest, size, "precision highp float;\n");
Q_strcat(dest, size, "precision mediump float;\n");
if(shaderType == GL_VERTEX_SHADER)
{