diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-19 10:42:30 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-19 10:42:30 +0300 |
commit | c409acd84234aae715d64857ed8b696d4f5ce85e (patch) | |
tree | a14065f0e0db2f402bea07b65549392708f1325a /source | |
parent | 1f46da922a98c6badf6e2de13304358b3b0b7576 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.c | 9 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_2D_line_dashed_legacy_vert.glsl | 17 |
3 files changed, 0 insertions, 27 deletions
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; -} |