diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-03-17 21:08:14 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-03-17 21:08:14 +0300 |
commit | 4a3d94c0734d1475aa9a2fbe89039fbc59c9fb8d (patch) | |
tree | 79c9f2cd9e9d1b963717095f02f9a39301a057c3 /source/blender/draw/engines | |
parent | 1ed287058d88fe9b217a5e44eba1b2888eb7c7a4 (diff) |
Eevee: Volumetrics: Fix crash when using smoke volumes.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_volumes.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index 26ac4498073..0c0ffa39146 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -472,17 +472,20 @@ void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved DRWShadingGroup *grp = DRW_shgroup_material_empty_tri_batch_create(mat, vedata->psl->volumetric_objects_ps, sldata->common_data.vol_tex_size[2]); + /* If shader failed to compile or is currently compiling. */ + if (grp == NULL) { + return; + } + /* Making sure it's updated. */ invert_m4_m4(ob->imat, ob->obmat); BKE_mesh_texspace_get_reference((struct Mesh *)ob->data, NULL, &texcoloc, NULL, &texcosize); - if (grp) { - DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo); - DRW_shgroup_uniform_mat4(grp, "volumeObjectMatrix", (float *)ob->imat); - DRW_shgroup_uniform_vec3(grp, "volumeOrcoLoc", texcoloc, 1); - DRW_shgroup_uniform_vec3(grp, "volumeOrcoSize", texcosize, 1); - } + DRW_shgroup_uniform_block(grp, "common_block", sldata->common_ubo); + DRW_shgroup_uniform_mat4(grp, "volumeObjectMatrix", (float *)ob->imat); + DRW_shgroup_uniform_vec3(grp, "volumeOrcoLoc", texcoloc, 1); + DRW_shgroup_uniform_vec3(grp, "volumeOrcoSize", texcosize, 1); /* Smoke Simulation */ if (((ob->base_flag & BASE_FROMDUPLI) == 0) && |