Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
739 stars 185 forks source link

performance: Use fence to sync between GPU/CPU in D3D11 #923

Closed karasusan closed 1 year ago

karasusan commented 1 year ago

This pull request improves the performance of the rendering thread which caused by the waiting time for rendering commands to copy render textures.

The past implementation is waiting the ID3D11DeviceContext::Flush to wait completion of rendering process, therefore it increases the load on rendering thread. In this change, by using ID3D11Fence to wait GPU process on the worker thread, it decreases the load on the rendering thread.

Currently, we are developing the same change for D3D12.