diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index e0f0eac72d..01b0af3f45 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -516,6 +516,7 @@ void ProgramShaderCache::Shutdown() void ProgramShaderCache::CreateHeader() { GLSL_VERSION v = g_ogl_config.eSupportedGLSLVersion; + bool is_glsles = v >= GLSLES_300; snprintf(s_glsl_header, sizeof(s_glsl_header), "%s\n" @@ -556,7 +557,7 @@ void ProgramShaderCache::CreateHeader() , GetGLSLVersionString().c_str() , v=GLSLES_300 ? "precision highp float;" : "" - , v>=GLSLES_300 ? "precision highp int;" : "" - , v>=GLSLES_300 ? "precision highp sampler2DArray;" : "" + , is_glsles ? "precision highp float;" : "" + , is_glsles ? "precision highp int;" : "" + , is_glsles ? "precision highp sampler2DArray;" : "" , DriverDetails::HasBug(DriverDetails::BUG_BROKENTEXTURESIZE) ? "#define textureSize(x, y) ivec2(1, 1)" : "" , DriverDetails::HasBug(DriverDetails::BUG_BROKENCENTROID) ? "#define centroid" : ""