Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
738 stars 185 forks source link

performance: Use GLsync to wait commandbuffer GPU process on GLCore/GLES #943

Closed karasusan closed 10 months ago

karasusan commented 11 months ago

This PR improves a CPU load of Render thread when using video encoding with OpenGL or GLES. It uses GLSync instead of glFinish to sync GPU and CPU.

Specifically, the process time of UnityVideoTrackSource.OnFrameCaptured is dramatically reduced.

Before

Screenshot from 2023-08-30 14-26-10

After

Screenshot from 2023-08-30 14-21-42