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>2019-05-04 02:41:39 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-04 15:11:04 +0300
commitfb3b2ab709bfd3aa1e9a1c9db9d3ce05ed4e6c13 (patch)
tree5d10c62ae50b03b38fb76e592122d754f766e631 /source/blender/draw/intern
parentb2f1a6587410d00ad3bbd22e045979f80048afe2 (diff)
Cleanup: Remove unused code in sculpt_mode, workbench and draw manager
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/DRW_render.h7
-rw-r--r--source/blender/draw/intern/draw_cache.c8
-rw-r--r--source/blender/draw/intern/draw_cache_impl.h2
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c19
-rw-r--r--source/blender/draw/intern/draw_manager.h6
-rw-r--r--source/blender/draw/intern/draw_manager_data.c9
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c11
7 files changed, 6 insertions, 56 deletions
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h
index 363cf67623a..82584ebbb8d 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -401,10 +401,6 @@ DRWShadingGroup *DRW_shgroup_transform_feedback_create(struct GPUShader *shader,
DRWPass *pass,
struct GPUVertBuf *tf_target);
-typedef void(DRWCallGenerateFn)(DRWShadingGroup *shgroup,
- void (*draw_fn)(DRWShadingGroup *shgroup, struct GPUBatch *geom),
- void *user_data);
-
/* return final visibility */
typedef bool(DRWCallVisibilityFn)(bool vis_in, void *user_data);
@@ -422,9 +418,6 @@ void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup,
void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup,
uint tria_count,
float (*obmat)[4]);
-void DRW_shgroup_call_object_procedural_triangles_culled_add(DRWShadingGroup *shgroup,
- uint tria_count,
- struct Object *ob);
void DRW_shgroup_call_object_add_ex(DRWShadingGroup *shgroup,
struct GPUBatch *geom,
struct Object *ob,
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index 6b4c4cef9c8..08cf56982ea 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -3290,14 +3290,6 @@ GPUBatch *DRW_cache_mesh_surface_mesh_analysis_get(Object *ob)
return DRW_mesh_batch_cache_get_edit_mesh_analysis(ob->data);
}
-void DRW_cache_mesh_sculpt_coords_ensure(Object *ob)
-{
- BLI_assert(ob->type == OB_MESH);
-
- Mesh *me = ob->data;
- DRW_mesh_cache_sculpt_coords_ensure(me);
-}
-
/** \} */
/* -------------------------------------------------------------------- */
diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h
index 4ef8f5a9326..508ae678778 100644
--- a/source/blender/draw/intern/draw_cache_impl.h
+++ b/source/blender/draw/intern/draw_cache_impl.h
@@ -159,8 +159,6 @@ struct GPUBatch *DRW_mesh_batch_cache_get_edituv_facedots(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_uv_edges(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edit_mesh_analysis(struct Mesh *me);
-void DRW_mesh_cache_sculpt_coords_ensure(struct Mesh *me);
-
/* Edit mesh bitflags (is this the right place?) */
enum {
VFLAG_VERT_ACTIVE = 1 << 0,
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 1d8c7f0e5a7..f3b7e7adff0 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -4455,25 +4455,6 @@ GPUBatch *DRW_mesh_batch_cache_get_surface_edges(Mesh *me)
return DRW_batch_request(&cache->batch.wire_loops);
}
-/**
- * Needed for when we draw with shaded data.
- */
-void DRW_mesh_cache_sculpt_coords_ensure(Mesh *UNUSED(me))
-{
-#if 0 /* Unused for now */
- if (me->runtime.batch_cache) {
- MeshBatchCache *cache = mesh_batch_cache_get(me);
- if (cache && cache->pos_with_normals && cache->is_sculpt_points_tag) {
- /* XXX Force update of all the batches that contains the pos_with_normals buffer.
- * TODO(fclem): Ideally, Gawain should provide a way to update a buffer without destroying it. */
- mesh_batch_cache_clear_selective(me, cache->pos_with_normals);
- GPU_VERTBUF_DISCARD_SAFE(cache->pos_with_normals);
- }
- cache->is_sculpt_points_tag = false;
- }
-#endif
-}
-
/* Compute 3D & 2D areas and their sum. */
BLI_INLINE void edit_uv_preprocess_stretch_area(BMFace *efa,
const int cd_loop_uv_offset,
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h
index a70438a2d37..77cf6d20117 100644
--- a/source/blender/draw/intern/draw_manager.h
+++ b/source/blender/draw/intern/draw_manager.h
@@ -142,8 +142,6 @@ typedef enum {
DRW_CALL_RANGE,
/** Draw instances without any instancing attributes. */
DRW_CALL_INSTANCES,
- /** Uses a callback to draw with any number of batches. */
- DRW_CALL_GENERATE,
/** Generate a drawcall without any #GPUBatch. */
DRW_CALL_PROCEDURAL,
} DRWCallType;
@@ -166,10 +164,6 @@ typedef struct DRWCall {
/* Count can be adjusted between redraw. If needed, we can add fixed count. */
uint *count;
} instances;
- struct { /* type == DRW_CALL_GENERATE */
- DRWCallGenerateFn *geometry_fn;
- void *user_data;
- } generate;
struct { /* type == DRW_CALL_PROCEDURAL */
uint vert_count;
GPUPrimType prim_type;
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index c63e30e65d7..8f324cf08cb 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -522,15 +522,6 @@ void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup,
drw_shgroup_call_procedural_add_ex(shgroup, GPU_PRIM_TRIS, tria_count * 3, obmat, NULL);
}
-/* TODO (fclem): this is a sign that the api is starting to be limiting.
- * Maybe add special function that general purpose for special cases. */
-void DRW_shgroup_call_object_procedural_triangles_culled_add(DRWShadingGroup *shgroup,
- uint tria_count,
- Object *ob)
-{
- drw_shgroup_call_procedural_add_ex(shgroup, GPU_PRIM_TRIS, tria_count * 3, NULL, ob);
-}
-
/* These calls can be culled and are optimized for redraw */
void DRW_shgroup_call_object_add_ex(
DRWShadingGroup *shgroup, GPUBatch *geom, Object *ob, Material *ma, bool bypass_culling)
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index bfbb7af49dd..46f4d0620c8 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -680,12 +680,16 @@ bool DRW_culling_sphere_test(BoundSphere *bsphere)
/* Do a rough test first: Sphere VS Sphere intersect. */
BoundSphere *frustum_bsphere = &DST.clipping.frustum_bsphere;
- float center_dist = len_squared_v3v3(bsphere->center, frustum_bsphere->center);
- if (center_dist > SQUARE(bsphere->radius + frustum_bsphere->radius)) {
+ float center_dist_sq = len_squared_v3v3(bsphere->center, frustum_bsphere->center);
+ float radius_sum = bsphere->radius + frustum_bsphere->radius;
+ if (center_dist_sq > SQUARE(radius_sum)) {
return false;
}
+ /* 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. */
for (int p = 0; p < 6; p++) {
float dist = plane_point_side_v3(DST.clipping.frustum_planes[p], bsphere->center);
if (dist < -bsphere->radius) {
@@ -1319,9 +1323,6 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
draw_geometry_execute_ex(
shgroup, call->instances.geometry, 0, *call->instances.count, true);
break;
- case DRW_CALL_GENERATE:
- call->generate.geometry_fn(shgroup, draw_geometry_execute, call->generate.user_data);
- break;
case DRW_CALL_PROCEDURAL:
GPU_draw_primitive(call->procedural.prim_type, call->procedural.vert_count);
break;