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.
This commit is contained in:
Bastien Montagne 2017-05-19 09:42:30 +02:00
parent 1f46da922a
commit c409acd842
3 changed files with 0 additions and 27 deletions

View File

@ -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)

View File

@ -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) */

View File

@ -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;
}