Commit: 2df27995f9226245c29007c3dd2eca61cb31fc69
Author: Mike Erwin
Date:   Sat Oct 15 02:30:59 2016 -0400
Branches: blender2.8
https://developer.blender.org/rB2df27995f9226245c29007c3dd2eca61cb31fc69

OpenGL: new built-in point shader, clean up other shader names

Smooth round point with outline (uniform color) and fill (varying color).

Updated shader naming scheme: a shader that doesn't deal with color does not 
have to say "no color". Vertex shaders do not have to say "uniform color" since 
their frag counterpart actually has the uniform. Each name should describe what 
that shader *does*, not what it *doesn't do*.

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

M       source/blender/gpu/CMakeLists.txt
M       source/blender/gpu/GPU_shader.h
M       source/blender/gpu/intern/gpu_shader.c
R100    
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_uniform_color_outline_smooth_vert.glsl
      
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_outline_smooth_vert.glsl
R100    
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_uniform_color_smooth_vert.glsl
      
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_smooth_vert.glsl
A       
source/blender/gpu/shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_smooth_vert.glsl
R100    source/blender/gpu/shaders/gpu_shader_2D_no_color_vert.glsl     
source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
R100    
source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_no_color_vert.glsl  
source/blender/gpu/shaders/gpu_shader_3D_point_varying_size_vert.glsl
R100    source/blender/gpu/shaders/gpu_shader_3D_no_color_vert.glsl     
source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
A       
source/blender/gpu/shaders/gpu_shader_point_varying_color_outline_smooth_frag.glsl

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

diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index d33e945..904e682 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -129,14 +129,14 @@ set(SRC
 data_to_c_simple(shaders/gpu_shader_depth_only_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_uniform_color_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_flat_color_frag.glsl SRC)
-data_to_c_simple(shaders/gpu_shader_2D_no_color_vert.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_smooth_color_vert.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_smooth_color_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_texture_2D_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_texture_rect_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_2D_texture_vert.glsl SRC)
-data_to_c_simple(shaders/gpu_shader_3D_no_color_vert.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_3D_vert.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_3D_flat_color_vert.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_3D_smooth_color_vert.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_3D_smooth_color_frag.glsl SRC)
@@ -144,13 +144,15 @@ 
data_to_c_simple(shaders/gpu_shader_3D_smooth_color_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_point_uniform_color_frag.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_point_uniform_color_smooth_frag.glsl SRC)
 
data_to_c_simple(shaders/gpu_shader_point_uniform_color_outline_smooth_frag.glsl
 SRC)
+data_to_c_simple(shaders/gpu_shader_point_varying_color_outline_smooth_frag.glsl
 SRC)
 data_to_c_simple(shaders/gpu_shader_point_varying_color_frag.glsl SRC)
 
data_to_c_simple(shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl 
SRC)
-data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_no_color_vert.glsl 
SRC)
+data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_vert.glsl SRC)
 
data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl
 SRC)
 
data_to_c_simple(shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl
 SRC)
-data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_uniform_color_smooth_vert.glsl
 SRC)
-data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_uniform_color_outline_smooth_vert.glsl
 SRC)
+data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_smooth_vert.glsl SRC)
+data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_outline_smooth_vert.glsl
 SRC)
