Cleanup: DRW: Remove uneeded DRWState values
authorClément Foucault <foucault.clem@gmail.com>
Fri, 17 May 2019 12:04:30 +0000 (14:04 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 17 May 2019 16:17:23 +0000 (18:17 +0200)
This removes:
- DRW_STATE_TRANS_FEEDBACK
- DRW_STATE_WIRE
- DRW_STATE_POINT

18 files changed:
source/blender/draw/engines/basic/basic_engine.c
source/blender/draw/engines/eevee/eevee_materials.c
source/blender/draw/engines/eevee/eevee_subsurface.c
source/blender/draw/intern/DRW_render.h
source/blender/draw/intern/draw_anim_viz.c
source/blender/draw/intern/draw_common.c
source/blender/draw/intern/draw_hair.c
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_manager_exec.c
source/blender/draw/modes/edit_armature_mode.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/edit_text_mode.c
source/blender/draw/modes/object_mode.c
source/blender/draw/modes/particle_mode.c
source/blender/draw/modes/pose_mode.c

index 360d1d3..aad92c9 100644 (file)
@@ -106,8 +106,8 @@ static void basic_cache_init(void *vedata)
   }
 
   {
-    psl->depth_pass = DRW_pass_create(
-        "Depth Pass", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE);
+    psl->depth_pass = DRW_pass_create("Depth Pass",
+                                      DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL);
     stl->g_data->depth_shgrp = DRW_shgroup_create(sh_data->depth, psl->depth_pass);
     if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
       DRW_shgroup_world_clip_planes_from_rv3d(stl->g_data->depth_shgrp, rv3d);
index 7989d4d..5a54d7a 100644 (file)
@@ -923,8 +923,7 @@ static struct DRWShadingGroup *EEVEE_default_shading_group_get(EEVEE_ViewLayerDa
   }
 
   if (vedata->psl->default_pass[options] == NULL) {
-    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES |
-                     DRW_STATE_WIRE;
+    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES;
     vedata->psl->default_pass[options] = DRW_pass_create("Default Lit Pass", state);
 
     /* XXX / WATCH: This creates non persistent binds for the ubos and textures.
@@ -1017,7 +1016,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
   }
 
   {
-    DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE;
+    DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
     psl->depth_pass = DRW_pass_create("Depth Pass", state);
     stl->g_data->depth_shgrp = DRW_shgroup_create(e_data.default_prepass_sh, psl->depth_pass);
 
@@ -1026,8 +1025,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
     stl->g_data->depth_shgrp_cull = DRW_shgroup_create(e_data.default_prepass_sh,
                                                        psl->depth_pass_cull);
 
-    state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES |
-            DRW_STATE_WIRE;
+    state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES;
     psl->depth_pass_clip = DRW_pass_create("Depth Pass Clip", state);
     stl->g_data->depth_shgrp_clip = DRW_shgroup_create(e_data.default_prepass_clip_sh,
                                                        psl->depth_pass_clip);
@@ -1042,14 +1040,13 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
   }
 
   {
-    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES |
-                     DRW_STATE_WIRE;
+    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES;
     psl->material_pass = DRW_pass_create("Material Pass", state);
     psl->material_pass_cull = DRW_pass_create("Material Pass Cull", state | DRW_STATE_CULL_BACK);
   }
 
   {
-    DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE;
+    DRWState state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
     psl->refract_depth_pass = DRW_pass_create("Refract Depth Pass", state);
     stl->g_data->refract_depth_shgrp = DRW_shgroup_create(e_data.default_prepass_sh,
                                                           psl->refract_depth_pass);
@@ -1059,8 +1056,7 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
     stl->g_data->refract_depth_shgrp_cull = DRW_shgroup_create(e_data.default_prepass_sh,
                                                                psl->refract_depth_pass_cull);
 
-    state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES |
-            DRW_STATE_WIRE;
+    state = DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES;
     psl->refract_depth_pass_clip = DRW_pass_create("Refract Depth Pass Clip", state);
     stl->g_data->refract_depth_shgrp_clip = DRW_shgroup_create(e_data.default_prepass_clip_sh,
                                                                psl->refract_depth_pass_clip);
@@ -1077,22 +1073,20 @@ void EEVEE_materials_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
   }
 
   {
-    DRWState state = (DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES |
-                      DRW_STATE_WIRE);
+    DRWState state = (DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES);
     psl->refract_pass = DRW_pass_create("Opaque Refraction Pass", state);
   }
 
   {
     DRWState state = (DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES |
-                      DRW_STATE_WIRE | DRW_STATE_WRITE_STENCIL);
+                      DRW_STATE_WRITE_STENCIL);
     psl->sss_pass = DRW_pass_create("Subsurface Pass", state);
     psl->sss_pass_cull = DRW_pass_create("Subsurface Pass Cull", state | DRW_STATE_CULL_BACK);
     e_data.sss_count = 0;
   }
 
   {
-    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES |
-                     DRW_STATE_WIRE;
+    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CLIP_PLANES;
     psl->transparent_pass = DRW_pass_create("Material Transparent Pass", state);
   }
 
index c73ee07..2323fdf 100644 (file)
@@ -174,7 +174,7 @@ void EEVEE_subsurface_output_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Dat
 
     /* Make the opaque refraction pass mask the sss. */
     DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | DRW_STATE_CLIP_PLANES |
-                     DRW_STATE_WIRE | DRW_STATE_WRITE_STENCIL;
+                     DRW_STATE_WRITE_STENCIL;
     DRW_pass_state_set(vedata->psl->refract_pass, state);
     DRW_pass_foreach_shgroup(vedata->psl->refract_pass, &set_shgrp_stencil, NULL);
   }
index cf7e952..6d290f9 100644 (file)
@@ -313,43 +313,47 @@ void DRW_shader_free(struct GPUShader *shader);
 /* Batches */
 
 typedef enum {
+  /** Wrtie mask */
   DRW_STATE_WRITE_DEPTH = (1 << 0),
   DRW_STATE_WRITE_COLOR = (1 << 1),
-  DRW_STATE_DEPTH_ALWAYS = (1 << 2),
-  DRW_STATE_DEPTH_LESS = (1 << 3),
-  DRW_STATE_DEPTH_LESS_EQUAL = (1 << 4),
-  DRW_STATE_DEPTH_EQUAL = (1 << 5),
-  DRW_STATE_DEPTH_GREATER = (1 << 6),
-  DRW_STATE_DEPTH_GREATER_EQUAL = (1 << 7),
-  DRW_STATE_CULL_BACK = (1 << 8),
-  DRW_STATE_CULL_FRONT = (1 << 9),
-  DRW_STATE_WIRE = (1 << 10),  /* TODO remove */
-  DRW_STATE_POINT = (1 << 11), /* TODO remove */
+  DRW_STATE_WRITE_STENCIL = (1 << 2),
+  DRW_STATE_WRITE_STENCIL_SHADOW_PASS = (1 << 3),
+  DRW_STATE_WRITE_STENCIL_SHADOW_FAIL = (1 << 4),
+
+  /** Depth test */
+  DRW_STATE_DEPTH_ALWAYS = (1 << 5),
+  DRW_STATE_DEPTH_LESS = (1 << 6),
+  DRW_STATE_DEPTH_LESS_EQUAL = (1 << 7),
+  DRW_STATE_DEPTH_EQUAL = (1 << 8),
+  DRW_STATE_DEPTH_GREATER = (1 << 9),
+  DRW_STATE_DEPTH_GREATER_EQUAL = (1 << 10),
+  /** Culling test */
+  DRW_STATE_CULL_BACK = (1 << 11),
+  DRW_STATE_CULL_FRONT = (1 << 12),
+  /** Stencil test */
+  DRW_STATE_STENCIL_EQUAL = (1 << 13),
+  DRW_STATE_STENCIL_NEQUAL = (1 << 14),
+
+  /** Blend state */
+  DRW_STATE_ADDITIVE = (1 << 15),
+  /** Same as additive but let alpha accumulate without premult. */
+  DRW_STATE_ADDITIVE_FULL = (1 << 16),
+  DRW_STATE_BLEND = (1 << 17),
+  /** Use that if color is already premult by alpha. */
+  DRW_STATE_BLEND_PREMUL = (1 << 18),
+  DRW_STATE_BLEND_PREMUL_UNDER = (1 << 19),
+  DRW_STATE_BLEND_OIT = (1 << 20),
+  DRW_STATE_MULTIPLY = (1 << 21),
+
+  DRW_STATE_CLIP_PLANES = (1 << 22),
+  DRW_STATE_WIRE_SMOOTH = (1 << 23),
+  DRW_STATE_FIRST_VERTEX_CONVENTION = (1 << 24),
   /** Polygon offset. Does not work with lines and points. */
-  DRW_STATE_OFFSET_POSITIVE = (1 << 12),
+  DRW_STATE_OFFSET_POSITIVE = (1 << 25),
   /** Polygon offset. Does not work with lines and points. */
-  DRW_STATE_OFFSET_NEGATIVE = (1 << 13),
-  DRW_STATE_WIRE_WIDE = (1 << 14),
-  DRW_STATE_BLEND = (1 << 15),
-  DRW_STATE_ADDITIVE = (1 << 16),
-  DRW_STATE_MULTIPLY = (1 << 17),
-  DRW_STATE_BLEND_PREMUL_UNDER = (1 << 18),
-  DRW_STATE_CLIP_PLANES = (1 << 19),
-  /** Same as DRW_STATE_ADDITIVE but let alpha accumulate without premult. */
-  DRW_STATE_ADDITIVE_FULL = (1 << 20),
-  /** Use that if color is already premult by alpha. */
-  DRW_STATE_BLEND_PREMUL = (1 << 21),
-  DRW_STATE_WIRE_SMOOTH = (1 << 22),
-  DRW_STATE_TRANS_FEEDBACK = (1 << 23),
-  DRW_STATE_BLEND_OIT = (1 << 24),
-  DRW_STATE_FIRST_VERTEX_CONVENTION = (1 << 25),
-
-  DRW_STATE_WRITE_STENCIL = (1 << 27),
-  DRW_STATE_WRITE_STENCIL_SHADOW_PASS = (1 << 28),
-  DRW_STATE_WRITE_STENCIL_SHADOW_FAIL = (1 << 29),
-  DRW_STATE_STENCIL_EQUAL = (1 << 30),
-  DRW_STATE_STENCIL_NEQUAL = (1 << 31),
+  DRW_STATE_OFFSET_NEGATIVE = (1 << 26),
 } DRWState;
+
 #define DRW_STATE_DEFAULT \
   (DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL)
 #define DRW_STATE_RASTERIZER_ENABLED \
index 31d7a45..7245930 100644 (file)
@@ -139,7 +139,7 @@ static void MPATH_cache_init(void *vedata)
   }
 
   {
-    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_POINT;
+    DRWState state = DRW_STATE_WRITE_COLOR;
     psl->points = DRW_pass_create("Motionpath Point Pass", state);
   }
 }
