Eevee: Fix dot corruption on intel HD5xx/6xx series
authorClément Foucault <foucault.clem@gmail.com>
Wed, 31 Oct 2018 11:32:09 +0000 (12:32 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 31 Oct 2018 11:32:18 +0000 (12:32 +0100)
It is caused by some sync issue apparently. Adding glFlush in these
two places fixes it.

Caveat: it might have a small perf impact (did not measure it).

The fix is limited to the affected driver/operating systems.

source/blender/draw/engines/eevee/eevee_effects.c
source/blender/draw/engines/eevee/eevee_occlusion.c

index 2978ea38d19b7540a55ee8406062c5f2102699f4..c7c3adeffc283b9944c7f76434167bea13e234f6 100644 (file)
@@ -34,6 +34,7 @@
 #include "eevee_private.h"
 #include "GPU_texture.h"
 #include "GPU_extensions.h"
+#include "GPU_state.h"
 
 static struct {
        /* Downsample Depth */
@@ -470,6 +471,13 @@ void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, GPUTexture *depth_src, int l
 
        /* Restore */
        GPU_framebuffer_bind(fbl->main_fb);
+
+       if (GPU_mip_render_workaround()) {
+               /* Fix dot corruption on intel HD5XX/HD6XX series.
+                * It seems affected drivers are the same that needs
+                * GPU_mip_render_workaround. */
+               GPU_flush();
+       }
 }
 
 /**
index 8ede22cda5aaa476853ec89564fcc190b483dddb..03aee102136c361a4e2f4ecaf8a841f52d48a842 100644 (file)
@@ -37,6 +37,9 @@
 
 #include "eevee_private.h"
 
+#include "GPU_extensions.h"
+#include "GPU_state.h"
+
 static struct {
        /* Ground Truth Ambient Occlusion */
        struct GPUShader *gtao_sh;
@@ -250,6 +253,13 @@ void EEVEE_occlusion_compute(
                        DRW_draw_pass(psl->ao_horizon_search);
                }
 
+               if (GPU_mip_render_workaround()) {
+                       /* Fix dot corruption on intel HD5XX/HD6XX series.
+                        * It seems affected drivers are the same that needs
+                        * GPU_mip_render_workaround. */
+                       GPU_flush();
+               }
+
                /* Restore */
                GPU_framebuffer_bind(fbl->main_fb);