   Problems with SetSoftwareVertexProcessing()
  Hi!My app loads 3d mesh and renders it using dx9 and vertex shader. When I use D3DCREATE_HARDWARE_VERTEXPROCESSING and vertex shaders everything works fine. But when I use D3DCREATE_MIXED_VERTEXPROCESSING and vertex shaders and then I try to switch to hardware vert. proc. (usingSetSoftwareVertexProcessing(FALSE)) DrawIndexedPrimitive() function returns an error. (First I call SetSoftwareVertexProcessing(TRUE) immediately after creating dx9 device and then later SetSoftwareVertexProcessing(FALSE), outside of BeginScene() EndScene() pair).The shader is loaded with Cg runtime.What is wrong? 
  Do you have the Debug runtime installed?  Crank up the error level and it will likely tell you what''s wrong.(Same goes for your problem cloning the mesh) Stay Casual,KenDrunken Hyena;  Ok, but how can i "crank up the error level"?Debug runtime - you mean d3dx9d.dll? ;  Start->Control Panel->DirectX->Direct3D, select "Use Debug Version of Direct3D" and crank up the Debug Output Level slider. ;quote:Original post by zacwonder  Ok, but how can i "crank up the error level"?Debug runtime - you mean d3dx9d.dll?   Using d3dx9d enables debug output for D3DX functions.  To enable it for D3D do what Erzengeldeslichtes said.   Stay Casual,KenDrunken Hyena;  What DirectX method returns an error. One of them willCheersChris ;  Thanks for all help.I''ve used the debug runtime and I''ve found that I can switch between hardware and software vertex processing only when I specify D3DUSAGE_SOFTWAREPROCESSING while creating vertex and index buffers. When USAGE is 0 (in SDK it stands that USAGE can be either D3DUSAGE_SOFTWAREPROCESSING or 0 provided that also D3DCREATE_MIXED_VERTEXPROCESSING is specified) and I try to switch to hardware processing (or to software) there is an error:VertexBuffer should have software usage or should be in system memory.I use D3DCREATE_MIXED_VERTEXPROCESSING so everything should be ok but it is not. Buffers are in managed pool; when I put them in systemmem the error looks like this:VertexBuffer should have software usage or should be managed or should be in system memory.It''s just greatI wouldn''t mind setting buffer usage to softwareprocessing, but I''ve also found that rendering speed is always (in some cases even 100%) faster when usage is 0 (of course in both cases I use hardware vertex processing).So basically I''d love to be able to switch between software nad hardware processing while in the same time not loosing performance in hardware mode. This should be possible if buffer usage was set to 0, and device type was MIXED.But it doesn''t happen. Why?Has anybody encountered similar dx9 behaviour?PS. My graphic card is Radeon 9700PRO so it''s not fault of hardware capabilities. ;  There are basically three classes of memory where vertex buffers might live: system memory, AGP memory, and local video memory.  D3D and the video driver use the usage flags to decide which of these three types of memory to put the vertex buffer in for optimal performance.The performance characteristics of each break down roughly as so:System MemoryCPU Writes: FastCPU Reads: FastGPU Reads: Very slowAGP MemoryCPU Writes: Very fast (if you do it right)CPU Reads: Very slowGPU Reads: Moderately fastLocal Video MemoryCPU Writes: Very slowCPU Reads: Very very slowGPU Reads: Very very fastSoftware vertex processing is done completely on the CPU so the only appropriate place for the vertices is in system memory.  HWVP is done by the GPU and so the vertices belong ideally in local vidmem but AGP is acceptable.  (When you specify D3DUSAGE_DYNAMIC you''re indicating that the CPU will be frequently writing to the vertex buffer, so AGP is preferable to local vidmem.)This applies to index buffers as well, but on older chips that don''t natively support index buffers they''re always put in system memory.HTH. ;  Well, thanks for clearing things a bit, but...I still doesn''t know why I can''t specify 0 usage when creating vertex buffer with mixed type device and then switch beween software and hardware vertex processing?. For sure DX SDK says that it can be done!Or I''m misunderstanding something completelyI''ve got another question. Correct me if I''m wrong but AGP is a bus (port) isn''t it? So why are everybody talking about AGP memory? What is AGP memory? And how to explicitly specify in d3d that I want vertex buffer to be hold in AGP memory? 