[Bf-blender-cvs] [2100dba34bb] master: Cleanup: GPU: Move program point size to GPU_state

Clément Foucault noreply at git.blender.org
Tue May 28 17:19:45 CEST 2019


Commit: 2100dba34bbec7fffdff787c01d3270ab7d3dfbb
Author: Clément Foucault
Date:   Tue May 28 17:14:22 2019 +0200
Branches: master
https://developer.blender.org/rB2100dba34bbec7fffdff787c01d3270ab7d3dfbb

Cleanup: GPU: Move program point size to GPU_state

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

M	source/blender/draw/intern/draw_manager.c
M	source/blender/draw/intern/draw_manager_exec.c
M	source/blender/editors/animation/keyframes_draw.c
M	source/blender/editors/gpencil/annotate_draw.c
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/mask/mask_draw.c
M	source/blender/editors/space_clip/clip_dopesheet_draw.c
M	source/blender/editors/space_graph/graph_draw.c
M	source/blender/editors/space_nla/nla_draw.c
M	source/blender/editors/space_node/node_draw.c
M	source/blender/editors/uvedit/uvedit_draw.c
M	source/blender/gpu/GPU_draw.h
M	source/blender/gpu/GPU_shader.h
M	source/blender/gpu/GPU_state.h
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/gpu/intern/gpu_state.c

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

diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index b1f8e951b3e..7a95120b273 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2822,7 +2822,7 @@ void DRW_framebuffer_select_id_setup(ARegion *ar, const bool clear)
   glDisable(GL_DITHER);
 
   GPU_depth_test(true);
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
 
   if (clear) {
     GPU_framebuffer_clear_color_depth(
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index 11c19b292f0..ae0239a7e49 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -355,7 +355,7 @@ void DRW_state_reset(void)
   DRW_state_reset_ex(DRW_STATE_DEFAULT);
 
   GPU_point_size(5);
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
 
   /* Reset blending function */
   glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 678afef5773..889d27480df 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -815,7 +815,7 @@ static void draw_keylist(View2D *v2d,
           format, "outlineColor", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
       uint flags_id = GPU_vertformat_attr_add(format, "flags", GPU_COMP_U32, 1, GPU_FETCH_INT);
       immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
-      GPU_enable_program_point_size();
+      GPU_program_point_size(true);
       immUniform2f(
           "ViewportSize", BLI_rcti_size_x(&v2d->mask) + 1, BLI_rcti_size_y(&v2d->mask) + 1);
       immBegin(GPU_PRIM_POINTS, key_len);
@@ -849,7 +849,7 @@ static void draw_keylist(View2D *v2d,
       }
 
       immEnd();
-      GPU_disable_program_point_size();
+      GPU_program_point_size(false);
       immUnbindProgram();
     }
   }
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index f325422fec7..a853e2bcc9a 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -561,7 +561,7 @@ static void annotation_draw_strokes(bGPdata *UNUSED(gpd),
                                     short lthick,
                                     const float color[4])
 {
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
 
   for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
     /* check if stroke can be drawn */
@@ -622,7 +622,7 @@ static void annotation_draw_strokes(bGPdata *UNUSED(gpd),
     }
   }
 
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
 }
 
 /* Draw selected verts for strokes being edited */
@@ -658,7 +658,7 @@ static void annotation_draw_strokes_edit(bGPdata *gpd,
     }
   }
 
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
 
   /* draw stroke verts */
   for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
