wined3d: Vertex declaration recording state.

Stop SetVertexDeclaration from reference counting if a stateblock is
being recorded.
This commit is contained in:
Oliver Stieber 2005-12-16 12:38:24 +01:00 committed by Alexandre Julliard
parent 13b9923165
commit 74e28a354f
1 changed files with 9 additions and 4 deletions

View File

@ -3727,16 +3727,21 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetVertexDeclaration(IWineD3DDevice* iface, IW
TRACE("(%p) : pDecl=%p\n", This, pDecl);
/* TODO: what about recording stateblocks? */
This->updateStateBlock->vertexDecl = pDecl;
This->updateStateBlock->changed.vertexDecl = TRUE;
This->updateStateBlock->set.vertexDecl = TRUE;
if (This->isRecordingState) {
TRACE("Recording... not performing anything\n");
return D3D_OK;
}
if (NULL != pDecl) {
IWineD3DVertexDeclaration_AddRef(pDecl);
}
if (NULL != This->updateStateBlock->vertexDecl) {
IWineD3DVertexDeclaration_Release(This->updateStateBlock->vertexDecl);
}
This->updateStateBlock->vertexDecl = pDecl;
This->updateStateBlock->changed.vertexDecl = TRUE;
This->updateStateBlock->set.vertexDecl = TRUE;
return D3D_OK;
}