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:
authorLuca Rood <dev@lucarood.com>2017-06-26 15:52:59 +0300
committerLuca Rood <dev@lucarood.com>2017-06-26 15:52:59 +0300
commitbafb90480706ad0c380a8eb1907beb046bfbcf1e (patch)
tree1e28e4c1946ba7ed2b112f9fc4891a39cce6d2e7 /source/blender/draw
parent37593b6a4242c8a31ffd6ce82b861b2097769ccf (diff)
Fix T51559: Update draw cache when changing flat/smooth shading
This also renames some flags/variables to be more generic for updating purposes. The call used here was previously only used for updating paint data, but as it was reused here, flags and variables were renamed to accomodate more clearly to the new usages.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c10
-rw-r--r--source/blender/draw/modes/paint_weight_mode.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 524ee22f577..ca61d3f7013 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1392,7 +1392,7 @@ typedef struct MeshBatchCache {
/* settings to determine if cache is invalid */
bool is_dirty;
- bool is_paint_dirty;
+ bool is_really_dirty; /* Instantly invalidates cache, skipping mesh check */
int edge_len;
int tri_len;
int poly_len;
@@ -1420,7 +1420,7 @@ static bool mesh_batch_cache_valid(Mesh *me)
return false;
}
- if (cache->is_paint_dirty) {
+ if (cache->is_really_dirty) {
return false;
}
@@ -1467,7 +1467,7 @@ static void mesh_batch_cache_init(Mesh *me)
cache->mat_len = mesh_render_mat_len_get(me);
cache->is_dirty = false;
- cache->is_paint_dirty = false;
+ cache->is_really_dirty = false;
}
static MeshBatchCache *mesh_batch_cache_get(Mesh *me)
@@ -1500,8 +1500,8 @@ void DRW_mesh_batch_cache_dirty(Mesh *me, int mode)
BATCH_DISCARD_ALL_SAFE(cache->overlay_facedots);
break;
- case BKE_MESH_BATCH_DIRTY_PAINT:
- cache->is_paint_dirty = true;
+ case BKE_MESH_BATCH_DIRTY_NOCHECK:
+ cache->is_really_dirty = true;
break;
default:
BLI_assert(0);
diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c
index 270566b6cc6..6a46acd869b 100644
--- a/source/blender/draw/modes/paint_weight_mode.c
+++ b/source/blender/draw/modes/paint_weight_mode.c
@@ -92,7 +92,7 @@ static void PAINT_WEIGHT_engine_init(void *UNUSED(vedata))
if (e_data.actdef != draw_ctx->obact->actdef) {
e_data.actdef = draw_ctx->obact->actdef;
- BKE_mesh_batch_cache_dirty(draw_ctx->obact->data, BKE_MESH_BATCH_DIRTY_PAINT);
+ BKE_mesh_batch_cache_dirty(draw_ctx->obact->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
}
if (!e_data.weight_face_shader) {