Commit: 0ca623362d5e955f051c6cc5cdd69925248e7f76
Author: Clément Foucault
Date:   Fri Feb 22 17:14:08 2019 +0100
Branches: master
https://developer.blender.org/rB0ca623362d5e955f051c6cc5cdd69925248e7f76

Fix T61837: Assert in Eevee multiresolution modfier in sculpt mode

Note that this commit remove the support (that was not really working)
for shadows in sculpt mode.

===================================================================

M       source/blender/draw/engines/eevee/eevee_materials.c

===================================================================

diff --git a/source/blender/draw/engines/eevee/eevee_materials.c 
b/source/blender/draw/engines/eevee/eevee_materials.c
index 6ffd11eeda6..133adf499c0 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -1518,14 +1518,19 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, 
EEVEE_ViewLayerData *sld
                        char *auto_layer_names;
                        int *auto_layer_is_srgb;
                        int auto_layer_count;
-                       struct GPUBatch **mat_geom = 
DRW_cache_object_surface_material_get(
-                               ob, gpumat_array, materials_len,
-                               &auto_layer_names,
-                               &auto_layer_is_srgb,
-                               &auto_layer_count);
-                       if (mat_geom) {
+                       struct GPUBatch **mat_geom = NULL;
+
+                       if (!is_sculpt_mode_draw) {
+                               mat_geom = 
DRW_cache_object_surface_material_get(
+                                       ob, gpumat_array, materials_len,
+                                       &auto_layer_names,
+                                       &auto_layer_is_srgb,
+                                       &auto_layer_count);
+                       }
+
+                       if (is_sculpt_mode_draw || mat_geom) {
                                for (int i = 0; i < materials_len; ++i) {
-                                       if (mat_geom[i] == NULL) {
+                                       if (!is_sculpt_mode_draw && mat_geom[i] 
== NULL) {
                                                continue;
                                        }
                                        EEVEE_ObjectEngineData *oedata = NULL;
@@ -1558,6 +1563,11 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, 
EEVEE_ViewLayerData *sld
                                        
ADD_SHGROUP_CALL_SAFE(shgrp_depth_array[i], ob, ma, mat_geom[i], oedata);
                                        
ADD_SHGROUP_CALL_SAFE(shgrp_depth_clip_array[i], ob, ma, mat_geom[i], oedata);
 
+                                       /* TODO(fclem): Don't support shadows 
in sculpt mode. */
+                                       if (is_sculpt_mode_draw) {
+                                               break;
+                                       }
+
                                        char *name = auto_layer_names;
                                        for (int j = 0; j < auto_layer_count; 
++j) {
                                                /* TODO don't add these uniform 
when not needed (default pass shaders). */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to