+data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_smooth_vert.glsl
 SRC)
 
 data_to_c_simple(shaders/gpu_shader_text_vert.glsl SRC)
 data_to_c_simple(shaders/gpu_shader_text_frag.glsl SRC)
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h
index 8ccaa9d..2256838 100644
--- a/source/blender/gpu/GPU_shader.h
+++ b/source/blender/gpu/GPU_shader.h
@@ -108,6 +108,7 @@ typedef enum GPUBuiltinShader {
        GPU_SHADER_2D_POINT_FIXED_SIZE_UNIFORM_COLOR,
        GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_SMOOTH,
        GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_SMOOTH,
+       GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_SMOOTH,
        GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR,
        GPU_SHADER_3D_POINT_FIXED_SIZE_UNIFORM_COLOR,
        GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR,
diff --git a/source/blender/gpu/intern/gpu_shader.c 
b/source/blender/gpu/intern/gpu_shader.c
index 2ad3927..cfc1e63 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -49,14 +49,14 @@
 extern char datatoc_gpu_shader_depth_only_frag_glsl[];
 extern char datatoc_gpu_shader_uniform_color_frag_glsl[];
 extern char datatoc_gpu_shader_flat_color_frag_glsl[];
-extern char datatoc_gpu_shader_2D_no_color_vert_glsl[];
+extern char datatoc_gpu_shader_2D_vert_glsl[];
 extern char datatoc_gpu_shader_2D_flat_color_vert_glsl[];
 extern char datatoc_gpu_shader_2D_smooth_color_vert_glsl[];
 extern char datatoc_gpu_shader_2D_smooth_color_frag_glsl[];
 extern char datatoc_gpu_shader_2D_texture_vert_glsl[];
 extern char datatoc_gpu_shader_2D_texture_2D_frag_glsl[];
 extern char datatoc_gpu_shader_2D_texture_rect_frag_glsl[];
-extern char datatoc_gpu_shader_3D_no_color_vert_glsl[];
+extern char datatoc_gpu_shader_3D_vert_glsl[];
 extern char datatoc_gpu_shader_3D_flat_color_vert_glsl[];
 extern char datatoc_gpu_shader_3D_smooth_color_vert_glsl[];
 extern char datatoc_gpu_shader_3D_smooth_color_frag_glsl[];
@@ -64,13 +64,15 @@ extern char datatoc_gpu_shader_3D_smooth_color_frag_glsl[];
 extern char datatoc_gpu_shader_point_uniform_color_frag_glsl[];
 extern char datatoc_gpu_shader_point_uniform_color_smooth_frag_glsl[];
 extern char datatoc_gpu_shader_point_uniform_color_outline_smooth_frag_glsl[];
+extern char datatoc_gpu_shader_point_varying_color_outline_smooth_frag_glsl[];
 extern char datatoc_gpu_shader_point_varying_color_frag_glsl[];
 extern char datatoc_gpu_shader_3D_point_fixed_size_varying_color_vert_glsl[];
-extern char datatoc_gpu_shader_3D_point_varying_size_no_color_vert_glsl[];
+extern char datatoc_gpu_shader_3D_point_varying_size_vert_glsl[];
 extern char datatoc_gpu_shader_3D_point_varying_size_varying_color_vert_glsl[];
 extern char datatoc_gpu_shader_2D_point_varying_size_varying_color_vert_glsl[];
-extern char 
datatoc_gpu_shader_2D_point_uniform_size_uniform_color_smooth_vert_glsl[];
-extern char 
datatoc_gpu_shader_2D_point_uniform_size_uniform_color_outline_smooth_vert_glsl[];
+extern char datatoc_gpu_shader_2D_point_uniform_size_smooth_vert_glsl[];
+extern char 
datatoc_gpu_shader_2D_point_uniform_size_outline_smooth_vert_glsl[];
+extern char 
datatoc_gpu_shader_2D_point_uniform_size_varying_color_outline_smooth_vert_glsl[];
 
 extern char datatoc_gpu_shader_text_vert_glsl[];
 extern char datatoc_gpu_shader_text_frag_glsl[];
@@ -119,6 +121,7 @@ static struct GPUShadersGlobal {
                GPUShader *point_varying_size_varying_color_2D;
                GPUShader *point_uniform_size_uniform_color_smooth_2D;
                GPUShader *point_uniform_size_uniform_color_outline_smooth_2D;
+               GPUShader *point_uniform_size_varying_color_outline_smooth_2D;
                GPUShader *point_fixed_size_uniform_color_3D;
                GPUShader *point_fixed_size_varying_color_3D;
                GPUShader *point_varying_size_uniform_color_3D;
@@ -676,7 +679,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader 
shader)
                case GPU_SHADER_2D_UNIFORM_COLOR:
                        if (!GG.shaders.uniform_color_2D)
                                GG.shaders.uniform_color_2D = GPU_shader_create(
-                                       
datatoc_gpu_shader_2D_no_color_vert_glsl,
+                                       datatoc_gpu_shader_2D_vert_glsl,
                                        
datatoc_gpu_shader_uniform_color_frag_glsl,
                                        NULL, NULL, NULL, 0, 0, 0);
                        retval = GG.shaders.uniform_color_2D;
@@ -700,7 +703,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader 
shader)
                case GPU_SHADER_3D_UNIFORM_COLOR:
                        if (!GG.shaders.uniform_color_3D)
                                GG.shaders.uniform_color_3D = GPU_shader_create(
-                                       
datatoc_gpu_shader_3D_no_color_vert_glsl,
+                                       datatoc_gpu_shader_3D_vert_glsl,
                                        
datatoc_gpu_shader_uniform_color_frag_glsl,
                                        NULL, NULL, NULL, 0, 0, 0);
                        retval = GG.shaders.uniform_color_3D;
