From db551cd23dfa89f6dfd3f7b2c641f533b1bd69e4 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 3 Jul 2018 15:27:23 +0100 Subject: [PATCH] Fix missing apply of blend state when indexed blending is not available --- renderdoc/driver/gl/gl_renderstate.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/gl/gl_renderstate.cpp b/renderdoc/driver/gl/gl_renderstate.cpp index 78a82768e..5b4ea23cc 100644 --- a/renderdoc/driver/gl/gl_renderstate.cpp +++ b/renderdoc/driver/gl/gl_renderstate.cpp @@ -1477,8 +1477,8 @@ void GLRenderState::ApplyState(WrappedOpenGL *gl) { for(GLuint i = 0; i < RDCMIN(maxDraws, (GLuint)ARRAY_COUNT(Blends)); i++) { - if(Blends[i].EquationRGB == - eGL_NONE) // not set, possibly there were lesser draw buffers during capture + // not set, possibly there were lesser draw buffers during capture + if(Blends[i].EquationRGB == eGL_NONE) continue; m_Real->glBlendFuncSeparatei(i, Blends[i].SourceRGB, Blends[i].DestinationRGB, @@ -1491,6 +1491,21 @@ void GLRenderState::ApplyState(WrappedOpenGL *gl) m_Real->glDisablei(eGL_BLEND, i); } } + else + { + // not set, possibly there were lesser draw buffers during capture + if(Blends[0].EquationRGB != eGL_NONE) + { + m_Real->glBlendFuncSeparate(Blends[0].SourceRGB, Blends[0].DestinationRGB, + Blends[0].SourceAlpha, Blends[0].DestinationAlpha); + m_Real->glBlendEquationSeparate(Blends[0].EquationRGB, Blends[0].EquationAlpha); + + if(Blends[0].Enabled) + m_Real->glEnable(eGL_BLEND); + else + m_Real->glDisable(eGL_BLEND); + } + } m_Real->glBlendColor(BlendColor[0], BlendColor[1], BlendColor[2], BlendColor[3]);