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-05-18 22:47:32 +0300
committerMike Erwin <significant.bit@gmail.com>2017-05-19 01:30:23 +0300
commit5ed0944ce6381037ecbb361320a0ed3f64c9183b (patch)
tree3885fa8f9dc113d50f6bae819c48397982436a95 /source/blender/gpu
parent7823957455fbdd0cc982a840b148dfbdc345f948 (diff)
GPU: cleanup GLSL version and standard extensions
Now we always use GLSL 3.3, AKA #version 330. Most of the extensions we used are built into OpenGL 3.3 so we don't need them anymore. Cleaned up comments related to GLSL version. Part of T49012
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_shader.c48
1 files changed, 1 insertions, 47 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index 0c294585aea..58610ee7f4b 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -191,33 +191,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";
- /* highest version that is widely supported
- * gives us native geometry shaders!
- * use compatibility profile so we can continue using builtin shader input/output names
- */
- }
- else {
- return "#version 130\n";
- /* latest version that is compatible with existing shaders */
- }
- }
- else if (GLEW_VERSION_3_0) {
- return "#version 130\n";
- /* GLSL 1.3 has modern syntax/keywords/datatypes so use if available
- * older features are deprecated but still available without compatibility extension or profile
- */
- }
- else {
- return "#version 120\n";
- /* minimum supported */
- }
-#else
return "#version 330\n";
-#endif
}
static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH])
@@ -227,25 +201,9 @@ static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH])
*/
if (GLEW_ARB_texture_query_lod) {
- /* a #version 400 feature, but we use #version 150 maximum so use extension */
+ /* a #version 400 feature, but we use #version 330 maximum so use extension */
strcat(defines, "#extension GL_ARB_texture_query_lod: enable\n");
}
-
-#ifdef WITH_LEGACY_OPENGL
- if (GLEW_VERSION_3_1 && !GLEW_VERSION_3_2 && GLEW_ARB_compatibility) {
- strcat(defines, "#extension GL_ARB_compatibility: enable\n");
- }
-
- if (!GLEW_VERSION_3_1) {
- if (GLEW_ARB_draw_instanced) {
- strcat(defines, "#extension GL_ARB_draw_instanced: enable\n");
- }
-
- if (!GLEW_VERSION_3_0) {
- strcat(defines, "#extension GL_EXT_gpu_shader4: require\n");
- }
- }
-#endif
}
static void gpu_shader_standard_defines(char defines[MAX_DEFINE_LENGTH],
@@ -322,10 +280,6 @@ GPUShader *GPU_shader_create_ex(const char *vertexcode,
const int flags)
{
#ifdef WITH_OPENSUBDIV
- /* TODO(sergey): used to add #version 150 to the geometry shader.
- * Could safely be renamed to "use_geometry_code" since it's very
- * likely any of geometry code will want to use GLSL 1.5.
- */
bool use_opensubdiv = (flags & GPU_SHADER_FLAGS_SPECIAL_OPENSUBDIV) != 0;
#else
UNUSED_VARS(flags);