DRW: Remove DRW_state_clip_planes_set_from_rv3d
authorClément Foucault <foucault.clem@gmail.com>
Mon, 20 May 2019 17:05:02 +0000 (19:05 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 22 May 2019 11:29:04 +0000 (13:29 +0200)
This should be handled by DST.view_default

source/blender/draw/engines/basic/basic_engine.c
source/blender/draw/engines/workbench/workbench_data.c
source/blender/draw/intern/DRW_render.h
source/blender/draw/intern/draw_manager_exec.c
source/blender/draw/modes/edit_curve_mode.c
source/blender/draw/modes/edit_lattice_mode.c
source/blender/draw/modes/edit_mesh_mode.c
source/blender/draw/modes/edit_metaball_mode.c
source/blender/draw/modes/overlay_mode.c
source/blender/draw/modes/paint_vertex_mode.c

index aad92c9..d6902dd 100644 (file)
@@ -96,10 +96,6 @@ static void basic_cache_init(void *vedata)
   BASIC_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
   const RegionView3D *rv3d = draw_ctx->rv3d;
 
-  if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
-    DRW_state_clip_planes_set_from_rv3d(draw_ctx->rv3d);
-  }
-
   if (!stl->g_data) {
     /* Alloc transient pointers */
     stl->g_data = MEM_mallocN(sizeof(*stl->g_data), __func__);
index 7728b3f..e4b2d09 100644 (file)
@@ -127,7 +127,6 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
     RegionView3D *rv3d = draw_ctx->rv3d;
     if (rv3d->rflag & RV3D_CLIPPING) {
       wpd->world_clip_planes = rv3d->clip;
-      DRW_state_clip_planes_set_from_rv3d(rv3d);
       UI_GetThemeColor4fv(TH_V3D_CLIPPING_BORDER, wpd->world_clip_planes_color);
       if (wpd->use_color_management) {
         srgb_to_linearrgb_v3_v3(wpd->world_clip_planes_color, wpd->world_clip_planes_color);
index 391d041..764c102 100644 (file)
@@ -688,7 +688,6 @@ void DRW_state_lock(DRWState state);
 
 void DRW_state_clip_planes_len_set(uint plane_len);
 void DRW_state_clip_planes_reset(void);
-void DRW_state_clip_planes_set_from_rv3d(struct RegionView3D *rv3d);
 
 /* Culling, return true if object is inside view frustum. */
 bool DRW_culling_sphere_test(const BoundSphere *bsphere);
index 986c8fe..b4428dd 100644 (file)
@@ -403,11 +403,6 @@ void DRW_state_clip_planes_reset(void)
   /* DUMMY TO REMOVE */
 }
 
-void DRW_state_clip_planes_set_from_rv3d(RegionView3D *rv3d)
-{
-  /* DUMMY TO REMOVE */
-}
-
 /** \} */
 
 /* -------------------------------------------------------------------- */
index 98b35cc..fe14ab2 100644 (file)
@@ -112,10 +112,6 @@ static void EDIT_CURVE_engine_init(void *UNUSED(vedata))
   const DRWContextState *draw_ctx = DRW_context_state_get();
   EDIT_CURVE_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
 
-  if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
-    DRW_state_clip_planes_set_from_rv3d(draw_ctx->rv3d);
-  }
-
   const GPUShaderConfigData *sh_cfg_data = &GPU_shader_cfg_data[draw_ctx->sh_cfg];
 
   if (!sh_data->wire_sh) {
index 5604f7f..42d377f 100644 (file)
@@ -139,9 +139,7 @@ static void EDIT_LATTICE_engine_init(void *vedata)
 
   const DRWContextState *draw_ctx = DRW_context_state_get();
   EDIT_LATTICE_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
-  if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
-    DRW_state_clip_planes_set_from_rv3d(draw_ctx->rv3d);
-  }
+
   const GPUShaderConfigData *sh_cfg_data = &GPU_shader_cfg_data[draw_ctx->sh_cfg];
 
   if (!sh_data->wire) {
index 2c22acd..6d89906 100644 (file)
@@ -188,10 +188,6 @@ static void EDIT_MESH_engine_init(void *vedata)
                                 {GPU_ATTACHMENT_TEXTURE(e_data.occlude_wire_depth_tx),
                                  GPU_ATTACHMENT_TEXTURE(e_data.occlude_wire_color_tx)});
 
-  if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
-    DRW_state_clip_planes_set_from_rv3d(draw_ctx->rv3d);
-  }
-
   const GPUShaderConfigData *sh_cfg_data = &GPU_shader_cfg_data[draw_ctx->sh_cfg];
 
   if (!sh_data->weight_face) {
index 1dc6bd8..4056032 100644 (file)
@@ -93,14 +93,6 @@ typedef struct EDIT_METABALL_PrivateData {
 
 /* *********** FUNCTIONS *********** */
 
-static void EDIT_METABALL_engine_init(void *UNUSED(vedata))
-{
-  const DRWContextState *draw_ctx = DRW_context_state_get();
-  if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
-    DRW_state_clip_planes_set_from_rv3d(draw_ctx->rv3d);
-  }
-}
-
 /* Here init all passes and shading groups
  * Assume that all Passes are NULL */
 static void EDIT_METABALL_cache_init(void *vedata)
@@ -232,7 +224,7 @@ DrawEngineType draw_engine_edit_metaball_type = {
     NULL,
     N_("EditMetaballMode"),
     &EDIT_METABALL_data_size,
-    &EDIT_METABALL_engine_init,
+    NULL,
     &EDIT_METABALL_engine_free,
     &EDIT_METABALL_cache_init,
     &EDIT_METABALL_cache_populate,
index 36493c5..378fdbf 100644 (file)
@@ -111,10 +111,6 @@ static void overlay_engine_init(void *vedata)
   const DRWContextState *draw_ctx = DRW_context_state_get();
   OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
 
-  if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
-    DRW_state_clip_planes_set_from_rv3d(draw_ctx->rv3d);
-  }
-
   if (!stl->g_data) {
     /* Alloc transient pointers */
     stl->g_data = MEM_callocN(sizeof(*stl->g_data), __func__);
index da76573..815cf09 100644 (file)
@@ -109,9 +109,6 @@ static void PAINT_VERTEX_engine_init(void *UNUSED(vedata))
   const DRWContextState *draw_ctx = DRW_context_state_get();
   PAINT_VERTEX_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg];
 
-  if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
-    DRW_state_clip_planes_set_from_rv3d(draw_ctx->rv3d);
-  }
   const GPUShaderConfigData *sh_cfg_data = &GPU_shader_cfg_data[draw_ctx->sh_cfg];
 
   if (!sh_data->face_select_overlay) {