Sign in to follow this  

OMSetRenderTargets is very slow on my machine.

This topic is 1121 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

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

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

This topic is 1121 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this