Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2017-04-07 19:50:44 +0300
committerMike Erwin <significant.bit@gmail.com>2017-04-07 19:51:11 +0300
commitf0ce39ab169a1f12ee2e89dc8cc71a1d3709d98b (patch)
tree47644c17dc4425a15fbb2edcdc097ebf116e06cb /source/blender/gpu/intern/gpu_shader.c
parentdb444fc783af03de6e4568f8f5d613ba7598f7b4 (diff)
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.
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader.c')
-rw-r--r--source/blender/gpu/intern/gpu_shader.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index 7e705662ac5..cea03b09843 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -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],