Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDXGIKeyedMutex::ReleaseSync when is rendering "done"?

Tags:

c++

direct3d

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?

like image 831
ronag Avatar asked Jan 22 '26 02:01

ronag


1 Answers

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.

like image 119
lancery Avatar answered Jan 23 '26 14:01

lancery



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!