From c4bebc03e0e7af0b6fe31c9751b81635645bd547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 28 Apr 2021 15:36:33 +0200 Subject: Fix T87464 EEVEE: Crash with deformation Motion Blur This was caused by the new depsgraph persistence. The GPUbatches we got from the cache being the same for each frame means that we need to be more careful about cleanning the additional VBOs references. Moving the `EEVEE_motion_blur_swap_data` function call at the end of the loop makes sure the references are cleaned. --- source/blender/draw/engines/eevee/eevee_engine.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index ae726d7af9a..509c002e25a 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -494,12 +494,7 @@ static void eevee_render_to_image(void *vedata, /* Previous motion step. */ if (do_motion_blur_fx) { - if (i > 0) { - /* The previous step of this iteration N is exactly the next step of iteration N - 1. - * So we just swap the resources to avoid too much re-evaluation. */ - EEVEE_motion_blur_swap_data(vedata); - } - else { + if (i == 0) { EEVEE_motion_blur_step_set(ved, MB_PREV); DRW_render_set_time(engine, depsgraph, floorf(time_prev), fractf(time_prev)); EEVEE_render_modules_init(vedata, engine, depsgraph); @@ -570,6 +565,14 @@ static void eevee_render_to_image(void *vedata, DRW_cache_restart(); } } + + if (do_motion_blur_fx) { + /* The previous step of next iteration N is exactly the next step of this iteration N - 1. + * So we just swap the resources to avoid too much re-evaluation. + * Note that this also clears the VBO references from the GPUBatches of deformed + * geometries. */ + EEVEE_motion_blur_swap_data(vedata); + } } EEVEE_volumes_free_smoke_textures(); -- cgit v1.2.3 From e0fa295bc6f2f99f5679a4d423818d83c67628a2 Mon Sep 17 00:00:00 2001 From: Falk David Date: Wed, 28 Apr 2021 16:20:09 +0200 Subject: Fix T86881: Curve Edit handle offset when snapping When an aligned (or auto) handle was snapped with only the control point selected, it would not snap to the correct point, but offset. This was because the handles were not considered selected. The `TD_SELECTED` flag was not being set. The fix makes sure that we include the handles in the selection when the handle is aligned or auto. Reviewed By: antoniov Maniphest Tasks: T86881 Differential Revision: https://developer.blender.org/D11111 --- source/blender/editors/transform/transform_convert_gpencil.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/transform/transform_convert_gpencil.c b/source/blender/editors/transform/transform_convert_gpencil.c index 45df0e66691..4932a5f8d23 100644 --- a/source/blender/editors/transform/transform_convert_gpencil.c +++ b/source/blender/editors/transform/transform_convert_gpencil.c @@ -78,14 +78,12 @@ static short get_bezt_sel_triple_flag(BezTriple *bezt, const bool handles_visibl flag = ((bezt->f1 & SELECT) ? SEL_F1 : 0) | ((bezt->f2 & SELECT) ? SEL_F2 : 0) | ((bezt->f3 & SELECT) ? SEL_F3 : 0); } - else { - if (bezt->f2 & SELECT) { - flag = SEL_ALL; - } + else if (bezt->f2 & SELECT) { + flag = SEL_ALL; } /* Special case for auto & aligned handles */ - if (flag != SEL_ALL && flag & SEL_F2) { + if ((flag != SEL_ALL) && (flag & SEL_F2)) { if (ELEM(bezt->h1, HD_AUTO, HD_ALIGN) && ELEM(bezt->h2, HD_AUTO, HD_ALIGN)) { flag = SEL_ALL; } @@ -316,7 +314,7 @@ static void createTransGPencil_curves(bContext *C, } } else if (handles_visible) { - if (BEZT_ISSEL_IDX(bezt, j)) { + if (sel) { td->flag = TD_SELECTED; } else { -- cgit v1.2.3