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>2022-05-02 00:47:26 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-05-02 00:54:41 +0300
commit2a7a01b339ad60aec5ffe265411fa2f0b1589137 (patch)
tree6b472e21edc425d2ceb21c378d248c19bbd558e5 /source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
parentaa34706aacdab45847d7c0e3987b1de4ff0b8760 (diff)
GPUShader: Port polyline shaders to use shaderCreateInfo
This should have no functional changes.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl35
1 files changed, 6 insertions, 29 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
index 627e91af4d6..1c824023234 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl
@@ -1,26 +1,3 @@
-#ifndef USE_GPU_SHADER_CREATE_INFO
-layout(lines) in;
-layout(triangle_strip, max_vertices = 4) out;
-
-uniform vec4 color;
-uniform vec2 viewportSize;
-uniform float lineWidth;
-uniform bool lineSmooth = true;
-
-# if !defined(UNIFORM)
-in vec4 finalColor_g[];
-# endif
-
-# ifdef CLIP
-in float clip_g[];
-out float clip;
-# endif
-
-out vec4 finalColor;
-noperspective out float smoothline;
-#endif
-
-#define SMOOTH_WIDTH 1.0
/* Clips point to near clip plane before perspective divide. */
vec4 clip_line_point_homogeneous_space(vec4 p, vec4 q)
@@ -41,26 +18,26 @@ vec4 clip_line_point_homogeneous_space(vec4 p, vec4 q)
void do_vertex(const int i, vec4 pos, vec2 ofs)
{
#if defined(UNIFORM)
- finalColor = color;
+ interp_out.color = color;
#elif defined(FLAT)
/* WATCH: Assuming last provoking vertex. */
- finalColor = finalColor_g[1];
+ interp_out.color = interp_in[1].color;
#elif defined(SMOOTH)
- finalColor = finalColor_g[i];
+ interp_out.color = interp_in[i].color;
#endif
#ifdef CLIP
- clip = clip_g[i];
+ interp_out.clip = interp_in[i].clip;
#endif
- smoothline = (lineWidth + SMOOTH_WIDTH * float(lineSmooth)) * 0.5;
+ interp_out.smoothline = (lineWidth + SMOOTH_WIDTH * float(lineSmooth)) * 0.5;
gl_Position = pos;
gl_Position.xy += ofs * pos.w;
EmitVertex();
- smoothline = -(lineWidth + SMOOTH_WIDTH * float(lineSmooth)) * 0.5;
+ interp_out.smoothline = -(lineWidth + SMOOTH_WIDTH * float(lineSmooth)) * 0.5;
gl_Position = pos;
gl_Position.xy -= ofs * pos.w;
EmitVertex();