summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-08-26 00:09:32 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2015-08-26 17:57:51 -0500
commit447b1b09e3e141003d0170cb5c51e3e32f1ddb00 (patch)
tree90bf656b537d0c0c7919dcfe930f28f2aa902366 /Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
parent6015e2d812db80557810aaa39ce473bb1af21056 (diff)
Support OpenGL ES 3.2.
OpenGL ES 3.2 adds a few things we care about supporting in core. In particular: - GL_{ARB,EXT,OES}_draw_elements_base_vertex - KHR_Debug - Sample Shading - GL_{ARB,EXT,OES,NV}_copy_image - Geometry shaders - Geometry shader instancing (If they support GL_{EXT,OES}_geometry_point_size) Nvidia was the first to release an OpenGL ES 3.2 driver which I uesd to test this on. This also enables GS Instancing on GLES 3.1 hardware if it supports all of the required extensions.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
index 767e98f1b6..22e86cfe42 100644
--- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
+++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp
@@ -50,6 +50,8 @@ static std::string GetGLSLVersionString()
return "#version 300 es";
case GLSLES_310:
return "#version 310 es";
+ case GLSLES_320:
+ return "#version 320 es";
case GLSL_130:
return "#version 130";
case GLSL_140:
@@ -521,6 +523,13 @@ void ProgramShaderCache::CreateHeader()
{
GLSL_VERSION v = g_ogl_config.eSupportedGLSLVersion;
bool is_glsles = v >= GLSLES_300;
+ std::string SupportedESPointSize;
+ switch (g_ogl_config.SupportedESPointSize)
+ {
+ case 1: SupportedESPointSize = "#extension GL_OES_geometry_point_size : enable"; break;
+ case 2: SupportedESPointSize = "#extension GL_EXT_geometry_point_size : enable"; break;
+ default: SupportedESPointSize = ""; break;
+ }
snprintf(s_glsl_header, sizeof(s_glsl_header),
"%s\n"
@@ -532,6 +541,7 @@ void ProgramShaderCache::CreateHeader()
"%s\n" // Sampler binding
"%s\n" // storage buffer
"%s\n" // shader5
+ "%s\n" // Geometry point size
"%s\n" // AEP
"%s\n" // texture buffer
@@ -567,7 +577,8 @@ void ProgramShaderCache::CreateHeader()
, (g_ogl_config.bSupportSampleShading) ? "#extension GL_ARB_sample_shading : enable" : ""
, g_ActiveConfig.backend_info.bSupportsBindingLayout ? "#define SAMPLER_BINDING(x) layout(binding = x)" : "#define SAMPLER_BINDING(x)"
, g_ActiveConfig.backend_info.bSupportsBBox ? "#extension GL_ARB_shader_storage_buffer_object : enable" : ""
- , g_ActiveConfig.backend_info.bSupportsGSInstancing ? "#extension GL_ARB_gpu_shader5 : enable" : ""
+ , !is_glsles && g_ActiveConfig.backend_info.bSupportsGSInstancing ? "#extension GL_ARB_gpu_shader5 : enable" : ""
+ , SupportedESPointSize.c_str()
, 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" : ""