@@ -751,7 +751,7 @@ static void annotation_draw_strokes_edit(bGPdata *gpd,
     immUnbindProgram();
   }
 
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
 
   /* clear depth mask */
   if (dflag & GP_DRAWDATA_ONLY3D) {
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index ef74aa28b63..5f08035a56b 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -180,7 +180,7 @@ static void gp_draw_stroke_volumetric_2d(const bGPDspoint *points,
       format, "color", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
 
   immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR);
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
   immBegin(GPU_PRIM_POINTS, totpoints);
 
   const bGPDspoint *pt = points;
@@ -199,7 +199,7 @@ static void gp_draw_stroke_volumetric_2d(const bGPDspoint *points,
 
   immEnd();
   immUnbindProgram();
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
 }
 
 /* draw a 3D stroke in "volumetric" style */
@@ -215,7 +215,7 @@ static void gp_draw_stroke_volumetric_3d(const bGPDspoint *points,
       format, "color", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
 
   immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR);
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
   immBegin(GPU_PRIM_POINTS, totpoints);
 
   const bGPDspoint *pt = points;
@@ -229,7 +229,7 @@ static void gp_draw_stroke_volumetric_3d(const bGPDspoint *points,
 
   immEnd();
   immUnbindProgram();
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
 }
 
 /* --------------- Stroke Fills ----------------- */
@@ -867,7 +867,7 @@ static void gp_draw_strokes(tGPDdraw *tgpw)
   short sthickness;
   float ink[4];
 
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
 
   bGPDstroke *gps_init = (tgpw->gps) ? tgpw->gps : tgpw->t_gpf->strokes.first;
 
@@ -1104,7 +1104,7 @@ static void gp_draw_strokes(tGPDdraw *tgpw)
     }
   }
 
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
 }
 
 /* ----- General Drawing ------ */
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index fa3605269ff..6f1f4dde1ab 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -317,7 +317,7 @@ static void vicon_keytype_draw_wrapper(
   uint flags_id = GPU_vertformat_attr_add(format, "flags", GPU_COMP_U32, 1, GPU_FETCH_INT);
 
   immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
   immUniform2f("ViewportSize", -1.0f, -1.0f);
   immBegin(GPU_PRIM_POINTS, 1);
 
@@ -343,7 +343,7 @@ static void vicon_keytype_draw_wrapper(
                       KEYFRAME_EXTREME_NONE);
 
   immEnd();
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
   immUnbindProgram();
 
   UI_Theme_Restore(&theme_state);
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index 33e89b1a7c5..d9ca58fa88c 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -600,7 +600,7 @@ static void draw_masklays(const bContext *C,
   GPU_blend(true);
   GPU_blend_set_func_separate(
       GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
 
   MaskLayer *masklay;
   int i;
@@ -635,7 +635,7 @@ static void draw_masklays(const bContext *C,
     }
   }
 
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
   GPU_blend(false);
 }
 
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index 0f6e7947482..599a92ff77f 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -223,7 +223,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
       uint flags_id = GPU_vertformat_attr_add(format, "flags", GPU_COMP_U32, 1, GPU_FETCH_INT);
 
       immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
-      GPU_enable_program_point_size();
+      GPU_program_point_size(true);
       immUniform2f(
           "ViewportSize", BLI_rcti_size_x(&v2d->mask) + 1, BLI_rcti_size_y(&v2d->mask) + 1);
       immBegin(GPU_PRIM_POINTS, keyframe_len);
@@ -282,7 +282,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
       }
 
       immEnd();
-      GPU_disable_program_point_size();
+      GPU_program_point_size(false);
       immUnbindProgram();
     }
 
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 062c9f86fab..b16374e0d66 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -292,7 +292,7 @@ static void draw_fcurve_vertices(ARegion *ar, FCurve *fcu, bool do_handles, bool
   uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
 
   GPU_blend(true);
-  GPU_enable_program_point_size();
+  GPU_program_point_size(true);
 
   /* draw the two handles first (if they're shown, the curve doesn't
    * have just a single keyframe, and the curve is being edited) */
@@ -303,7 +303,7 @@ static void draw_fcurve_vertices(ARegion *ar, FCurve *fcu, bool do_handles, bool
   /* draw keyframes over the handles */
   draw_fcurve_keyframe_vertices(fcu, v2d, !(fcu->flag & FCURVE_PROTECTED), pos);
 
-  GPU_disable_program_point_size();
+  GPU_program_point_size(false);
   GPU_blend(false);
 }
 
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 68cbfd76331..5cf9646210e 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -142,7 +142,7 @@ static void nla_action_draw_keyframes(
         format, "outlineColor", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
     uint flags_id = GPU_vertformat_attr_add(format, "flags", GPU_COMP_U32, 1, GPU_FETCH_INT);
     immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
-    GPU_enable_program_point_size();
+    GPU_program_point_size(true);
     immUniform2f("ViewportSize", BLI_rcti_size_x(&v2d->mask) + 1, BLI_rcti_size_y(&v2d->mask) + 1);
     immBegin(GPU_PRIM_POINTS, key_len);
 
@@ -167,7 +167,7 @@ static void nla_action_draw_keyframes(
     }
 
     immEnd();
-    GPU_disable_program_point_size();
+    GPU_program_point_size(false);
     immUnbindProgram();
   }
 
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 020bdbf60a1..1c3544077c4 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -896,7 +896,7 @@ void node_draw_sockets(View2D *v2d,
   uint col = GPU_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list