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();