@@ -724,7 +727,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader 
shader)
                case GPU_SHADER_3D_DEPTH_ONLY:
                        if (!GG.shaders.depth_only_3D)
                                GG.shaders.depth_only_3D = GPU_shader_create(
-                                       
datatoc_gpu_shader_3D_no_color_vert_glsl,
+                                       datatoc_gpu_shader_3D_vert_glsl,
                                        datatoc_gpu_shader_depth_only_frag_glsl,
                                        NULL, NULL, NULL, 0, 0, 0);
                        retval = GG.shaders.depth_only_3D;
@@ -732,7 +735,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader 
shader)
                case GPU_SHADER_2D_POINT_FIXED_SIZE_UNIFORM_COLOR:
                        if (!GG.shaders.point_fixed_size_uniform_color_2D)
                                GG.shaders.point_fixed_size_uniform_color_2D = 
GPU_shader_create(
-                                       
datatoc_gpu_shader_2D_no_color_vert_glsl,
+                                       datatoc_gpu_shader_2D_vert_glsl,
                                        
datatoc_gpu_shader_point_uniform_color_frag_glsl,
                                        NULL, NULL, NULL, 0, 0, 0);
                        retval = GG.shaders.point_fixed_size_uniform_color_2D;
@@ -748,7 +751,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader 
shader)
                case GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_SMOOTH:
                        if 
(!GG.shaders.point_uniform_size_uniform_color_smooth_2D)
                                
GG.shaders.point_uniform_size_uniform_color_smooth_2D = GPU_shader_create(
-                                       
datatoc_gpu_shader_2D_point_uniform_size_uniform_color_smooth_vert_glsl,
+                                       
datatoc_gpu_shader_2D_point_uniform_size_smooth_vert_glsl,
                                        
datatoc_gpu_shader_point_uniform_color_smooth_frag_glsl,
                                        NULL, NULL, NULL, 0, 0, 0);
                        retval = 
GG.shaders.point_uniform_size_uniform_color_smooth_2D;
@@ -756,15 +759,23 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader 
shader)
                case 
GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_SMOOTH:
                        if 
(!GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D)
                                
GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D = 
GPU_shader_create(
-                                       
datatoc_gpu_shader_2D_point_uniform_size_uniform_color_outline_smooth_vert_glsl,
+                                       
datatoc_gpu_shader_2D_point_uniform_size_outline_smooth_vert_glsl,
                                        
datatoc_gpu_shader_point_uniform_color_outline_smooth_frag_glsl,
                                        NULL, NULL, NULL, 0, 0, 0);
                        retval = 
GG.shaders.point_uniform_size_uniform_color_outline_smooth_2D;
                        break;
+               case 
GPU_SHADER_2D_POINT_UNIFORM_SIZE_VARYING_COLOR_OUTLINE_SMOOTH:
+                       if 
(!GG.shaders.point_uniform_size_varying_color_outline_smooth_2D)
+                               
GG.shaders.point_uniform_size_varying_color_outline_smooth_2D = 
GPU_shader_create(
+                                       
datatoc_gpu_shader_2D_point_uniform_size_varying_color_outline_smooth_vert_glsl,
+                                       
datatoc_gpu_shader_point_varying_color_outline_smooth_frag_glsl,
+                                       NULL, NULL, NULL, 0, 0, 0);
+                       retval = 
GG.shaders.point_uniform_size_varying_color_outline_smooth_2D;
+                       break;
                case GPU_SHADER_3D_POINT_FIXED_SIZE_UNIFORM_COLOR:
                        if (!GG.shaders.point_fixed_size_uniform_color_3D)
                                GG.shaders.point_fixed_size_uniform_color_3D = 
GPU_shader_cr

@@ Diff output truncated at 10240 characters. @@

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

Reply via email to