Fix T62961 EEVEE: Viewport refresh when hovering widgets

We now bypass EEVEE's rendering if the TAA accumulation has ended.
This commit is contained in:
Clément Foucault 2020-06-23 22:40:45 +02:00
parent 5fbbe1fca9
commit d82c3d8615
Notes: blender-bot 2023-02-14 09:09:43 +01:00
Referenced by commit 574bd866c8, Fix T78520 EEVEE: No viewport update when changing material nodetree
Referenced by commit f3e724b93d, Fix T79370 EEVEE: Texture paint does not update during stroke
Referenced by commit bcc086584f, Fix unreported 1 pixel offset when drawing with GPencil
Referenced by issue #79370, Texture paint does not update during stroke on material and render viewport shading
Referenced by issue #67236, multi monitor evvee keeps refreshing when moving image editor on second screen
Referenced by issue #62961, 3d viewport shimmers when moving mouse over the interface in Solid & Lookdev modes
3 changed files with 13 additions and 2 deletions

View File

@ -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();

View File

@ -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. */

View File

@ -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 |