Wgl_nv_dx_interop calls ID3D11DeviceContext::Flush with D3D10 context

Hello !

I’m having issues with the WGL-DX interop. I am using OpenGL in a thread and pushing commands to it.
I create a SwapChain with a single buffer using D3D10 Factory, register the buffer, draw to it using OGL, and Present the buffer to the Window using the DXGI SwapChain.

When using D3D10, on EVERY wglDX calls I get this warning : D3D11 WARNING: ID3D11DeviceContext::Flush: This ID3D11DeviceContext method of the immediate context is locked out because an ID3D10Device[1] device context state is active. [ STATE_SETTING WARNING #3145945: DEVICE_LOCKEDOUT_INTERFACE]

Also, when using D3D11, I get a _com_error every time I call wglDXRegisterObjectNV when registering new buffers when resizing the SwapChain, and I get a memory leak.

And when trying to use more than one buffer in the SwapChain, I randomly loose the D3D context when registering the buffers with wglDX…

The program is working as expected despite the warnings and error messages…

Hello @gpinchon and welcome to the NVIDIA developer forums!

Good to hear that your project works despite the warnings!
Of course I can understand that you want to have your code run as smoothly as possible, so I will try to get some of our OGL experts to look at your warnings.