sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.69k stars 641 forks source link

DXGI.SwapChain3.FrameLatencyWaitableObject and IDisposable #1007

Open BEEden opened 6 years ago

BEEden commented 6 years ago

Hi all,

Thanks for making SharpDX such a wonderful library. I've put it to great use and although I've had no major problem with it so far, I have a couple of questions/issues:

  1. FrameLatencyWaitableObject -- I'm trying to make use of this, using an WaitHandle, RegisteredWaitHandle and ThreadPool.RegisterWaitForSingleObject. Sure enough, when SwapChain.Present() is called, Update() (Which I specified as the callback in RegisterWaitForSingleObject) is called on a ThreadPool thread. But, that's all it does. Changing the TimeOut value does nothing, Set'ing or Reset'ing the WaitHandle raises a WinIO Exception saying "The Handle is Invalid" and calling WaitOne() seems to have no effect either. Am I missing something?

  2. I noticed the DisposeCollector in the SharpDX Toolkit. Is something like this necessary to properly clean up, or will calling Dispose() take care of garbage collection? I'm getting a lot of live objects persisting after my application has exited, according to the D3DDebug in the Output window. None of the methods in the SharpDX.Diagnostics seem to produce any output.

Many thanks in advance, and keep up the excellent work!

BEEden commented 6 years ago

Please disregard the second part of my query -- I found Direct3D11.DeviceDebug and now have verbose reporting.