diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-07 23:45:14 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-08 18:52:49 +0300 |
commit | 901026c49352742c046819aad42284413271e512 (patch) | |
tree | da1f09d646adf10d3ee73e312eb5712e98d2b873 | |
parent | 55173b1583a67308b053d57f960738b55fe81abb (diff) |
Cleanup: Remove BKE_MESH_BATCH_DIRTY_MAYBE_ALL
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 1 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 32 |
2 files changed, 9 insertions, 24 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 6866eb129fe..b094dc5f400 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -671,7 +671,6 @@ void BKE_mesh_eval_geometry(struct Depsgraph *depsgraph, struct Mesh *mesh); /* Draw Cache */ enum { BKE_MESH_BATCH_DIRTY_ALL = 0, - BKE_MESH_BATCH_DIRTY_MAYBE_ALL, BKE_MESH_BATCH_DIRTY_SELECT, BKE_MESH_BATCH_DIRTY_SELECT_PAINT, BKE_MESH_BATCH_DIRTY_SHADING, diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index b046396dc21..737bfd24439 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -2036,13 +2036,12 @@ typedef struct MeshBatchCache { DRWBatchFlag batch_ready; /* settings to determine if cache is invalid */ - bool is_maybe_dirty; - bool is_dirty; /* Instantly invalidates cache, skipping mesh check */ int edge_len; int tri_len; int poly_len; int vert_len; int mat_len; + bool is_dirty; /* Instantly invalidates cache, skipping mesh check */ bool is_editmode; bool is_uvsyncsel; @@ -2071,10 +2070,6 @@ static bool mesh_batch_cache_valid(Mesh *me) return false; } - if (cache->mat_len != mesh_render_mat_len_get(me)) { - return false; - } - if (cache->is_editmode != (me->edit_mesh != NULL)) { return false; } @@ -2083,20 +2078,15 @@ static bool mesh_batch_cache_valid(Mesh *me) return false; } - if (cache->is_maybe_dirty == false) { - return true; + if (cache->is_editmode) { + return false; } - else { - if (cache->is_editmode) { - return false; - } - else if ((cache->vert_len != mesh_render_verts_len_get(me)) || - (cache->edge_len != mesh_render_edges_len_get(me)) || - (cache->tri_len != mesh_render_looptri_len_get(me)) || - (cache->poly_len != mesh_render_polys_len_get(me)) || - (cache->mat_len != mesh_render_mat_len_get(me))) { - return false; - } + else if ((cache->vert_len != mesh_render_verts_len_get(me)) || + (cache->edge_len != mesh_render_edges_len_get(me)) || + (cache->tri_len != mesh_render_looptri_len_get(me)) || + (cache->poly_len != mesh_render_polys_len_get(me)) || + (cache->mat_len != mesh_render_mat_len_get(me))) { + return false; } return true; @@ -2127,7 +2117,6 @@ static void mesh_batch_cache_init(Mesh *me) __func__); cache->surf_per_mat = MEM_callocN(sizeof(*cache->surf_per_mat) * cache->mat_len, __func__); - cache->is_maybe_dirty = false; cache->is_dirty = false; drw_mesh_weight_state_clear(&cache->weight_state); @@ -2217,9 +2206,6 @@ void DRW_mesh_batch_cache_dirty_tag(Mesh *me, int mode) return; } switch (mode) { - case BKE_MESH_BATCH_DIRTY_MAYBE_ALL: - cache->is_maybe_dirty = true; - break; case BKE_MESH_BATCH_DIRTY_SELECT: GPU_VERTBUF_DISCARD_SAFE(cache->edit.loop_data); GPU_VERTBUF_DISCARD_SAFE(cache->edit.facedots_pos_nor_data); |