[Bf-blender-cvs] [4b8558e6f42] blender-v2.80-release: Fix T67033 EEVEE: Random Flickering Materials
Clément Foucault
noreply at git.blender.org
Wed Jul 24 16:28:59 CEST 2019
Commit: 4b8558e6f42f0db3e6faaaa5e4c522e153133133
Author: Clément Foucault
Date: Fri Jul 19 14:38:03 2019 +0200
Branches: blender-v2.80-release
https://developer.blender.org/rB4b8558e6f42f0db3e6faaaa5e4c522e153133133
Fix T67033 EEVEE: Random Flickering Materials
This was a read after free error. This only fix the undefined behavior.
The result is still not correct in certain cases (see T67226).
We want to include this for 2.80
===================================================================
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 f5f3a7a70e3..61da9e21cc8 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -1659,14 +1659,17 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata,
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). */
+ /* FIXME: This is broken, as it overrides any autolayers srgb bool of the previous mesh
+ * that shares the same material. */
if (shgrp_array[i]) {
- DRW_shgroup_uniform_bool(shgrp_array[i], name, &auto_layer_is_srgb[j], 1);
+ DRW_shgroup_uniform_bool_copy(shgrp_array[i], name, auto_layer_is_srgb[j]);
}
if (shgrp_depth_array[i]) {
- DRW_shgroup_uniform_bool(shgrp_depth_array[i], name, &auto_layer_is_srgb[j], 1);
+ DRW_shgroup_uniform_bool_copy(shgrp_depth_array[i], name, auto_layer_is_srgb[j]);
}
if (shgrp_depth_clip_array[i]) {
- DRW_shgroup_uniform_bool(shgrp_depth_clip_array[i], name, &auto_layer_is_srgb[j], 1);
+ DRW_shgroup_uniform_bool_copy(
+ shgrp_depth_clip_array[i], name, auto_layer_is_srgb[j]);
}
/* Go to next layer name. */
while (*name != '\0') {
More information about the Bf-blender-cvs
mailing list