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.
This commit is contained in:
Ryan Houdek 2015-02-27 19:38:51 -06:00
parent c792d45d89
commit 3c5e99c777
1 changed files with 5 additions and 4 deletions

View File

@ -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<GLSL_140 ? "#extension GL_ARB_uniform_buffer_object : enable" : ""
, g_ActiveConfig.backend_info.bSupportsEarlyZ ? "#extension GL_ARB_shader_image_load_store : enable" : ""
, !is_glsles && g_ActiveConfig.backend_info.bSupportsEarlyZ ? "#extension GL_ARB_shader_image_load_store : enable" : ""
, (g_ActiveConfig.backend_info.bSupportsBindingLayout && v < GLSLES_310) ? "#extension GL_ARB_shading_language_420pack : enable" : ""
, (g_ogl_config.bSupportsMSAA && v < GLSL_150) ? "#extension GL_ARB_texture_multisample : enable" : ""
, (g_ogl_config.bSupportSampleShading) ? "#extension GL_ARB_sample_shading : enable" : ""
@ -566,9 +567,9 @@ void ProgramShaderCache::CreateHeader()
, g_ogl_config.bSupportsAEP ? "#extension GL_ANDROID_extension_pack_es31a : enable" : ""
, v<GLSL_140 && g_ActiveConfig.backend_info.bSupportsPaletteConversion ? "#extension GL_ARB_texture_buffer_object : enable" : ""
, 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" : ""