Unity-Technologies / com.unity.uiwidgets

UIWidgets is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.
https://unity.cn/uiwidgets
626 stars 78 forks source link

Zxw/3d mac #318

Closed zhuxingwei closed 2 years ago

zhuxingwei commented 2 years ago

In this PR we are trying to support OpenGL backend on Mac/iOS and external texture on it, mainly including the following changes: (1) fix the C# side codes so that the UIWidgetsPanel can now handle both Metal and OpenGLCore/OpenGLES backends on Mac/iOS respectively via different C++ bindings.

(2) refine the UIWidgets engine codes on the C++ side to fix issues caused by OpenGL context switching: Specifically, since we have to deal with both the openGL context of UIWidgets engine itself and that of Unity engine, we need a more careful approach to guarantee that the two kinds of openGL context doesn't mess around with each other. This situation doesn't not happen for flutter.

(3) refine the UIWidgetsPanel as well as SurfaceManager codes on C++ side to support both Metal and OpenGLCore/OpenGLES backends

(4) add the support of external native texture for OpenGLCore/OpenGLES backends on Mac/iOS respectively

(5) update the build code a bit so that it now support building iOS plugin with Mac 12 SDK

In this PR, we also add support for linear colorspace support on all platforms.