index 51f097e..e1c8679 100644 (file)
@@ -385,7 +385,6 @@ struct DRWCallBuffer *buffer_groundpoints_uniform_color(DRWPass *pass,
 
   DRWShadingGroup *grp = DRW_shgroup_create(sh, pass);
   DRW_shgroup_uniform_vec4(grp, "color", color, 1);
-  DRW_shgroup_state_enable(grp, DRW_STATE_POINT);
   if (sh_cfg == GPU_SHADER_CFG_CLIPPED) {
     DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d);
   }
index 6dee25f..50819f6 100644 (file)
@@ -98,9 +98,9 @@ static GPUShader *hair_refine_shader_get(ParticleRefineShader sh)
 void DRW_hair_init(void)
 {
 #ifdef USE_TRANSFORM_FEEDBACK
-  g_tf_pass = DRW_pass_create("Update Hair Pass", DRW_STATE_TRANS_FEEDBACK);
+  g_tf_pass = DRW_pass_create("Update Hair Pass", 0);
 #else
-  g_tf_pass = DRW_pass_create("Update Hair Pass", DRW_STATE_WRITE_COLOR | DRW_STATE_POINT);
+  g_tf_pass = DRW_pass_create("Update Hair Pass", DRW_STATE_WRITE_COLOR);
 #endif
 }
 
