I'm looking at the documentation for IDXGIKeyedMutex and I'm a bit unsure regarding the following:
You must call the ReleaseSync method when you are done rendering to a surface.
My question is what does "when you are done rendering" mean? Is it after is remove the texture as the render target for the immidiate context, when I call Flush on the immediate context or do I need some other form of GPU fence/sync before I can call ReleaseSync?
Also why is D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX preferred over D3D11_RESOURCE_MISC_SHARED?
You should call IDXGIKeyedMutex::ReleaseSync after you have called the ID3D11DeviceContext::Draw calls or other calls to issue GPU commands to write to the buffer (i.e. ID3D11DeviceContext::CopyResource). You don't need to explicitly call Flush. For a sample of using AcquireSync/ReleaseSync, please look at http://code.msdn.microsoft.com/DXGISyncSharedSurf
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX is preferred over D3D11_RESOURCE_MISC_SHARED because it can be used with D3D11_RESOURCE_MISC_SHARED_NTHANDLE, which provides better security for cross-proc surface sharing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With