[Bf-blender-cvs] [ad5d5d3f3bb] master: EEVEE: Fix broken rendering caused by SSR + Alpha blended material

Clément Foucault noreply at git.blender.org
Sun Aug 30 13:36:08 CEST 2020


Commit: ad5d5d3f3bb2765a97cfc07202d00d8112701fea
Author: Clément Foucault
Date:   Sun Aug 30 12:40:27 2020 +0200
Branches: master
https://developer.blender.org/rBad5d5d3f3bb2765a97cfc07202d00d8112701fea

EEVEE: Fix broken rendering caused by SSR + Alpha blended material

This was affecting Mesa drivers as well as AMD pro driver. But it
might have been noticeable on other config too.

This was introduced by rBa9f2ebb21508.

===================================================================

M	source/blender/gpu/opengl/gl_state.cc

===================================================================

diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc
index 84824191a12..8f01ff13486 100644
--- a/source/blender/gpu/opengl/gl_state.cc
+++ b/source/blender/gpu/opengl/gl_state.cc
@@ -407,8 +407,10 @@ void GLStateManager::set_blend(const eGPUBlend value)
     }
   }
 
+  /* Always set the blend function. This avoid a rendering error when blending is disabled but
+   * GPU_BLEND_CUSTOM was used just before and the framebuffer is using more than 1 color targe */
+  glBlendFuncSeparate(src_rgb, dst_rgb, src_alpha, dst_alpha);
   if (value != GPU_BLEND_NONE) {
-    glBlendFuncSeparate(src_rgb, dst_rgb, src_alpha, dst_alpha);
     glEnable(GL_BLEND);
   }
   else {



More information about the Bf-blender-cvs mailing list