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:
authorJeroen Bakker <j.bakker@atmind.nl>2020-07-21 12:47:53 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2020-07-21 12:50:21 +0300
commit8c916a3aecc49351dbbb0d22c8bc0e5712b9e9ac (patch)
tree3e6c9ef6b0066353d26144048c525c7aaee55f52 /source/blender/draw/intern/draw_cache_extract_mesh.c
parentfdc3f56234e1bde5ed1d3108501c4d1812da1d7f (diff)
Fix T79066: Entering Edit Mode when Viewport Display set as Wire or Bounds leads to crash
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract_mesh.c')
-rw-r--r--source/blender/draw/intern/draw_cache_extract_mesh.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c
index 1737f8b2ff9..cca8ebcf2a8 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -890,7 +890,9 @@ static void extract_tris_finish(const MeshRenderData *mr, void *ibo, void *_data
MeshExtract_Tri_Data *data = _data;
GPU_indexbuf_build_in_place(&data->elb, ibo);
/* HACK: Create ibo sub-ranges and assign them to each #GPUBatch. */
- if (mr->use_final_mesh) {
+ /* The `surface_per_mat` tests are there when object shading type is set to Wire or Bounds. In
+ * these cases there isn't a surface per material. */
+ if (mr->use_final_mesh && mr->cache->surface_per_mat && mr->cache->surface_per_mat[0]) {
for (int i = 0; i < mr->mat_len; i++) {
/* Multiply by 3 because these are triangle indices. */
const int mat_start = data->tri_mat_start[i];