Original Post
Hey, As a school project I'm currently developing a renderingframework with some features to enable gameplay-programming. Everything was going great, untill today. A few hours ago, I started testing the rendering performance on large scenes, and as it turns out, with only 200 planes to render (shared vertex-/index-buffer) my framerate nearly reaches 4. I profiled the render-cycle, and it looks as if calling the Present(0, 0, 0, 0); method on my device-pointer takes about 200msec. It might be interesting to know that the framework renders the scene on a seperate-thread than the main thread and that the device is created with the D3DCREATE_MULTITHREADED flag. (which doen't seems to make any difference)
// Behaviour flags
devBehaviourFlags = D3DCREATE_PUREDEVICE | D3DCREATE_MULTITHREADED | D3DCREATE_HARDWARE_VERTEXPROCESSING;
// presentParams
m_ePP.BackBufferWidth = 1280;
m_ePP.BackBufferHeight = 768;
m_ePP.BackBufferFormat = bFullscreen ? D3DFMT_X8R8G8B8 : m_eDisplayMode.Format;
m_ePP.BackBufferCount = 1;
m_ePP.MultiSampleType = D3DMULTISAMPLE_NONE;
m_ePP.MultiSampleQuality = 0;
m_ePP.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_ePP.hDeviceWindow = KiCodil::GetRenderWindow()->GetWindow();
m_ePP.Windowed = !bFullscreen;
m_ePP.EnableAutoDepthStencil = true;
m_ePP.AutoDepthStencilFormat = D3DFMT_D24X8;
m_ePP.Flags = 0;
m_ePP.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
m_ePP.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
// before rendering
HR(m_pDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_RGBA(255, 255, 255, 0), 1.0f, 0));
HR(m_pDevice->BeginScene());
// after rendering
HR(m_pDevice->EndScene());
HR(m_pDevice->Present(NULL, NULL, NULL, NULL)); <= this devil takes about 200msec each frame
So, anybody any ideas on how to speed up the Present(0, 0, 0, 0); ?