PojavLauncher icon indicating copy to clipboard operation
PojavLauncher copied to clipboard

Zink, but swapchain-based

Open artdeell opened this issue 1 year ago • 29 comments

Features:

  • Zink with swapchain
  • Auto-loading of Turnip for Adreno users

Bugs:

  • Broken rendering and awful performance on Adreno due to a bug in either Zink or Turnip

Mesa: https://github.com/artdeell/zink-mesa Turnip: https://github.com/MrPurple666/freedreno-CI/actions/runs/5165805314

artdeell avatar Jun 05 '23 18:06 artdeell

Android 13 (Poco X4 GT), (Dimensity 8100) Mali-G610 MC6. Crashes when entering version 1.7.10 and 1.12.2. just throws out of the launcher on the main screen, without errors

Eggir avatar Jun 06 '23 06:06 Eggir

At this moment, the renderer is only work with 1.17+ above only. try downgrade your version to The Judge build zink.

Mario191209 avatar Jun 06 '23 06:06 Mario191209

8gen2选用zink渲染器打开游戏闪退

Heartbeat23333 avatar Jun 11 '23 08:06 Heartbeat23333

is it possible to use vendor vulkan driver rather than turnip? currently turnip dont have too much compatibility (only works for a6xx). and also have bad performance compare to vendor(qcom) one. here is a example of how to compile a mesa/zink that using vendor vulkan driver. it should works on device even turnip not supported

rhjdvsgsgks avatar Jun 13 '23 04:06 rhjdvsgsgks

@rhjdvsgsgks the problem is that the vendor qcom driver doesn't support enough features for zink to work, so we use turnip by default. It's planned to add checks if your adreno is supported and not swapping the driver if necessary

artdeell avatar Jun 13 '23 07:06 artdeell

@artdeell in my test. glxinfo shows it (zink on qcom vulkan driver) can provide upto compat profile 2.1. which is similar to gl4es. i think the logic should: if a gpu (a6xx) supported by turnip. then use it to get higher opengl version. otherwise, use vendor vulkan driver (just like current state for mali gpu). at least it may able to run some old version that not requiring high opengl version. it is better force all adreno to use turnip and cause a crash on startup.

rhjdvsgsgks avatar Jun 13 '23 08:06 rhjdvsgsgks

When i tested it on my device it didn't work at all cuz my version of the driver ioesn't have VK_KHR_imageless_framebuffer and VK_KHR_timeline_semaphore

artdeell avatar Jun 13 '23 08:06 artdeell

i just tried the last commit before zink been removed (fa78ff0642af2adc2b0d2e8ced1741235732ce1b). seems it works fine even without these extension. but got pretty bad performance (25fps compare to virgl 90fps).

i also compared performance of gl4es on this commit and head. it is a big drop. from 45fps (or 200fps with sodium) to 2. what happened to it?

rhjdvsgsgks avatar Jun 13 '23 13:06 rhjdvsgsgks

This commit had old Zink from Mesa 20.3 if i recall correctly, which had leaner requirements and worse performance overall

artdeell avatar Jun 13 '23 14:06 artdeell

VK_KHR_timeline_semaphore and VK_KHR_imageless_framebuffer introduced in 22.2 . maybe we can ship a mesa 22.1.7 for the device doesnt support them? or revert part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904

rhjdvsgsgks avatar Jun 13 '23 14:06 rhjdvsgsgks

VK_KHR_timeline_semaphore and VK_KHR_imageless_framebuffer introduced in 22.2 . maybe we can ship a mesa 22.1.7 for the device doesnt support them? or revert part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904

Zink had a lot of performance improvement commits between 22 and 23, so yeah, no Reverting is not possible anymore, changes in zink are too big

artdeell avatar Jun 13 '23 18:06 artdeell

Vanilla Minecraft 1.20.1 loads to a black screen, then crashes on my Pixel 6 Pro. Same with 1.19.2.

latestlog.txt (1.20.1)

Is there more setup required than just setting the renderer to "zink"?

unilock avatar Jun 14 '23 18:06 unilock

VK_KHR_timeline_semaphore and VK_KHR_imageless_framebuffer introduced in 22.2 . maybe we can ship a mesa 22.1.7 for the device doesnt support them? or revert part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904

Zink had a lot of performance improvement commits between 22 and 23, so yeah, no Reverting is not possible anymore, changes in zink are too big

i just found that there already have the revert patch exist. which is small and easy to apply https://github.com/alexvorxx/Zink-Mesa-Xlib/commit/8dde62c532a55b38d715517d69e1fd1fb77ccc45 https://github.com/alexvorxx/Zink-Mesa-Xlib/commit/23c9c9b18977f4b15e4c89c71c5a24bbde5d8c9c

