Jump to content

  • Log In with Google      Sign In   
  • Create Account

WPF and SlimDX (DirectX 11) interop


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Opwiz   Members   -  Reputation: 293

Like
0Likes
Like

Posted 27 March 2012 - 07:19 AM

Hello, posted this on StackOverflow (http://stackoverflow...ectx-11-interop) but figured that this might be a better forum to post my question. Here it is:

 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 (20 FPS) when rendering simple scenes (e.g. GameOfLife in the SlimDX samples) at high resolution (2560x1440). 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.

_d3dImage.Lock(); // <- this call takes 78,5 % of the time when rendering the frame
_d3dImage.AddDirtyRect(new Int32Rect(0, 0, _d3dImage.PixelWidth, _d3dImage.PixelHeight));
_d3dImage.Unlock();

A lot of time is spent flushing the device after drawing:
_device.ImmediateContext.Flush(); // <- 20,6% of the time when rendering the frame

Anyone know the problem and how to optimize this? Can you expect to get descent performance when integrating WPF and SlimDX?
 
I've used the same rendering code and initialization as in the SlimDX WPF interop sample (for DirectX 10), just modified it so it uses DirectX 11 instead. Seeing as it spends much time waiting for the D3DImage to get unlocked, it seems to me that WPF is keeping it locked alot for some reason (I'm not updating any WPF controls). Any Ideas?

Thanks

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS