DirectX 12 Native Plugin: synchronise render-to-screen
Hi, I'm currently working within the Native Rendering Plugin and with some updated header files.
(https://github.com/Unity-Technologies/NativeRenderingPlugin)
I'm going for a custom D3D12 approach with my own wrapper classes etc.
At the moment I'm trying to render simple triangles with 1 colour value.
I know someone has already asked a similar question and their answer seemed to be to Blit the screen with a rendertexture
(https://forum.unity.com/threads/direct3d12-native-plugin-render-to-screen.733025/)
Instead of using a swapchain object (which is impossible, since there's no access to Unity's internal Window handle (HWND) and for good reason)
My question would be how to synchronise the GPU with Unity, both the example from Unity and some from the official DirectX GitHub seem to pause the CPU until the GPU finishes, but I absolutely do not want this since performance is of utmost importance.
Ideally I'd like to know a way to efficiently perform a Swapchain.Present(), without blocking or waiting either the CPU or GPU
(Perhaps there's something to do with the fence value that you can obtain through executing a commandlist via Unity's D3D12 interface class)
Your answer
![](https://koobas.hobune.stream/wayback/20220613061510im_/https://answers.unity.com/themes/thub/images/avi.jpg)