   bottleneck: IDirect3DSwapChain9::Present
  I have been working on an engine for quite a while now.  I was only getting 60 fps for a couple of thousand polygons so I just assumed it was down my very unoptimised abstraction.  Yet when I added a couple more objects to the procedure, the frame rate did not drop even though 10s of 1000s of evtra triangles were being added.So I thought there must be a specific section causing me problems.  I made my self a profiler and I found that my logic was taking up a measly 5%.  All the rest is down to one function which calls IDirect3DSwapChain9:: Present(NULL, NULL, NULL, NULL, 0);Why is this so incredibly slow?Here are several flags that D3DPRESENT_PARAMETERS are set to:PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;FullScreen_RefreshRateInHz = 0;Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;MultiSampleType = D3DMULTISAMPLE_NONE;SwapEffect = D3DSWAPEFFECT_DISCARD;The device and swapchain uses it.// edit// changed  to : P[edited by - Drath on February 3, 2004 5:53:35 PM]
  PresentInterval default means PresentInterval one, which means wait for v-sync, which means go 60Hz.  Use PresentInterval Immediate to unlock your framerate from refreshrate.;  It does not help...My parameters are now exactly the same as the example version.I have converted the Present call a device call instead of a swapchain one.In contrast, all the DirectX examples run at way higher rates. ;  Well it seems that the rendering time is not spent during the render calls.  I have checked around and if I eliminate Present(...) nothing changes, while if I eliminate my render operations the fps goes up.  The graphics card works outside the functions meaning that the time is a wrong measure. ;  Never rely on the time spent in present.  This is were the driver will go through the display list and command que it is given by Direct X.Another thing that present will spend time on is if your sync''d to the monitor''s refresh,  the runtime will just spin in the present call until the current frame time is up and then return control to your app.  Present itself is not a single call, its actually where the Direct X runtime performs alot of its work.CheersChris 