Procházet zdrojové kódy

Merge branch 'master' of https://github.com/defold/doc

Björn Ritzl před 4 roky
rodič
revize
0c183d9672
1 změnil soubory, kde provedl 47 přidání a 21 odebrání
  1. 47 21
      docs/zh/shared/linux-faq.md

+ 47 - 21
docs/zh/shared/linux-faq.md

@@ -4,6 +4,7 @@ A: 启动 Defold 之前修改缩放参数. [参见](https://unix.stackexchange.c
 
 ```bash
 $ gsettings set org.gnome.desktop.interface scaling-factor 2
+$ ./Defold
 ```
 
 
@@ -16,52 +17,77 @@ $ GTK_CSD=0 ./Defold
 ```
 
 
-#### Q: 在新建, 打开项目时 Defold 编辑器崩溃?
+#### Q: 在 Defold 编辑器里打开集合或者游戏对象时崩溃报关于 "com.jogamp.opengl" 的错误.
+
+A: 某些Linux版本 (如 Ubuntu 18) 下 [Mesa](https://docs.mesa3d.org/) 版所使用的 jogamp/jogl Defold 版本有冲突.
+可以在调用 `glGetString(GL_VERSION)` 是设置`MESA_GL_VERSION_OVERRIDE` 为2.1或者更高的值以覆盖 GL 默认的驱动版本.
+可以使用如下命令查看系统上支持 `glxinfo` 的最高 OpenGL 版本:
+
+```bash
+glxinfo | grep version
+```
 
-A: 某些版本 (比如 Ubuntu 18) 上 Defold 使用的 jogamp/jogl 版本与系统 Mesa 版本冲突.
+输出举例 (注意 "OpenGL version string: x.y"):
 
-详情请见:
+```
+server glx version string: 1.4
+client glx version string: 1.4
+GLX version: 1.4
+Max core profile version: 4.6
+Max compat profile version: 4.6
+Max GLES1 profile version: 1.1
+Max GLES[23] profile version: 3.2
+OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.2.6
+OpenGL core profile shading language version string: 4.60
+OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.2.6
+OpenGL shading language version string: 4.60
+OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.2.6
+OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
+GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix,
+```
 
-  - https://github.com/defold/editor2-issues/issues/1905
-  - https://github.com/defold/editor2-issues/issues/1886
+使用版本 2.1 或者更高的匹配显卡的版本:
 
-使用如下代码可以绕过冲突:
+```bash
+$ MESA_GL_VERSION_OVERRIDE=2.1 ./Defold
+```
 
 ```bash
-$ export MESA_GL_VERSION_OVERRIDE=2.1
-$ ./Defold
+$ MESA_GL_VERSION_OVERRIDE=4.6 ./Defold
 ```
 
-如果问题没有解决可以尝试 (根据你自己的驱动匹配选取大于等于 2.1 的版本号):
+
+A: 某些Linux版本 (如 Ubuntu 20.04) 在運行 Defold 時會出現新的 [Mesa](https://docs.mesa3d.org/) 驅動程序 (Iris) 的問題. 可以嘗試使用舊版本驅動程序:
 
 ```bash
-$ export MESA_GL_VERSION_OVERRIDE=3.1
+$ export MESA_LOADER_DRIVER_OVERRIDE=i965
 $ ./Defold
 ```
 
 
-#### Q: 我的 OpenGL 驱动过期了. 还能用 Defold 吗?
+#### Q: 在 Defold 编辑器里打开集合或者游戏对象时崩溃报关于 "libffi.so" 的错误.
 
-A: 能用, 但是需要打开 Defold 软件渲染. 可以设置环境变量 LIBGL_ALWAYS_SOFTWARE 值为 1:
+A: 这是由于Linux系统的 [libffi](https://sourceware.org/libffi/) 版本与 Defold (版本 6 或 7) 需要的版本不一致.
+确保 `libffi.so.6` 或 `libffi.so.7` 已安装在 `/usr/lib/x86_64-linux-gnu` 路径下. 可以使用如下命令下载 `libffi.so.7`:
 
 ```bash
-~/bin/Defold$ LIBGL_ALWAYS_SOFTWARE=1 ./Defold
+$ wget http://ftp.br.debian.org/debian/pool/main/libf/libffi/libffi7_3.3-5_amd64.deb
+$ sudo dpkg -i libffi7_3.3-5_amd64.deb
 ```
 
-
-#### Q: 在 Ubuntu 20.04 上運行 Defold 報錯 "com.jogamp.opengl.GLException: Graphics configuration failed" ?
-
-A: 這個版本在運行 Defold 時會出現新驅動程序 (Iris) 問題. 可以嘗試使用舊版本驅動程序:
+然后需要在环境变量 `LD_PRELOAD` 中指定安装路径再启动 Defold:
 
 ```bash
-$ export MESA_LOADER_DRIVER_OVERRIDE=i965
-$ ./Defold
+$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.7 ./Defold
 ```
 
-可能还需要指定载入 libffi 版本 6 才能启动 Defold:
+
+#### Q: 我的 OpenGL 驱动过期了. 还能用 Defold 吗?
+
+A: 能用, 但是需要打开 Defold 软件渲染. 可以设置环境变量 LIBGL_ALWAYS_SOFTWARE 值为 1:
 
 ```bash
-$ export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.6
+~/bin/Defold$ LIBGL_ALWAYS_SOFTWARE=1 ./Defold
 ```