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:
authorClément Foucault <foucault.clem@gmail.com>2020-03-27 19:20:48 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-03-27 22:00:27 +0300
commita7110618ff3205e2389768f1c387f263dc0d4da3 (patch)
tree081e75ebef5eb9ece874948d6e1bc6d08b54bdeb /source/blender/gpu/shaders
parent0c0170f77a66eb07b2a59ea0303216df01bb09ac (diff)
Cleanup: GPUShader: Remove unused shaders
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl18
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_normal_smooth_color_vert.glsl22
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_depth_copy_frag.glsl12
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl16
-rw-r--r--source/blender/gpu/shaders/gpu_shader_image_multisample_resolve_frag.glsl119
-rw-r--r--source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl14
-rw-r--r--source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl16
-rw-r--r--source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl4
8 files changed, 0 insertions, 221 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl
deleted file mode 100644
index 181b1bf3fad..00000000000
--- a/source/blender/gpu/shaders/gpu_shader_2D_smooth_color_dithered_frag.glsl
+++ /dev/null
@@ -1,18 +0,0 @@
-
-noperspective in vec4 finalColor;
-out vec4 fragColor;
-
-/* 4x4 bayer matrix prepared for 8bit UNORM precision error. */
-#define P(x) (((x + 0.5) * (1.0 / 16.0) - 0.5) * (1.0 / 255.0))
-const vec4 dither_mat4x4[4] = vec4[4](vec4(P(0.0), P(8.0), P(2.0), P(10.0)),
- vec4(P(12.0), P(4.0), P(14.0), P(6.0)),
- vec4(P(3.0), P(11.0), P(1.0), P(9.0)),
- vec4(P(15.0), P(7.0), P(13.0), P(5.0)));
-
-void main()
-{
- ivec2 tx1 = ivec2(gl_FragCoord.xy) % 4;
- ivec2 tx2 = ivec2(gl_FragCoord.xy) % 2;
- float dither_noise = dither_mat4x4[tx1.x][tx1.y];
- fragColor = finalColor + dither_noise;
-}
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_normal_smooth_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_normal_smooth_color_vert.glsl
deleted file mode 100644
index 7fa571343a2..00000000000
--- a/source/blender/gpu/shaders/gpu_shader_3D_normal_smooth_color_vert.glsl
+++ /dev/null
@@ -1,22 +0,0 @@
-
-uniform mat4 ModelViewProjectionMatrix;
-uniform mat3 NormalMatrix;
-
-in vec3 pos;
-in vec3 nor;
-in vec4 color;
-
-#ifdef USE_FLAT_NORMAL
-flat out vec3 normal;
-flat out vec4 finalColor;
-#else
-out vec3 normal;
-out vec4 finalColor;
-#endif
-
-void main()
-{
- normal = normalize(NormalMatrix * nor);
- gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
- finalColor = color;
-}
diff --git a/source/blender/gpu/shaders/gpu_shader_image_depth_copy_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_depth_copy_frag.glsl
deleted file mode 100644
index 0f2749362b9..00000000000
--- a/source/blender/gpu/shaders/gpu_shader_image_depth_copy_frag.glsl
+++ /dev/null
@@ -1,12 +0,0 @@
-
-in vec2 texCoord_interp;
-out vec4 fragColor;
-
-uniform sampler2D image;
-
-void main()
-{
- float depth = texture(image, texCoord_interp).r;
- fragColor = vec4(depth);
- gl_FragDepth = depth;
-}
diff --git a/source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl
deleted file mode 100644
index 017b21076c8..00000000000
--- a/source/blender/gpu/shaders/gpu_shader_image_depth_linear_frag.glsl
+++ /dev/null
@@ -1,16 +0,0 @@
-
-in vec2 texCoord_interp;
-out vec4 fragColor;
-
-uniform float znear;
-uniform float zfar;
-uniform sampler2D image;
-
-void main()
-{
- float depth = texture(image, texCoord_interp).r;
-
- /* normalize */
- fragColor.rgb = vec3((2.0f * znear) / (zfar + znear - (depth * (zfar - znear))));
- fragColor.a = 1.0f;
-}
diff --git a/source/blender/gpu/shaders/gpu_shader_image_multisample_resolve_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_multisample_resolve_frag.glsl
deleted file mode 100644
index ca425374a1b..00000000000
--- a/source/blender/gpu/shaders/gpu_shader_image_multisample_resolve_frag.glsl
+++ /dev/null
@@ -1,119 +0,0 @@
-
-uniform sampler2DMS depthMulti;
-uniform sampler2DMS colorMulti;
-
-out vec4 fragColor;
-
-#if SAMPLES > 16
-# error "Too many samples"
-#endif
-
-void main()
-{
- ivec2 texel = ivec2(gl_FragCoord.xy);
-
- bvec4 b1, b2, b3, b4;
- vec4 w1, w2, w3, w4;
- vec4 d1, d2, d3, d4;
- vec4 c1, c2, c3, c4, c5, c6, c7, c8;
- vec4 c9, c10, c11, c12, c13, c14, c15, c16;
- d1 = d2 = d3 = d4 = vec4(0.5);
- w1 = w2 = w3 = w4 = vec4(0.0);
- c1 = c2 = c3 = c4 = c5 = c6 = c7 = c8 = vec4(0.0);
- c9 = c10 = c11 = c12 = c13 = c14 = c15 = c16 = vec4(0.0);
-
-#ifdef USE_DEPTH
- /* Depth */
- d1.x = texelFetch(depthMulti, texel, 0).r;
- d1.y = texelFetch(depthMulti, texel, 1).r;
-# if SAMPLES > 2
- d1.z = texelFetch(depthMulti, texel, 2).r;
- d1.w = texelFetch(depthMulti, texel, 3).r;
-# endif
-# if SAMPLES > 4
- d2.x = texelFetch(depthMulti, texel, 4).r;
- d2.y = texelFetch(depthMulti, texel, 5).r;
- d2.z = texelFetch(depthMulti, texel, 6).r;
- d2.w = texelFetch(depthMulti, texel, 7).r;
-# endif
-# if SAMPLES > 8
- d3.x = texelFetch(depthMulti, texel, 8).r;
- d3.y = texelFetch(depthMulti, texel, 9).r;
- d3.z = texelFetch(depthMulti, texel, 10).r;
- d3.w = texelFetch(depthMulti, texel, 11).r;
- d4.x = texelFetch(depthMulti, texel, 12).r;
- d4.y = texelFetch(depthMulti, texel, 13).r;
- d4.z = texelFetch(depthMulti, texel, 14).r;
- d4.w = texelFetch(depthMulti, texel, 15).r;
-# endif
-#endif
-
- /* COLOR */
- b1 = notEqual(d1, vec4(1.0));
- if (any(b1)) {
- c1 = texelFetch(colorMulti, texel, 0);
- c2 = texelFetch(colorMulti, texel, 1);
-#if SAMPLES > 2
- c3 = texelFetch(colorMulti, texel, 2);
- c4 = texelFetch(colorMulti, texel, 3);
-#endif
- w1 = vec4(b1);
- }
-#if SAMPLES > 4
- b2 = notEqual(d2, vec4(1.0));
- if (any(b2)) {
- c5 = texelFetch(colorMulti, texel, 4);
- c6 = texelFetch(colorMulti, texel, 5);
- c7 = texelFetch(colorMulti, texel, 6);
- c8 = texelFetch(colorMulti, texel, 7);
- w2 = vec4(b2);
- }
-#endif
-#if SAMPLES > 8
- b3 = notEqual(d3, vec4(1.0));
- if (any(b3)) {
- c9 = texelFetch(colorMulti, texel, 8);
- c10 = texelFetch(colorMulti, texel, 9);
- c11 = texelFetch(colorMulti, texel, 10);
- c12 = texelFetch(colorMulti, texel, 11);
- w3 = vec4(b3);
- }
- b4 = notEqual(d4, vec4(1.0));
- if (any(b4)) {
- c13 = texelFetch(colorMulti, texel, 12);
- c14 = texelFetch(colorMulti, texel, 13);
- c15 = texelFetch(colorMulti, texel, 14);
- c16 = texelFetch(colorMulti, texel, 15);
- w4 = vec4(b4);
- }
-#endif
-
-#ifdef USE_DEPTH
-# if SAMPLES > 8
- d1 = min(d1, min(d3, d4));
-# endif
-# if SAMPLES > 4
- d1 = min(d1, d2);
- d1 = min(d1, d2);
-# endif
-# if SAMPLES > 2
- d1.xy = min(d1.xy, d1.zw);
-# endif
- gl_FragDepth = min(d1.x, d1.y);
-#endif
-
- c1 = c1 + c2;
-#if SAMPLES > 2
- c1 += c3 + c4;
-#endif
-#if SAMPLES > 4
- c1 += c5 + c6 + c7 + c8;
-#endif
-#if SAMPLES > 8
- c1 += c9 + c10 + c11 + c12 + c13 + c14 + c15 + c16;
-#endif
-
- const float inv_samples = 1.0 / float(SAMPLES);
-
- fragColor = c1 * inv_samples;
-}
diff --git a/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl b/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl
deleted file mode 100644
index 2ed99be2bcf..00000000000
--- a/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_alpha_frag.glsl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-uniform vec3 light;
-uniform float alpha;
-uniform float global;
-
-in vec3 normal;
-in vec4 finalColor;
-out vec4 fragColor;
-
-void main()
-{
- fragColor = finalColor * (global + (1.0 - global) * max(0.0, dot(normalize(normal), light)));
- fragColor.a = alpha;
-}
diff --git a/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl
deleted file mode 100644
index 738b0d84e51..00000000000
--- a/source/blender/gpu/shaders/gpu_shader_simple_lighting_smooth_color_frag.glsl
+++ /dev/null
@@ -1,16 +0,0 @@
-
-uniform vec3 light;
-
-#ifdef USE_FLAT_NORMAL
-flat in vec3 normal;
-flat in vec4 finalColor;
-#else
-in vec3 normal;
-in vec4 finalColor;
-#endif
-out vec4 fragColor;
-
-void main()
-{
- fragColor = finalColor * max(0.0, dot(normalize(normal), light));
-}
diff --git a/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl
index cfa82572e87..d9f84964eb4 100644
--- a/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl
@@ -17,8 +17,4 @@ void main()
#else
fragColor = color;
#endif
-
-#if defined(USE_BACKGROUND)
- gl_FragDepth = 1.0;
-#endif
}