Shared Render Target between two D3D11Devices

Started by
1 comment, last by ProgramYourFace 5 years, 8 months ago

I am using 2 directx devices, one to render in my native C++ plugin and the other belongs to Unity. I do the rendering in my plugin but then I send the render target to the unity graphics pipeline. This works generally, but sometimes there is a flicker in the resulting render. I recorded it and slowed it down and it appears as if the frame is in the process of being rendered, one mesh has missing triangles as if it was in the process of drawing the rest of the triangles, and most of the rest of the meshes are completely missing.

 

My question is, how do I force the render to finish before it is accessed again in the shared resource from unity rendering pipeline? I am already using a mutex lock but that doesn't seam to work, it seems like I need to synchronize from the graphics card. I used a IDXGIKeyedMutex but that actually stopped everything from rendering for some reason, maybe I used it wrong, I don't know. Any help would be much appreciated.

 

 

Capture.PNG

Advertisement

I fixed it. It turned out that it was that I needed to use a IDXGIKeyedMutex. I just didn't use it right the first time. You have to release the mutex AFTER you flush the context not before.

This topic is closed to new replies.

Advertisement