   CloneMeshFVF() returns error due tu lack of memory
  When I try to load bigger mesh from an .x file (around 30k vertices) in dx9 using D3DXLoadMeshFromX() and then CloneMeshFVF() (to set FVF), it returns an error beacuse of lack of memory. I tried using D3DXMESH_MANAGED and D3DXMESH_SYSTEMMEM. I''ve got gefoce2mx 32mb card and 256mb ram.Here is the clone mesh call:LPD3DXMESH pTempMesh = NULL;g_pMesh->CloneMeshFVF( D3DXMESH_MANAGED, dwFVF, g_pd3dDevice,  &pTempMesh );g_pMesh->Release();g_pMesh = pTempMesh;pTempMesh = NULL;How can I solve this?Thanks for help. 
  Are you sure that you''re getting an out of memory error?  Remember that eventhough CloneMeshFVF says it can return D3DERR_INVALIDCALL and E_OUTOFMEMORY, that doesn''t mean that those are the only two errors it will ever return.If you''re getting this error even when you create the mesh in system memory, there has got to be something else wrong.  I doubt you''re using all of your 256MB of system RAM.  Even if you were, Windows would still switch to virtual memory anyway.Try to call D3DXValidMesh on the original mesh before you try to clone it.  See if it returns an error value.  If your original mesh is from an .x file, try to load it in MeshView and validate/clean it in there and re-save it.neneboricua ;  You''re GF2 32mb card may be the source of your problem.  If you loaded the original mesh successfully (already 30k verts) and attempted to clone that (putting total to 60k verts (and index buffer, too)), you may be over the available video memory, considering all the other things that are allocated there.However, you may not be allocating memory on the vid card.  Does D3DXMESH_MANAGED pick which one, or is it system memory only?   Dustin Franklin   Mircrosoft DirectX MVP ;  If you link to the debug version of D3DX (d3dx9d.lib) it may give you more information in the debug spew to help you track down the problem. Stay Casual,KenDrunken Hyena;  Link to d3dx9d.lib (debug d3dx library). Use the debug runtime, check the debut output. It'll tell you why it failed.   Muhammad Haggag[edit]Ken has already beat me to this, it seems . I had the page open for a long time, so I didn't see his reply[/edit]   [edited by - Coder on February 5, 2004 10:13:00 PM];  Thanks for all help.I checked again and it turned out that CloneMeshFVF returns with D3DERR_INVALIDCALL!! I don''t know why I thought that it was with E_OUTOFMEMORY;(Anyway why INVALID_CALL? And only with big meshes. I''m calling D3DXValidMesh() just before CloneMeshFVF() and it''s ok!.How to use the debug rutime? First, link to d3dx9d, ok but what next(debug spew?, debug output?)?Help please! ;  It could be returning INVALIDCALL because maybe your FVF isn''t set up right.  Or it could be that something is wrong with the mesh object you''re calling Clone on.The Debug Runtime is selected from the DX settings in the Control Panel.  Once you click on the DX icon in the Control Panel, select the Direct3D tab.  Then click on "Use Debug Version of Direct3D".  While you''re at it, make sure the Debug Output Level is at max.  This will cause D3D to output more debug info to the debug spew.If you don''t see the DX icon inside your Control Panel, then that means that when you installed the DX SDK you didn''t tell it to install the Debug Runtimes as well.  In that case, you''ll need to uninstall the SDK and reinstall it.  This time, make sure that you select specifically to use the Debug Runtimes.  Once you''ve installed them, you can always switch back and forth between Debug and Release Runtimes by using the Control Panel.neneboricua 