Use MESA_LOADER_DRIVER_OVERRIDE on Linux (#2146)

This commit is contained in:
Glavo 2023-02-24 01:56:01 +08:00 committed by GitHub
parent af63c3aa3a
commit 0eac7b5d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,15 +470,21 @@ public class DefaultLauncher extends Launcher {
env.put("INST_JAVA", options.getJava().getBinary().toString());
Renderer renderer = options.getRenderer();
if (renderer != Renderer.DEFAULT && OperatingSystem.CURRENT_OS != OperatingSystem.OSX) {
if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX) {
if (renderer != Renderer.DEFAULT) {
if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) {
if (renderer != Renderer.LLVMPIPE)
env.put("GALLIUM_DRIVER", renderer.name().toLowerCase(Locale.ROOT));
} else if (OperatingSystem.CURRENT_OS == OperatingSystem.LINUX) {
env.put("__GLX_VENDOR_LIBRARY_NAME", "mesa");
if (renderer == Renderer.LLVMPIPE)
env.put("LIBGL_ALWAYS_SOFTWARE", "1");
switch (renderer) {
case LLVMPIPE:
env.put("LIBGL_ALWAYS_SOFTWARE", "1");
break;
case ZINK:
env.put("MESA_LOADER_DRIVER_OVERRIDE", "zink");
break;
}
}
if (renderer != Renderer.LLVMPIPE)
env.put("GALLIUM_DRIVER", renderer.name().toLowerCase(Locale.ROOT));
}
LibraryAnalyzer analyzer = LibraryAnalyzer.analyze(version);