Commit: c409acd84234aae715d64857ed8b696d4f5ce85e
Author: Bastien Montagne
Date:   Fri May 19 09:42:30 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBc409acd84234aae715d64857ed8b696d4f5ce85e

Cleanup: removing dummy legacy dashed line shader.

Dashed requires geom shader, which was not available with older OpenGL,
now that we are on 3.3 we do not need that dummy workaround anymore.

===================================================================

M       source/blender/gpu/CMakeLists.txt
M       source/blender/gpu/intern/gpu_shader.c
D       source/blender/gpu/shaders/gpu_shader_2D_line_dashed_legacy_vert.glsl

===================================================================

diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index 14520a4f436..9b7cb827adb 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -134,7 +134,6 @@ data_to_c_simple(shaders/gpu_shader_flat_color_frag.glsl 
SRC)
 data_to_c_simple(shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_vert.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_flat_color_vert.glsl SRC)
-data_to_c_simple(shaders/gpu_shader_2D_line_dashed_legacy_vert.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_line_dashed_vert.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_line_dashed_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_line_dashed_geom.glsl SRC)
diff --git a/source/blender/gpu/intern/gpu_shader.c 
b/source/blender/gpu/intern/gpu_shader.c
index 83e126bd39f..d52be6ef6e4 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -113,7 +113,6 @@ extern char 
datatoc_gpu_shader_2D_point_uniform_size_aa_vert_glsl[];
 extern char datatoc_gpu_shader_2D_point_uniform_size_outline_aa_vert_glsl[];
 extern char 
datatoc_gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert_glsl[];
 
-extern char datatoc_gpu_shader_2D_line_dashed_legacy_vert_glsl[];
 extern char datatoc_gpu_shader_2D_line_dashed_vert_glsl[];
 extern char datatoc_gpu_shader_2D_line_dashed_frag_glsl[];
 extern char datatoc_gpu_shader_2D_line_dashed_geom_glsl[];
@@ -791,14 +790,6 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader 
shader)
                        stages = &legacy_fancy_edges;
                }
 
-               if (shader == GPU_SHADER_2D_LINE_DASHED_COLOR && 
!GLEW_VERSION_3_2) {
-                       /* Dashed need geometry shader, which are not supported 
by legacy OpenGL, fallback to solid lines. */
-                       /* TODO: remove after switch to core profile (maybe) */
-                       static const GPUShaderStages legacy_dashed_lines = { 
datatoc_gpu_shader_2D_line_dashed_legacy_vert_glsl,
-                                                                            
datatoc_gpu_shader_2D_line_dashed_frag_glsl };
-                       stages = &legacy_dashed_lines;
-               }
-
                if (shader == GPU_SHADER_3D_LINE_DASHED_COLOR && 
!GLEW_VERSION_3_2) {
                        /* Dashed need geometry shader, which are not supported 
by legacy OpenGL, fallback to solid lines. */
                        /* TODO: remove after switch to core profile (maybe) */
diff --git 
a/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_legacy_vert.glsl 
b/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_legacy_vert.glsl
deleted file mode 100644
index c401b2c17c3..00000000000
--- a/source/blender/gpu/shaders/gpu_shader_2D_line_dashed_legacy_vert.glsl
+++ /dev/null
@@ -1,17 +0,0 @@
-
-// Draw dashed lines, perforated in screen space.
-// Based on a (3D) version by Mike Erwin.
-
-uniform mat4 ModelViewProjectionMatrix;
-uniform vec2 viewport_size;
-
-in vec2 pos;
-noperspective out float distance_along_line;
-
-void main()
-{
-       gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0);
-
-       /* Hack - prevent stupid GLSL compiler to optimize out unused 
viewport_size uniform, which gives crash! */
-       distance_along_line = viewport_size.x * 0.000001f - viewport_size.x * 
0.0000009f;
-}

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to