GstD3D11Device & WGL_NV_DX_interop2 issue
Hi all,
I'm currently trying to make a simple d3d11 -> opengl texture sharing test case work and I'm running into some issues
Gstreamer 1.24 official build, Windows 10/11
apparently the ID3D11Device created by d3d11 doesn't have MultithreadProtected flag set in ID3D11Multithread
so wglDXOpenDeviceNV/wglDXRegisterObjectNV/wglDXLockObjectsNV/wglDXUnlockObjectsNV will randomly fail/crash with a race condition or with a "Two threads were found to be executing functions associated with the same Device[Context] at the same time. This will cause corruption of memory." message
WGL_NV_DX_interop2 is relying on that ( see "Additions to the WGL_NV_DX_interop specification" )
https://registry.khronos.org/OpenGL/extensions/NV/WGL_NV_DX_interop2.txt
sieving through the gst-plugins-bad source I found that all other plugins ( nvcodec, qsv, mediafoundation ) using D3D11Memory set the MultithreadProtected flag on device creation/wrapping resulting in a stable D3D<->GL interop
I've been happily ignoring Direct3D the last couple of years, so I'm by no means an expert
Cheers & thanks in advance
/edit changed subject