d3dx9: Use 0 instead of D3DLOCK_DISCARD in OptimizeInPlace.

It does not make sense to use D3DLOCK_DISCARD for locking a newly created
vertex buffer because it will be allocated, freed, and then allocated again.
This commit is contained in:
Michael Mc Donnell 2011-08-19 16:48:18 +02:00 committed by Alexandre Julliard
parent 97556eb061
commit 342faea035

View file

@ -1293,7 +1293,7 @@ static HRESULT WINAPI ID3DXMeshImpl_OptimizeInplace(ID3DXMesh *iface, DWORD flag
hr = IDirect3DVertexBuffer9_Lock(This->vertex_buffer, 0, 0, (void**)&orig_vertices, D3DLOCK_READONLY);
if (FAILED(hr)) goto cleanup;
hr = IDirect3DVertexBuffer9_Lock(vertex_buffer, 0, 0, (void**)&new_vertices, D3DLOCK_DISCARD);
hr = IDirect3DVertexBuffer9_Lock(vertex_buffer, 0, 0, (void**)&new_vertices, 0);
if (FAILED(hr)) {
IDirect3DVertexBuffer9_Unlock(This->vertex_buffer);
goto cleanup;