rhjdvsgsgks avatar Jul 21 '23 07:07 rhjdvsgsgks

VK_KHR_timeline_semaphore and VK_KHR_imageless_framebuffer introduced in 22.2 . maybe we can ship a mesa 22.1.7 for the device doesnt support them? or revert part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904

Zink had a lot of performance improvement commits between 22 and 23, so yeah, no Reverting is not possible anymore, changes in zink are too big

i just found that there already have the revert patch exist. which is small and easy to apply alexvorxx/Zink-Mesa-Xlib@8dde62c alexvorxx/Zink-Mesa-Xlib@23c9c9b

So this patch can be used to make some devices that do not support the above features use GPU-based Zink?

Pevernow avatar Jul 24 '23 05:07 Pevernow

Android 13, CPU: Dimensity9200+, GPU:Immortalis-G715,Mesa23.0.4zink,What is the solution to flashing during startup loading?

mcghjbcg avatar Jul 29 '23 12:07 mcghjbcg

Android 13, CPU: Dimensity9200+, GPU:Immortalis-G715,Mesa23.0.4zink,What is the solution to crashes when starting loading?

mcghjbcg avatar Jul 29 '23 12:07 mcghjbcg

Send latestlog

Mario191209 avatar Jul 29 '23 12:07 Mario191209

发送最新日志 --------- beginning with launcher debug Info: Launcher version: LOCAL-20230605 Info: Architecture: arm64 Info: Device model: vivo V2302A Info: API version: 33 Info: Selected Minecraft version: 1.20.1 Info: Custom Java arguments: "" logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

Added custom env: TMPDIR=/data/user/0/net.kdt.pojavlaunch.debug/cache Added custom env: AWTSTUB_WIDTH=2726 Added custom env: FORCE_VSYNC=false Added custom env: POJAV_NATIVEDIR=/data/app/~~GEOEkdk6iJNLhzStjbxQBg==/net.kdt.pojavlaunch.debug-xflPVyTQ79RRjyQ-hSxfAg==/lib/arm64 Added custom env: REGAL_GL_VERSION=4.5 Added custom env: REGAL_GL_VENDOR=Android Added custom env: LIBGL_MIPMAP=3 Added custom env: allow_higher_compat_version=true Added custom env: MESA_GLSL_CACHE_DIR=/data/user/0/net.kdt.pojavlaunch.debug/cache Added custom env: HOME=/storage/emulated/0/Android/data/net.kdt.pojavlaunch.debug/files Added custom env: PATH=/data/user/0/net.kdt.pojavlaunch.debug/runtimes/Internal-17/bin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin Added custom env: LIBGL_NOINTOVLHACK=1 Added custom env: force_glsl_extensions_warn=true Added custom env: LIBGL_NORMALIZE=1 Added custom env: LD_LIBRARY_PATH=/data/user/0/net.kdt.pojavlaunch.debug/runtimes/Internal-17/lib/jli:/data/user/0/net.kdt.pojavlaunch.debug/runtimes/Internal-17/lib:/system/lib64:/vendor/lib64:/vendor/lib64/hw:/data/app/~~GEOEkdk6iJNLhzStjbxQBg==/net.kdt.pojavlaunch.debug-xflPVyTQ79RRjyQ-hSxfAg==/lib/arm64 Added custom env: POJAV_RENDERER=vulkan_zink Added custom env: LIBGL_ES=2 Added custom env: VTEST_SOCKET_NAME=/data/user/0/net.kdt.pojavlaunch.debug/cache/.virgl_test Added custom env: MESA_LOADER_DRIVER_OVERRIDE=zink Added custom env: MESA_GLSL_VERSION_OVERRIDE=460 Added custom env: JAVA_HOME=/data/user/0/net.kdt.pojavlaunch.debug/runtimes/Internal-17 Added custom env: MESA_GL_VERSION_OVERRIDE=4.6 Added custom env: allow_glsl_extension_directive_midshader=true Added custom env: REGAL_GL_RENDERER=Regal Added custom env: AWTSTUB_HEIGHT=1260 logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

2023-07-29 20:54:05,283 main ERROR appender Console has no parameter that matches element Policies logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

