Make sure GL pipeline state is cleared up before we make a new one

This commit is contained in:
baldurk
2014-12-07 15:24:49 +00:00
parent 9b15527a84
commit 02fb0ce003
+13 -4
View File
@@ -1076,16 +1076,21 @@ void GLReplay::SavePipelineState()
};
ShaderReflection *refls[6] = { NULL };
ShaderBindpointMapping *mappings[6] = { NULL };
for(int i=0; i < 6; i++)
{
stages[i]->Shader = ResourceId();
stages[i]->ShaderDetails = NULL;
stages[i]->BindpointMapping.ConstantBlocks.Delete();
stages[i]->BindpointMapping.Resources.Delete();
}
if(curProg == 0)
{
gl.glGetIntegerv(eGL_PROGRAM_PIPELINE_BINDING, (GLint*)&curProg);
if(curProg == 0)
{
pipe.m_VS.Shader = ResourceId();
pipe.m_FS.Shader = ResourceId();
for(GLint unit=0; unit < numTexUnits; unit++)
{
pipe.Textures[unit].FirstSlice = 0;
@@ -1107,6 +1112,10 @@ void GLReplay::SavePipelineState()
GetMapping(gl, curProg, (int)i, refls[i], stages[i]->BindpointMapping);
mappings[i] = &stages[i]->BindpointMapping;
}
else
{
stages[i]->Shader = ResourceId();
}
}
}
}