wined3d: Clear resources that we aren't recording in stateblock_init().

This commit is contained in:
Henri Verbeet 2009-10-09 09:58:46 +02:00 committed by Alexandre Julliard
parent 61abc0a51d
commit 442beb1dcf
1 changed files with 13 additions and 0 deletions

View File

@ -1674,6 +1674,13 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
{
stateblock->streamSource[i] = NULL;
}
for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
{
stateblock->textures[i] = NULL;
}
stateblock->vertexDecl = NULL;
stateblock->pIndexData = NULL;
stateblock->vertexShader = NULL;
}
@ -1700,8 +1707,14 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
if (stateblock->streamSource[i]) IWineD3DBuffer_AddRef(stateblock->streamSource[i]);
}
for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
{
stateblock->textures[i] = NULL;
}
if (stateblock->vertexShader) IWineD3DVertexShader_AddRef(stateblock->vertexShader);
stateblock->vertexDecl = NULL;
stateblock->pIndexData = NULL;
stateblock->pixelShader = NULL;
}