diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-23 23:40:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-23 23:59:55 +0300 |
commit | d82c3d86155ea3c7831c7b5ef5d07bc8e2d99394 (patch) | |
tree | 643f0f2d75cd434aee42eab998bdd0c7e83dfed0 /source/blender | |
parent | 5fbbe1fca9b5a4d30a846a068dcfff03991d1622 (diff) |
Fix T62961 EEVEE: Viewport refresh when hovering widgets
We now bypass EEVEE's rendering if the TAA accumulation has ended.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_engine.c | 9 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_private.h | 1 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_temporal_sampling.c | 5 |
3 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index bdf00b7c568..55a20a0f6bb 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -214,6 +214,10 @@ static void eevee_draw_scene(void *vedata) loop_len = MAX2(1, scene->eevee.taa_samples); } + if (stl->effects->bypass_drawing) { + loop_len = 0; + } + while (loop_len--) { float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f}; float clear_depth = 1.0f; @@ -352,6 +356,11 @@ static void eevee_draw_scene(void *vedata) EEVEE_renderpasses_draw(sldata, vedata); } + if (stl->effects->bypass_drawing) { + /* Restore the depth from sample 1. */ + GPU_framebuffer_blit(fbl->double_buffer_depth_fb, 0, dfbl->default_fb, 0, GPU_DEPTH_BIT); + } + EEVEE_renderpasses_draw_debug(vedata); EEVEE_volumes_free_smoke_textures(); diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index 156f4a2e706..239a1ddcc1f 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -668,6 +668,7 @@ typedef struct EEVEE_EffectsInfo { int taa_render_sample; int taa_total_sample; float taa_alpha; + bool bypass_drawing; bool prev_drw_support; bool prev_is_navigating; float prev_drw_persmat[4][4]; /* Used for checking view validity and reprojection. */ diff --git a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c index 9ad302f93ce..04878c7268a 100644 --- a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c +++ b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c @@ -213,6 +213,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data * we accumulate the redraw inside the drawing loop in eevee_draw_scene(). **/ effects->taa_render_sample = 1; + effects->bypass_drawing = false; EEVEE_temporal_sampling_create_view(vedata); @@ -255,7 +256,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data if (((effects->taa_total_sample == 0) || (effects->taa_current_sample < effects->taa_total_sample)) || - DRW_state_is_image_render()) { + (!view_is_valid) || DRW_state_is_image_render()) { if (view_is_valid) { /* Viewport rendering updates the matrices in `eevee_draw_scene` */ if (!DRW_state_is_image_render()) { @@ -268,7 +269,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data } } else { - effects->taa_current_sample = 1; + effects->bypass_drawing = true; } return repro_flag | EFFECT_TAA | EFFECT_DOUBLE_BUFFER | EFFECT_DEPTH_DOUBLE_BUFFER | |