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
path: root/source
diff options
context:
space:
mode:
authorLuca Rood <dev@lucarood.com>2017-05-26 14:35:45 +0300
committerLuca Rood <dev@lucarood.com>2017-05-26 14:36:12 +0300
commit3b311b7cb2320cc7a86f23c6d5ffa0747a045818 (patch)
tree52101a96f520d3f42b594785f803c16d65aa5078 /source
parentc6e92b4947945e3c1238d936f7954a5b4688c195 (diff)
Fix uninit shading group in object mode particles
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/modes/object_mode.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index e9f364eee21..24f3e1e54b6 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -1418,7 +1418,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
if (draw_as != PART_DRAW_PATH) {
struct Batch *geom = DRW_cache_particles_get_dots(psys);
- DRWShadingGroup *shgrp;
+ DRWShadingGroup *shgrp = NULL;
static int screen_space[2] = {0, 1};
static float def_prim_col[3] = {0.5f, 0.5f, 0.5f};
static float def_sec_col[3] = {1.0f, 1.0f, 1.0f};
@@ -1454,13 +1454,15 @@ static void OBJECT_cache_populate(void *vedata, Object *ob)
break;
}
- if (draw_as != PART_DRAW_DOT) {
- DRW_shgroup_attrib_float(shgrp, "pos", 3);
- DRW_shgroup_attrib_float(shgrp, "rot", 4);
- DRW_shgroup_attrib_float(shgrp, "val", 1);
- DRW_shgroup_uniform_short_to_int(shgrp, "draw_size", &part->draw_size, 1);
- DRW_shgroup_uniform_float(shgrp, "pixel_size", DRW_viewport_pixelsize_get(), 1);
- DRW_shgroup_instance_batch(shgrp, geom);
+ if (shgrp) {
+ if (draw_as != PART_DRAW_DOT) {
+ DRW_shgroup_attrib_float(shgrp, "pos", 3);
+ DRW_shgroup_attrib_float(shgrp, "rot", 4);
+ DRW_shgroup_attrib_float(shgrp, "val", 1);
+ DRW_shgroup_uniform_short_to_int(shgrp, "draw_size", &part->draw_size, 1);
+ DRW_shgroup_uniform_float(shgrp, "pixel_size", DRW_viewport_pixelsize_get(), 1);
+ DRW_shgroup_instance_batch(shgrp, geom);
+ }
}
}
}