title: WPF and SlimDX (DirectX 11) interop
body: <p>Hello I've managed to integrate SlimDX and DirectX 11 graphics in a WPF application by using D3DImage and shared textures. However, but I'm getting some really poor performance when rendering simple scenes (e.g. GameOfLife in the SlimDX samples) at high resolution (2560x1440).</p>
  
  <p>I've tried doing some performance profiling of my render method and it looks like most of the time is spent on locking the D3DImage when invalidating the backbuffer. </p>
  
  <pre><code>_d3dImage.Lock(); // &lt;- this call takes 78,5 % of the time when rendering the frame
  _d3dImage.AddDirtyRect(new Int32Rect(0, 0, _d3dImage.PixelWidth, _d3dImage.PixelHeight));
  _d3dImage.Unlock();
  </code></pre>
  
  <p>A lot of time is spent flusing the device after drawing:</p>
  
  <pre><code>_device.ImmediateContext.Flush(); // &lt;- 20,6% of the time when rendering the frame
  </code></pre>
  
  <p>Anyone know the problem and how to optimize this? Can you expect to get descent performance when integrating WPF and SlimDX? </p>