Jump to content
  • Advertisement
Sign in to follow this  
Volgogradetzzz

OMSetRenderTargets is very slow on my machine.

This topic is 1332 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings.

 

I have a very simple application - just a triangle. And I'm experiencing a performance problem I have a strange execution time for rendering. Sometimes it takes 33ms and sometimes 16ms. Looks like 30 and 60 fps. I narrowed problem a found that only OMSetRenderTargets method takes so much time.

 

This code causes problems:

chrono::high_resolution_clock::time_point t1 = chrono::high_resolution_clock::now();

// set targets and states
context->OMSetRenderTargets(1, ppRenderTargetViews, pDepthStencilView);

chrono::high_resolution_clock::time_point t2 = chrono::high_resolution_clock::now();
auto duration = chrono::duration_cast<chrono::milliseconds>(t2 - t1).count();

Share this post


Link to post
Share on other sites
Advertisement

The information provided isnt enough,

 

Can you be more specific? How often (per frame) you call OMSetRenderTargets? How many render targets are needed to render one frame?

 

PS:

Have you tried to replace "chrono" with GetPerformace/FreqCounter or timeGetTime()? I had bad experience with chrono.

Share this post


Link to post
Share on other sites
Disable v-sync. 

 

L. Spiro, how? As far as I know in windowed mode vsync is off by default and there's no way to enable it. And I have the same problems in windowed mode.

Share this post


Link to post
Share on other sites

Oh. Thank you. Also I noticed that DXGI_SWAP_CHAIN_DESC::SwapEffect also have an effect on fps. But DXGI_SWAP_CHAIN_DESC::BufferDesc::RefreshRate have no effect at all. Can someone please explain how this works in simple words. I've read msdn but it so dry and it's hard to understand for not experienced guy like me.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!