OpenGL: support GLSL 3.3 core profile

When WITH_LEGACY_OPENGL = OFF.

This is our final target for Blender 2.8, all previous versions will be dropped in the future. GLSL 3.3 is richer so we don't require as many extensions.
This commit is contained in:
Mike Erwin
2017-04-07 12:50:44 -04:00
parent db444fc783
commit f0ce39ab16

View File

@@ -178,6 +178,7 @@ static void shader_print_errors(const char *task, const char *log, const char **
static const char *gpu_shader_version(void)
{
#ifdef WITH_LEGACY_OPENGL
if (GLEW_VERSION_3_3) {
if (GPU_legacy_support()) {
return "#version 330 compatibility\n";
@@ -201,9 +202,11 @@ static const char *gpu_shader_version(void)
return "#version 120\n";
/* minimum supported */
}
#else
return "#version 330\n";
#endif
}
static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH], bool use_geometry_shader)
{
/* enable extensions for features that are not part of our base GLSL version
@@ -215,6 +218,7 @@ static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH],
strcat(defines, "#extension GL_ARB_texture_query_lod: enable\n");
}
#ifdef WITH_LEGACY_OPENGL
if (use_geometry_shader && GPU_geometry_shader_support_via_extension()) {
strcat(defines, "#extension GL_EXT_geometry_shader4: enable\n");
}
@@ -232,6 +236,9 @@ static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH],
strcat(defines, "#extension GL_EXT_gpu_shader4: require\n");
}
}
#else
(void)use_geometry_shader;
#endif
}
static void gpu_shader_standard_defines(char defines[MAX_DEFINE_LENGTH],