wined3d: Unset the current GLSL program when it's destroyed.

This commit is contained in:
Henri Verbeet 2009-04-06 10:10:05 +02:00 committed by Alexandre Julliard
parent 95156d1b5f
commit 1120f0f585
1 changed files with 4 additions and 0 deletions

View File

@ -3766,9 +3766,13 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
if(pshader) { if(pshader) {
ps = (IWineD3DPixelShaderImpl *) This; ps = (IWineD3DPixelShaderImpl *) This;
if(ps->num_gl_shaders == 0) return; if(ps->num_gl_shaders == 0) return;
if (priv->glsl_program && (IWineD3DBaseShader *)priv->glsl_program->pshader == iface)
shader_glsl_select(This->baseShader.device, FALSE, FALSE);
} else { } else {
vs = (IWineD3DVertexShaderImpl *) This; vs = (IWineD3DVertexShaderImpl *) This;
if(vs->num_gl_shaders == 0) return; if(vs->num_gl_shaders == 0) return;
if (priv->glsl_program && (IWineD3DBaseShader *)priv->glsl_program->vshader == iface)
shader_glsl_select(This->baseShader.device, FALSE, FALSE);
} }
linked_programs = &This->baseShader.linked_programs; linked_programs = &This->baseShader.linked_programs;