title: DirectX 11 SwapChain::Present issue
body: <p>I've quite the weird problem at my hand here.
  I'm using directx 11 to make my own game framework/engine and it has worked fine until i tried to implement frustum culling which gave me really weird framerate issues.</p>
  
  <p>I've simplifed the problem a bit so it happens without me doing any frustum culling. Right now I have 250 models rendered on my screen, 70 fps in debug. I've made it so that if i hold in the button H it skips the rendering of my models in my Application::Render but if i do this and then let go of the button again, my framerate is tops around 40 afterwards most times around 4 fps even. Profiling shows me it's SwapChain::Present that all of a sudden takes way longer time then it ever should.</p>
  
  <p>In Release it's the same problem, this only happens if i got the debugger attached btw. I can't really figure this one out myself.</p>
  
  <p>Tried rebuilding and rebooting.</p>
  
  <p>my present function:</p>
  
  <pre><code>m_pSwapChain-&gt;Present( 0, 0);
  </code></pre>
  
  <p>My Application::Render function:</p>
  
  <pre><code>void CApplication::Render() const
  {
      CD3D::Instance()-&gt;BeginRender();
  
      //Render 3d
      if ( !CInputSystem::Instance()-&gt;IsKeyPressed('H'))
      {
          std::vector&lt;CPlanet*&gt;::const_iterator it;
          for (it = m_Planets.begin(); it != m_Planets.end(); ++it)
          {
              (*it)-&gt;Render();
          }
      }
      // Render 2d
      m_pScreenSprite-&gt;Render();
  
      CTextSystem::Instance()-&gt;Render2D();
      CD3D::Instance()-&gt;EndRender();
  }
  </code></pre>
  
  <p>This is how my profiling looks before stopping my models to be rendered by pressing H:</p>
  
  <pre><code>[Profiler] BeginRender: 2.830984218768823e-005
  [Profiler] Models::Render: 1.4456089627755692e-005
  [Profiler] Text|Sprite ::Render: 0.00015811348030357787
  [Profiler] EndRender: 0.00018853150222864715
  [Profiler] CApplication::Render(): 0.00067612335863149022
  </code></pre>
  
  <p>After I've pressed H for a second then released it so the models are being rendered again:</p>
  
  <pre><code>[Profiler] BeginRender: 2.4996988314660883e-005
  [Profiler] Models::Render: 0.0091422720154198285
  [Profiler] Text|Sprite ::Render: 0.00011655222262378027
  [Profiler] EndRender: 0.2590757137694254
  [Profiler] CApplication::Render(): 0.26870557764124803
  </code></pre>
  
  <p>I also tried, instead of not rendering my models when i press H, I create a new model when i press C which has the same effect. So if the number of models rendered changes in any way during runtime my framerate goes crazy.</p>
  
  <p>This doesn't happen if i have fraps running(was going to capture the behavior so you could see it). Duno if that's a clue to anything.</p>
  
  <p>FIXED! Look at comment below</p>