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:
@@ -214,6 +214,10 @@ static void eevee_draw_scene(void *vedata)
|
|||||||
loop_len = MAX2(1, scene->eevee.taa_samples);
|
loop_len = MAX2(1, scene->eevee.taa_samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stl->effects->bypass_drawing) {
|
||||||
|
loop_len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
while (loop_len--) {
|
while (loop_len--) {
|
||||||
float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
float clear_depth = 1.0f;
|
float clear_depth = 1.0f;
|
||||||
@@ -352,6 +356,11 @@ static void eevee_draw_scene(void *vedata)
|
|||||||
EEVEE_renderpasses_draw(sldata, 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_renderpasses_draw_debug(vedata);
|
||||||
|
|
||||||
EEVEE_volumes_free_smoke_textures();
|
EEVEE_volumes_free_smoke_textures();
|
||||||
|
|||||||
@@ -668,6 +668,7 @@ typedef struct EEVEE_EffectsInfo {
|
|||||||
int taa_render_sample;
|
int taa_render_sample;
|
||||||
int taa_total_sample;
|
int taa_total_sample;
|
||||||
float taa_alpha;
|
float taa_alpha;
|
||||||
|
bool bypass_drawing;
|
||||||
bool prev_drw_support;
|
bool prev_drw_support;
|
||||||
bool prev_is_navigating;
|
bool prev_is_navigating;
|
||||||
float prev_drw_persmat[4][4]; /* Used for checking view validity and reprojection. */
|
float prev_drw_persmat[4][4]; /* Used for checking view validity and reprojection. */
|
||||||
|
|||||||
@@ -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().
|
* we accumulate the redraw inside the drawing loop in eevee_draw_scene().
|
||||||
**/
|
**/
|
||||||
effects->taa_render_sample = 1;
|
effects->taa_render_sample = 1;
|
||||||
|
effects->bypass_drawing = false;
|
||||||
|
|
||||||
EEVEE_temporal_sampling_create_view(vedata);
|
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) ||
|
if (((effects->taa_total_sample == 0) ||
|
||||||
(effects->taa_current_sample < effects->taa_total_sample)) ||
|
(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) {
|
if (view_is_valid) {
|
||||||
/* Viewport rendering updates the matrices in `eevee_draw_scene` */
|
/* Viewport rendering updates the matrices in `eevee_draw_scene` */
|
||||||
if (!DRW_state_is_image_render()) {
|
if (!DRW_state_is_image_render()) {
|
||||||
@@ -268,7 +269,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
effects->taa_current_sample = 1;
|
effects->bypass_drawing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return repro_flag | EFFECT_TAA | EFFECT_DOUBLE_BUFFER | EFFECT_DEPTH_DOUBLE_BUFFER |
|
return repro_flag | EFFECT_TAA | EFFECT_DOUBLE_BUFFER | EFFECT_DEPTH_DOUBLE_BUFFER |
|
||||||
|
|||||||
Reference in New Issue
Block a user