From 76b15e338aa288cedc19dfe5fae3d2be0456bf4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 7 Oct 2020 14:03:27 +0200 Subject: GPU: Avoid blit operation modifying the wrong framebuffer during restore At the end of `GPU_framebuffer_blit` when `prev_fb->bind(true);` is called, the `context_->active_fb` was not in sync and lead to the wrong framebuffer being modified by bind function. This fix T81055 SSS light is missing from the diffuse light render pass --- source/blender/gpu/opengl/gl_framebuffer.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/gpu/opengl/gl_framebuffer.cc') diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index 6b9d97530f9..4270ba544b5 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -489,6 +489,8 @@ void GLFrameBuffer::blit_to( /* Restore the draw buffers. */ glDrawBuffers(ARRAY_SIZE(dst->gl_attachments_), dst->gl_attachments_); } + /* Ensure previous buffer is restored. */ + context_->active_fb = dst; } /** \} */ -- cgit v1.2.3