forked from bartvdbraak/blender
DRW: Avoid undefined behavior when running multiple iteration
This was caused by DST.dupli_origin not being reset properly. This had not effect in master but has effect in EEVEE motion blur branch.
This commit is contained in:
parent
a809631ff2
commit
fd14d1cceb
@ -1467,6 +1467,7 @@ void DRW_draw_render_loop_ex(struct Depsgraph *depsgraph,
|
||||
|
||||
/* Only iterate over objects for internal engines or when overlays are enabled */
|
||||
if (do_populate_loop) {
|
||||
DST.dupli_origin = NULL;
|
||||
DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN (depsgraph, ob) {
|
||||
if ((object_type_exclude_viewport & (1 << ob->type)) != 0) {
|
||||
continue;
|
||||
@ -1864,6 +1865,7 @@ void DRW_render_object_iter(
|
||||
const int object_type_exclude_viewport = draw_ctx->v3d ?
|
||||
draw_ctx->v3d->object_type_exclude_viewport :
|
||||
0;
|
||||
DST.dupli_origin = NULL;
|
||||
DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN (depsgraph, ob) {
|
||||
if ((object_type_exclude_viewport & (1 << ob->type)) == 0) {
|
||||
DST.dupli_parent = data_.dupli_parent;
|
||||
@ -2121,6 +2123,7 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph,
|
||||
const int object_type_exclude_select = (v3d->object_type_exclude_viewport |
|
||||
v3d->object_type_exclude_select);
|
||||
bool filter_exclude = false;
|
||||
DST.dupli_origin = NULL;
|
||||
DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN (depsgraph, ob) {
|
||||
if (!BKE_object_is_visible_in_viewport(v3d, ob)) {
|
||||
continue;
|
||||
@ -2271,6 +2274,7 @@ static void drw_draw_depth_loop_imp(struct Depsgraph *depsgraph,
|
||||
drw_engines_world_update(DST.draw_ctx.scene);
|
||||
|
||||
const int object_type_exclude_viewport = v3d->object_type_exclude_viewport;
|
||||
DST.dupli_origin = NULL;
|
||||
DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN (DST.draw_ctx.depsgraph, ob) {
|
||||
if ((object_type_exclude_viewport & (1 << ob->type)) != 0) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user