Module: wine Branch: master Commit: 342faea03591e2d13851be798b5b61f9a68f9be0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=342faea03591e2d13851be798b...
Author: Michael Mc Donnell michael@mcdonnell.dk Date: Fri Aug 19 16:48:18 2011 +0200
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.
---
dlls/d3dx9_36/mesh.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index 9a0fd03..ed42883 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -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;