From 3c5e99c777f8300b06e53ec3040446fb074473f5 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 27 Feb 2015 19:38:51 -0600 Subject: [PATCH] Fix OpenGL ES 3.1 on non-Nvidia devices. We are declaring we require ARB_shader_image_load_store in the shader, this isn't an extension on GLES because it is part of the GLSL ES 3.1 spec. If we are running as GLES then just not put it in the shaders. --- Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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" : ""