diff options
Diffstat (limited to 'source/blender/gpu/opengl/gl_framebuffer.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_framebuffer.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index 4270ba544b5..cd87fc88144 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -286,20 +286,22 @@ void GLFrameBuffer::bind(bool enabled_srgb) this->scissor_reset(); } - if (context_->active_fb != this) { - context_->active_fb = this; - state_manager_->active_fb = this; - dirty_state_ = true; - + if (context_->active_fb != this || enabled_srgb_ != enabled_srgb) { + enabled_srgb_ = enabled_srgb; if (enabled_srgb) { glEnable(GL_FRAMEBUFFER_SRGB); } else { glDisable(GL_FRAMEBUFFER_SRGB); } - GPU_shader_set_framebuffer_srgb_target(enabled_srgb && srgb_); } + + if (context_->active_fb != this) { + context_->active_fb = this; + state_manager_->active_fb = this; + dirty_state_ = true; + } } /** \} */ |