[20:54:05] [main/WARN]: Failed retrieving info for group processor java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native at com.sun.jna.NativeLong.(NativeLong.java:35) ~[jna-5.12.1.jar:5.12.1 (b0)] at oshi.util.FileUtil.readNativeLongFromBuffer(FileUtil.java:240) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.driver.linux.proc.Auxv.queryAuxv(Auxv.java:59) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.software.os.linux.LinuxOperatingSystem.(LinuxOperatingSystem.java:106) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.platform.linux.LinuxCentralProcessor.initProcessorCounts(LinuxCentralProcessor.java:171) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.common.AbstractCentralProcessor.(AbstractCentralProcessor.java:83) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.platform.linux.LinuxCentralProcessor.(LinuxCentralProcessor.java:71) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.createProcessor(LinuxHardwareAbstractionLayer.java:62) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.util.Memoizer$1.get(Memoizer.java:87) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68) ~[oshi-core-6.2.2.jar:6.2.2] at ab.c(SourceFile:75) ~[1.20.1.jar:?] at ab.a(SourceFile:82) ~[1.20.1.jar:?] at ab.a(SourceFile:75) ~[1.20.1.jar:?] at ab.c(SourceFile:52) ~[1.20.1.jar:?] at ab.a(SourceFile:82) ~[1.20.1.jar:?] at ab.(SourceFile:52) ~[1.20.1.jar:?] at o.(SourceFile:34) ~[1.20.1.jar:?] at o.h(SourceFile:274) ~[1.20.1.jar:?] at net.minecraft.client.main.Main.main(SourceFile:164) ~[1.20.1.jar:?] Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /storage/emulated/0/Android/data/net.kdt.pojavlaunch.debug/files/.cache/JNA/temp/jna14518903647044409225.tmp: dlopen failed: library "/storage/emulated/0/Android/data/net.kdt.pojavlaunch.debug/files/.cache/JNA/temp/jna14518903647044409225.tmp" needed or dlopened by "/data/data/net.kdt.pojavlaunch.debug/runtimes/Internal-17/lib/server/libjvm.so" is not accessible for the namespace "classloader-namespace" [in thread "main"] at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?] at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source) ~[?:?] at jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) ~[?:?] at jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) ~[?:?] at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:?] at java.lang.Runtime.load0(Unknown Source) ~[?:?] at java.lang.System.load(Unknown Source) ~[?:?] at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1045) ~[jna-5.12.1.jar:5.12.1 (b0)] at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015) ~[jna-5.12.1.jar:5.12.1 (b0)] at com.sun.jna.Native.(Native.java:221) ~[jna-5.12.1.jar:5.12.1 (b0)] at com.sun.jna.platform.linux.Udev.(Udev.java:37) ~[jna-platform-5.12.1.jar:5.12.1 (b0)] at oshi.software.os.linux.LinuxOperatingSystem.(LinuxOperatingSystem.java:93) ~[oshi-core-6.2.2.jar:6.2.2] ... 15 more [20:54:05] [main/WARN]: Failed retrieving info for group memory java.lang.NoClassDefFoundError: Could not initialize class oshi.software.os.linux.LinuxOperatingSystem at oshi.hardware.platform.linux.LinuxGlobalMemory.(LinuxGlobalMemory.java:47) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.createMemory(LinuxHardwareAbstractionLayer.java:57) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.util.Memoizer$1.get(Memoizer.java:87) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.common.AbstractHardwareAbstractionLayer.getMemory(AbstractHardwareAbstractionLayer.java:80) ~[oshi-core-6.2.2.jar:6.2.2] at ab.a(SourceFile:77) ~[1.20.1.jar:?] at ab.a(SourceFile:82) ~[1.20.1.jar:?] at ab.a(SourceFile:77) ~[1.20.1.jar:?] at ab.c(SourceFile:52) ~[1.20.1.jar:?] at ab.a(SourceFile:82) ~[1.20.1.jar:?] at ab.(SourceFile:52) ~[1.20.1.jar:?] at o.(SourceFile:34) ~[1.20.1.jar:?] at o.h(SourceFile:274) ~[1.20.1.jar:?] at net.minecraft.client.main.Main.main(SourceFile:164) ~[1.20.1.jar:?] Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native [in thread "main"] at com.sun.jna.NativeLong.(NativeLong.java:35) ~[jna-5.12.1.jar:5.12.1 (b0)] at oshi.util.FileUtil.readNativeLongFromBuffer(FileUtil.java:240) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.driver.linux.proc.Auxv.queryAuxv(Auxv.java:59) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.software.os.linux.LinuxOperatingSystem.(LinuxOperatingSystem.java:106) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.platform.linux.LinuxCentralProcessor.initProcessorCounts(LinuxCentralProcessor.java:171) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.common.AbstractCentralProcessor.(AbstractCentralProcessor.java:83) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.platform.linux.LinuxCentralProcessor.(LinuxCentralProcessor.java:71) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.createProcessor(LinuxHardwareAbstractionLayer.java:62) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.util.Memoizer$1.get(Memoizer.java:87) ~[oshi-core-6.2.2.jar:6.2.2] at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68) ~[oshi-core-6.2.2.jar:6.2.2] at ab.c(SourceFile:75) ~[1.20.1.jar:?] at ab.a(SourceFile:82) ~[1.20.1.jar:?] at ab.a(SourceFile:75) ~[1.20.1.jar:?] ... 6 more logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

