Eevee: Add failsafe check in shadow material.
authorClément Foucault <foucault.clem@gmail.com>
Tue, 11 Jul 2017 10:42:59 +0000 (12:42 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Tue, 11 Jul 2017 10:42:59 +0000 (12:42 +0200)
source/blender/draw/engines/eevee/eevee_lights.c

index 37b33e210215f3c091975ca22255ceacd29af669..096a02668b1e8d3ce5c3e632b39c71efc047a8ca 100644 (file)
@@ -200,6 +200,9 @@ void EEVEE_lights_cache_shcaster_material_add(
        EEVEE_SceneLayerData *sldata, EEVEE_PassList *psl, struct GPUMaterial *gpumat, struct Gwn_Batch *geom, float (*obmat)[4], float *alpha_threshold)
 {
        DRWShadingGroup *grp = DRW_shgroup_material_instance_create(gpumat, psl->shadow_cube_pass, geom);
+
+       if (grp == NULL) return;
+
        DRW_shgroup_uniform_block(grp, "shadow_render_block", sldata->shadow_render_ubo);
        DRW_shgroup_uniform_mat4(grp, "ShadowModelMatrix", (float *)obmat);