   Background thread rendering and timing (WPF too)
  I'm trying to render to a surface on a background thread and copy its contents to WPF on the main thread (using D3DImage). I think this is more of a D3D issue than WPF. I'm using SlimDX and D3D9.The problem is that after I've made all my D3D calls to render the scene, I don't know when the rendering actually occurs and when the surface would be valid to use. I'm also unsure whether there are implementation details in WPF's copy (D3DImage.Unlock()) that I should be aware of, such as performing the copy on its own render thread. As a result, I see occasional flickering and tearing.If I render on the main thread, I can produce a similar result when using multiple D3DImage viewports with a single shared surface. I have a loop that renders and copies to each viewport in succession, but the viewports appear to flicker among any of the scenes that are being rendered. This indicates a timing issue to me.So, is there any way I can control or determine when rendering has actually completed?Thanks!   