ERROR: Unable to get more log. [20:54:08] [Datafixer Bootstrap/INFO]: 188 Datafixer optimizations took 167 milliseconds [20:54:10] [Render thread/INFO]: [STDERR]: [LWJGL] Failed to load a library. Possible solutions: a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath. b) Add the JAR that contains the shared library to the classpath. [20:54:10] [Render thread/INFO]: [STDERR]: [LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics. [20:54:10] [Render thread/INFO]: [STDERR]: [LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics. [20:54:10] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD' [20:54:11] [Render thread/ERROR]: Failed to verify authentication com.mojang.authlib.exceptions.InvalidCredentialsException: Status: 401 at com.mojang.authlib.exceptions.MinecraftClientHttpException.toAuthenticationException(MinecraftClientHttpException.java:56) ~[authlib-4.0.43.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:156) ~[authlib-4.0.43.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.(YggdrasilUserApiService.java:55) ~[authlib-4.0.43.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.createUserApiService(YggdrasilAuthenticationService.java:124) ~[authlib-4.0.43.jar:?] at enn.a(SourceFile:733) ~[1.20.1.jar:?] at enn.(SourceFile:442) ~[1.20.1.jar:?] at net.minecraft.client.main.Main.main(SourceFile:211) ~[1.20.1.jar:?] Caused by: com.mojang.authlib.exceptions.MinecraftClientHttpException: Status: 401 at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:85) ~[authlib-4.0.43.jar:?] at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:48) ~[authlib-4.0.43.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:129) ~[authlib-4.0.43.jar:?] ... 5 more [20:54:11] [Render thread/INFO]: Setting user: tgub Registered forkAndExec [20:54:11] [Render thread/ERROR]: Error parsing option value off for option Fullscreen: Not a boolean: "off" [20:54:11] [Render thread/ERROR]: Error parsing option value for option Text Background Opacity: Not a boolean: "" [20:54:11] [Render thread/INFO]: Backend library: LWJGL version 3.2.3 SNAPSHOT OSMDroid: generating context WARNING: Some incorrect rendering might occur because the selected Vulkan device (Mali-G715-Immortalis MC11) doesn't support base Zink requirements: feats.features.logicOp feats.features.fillModeNonSolid feats.features.shaderClipDistance

mcghjbcg avatar Jul 29 '23 12:07 mcghjbcg

The zink branch doesn't support 1.20+ I guess

Mario191209 avatar Jul 29 '23 12:07 Mario191209

The zink branch doesn't support 1.20+ I guess Version 1.12 and above crashes during startup loading

mcghjbcg avatar Jul 29 '23 13:07 mcghjbcg

Known Issue afaik

Mario191209 avatar Jul 29 '23 13:07 Mario191209

The zink branch doesn't support 1.20+ I guess Version 1.12 and above crashes during startup loading

so 1.11 and down work?

WesleyVanNeck avatar Jul 29 '23 13:07 WesleyVanNeck

It doesn't work, it just crashes

mcghjbcg avatar Jul 29 '23 13:07 mcghjbcg

It crashed for me as well.

Mario191209 avatar Jul 29 '23 13:07 Mario191209

My Gpu is Mali G77-MC9

Mario191209 avatar Jul 29 '23 13:07 Mario191209

so what version do work

It crashed for me as well.

WesleyVanNeck avatar Jul 29 '23 13:07 WesleyVanNeck

@mcghjbcg lol The real reason is your device(Same to me) does not support a basic vulkan extension for the new mesa version. I had report it to the cellphone provider company.You have no choice but use old mesa version(cpu only) instead of it.

Pevernow avatar Jul 29 '23 13:07 Pevernow

@mcghjbcg lol The real reason is your device(Same to me) does not support a basic vulkan extension for the new mesa version. I had report it to the cellphone provider company.You have no choice but use old mesa version(cpu only) instead of it.

Mali-G715 supports Vulkan1.3, which is a VK extension that supports Mesa23.0.4

mcghjbcg avatar Jul 30 '23 17:07 mcghjbcg

Well adreno 725 support vulkan 1.1 and supported mesa 24.0.0 UMP zink in solDev69 pojav

kasrarouhi avatar Jun 13 '24 19:06 kasrarouhi