From 8a5af5202c51e29284a03245d7331a4f2fe6d08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 12 Sep 2017 18:32:29 +0200 Subject: Eevee: Fix T52713: SSR not working in AMD This was cause by a fairly funky unitialize buffer (last frame) that was causing NANs during the SSR resolve stage. They were then propagated to the whole image during the next swap. Bypassing the SSR completly if no valid history exists fixes the problem. Also disabling SSR data output in this case so we can have correct reflection in the 1st history buffer. --- source/blender/draw/engines/eevee/eevee_effects.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source/blender/draw/engines/eevee/eevee_effects.c') diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c index 73c7b4e96b3..b18d6455893 100644 --- a/source/blender/draw/engines/eevee/eevee_effects.c +++ b/source/blender/draw/engines/eevee/eevee_effects.c @@ -1257,7 +1257,7 @@ void EEVEE_effects_do_ssr(EEVEE_SceneLayerData *UNUSED(sldata), EEVEE_Data *veda EEVEE_TextureList *txl = vedata->txl; EEVEE_EffectsInfo *effects = stl->effects; - if ((effects->enabled_effects & EFFECT_SSR) != 0) { + if (((effects->enabled_effects & EFFECT_SSR) != 0) && stl->g_data->valid_double_buffer) { DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); e_data.depth_src = dtxl->depth; @@ -1266,14 +1266,8 @@ void EEVEE_effects_do_ssr(EEVEE_SceneLayerData *UNUSED(sldata), EEVEE_Data *veda } DRW_framebuffer_bind(fbl->screen_tracing_fb); - if (stl->g_data->valid_double_buffer) { - /* Raytrace. */ - DRW_draw_pass(psl->ssr_raytrace); - } - else { - float clear_col[4] = {0.0f, 0.0f, -1.0f, 0.001f}; - DRW_framebuffer_clear(true, false, false, clear_col, 0.0f); - } + /* Raytrace. */ + DRW_draw_pass(psl->ssr_raytrace); for (int i = 0; i < effects->ssr_ray_count; ++i) { DRW_framebuffer_texture_detach(stl->g_data->ssr_hit_output[i]); -- cgit v1.2.3