Fix missing apply of blend state when indexed blending is not available

This commit is contained in:
baldurk
2018-07-03 15:27:23 +01:00
parent dcfe93d5c6
commit db551cd23d
+17 -2
View File
@@ -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]);