index e68f3e4..5c9f49e 100644 (file)
@@ -1729,16 +1729,15 @@ void DRW_draw_render_loop_ex(struct Depsgraph *depsgraph,
   }
 
   DRW_draw_callbacks_post_scene();
+  DRW_state_reset();
+
   if (DST.draw_ctx.evil_C) {
-    DRW_state_reset();
     ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.ar, REGION_DRAW_POST_VIEW);
     /* Callback can be nasty and do whatever they want with the state.
      * Don't trust them! */
     DRW_state_reset();
   }
 
-  DRW_state_reset();
-
   drw_debug_draw();
 
   GPU_depth_test(false);
index bb4e807..2c29ce3 100644 (file)
@@ -168,18 +168,11 @@ void drw_state_set(DRWState state)
   /* Wire Width */
   {
     int test;
-    if (CHANGED_ANY_STORE_VAR(DRW_STATE_WIRE | DRW_STATE_WIRE_WIDE | DRW_STATE_WIRE_SMOOTH,
-                              test)) {
-      if (test & DRW_STATE_WIRE_WIDE) {
-        GPU_line_width(3.0f);
-      }
-      else if (test & DRW_STATE_WIRE_SMOOTH) {
+    if ((test = CHANGED_TO(DRW_STATE_WIRE_SMOOTH))) {
+      if (test == 1) {
         GPU_line_width(2.0f);
         GPU_line_smooth(true);
       }
-      else if (test & DRW_STATE_WIRE) {
-        GPU_line_width(1.0f);
-      }
       else {
         GPU_line_width(1.0f);
         GPU_line_smooth(false);
@@ -187,20 +180,6 @@ void drw_state_set(DRWState state)
     }
   }
 
-  /* Points Size */
-  {
-    int test;
-    if ((test = CHANGED_TO(DRW_STATE_POINT))) {
-      if (test == 1) {
-        GPU_enable_program_point_size();
-        glPointSize(5.0f);
-      }
-      else {
-        GPU_disable_program_point_size();
-      }
-    }
-  }
-
   /* Blending (all buffer) */
   {
     int test;
@@ -401,6 +380,9 @@ void DRW_state_reset(void)
 {
   DRW_state_reset_ex(DRW_STATE_DEFAULT);
 
+  GPU_point_size(5);
+  GPU_enable_program_point_size();
+
   /* Reset blending function */
   glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 }
@@ -689,8 +671,8 @@ bool DRW_culling_sphere_test(BoundSphere *bsphere)
   /* TODO we could test against the inscribed sphere of the frustum to early out positively. */
 
   /* Test against the 6 frustum planes. */
-  /* TODO order planes with sides first then far then near clip. Should be better culling heuristic
-   * when sculpting. */
+  /* TODO order planes with sides first then far then near clip. Should be better culling
+   * heuristic when sculpting. */
   for (int p = 0; p < 6; p++) {
     float dist = plane_point_side_v3(DST.clipping.frustum_planes[p], bsphere->center);
     if (dist < -bsphere->radius) {
@@ -1101,7 +1083,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
     DST.shader = shgroup->shader;
   }
 
-  if ((pass_state & DRW_STATE_TRANS_FEEDBACK) != 0 && (shgroup->tfeedback_target != NULL)) {
+  if (shgroup->tfeedback_target != NULL) {
     use_tfeedback = GPU_shader_transform_feedback_enable(shgroup->shader,
                                                          shgroup->tfeedback_target->vbo_id);
   }
index d1ef0d0..9a10323 100644 (file)
@@ -95,7 +95,7 @@ static void EDIT_ARMATURE_cache_init(void *vedata)
     psl->bone_envelope[i] = DRW_pass_create("Bone Envelope Outline Pass", state);
 
     state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
-            DRW_STATE_BLEND | DRW_STATE_WIRE;
+            DRW_STATE_BLEND;
     psl->relationship[i] = DRW_pass_create("Bone Relationship Pass", state);
   }
 
index 5177a8f..98b35cc 100644 (file)
@@ -207,9 +207,8 @@ static void EDIT_CURVE_cache_init(void *vedata)
     DRWShadingGroup *grp;
 
     /* Center-Line (wire) */
-    psl->wire_pass = DRW_pass_create("Curve Wire",
-                                     DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH |
-                                         DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE);
+    psl->wire_pass = DRW_pass_create(
+        "Curve Wire", DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL);
     EDIT_CURVE_wire_shgrp_create(sh_data,
                                  v3d,
                                  rv3d,
@@ -217,9 +216,8 @@ static void EDIT_CURVE_cache_init(void *vedata)
                                  &stl->g_data->wire_shgrp,
                                  &stl->g_data->wire_normals_shgrp);
 
-    psl->wire_pass_xray = DRW_pass_create("Curve Wire Xray",
-                                          DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH |
-                                              DRW_STATE_DEPTH_ALWAYS | DRW_STATE_WIRE);
+    psl->wire_pass_xray = DRW_pass_create(
+        "Curve Wire Xray", DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_ALWAYS);
     EDIT_CURVE_wire_shgrp_create(sh_data,
                                  v3d,
                                  rv3d,
@@ -239,8 +237,7 @@ static void EDIT_CURVE_cache_init(void *vedata)
     }
     stl->g_data->overlay_edge_shgrp = grp;
 
-    psl->overlay_vert_pass = DRW_pass_create("Curve Vert Overlay",
-                                             DRW_STATE_WRITE_COLOR | DRW_STATE_POINT);
+    psl->overlay_vert_pass = DRW_pass_create("Curve Vert Overlay", DRW_STATE_WRITE_COLOR);
 
     grp = DRW_shgroup_create(sh_data->overlay_vert_sh, psl->overlay_vert_pass);
     DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
index cede3ed..5604f7f 100644 (file)
@@ -183,14 +183,14 @@ static void EDIT_LATTICE_cache_init(void *vedata)
   {
     psl->wire_pass = DRW_pass_create("Lattice Wire",
                                      DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH |
-                                         DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE);
+                                         DRW_STATE_DEPTH_LESS_EQUAL);
     stl->g_data->wire_shgrp = DRW_shgroup_create(sh_data->wire, psl->wire_pass);
     if (rv3d->rflag & RV3D_CLIPPING) {
       DRW_shgroup_world_clip_planes_from_rv3d(stl->g_data->wire_shgrp, rv3d);
     }
 
-    psl->vert_pass = DRW_pass_create(
-        "Lattice Verts", DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_POINT);
+    psl->vert_pass = DRW_pass_create("Lattice Verts",
+                                     DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH);
     stl->g_data->vert_shgrp = DRW_shgroup_create(sh_data->overlay_vert, psl->vert_pass);
     DRW_shgroup_uniform_block(stl->g_data->vert_shgrp, "globalsBlock", G_draw.block_ubo);
     if (rv3d->rflag & RV3D_CLIPPING) {
index ee2d623..1bd94cb 100644 (file)
@@ -337,8 +337,7 @@ static DRWPass *edit_mesh_create_overlay_pass(float *face_alpha,
   }
   const float depth_ofs = bglPolygonOffsetCalc((float *)winmat, viewdist, 1.0f);
 
-  DRWPass *pass = DRW_pass_create("Edit Mesh Face Overlay Pass",
-                                  DRW_STATE_WRITE_COLOR | DRW_STATE_POINT | statemod);
+  DRWPass *pass = DRW_pass_create("Edit Mesh Face Overlay Pass", DRW_STATE_WRITE_COLOR | statemod);
 
   DRWShadingGroup *grp;
 
index 11ff95a..1dc6bd8 100644 (file)
@@ -117,7 +117,7 @@ static void EDIT_METABALL_cache_init(void *vedata)
   {
     /* Create a pass */
     DRWState state = (DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
-                      DRW_STATE_BLEND | DRW_STATE_WIRE);
+                      DRW_STATE_BLEND);
     psl->pass = DRW_pass_create("My Pass", state);
 
     /* Create a shadingGroup using a function in draw_common.c or custom one */
index fa2248e..b7215d5 100644 (file)
@@ -162,9 +162,8 @@ static void EDIT_TEXT_cache_init(void *vedata)
 
   {
     /* Text outline (fast drawing!) */
-    psl->wire_pass = DRW_pass_create("Font Wire",
-                                     DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH |
-                                         DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE);
+    psl->wire_pass = DRW_pass_create(
+        "Font Wire", DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL);
     stl->g_data->wire_shgrp = DRW_shgroup_create(e_data.wire_sh, psl->wire_pass);
 
     psl->overlay_select_pass = DRW_pass_create("Font Select",
index 9702f99..d56cf34 100644 (file)
@@ -1070,8 +1070,7 @@ static void OBJECT_cache_init(void *vedata)
   g_data->custom_shapes = BLI_ghash_ptr_new(__func__);
 
   {
-    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
-                     DRW_STATE_WIRE;
+    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
     psl->outlines = DRW_pass_create("Outlines Depth Pass", state);
 
     GPUShader *sh = sh_data->outline_prepass;
@@ -1096,8 +1095,7 @@ static void OBJECT_cache_init(void *vedata)
   }
 
   {
-    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
-                     DRW_STATE_POINT;
+    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
     DRWPass *pass = psl->lightprobes = DRW_pass_create("Object Probe Pass", state);
     struct GPUBatch *sphere = DRW_cache_sphere_get();
     struct GPUBatch *quad = DRW_cache_quad_get();
@@ -1236,8 +1234,7 @@ static void OBJECT_cache_init(void *vedata)
     sgl->bone_envelope = psl->bone_envelope[i] = DRW_pass_create("Bone Envelope Outline Pass",
                                                                  state);
 
-    state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
-            DRW_STATE_WIRE;
+    state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
     sgl->bone_axes = psl->bone_axes[i] = DRW_pass_create("Bone Axes Pass", state);
   }
 
@@ -1249,10 +1246,10 @@ static void OBJECT_cache_init(void *vedata)
     struct GPUShader *sh;
 
     DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
-                     DRW_STATE_BLEND | DRW_STATE_POINT | DRW_STATE_WIRE;
+                     DRW_STATE_BLEND;
     sgl->non_meshes = psl->non_meshes[i] = DRW_pass_create("Non Meshes Pass", state);
 
-    state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND | DRW_STATE_WIRE;
+    state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND;
     sgl->image_empties = psl->image_empties[i] = DRW_pass_create("Image Empties", state);
 
     /* Empties */
@@ -1406,7 +1403,6 @@ static void OBJECT_cache_init(void *vedata)
     DRWShadingGroup *grp = DRW_shgroup_create(sh, sgl->non_meshes);
     DRW_shgroup_uniform_vec4(grp, "color", gb->colorLightNoAlpha, 1);
     DRW_shgroup_uniform_float(grp, "size", &gb->sizeLightCenter, 1);
-    DRW_shgroup_state_enable(grp, DRW_STATE_POINT);
     if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
       DRW_shgroup_world_clip_planes_from_rv3d(grp, DRW_context_state_get()->rv3d);
     }
@@ -1532,7 +1528,7 @@ static void OBJECT_cache_init(void *vedata)
     DRWShadingGroup *grp;
     static float outlineWidth, size;
 
-    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND | DRW_STATE_POINT;
+    DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND;
     psl->ob_center = DRW_pass_create("Obj Center Pass", state);
 
     outlineWidth = 1.0f * U.pixelsize;
@@ -1578,8 +1574,7 @@ static void OBJECT_cache_init(void *vedata)
     /* Particle Pass */
     psl->particle = DRW_pass_create("Particle Pass",
                                     DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH |
-                                        DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_POINT |
-                                        DRW_STATE_BLEND);
+                                        DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND);
   }
 }
 
index c4a0a76..ee35fa6 100644 (file)
@@ -123,10 +123,9 @@ static void particle_cache_init(void *vedata)
   }
 
   /* Create a pass */
-  psl->psys_edit_pass = DRW_pass_create("PSys Edit Pass",
-                                        (DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH |
-                                         DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE |
-                                         DRW_STATE_POINT));
+  psl->psys_edit_pass = DRW_pass_create(
+      "PSys Edit Pass",
+      (DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL));
 
   GPUShader *strand_shader = (use_weight) ? e_data.strands_weight_shader : e_data.strands_shader;
   stl->g_data->strands_group = DRW_shgroup_create(strand_shader, psl->psys_edit_pass);
index cde0d39..08b6a99 100644 (file)
@@ -138,7 +138,7 @@ static void POSE_cache_init(void *vedata)
     psl->bone_envelope[i] = DRW_pass_create("Bone Envelope Outline Pass", state);
 
     state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL |
-            DRW_STATE_BLEND | DRW_STATE_WIRE;
+            DRW_STATE_BLEND;
     psl->relationship[i] = DRW_pass_create("Bone Relationship Pass", state);
 
     ppd->custom_shapes[i] = BLI_ghash_ptr_new(__func__);