From 447b1b09e3e141003d0170cb5c51e3e32f1ddb00 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 26 Aug 2015 00:09:32 -0500 Subject: 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. --- Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp') 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