openglonmetal / MGL

OpenGL 4.6 on Metal
Apache License 2.0
769 stars 30 forks source link

[not issue] MC on MGL #55

Open r58Playz opened 2 years ago

r58Playz commented 2 years ago

Creating an issue here for the current status of getting Minecraft to run using MGL.

This checklist may change.

Current stacktrace/error log/etc:

11:45:37] [Render thread/ERROR]: Reported exception thrown!
net.minecraft.class_148: Rendering overlay
    at net.minecraft.class_757.method_3192(class_757.java:877) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1523(class_310.java:1143) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1514(class_310.java:734) [client-intermediary.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:237) [client-intermediary.jar:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) [fabric-loader-0.14.8.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.8.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.14.8.jar:?]
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88) [NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126) [NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:71) [NewLaunch.jar:?]
Caused by: java.lang.IllegalStateException: Rendersystem called from wrong thread
    at com.mojang.blaze3d.systems.RenderSystem.constructThreadException(RenderSystem.java:181) ~[client-intermediary.jar:?]
    at com.mojang.blaze3d.systems.RenderSystem.assertOnRenderThreadOrInit(RenderSystem.java:165) ~[client-intermediary.jar:?]
    at com.mojang.blaze3d.platform.GlStateManager._getInteger(GlStateManager.java:772) ~[client-intermediary.jar:?]
    at com.mojang.blaze3d.systems.RenderSystem.maxSupportedTextureSize(RenderSystem.java:1442) ~[client-intermediary.jar:?]
    at net.minecraft.class_1059.<init>(class_1059.java:63) ~[client-intermediary.jar:?]
    at net.minecraft.class_1088.<init>(class_1088.java:225) ~[client-intermediary.jar:?]
    at net.minecraft.class_1092.method_18178(class_1092.java:52) ~[client-intermediary.jar:?]
    at net.minecraft.class_1092.method_18789(class_1092.java:19) ~[client-intermediary.jar:?]
    at net.minecraft.class_4080.method_18791(class_4080.java:11) ~[client-intermediary.jar:?]
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
    at net.minecraft.class_4010.method_18357(class_4010.java:35) ~[client-intermediary.jar:?]
    at net.minecraft.class_4014.method_18371(class_4014.java:62) ~[client-intermediary.jar:?]
    at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395) ~[?:?]
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
    at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
    at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
---- Minecraft Crash Report ----
// Surprise! Haha. Well, this is awkward.
Time: 1/5/23, 11:45 AM
Description: Rendering overlay
java.lang.IllegalStateException: Rendersystem called from wrong thread
    at com.mojang.blaze3d.systems.RenderSystem.constructThreadException(RenderSystem.java:181)
    at com.mojang.blaze3d.systems.RenderSystem.assertOnRenderThreadOrInit(RenderSystem.java:165)
    at com.mojang.blaze3d.platform.GlStateManager._getInteger(GlStateManager.java:772)
    at com.mojang.blaze3d.systems.RenderSystem.maxSupportedTextureSize(RenderSystem.java:1442)
    at net.minecraft.class_1059.<init>(class_1059.java:63)
    at net.minecraft.class_1088.<init>(class_1088.java:225)
    at net.minecraft.class_1092.method_18178(class_1092.java:52)
    at net.minecraft.class_1092.method_18789(class_1092.java:19)
    at net.minecraft.class_4080.method_18791(class_4080.java:11)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
    at net.minecraft.class_4010.method_18357(class_4010.java:35)
    at net.minecraft.class_4014.method_18371(class_4014.java:62)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Render thread
Stacktrace:
    at com.mojang.blaze3d.systems.RenderSystem.constructThreadException(RenderSystem.java:181)
    at com.mojang.blaze3d.systems.RenderSystem.assertOnRenderThreadOrInit(RenderSystem.java:165)
    at com.mojang.blaze3d.platform.GlStateManager._getInteger(GlStateManager.java:772)
    at com.mojang.blaze3d.systems.RenderSystem.maxSupportedTextureSize(RenderSystem.java:1442)
    at net.minecraft.class_1059.<init>(class_1059.java:63)
    at net.minecraft.class_1088.<init>(class_1088.java:225)
    at net.minecraft.class_1092.method_18178(class_1092.java:52)
    at net.minecraft.class_1092.method_18789(class_1092.java:19)
-- Overlay render details --
Details:
    Overlay name: net.minecraft.class_425
Stacktrace:
    at net.minecraft.class_757.method_3192(class_757.java:873)
    at net.minecraft.class_310.method_1523(class_310.java:1143)
    at net.minecraft.class_310.method_1514(class_310.java:734)
    at net.minecraft.client.main.Main.main(Main.java:237)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88)
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126)
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:71)
-- Last reload --
Details:
    Reload number: 1
    Reload reason: initial
    Finished: No
    Packs: Default
-- System Details --
Details:
    Minecraft Version: 1.19
    Minecraft Version ID: 1.19
    Operating System: Mac OS X (aarch64) version 13.0
    Java Version: 17.0.3, Azul Systems, Inc.
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Azul Systems, Inc.
    Memory: 1800674304 bytes (1717 MiB) / 2231369728 bytes (2128 MiB) up to 4294967296 bytes (4096 MiB)
    CPUs: 8
    Processor Vendor: Apple Inc.
    Processor Name: Apple M1
    Identifier: Apple Inc. Family 0x1b588bb3 Model 0 Stepping 0
    Microarchitecture: unknown
    Frequency (GHz): 24.00
    Number of physical packages: 1
    Number of physical CPUs: 8
    Number of logical CPUs: 8
    Graphics card #0 name: Apple M1
    Graphics card #0 vendor: Apple (0x106b)
    Graphics card #0 VRAM (MB): 0.00
    Graphics card #0 deviceId: unknown
    Graphics card #0 versionInfo: unknown
    Memory slot #0 capacity (MB): 0.00
    Memory slot #0 clockSpeed (GHz): 0.00
    Memory slot #0 type: unknown
    Virtual memory max (MB): 14336.00
    Virtual memory used (MB): 12015.36
    Swap memory total (MB): 6144.00
    Swap memory used (MB): 5010.00
    JVM Flags: 3 total; -XX:+ShowMessageBoxOnError -Xms512m -Xmx4096m
    Launched Version: 1.19
    Backend library: LWJGL version 3.3.1 SNAPSHOT
    Backend API: MGL GL version 4.6.0, Mike Larson
    Window size: 1708x960
    GL Caps: Using framebuffer using OpenGL 3.2
    GL debug messages: <disabled>
    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'fabric'
    Type: Client (map_client.txt)
    Graphics mode: fancy
    Resource Packs: 
    Current Language: English (US)
    CPU: 8x Apple M1

Modifications to get to this point:

How to inject MGL:

r58Playz commented 2 years ago

Current mod I use to change MC code: https://github.com/r58Playz/mglmod

mjwells2002 commented 2 years ago

Im also attempting this, and reached the same roadblock as you, if you disable the texture subimg function, you can get more loading, but you will eventually hit a metal shader compile error, i attempted to debug the crash in texsubimg, but didnt have time to setup a proper enviroment for it so didnt get far

in my attempts i also attempted to load using the sodium mod (0.5 from the 1.19/next branch) but this did not make much difference

r58Playz commented 2 years ago

Im also attempting this, and reached the same roadblock as you, if you disable the texture subimg function, you can get more loading, but you will eventually hit a metal shader compile error

I probably need to change the shaders to use layout(location = ) in the MGL mod. I'll most likely fix the subimg issue then fix that

mjwells2002 commented 2 years ago

actually no, i changed the shader compile function to use the auto layout flag, thats how i got that that far in the first place, with this metal shader code is generated, but it fails to compile, i was able to create seemingly valid MSL on the command line using the same tools, so im going to attempt updating the shader compile functions when i have time

mjwells2002 commented 2 years ago

i was also using MGL from your uniforms branch/pr, but im sure you are aswell

r58Playz commented 2 years ago

actually no, i changed the shader compile function to use the auto layout flag, thats how i got that that far in the first place, with this metal shader code is generated, but it fails to compile, i was able to create seemingly valid MSL on the command line using the same tools, so im going to attempt updating the shader compile functions when i have time

After quickly disabling the texture subimg function I seem to have gotten to a different point. See this log:

[08:58:56] [main/INFO]: Loading Minecraft 1.19 with Fabric Loader 0.14.9
[08:58:56] [main/DEBUG]: Found game constructor: net.minecraft.client.main.Main -> net.minecraft.class_310
[08:58:56] [main/DEBUG]: Patching game constructor <init>(Lnet/minecraft/class_542;)V
[08:58:56] [main/DEBUG]: Run directory field is thought to be net/minecraft/class_310/field_1697
[08:58:56] [main/DEBUG]: Applying brand name hook to net/minecraft/client/ClientBrandRetriever::getClientModName
[08:58:56] [main/DEBUG]: Applying brand name hook to net/minecraft/server/MinecraftServer::getServerModName
[08:58:56] [main/DEBUG]: Patched 3 classs
[08:58:56] [main/DEBUG]: Mod discovery time: 9.8 ms
[08:58:56] [main/DEBUG]: Mod resolution time: 24.7 ms
[08:58:56] [main/INFO]: Loading 4 mods:
    - fabricloader 0.14.9
    - java 17
    - mglmod 0.1.2
    - minecraft 1.19
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/.minecraft/mods/fabric-example-mod-1.0.0.jar to classpath.
[08:58:56] [main/DEBUG]: Registering new-style initializer com.github.r58playz.mgl.MGL for mod mglmod (key main)
[08:58:56] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/sponge-mixin/0.11.4+mixin.0.8.5/sponge-mixin-0.11.4+mixin.0.8.5.jar Service=Knot/Fabric Env=CLIENT
[08:58:56] [main/DEBUG]: Error cleaning class output directory: .mixin.out
[08:58:56] [main/DEBUG]: Initialising Mixin Platform Manager
[08:58:56] [main/DEBUG]: Adding mixin platform agents for container ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[08:58:56] [main/DEBUG]: Instancing new MixinPlatformAgentDefault for ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[08:58:56] [main/DEBUG]: MixinPlatformAgentDefault accepted container ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[08:58:56] [main/DEBUG]: Instancing new MixinPlatformAgentDefault for ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[08:58:56] [main/DEBUG]: MixinPlatformAgentDefault accepted container ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[08:58:56] [main/DEBUG]: Processing prepare() for PlatformAgent[MixinPlatformAgentDefault:ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)]
[08:58:56] [main/DEBUG]: Processing prepare() for PlatformAgent[MixinPlatformAgentDefault:ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)]
[08:58:56] [main/DEBUG]: Compatibility level JAVA_17 specified by com.github.r58playz.mgl.mixin.json is higher than the maximum level supported by this version of mixin (JAVA_13).
[08:58:56] [main/INFO]: Compatibility level set to JAVA_17
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/.minecraft/.fabric/remappedJars/minecraft-1.19-0.14.9/client-intermediary.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /private/var/folders/kw/63mpn_596s72yz4nbn2x3kvc0000gn/T/AppTranslocation/D4A1A1D5-9423-4FB7-B93F-1D37AB138265/d/ManyMC.app/Contents/MacOS/jars/NewLaunch.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-glfw/3.3.1-mmachina.1/lwjgl-glfw-3.3.1-mmachina.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-jemalloc/3.3.1-mmachina.1/lwjgl-jemalloc-3.3.1-mmachina.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-openal/3.3.1-mmachina.1/lwjgl-openal-3.3.1-mmachina.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-opengl/3.3.1-mmachina.1/lwjgl-opengl-3.3.1-mmachina.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-stb/3.3.1-mmachina.1/lwjgl-stb-3.3.1-mmachina.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-tinyfd/3.3.1-mmachina.1/lwjgl-tinyfd-3.3.1-mmachina.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl/3.3.1-mmachina.1/lwjgl-3.3.1-mmachina.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/blocklist/1.0.10/blocklist-1.0.10.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/patchy/2.2.10/patchy-2.2.10.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/github/oshi/oshi-core/5.8.5/oshi-core-5.8.5.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/net/java/dev/jna/jna/5.10.0/jna-5.10.0.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/net/java/dev/jna/jna-platform/5.10.0/jna-platform-5.10.0.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/ibm/icu/icu4j/70.1/icu4j-70.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/javabridge/1.2.24/javabridge-1.2.24.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-common/4.1.77.Final/netty-common-4.1.77.Final.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-buffer/4.1.77.Final/netty-buffer-4.1.77.Final.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-codec/4.1.77.Final/netty-codec-4.1.77.Final.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-handler/4.1.77.Final/netty-handler-4.1.77.Final.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-resolver/4.1.77.Final/netty-resolver-4.1.77.Final.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-transport/4.1.77.Final/netty-transport-4.1.77.Final.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-transport-native-unix-common/4.1.77.Final/netty-transport-native-unix-common-4.1.77.Final.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-transport-classes-epoll/4.1.77.Final/netty-transport-classes-epoll-4.1.77.Final.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/commons-codec/commons-codec/1.15/commons-codec-1.15.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/brigadier/1.0.18/brigadier-1.0.18.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/datafixerupper/5.0.28/datafixerupper-5.0.28.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/apache/commons/commons-compress/1.21/commons-compress-1.21.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/commons-logging/commons-logging/1.2/commons-logging-1.2.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/it/unimi/dsi/fastutil/8.5.6/fastutil-8.5.6.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/text2speech/1.13.9/text2speech-1.13.9.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/ca/weblite/java-objc-bridge/1.1/java-objc-bridge-1.1.jar to classpath.
[08:58:56] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/net/fabricmc/intermediary/1.19/intermediary-1.19.jar to classpath.
[08:58:56] [main/DEBUG]: No subscribers for entrypoint 'preLaunch'
[08:58:56] [main/DEBUG]: Preparing mixins for MixinEnvironment[DEFAULT]
[08:58:56] [main/DEBUG]: Selecting config com.github.r58playz.mgl.mixin.json
[08:58:56] [main/DEBUG]: Selecting config com.github.r58playz.mgl.mixin.render.json
[08:58:56] [main/DEBUG]: Preparing com.github.r58playz.mgl.mixin.json (2)
[08:58:56] [main/DEBUG]: Preparing com.github.r58playz.mgl.mixin.render.json (1)
[08:58:56] [main/DEBUG]: Registering new injector for @Inject with org.spongepowered.asm.mixin.injection.struct.CallbackInjectionInfo
[08:58:56] [main/DEBUG]: Registering new injector for @ModifyArg with org.spongepowered.asm.mixin.injection.struct.ModifyArgInjectionInfo
[08:58:56] [main/DEBUG]: Registering new injector for @ModifyArgs with org.spongepowered.asm.mixin.injection.struct.ModifyArgsInjectionInfo
[08:58:56] [main/DEBUG]: Registering new injector for @Redirect with org.spongepowered.asm.mixin.injection.struct.RedirectInjectionInfo
[08:58:56] [main/DEBUG]: Registering new injector for @ModifyVariable with org.spongepowered.asm.mixin.injection.struct.ModifyVariableInjectionInfo
[08:58:56] [main/DEBUG]: Registering new injector for @ModifyConstant with org.spongepowered.asm.mixin.injection.struct.ModifyConstantInjectionInfo
[08:58:56] [main/DEBUG]: Using SLF4J as the default logging framework
[08:58:56] [main/DEBUG]: -Dio.netty.leakDetection.level: simple
[08:58:56] [main/DEBUG]: -Dio.netty.leakDetection.targetRecords: 4
[08:58:56] [main/WARN]: Configuration conflict: there is more than one oshi.properties file on the classpath
[08:58:57] [main/WARN]: Configuration conflict: there is more than one oshi.architecture.properties file on the classpath
[08:58:58] [main/INFO]: Building optimized datafixer
[08:59:00] [Render thread/DEBUG]: Mixing MGLMaxTextureSizeMixin from com.github.r58playz.mgl.mixin.render.json into com.mojang.blaze3d.systems.RenderSystem
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Version: 3.3.1 SNAPSHOT
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):    OS: Mac OS X v12.4
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   JRE: macOS aarch64 17.0.3
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   JVM: OpenJDK 64-Bit Server VM v17.0.3+7-LTS by Azul Systems, Inc.
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Loading JNI library: lwjgl
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Module: org.lwjgl
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   liblwjgl.dylib not found in org.lwjgl.librarypath=/Users/r58playz/mglmod/
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Loaded from java.library.path: /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/natives/macos/arm64/org/lwjgl/liblwjgl.dylib
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Loading library: jemalloc
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Module: org.lwjgl.jemalloc
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   libjemalloc.dylib not found in org.lwjgl.librarypath=/Users/r58playz/mglmod/
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Loaded from java.library.path: /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/natives/macos/arm64/org/lwjgl/jemalloc/libjemalloc.dylib
[08:59:00] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): MemoryUtil allocator: JEmallocAllocator
[08:59:00] [Render thread/DEBUG]: Mixing MGLInitMixin from com.github.r58playz.mgl.mixin.json into net.minecraft.class_442
[08:59:00] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.json:MGLInitMixin from mod mglmod->@Inject::init(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[08:59:00] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.json:MGLInitMixin from mod mglmod->@Inject::init(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V has 0 override(s) in child classes
[08:59:00] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.json:MGLInitMixin from mod mglmod->@Inject::init(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V won't be passed a CallbackInfo as a result
[08:59:00] [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'
[08:59:00] [Render thread/DEBUG]: Connecting to https://api.minecraftservices.com/player/attributes
[08:59:01] [Render thread/INFO]: Setting user: blcy
[08:59:01] [Render thread/DEBUG]: (Session ID is token:<ACCESS TOKEN>:<PROFILE ID>)
[08:59:01] [Render thread/DEBUG]: Iterating over entrypoint 'main'
[08:59:01] [Render thread/INFO]: loading the big guns
[08:59:01] [Render thread/DEBUG]: No subscribers for entrypoint 'client'
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Loading library: glfw
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Module: org.lwjgl.glfw
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Loaded from org.lwjgl.librarypath: /Users/r58playz/mglmod/libglfw.dylib
[08:59:01] [Render thread/INFO]: Backend library: LWJGL version 3.3.1 SNAPSHOT
[08:59:01] [Render thread/DEBUG]: Mixing MGLWindowMixin from com.github.r58playz.mgl.mixin.json into net.minecraft.class_1041
[08:59:01] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.json:MGLWindowMixin from mod mglmod->@Inject::modifyRequestedContext(Lnet/minecraft/class_3678;Lnet/minecraft/class_323;Lnet/minecraft/class_543;Ljava/lang/String;Ljava/lang/String;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Java 9 check intrinsics enabled
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Closure Registry: ConcurrentHashMap
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Loading library: objc
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Module: org.lwjgl
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   libobjc.dylib not found in org.lwjgl.librarypath=/Users/r58playz/mglmod/
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Java 9 text decoding enabled
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Loaded from system paths: /usr/lib/libobjc.A.dylib
[08:59:01] [Render thread/INFO]: glfw context changed to 4.6 woot woot
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Loading JNI library: lwjgl_opengl
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Module: org.lwjgl.opengl
[08:59:01] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   liblwjgl_opengl.dylib not found in org.lwjgl.librarypath=/Users/r58playz/mglmod/
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Loaded from java.library.path: /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/natives/macos/arm64/org/lwjgl/opengl/liblwjgl_opengl.dylib
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Loading library: libMGL.dylib
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Module: org.lwjgl.opengl
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Loaded from org.lwjgl.librarypath: /Users/r58playz/mglmod/libMGL.dylib
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Java 10 multiplyHigh enabled
[08:59:02] [Render thread/INFO]: mgl texture size function called
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86): Loading library: openal
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Module: org.lwjgl.openal
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   libopenal.dylib not found in org.lwjgl.librarypath=/Users/r58playz/mglmod/
[08:59:02] [Render thread/INFO]: [STDERR]@.(APIUtil.java:86):   Loaded from java.library.path: /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/natives/macos/arm64/org/lwjgl/openal/libopenal.dylib
[08:59:02] [Render thread/DEBUG]: Growing IndexBuffer: Old limit 0, new limit 9360.
[08:59:02] [Render thread/DEBUG]: Growing IndexBuffer: Old limit 0, new limit 20.
[08:59:02] [Render thread/INFO]: mgl texture size function called
[08:59:02] [Render thread/INFO]: mgl texture size function called
[08:59:02] [Render thread/INFO]: mgl texture size function called
[LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] [LWJGL] Assertion failed: (0), function mglDeleteFramebuffers, file framebuffers.c, line 207.
GL Error func: createTextureLevel type: 1282
mglCheckFramebufferStatus need to fix this function
GL Error func: createTextureLevel type: 1282
GL Error func: createTextureLevel type: 1282
GL Error func: createTextureLevel type: 1282
GL Error func: mglBindVertexArray type: 1281
GL Error func: mglBindVertexArray type: 1281
GL Error func: mglBindVertexArray type: 1281

After this it just crashes.

mjwells2002 commented 2 years ago

huh this is without modifying shaders?

mjwells2002 commented 2 years ago

oh yes, i remeber this one sorry, the mglDeleteFramebuffers function is not implemented, it is just a assert(0), i just removed this and made a note of it for later, you can see the assertion failure in your log Assertion failed: (0), function mglDeleteFramebuffers, file framebuffers.c, line 207

r58Playz commented 2 years ago

actually no, i changed the shader compile function to use the auto layout flag, thats how i got that that far in the first place, with this metal shader code is generated, but it fails to compile, i was able to create seemingly valid MSL on the command line using the same tools, so im going to attempt updating the shader compile functions when i have time

It seems that all the shaders use #version 150 which glslang does not like

mjwells2002 commented 2 years ago

ah yes, sorry i forgot to mention this one, as a hack fix to get past this i just added some code to replace #version 150 with #version 330, that gets you past glslang, and into a metal shader compile error, however i was able to compile these shaders with verison 150, using the cli version of the same tools, and get a different metal output, hence why i belive the shader compile functions could need some work

r58Playz commented 2 years ago

ah yes, sorry i forgot to mention this one, as a hack fix to get past this i just added some code to replace #version 150 with #version 330, that gets you past glslang, and into a metal shader compile error, however i was able to compile these shaders with verison 150, using the cli version of the same tools, and get a different metal output, hence why i belive the shader compile functions could need some work

Ah I see the error now: program_source:20:40: error: invalid type 'vertex_1_main_in' of input declaration with attribute 'stage_in' in a vertex function Had to comment out an assert(0) for mglBindAttribLocation.

r58Playz commented 2 years ago

ah yes, sorry i forgot to mention this one, as a hack fix to get past this i just added some code to replace #version 150 with #version 330, that gets you past glslang, and into a metal shader compile error, however i was able to compile these shaders with verison 150, using the cli version of the same tools, and get a different metal output, hence why i belive the shader compile functions could need some work

Ah I see the error now: program_source:20:40: error: invalid type 'vertex_1_main_in' of input declaration with attribute 'stage_in' in a vertex function Had to comment out an assert(0) for mglBindAttribLocation.

It seems that adding [[attribute(<digit>)]] to the end of each attribute in vertex_1_main_in fixes the issue.

r58Playz commented 2 years ago

actually no, i changed the shader compile function to use the auto layout flag, thats how i got that that far in the first place, with this metal shader code is generated, but it fails to compile, i was able to create seemingly valid MSL on the command line using the same tools, so im going to attempt updating the shader compile functions when i have time

The auto layout flag just doesn't pass a location to the MSL compiler so it doesn't know what to do. I guess the auto layout flag is broken?

Edit: You can see this by enabling auto layout and removing layout(location = ) in one of the tests and running it. Exact same error.

mjwells2002 commented 2 years ago

I wouldnt be so sure of that, if you take a look at this https://shader-playground.timjones.io/d801c4d82b17a8e6405f598a3214a0d7

this is the minecraft blit shader, the very same one that is causing us problems in MGL, and as you can see the generated MSL is very different,

MGL generates the following MSL

#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;

struct vertex_1_main_out
{
    float2 texCoord;
    float4 vertexColor;
    float4 gl_Position [[position]];
};

struct vertex_1_main_in
{
    float3 Position;
    float2 UV;
    float4 Color;
};

vertex vertex_1_main_out vertex_1_main(vertex_1_main_in in [[stage_in]], constant float4x4& ProjMat [[buffer(0)]], constant float4x4& ModelViewMat [[buffer(1)]])
{
    vertex_1_main_out out = {};
    out.gl_Position = (ProjMat * ModelViewMat) * float4(in.Position, 1.0);
    out.texCoord = in.UV;
    out.vertexColor = in.Color;
    return out;
}

Shader playground (and me using the same tools on command line) get the following

#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;

struct main0_out
{
    float2 texCoord [[user(locn0)]];
    float4 vertexColor [[user(locn1)]];
    float4 gl_Position [[position]];
};

struct main0_in
{
    float3 Position [[attribute(0)]];
    float2 UV [[attribute(1)]];
    float4 Color [[attribute(2)]];
};

vertex main0_out main0(main0_in in [[stage_in]], constant float4x4& ProjMat [[buffer(0)]], constant float4x4& ModelViewMat [[buffer(1)]])
{
    main0_out out = {};
    out.gl_Position = (ProjMat * ModelViewMat) * float4(in.Position, 1.0);
    out.texCoord = in.UV;
    out.vertexColor = in.Color;
    return out;
}

and as expected the first shader that MSL outputs fails to compile, but the second shader compiles fine

mjwells2002 commented 2 years ago

i took a quick look into what could be causing this behaviour but i wasnt able to see a cause, but it looks to me like MGL's shader compile functions are not working correctly

Given we are getting wrong MSL this could either be happening in the glsl -> spirv phase or the spirv -> msl phase, i will attempt to debug this more and update if i find anything

r58Playz commented 2 years ago

I have gotten much further, but now MC crashes because of a buffer issue. (Assert on error off, all you need is the mgl mod)

[07:59:05] [main/INFO]: Loading Minecraft 1.19 with Fabric Loader 0.14.9
[07:59:05] [main/DEBUG]: Found game constructor: net.minecraft.client.main.Main -> net.minecraft.class_310
[07:59:05] [main/DEBUG]: Patching game constructor <init>(Lnet/minecraft/class_542;)V
[07:59:05] [main/DEBUG]: Run directory field is thought to be net/minecraft/class_310/field_1697
[07:59:05] [main/DEBUG]: Applying brand name hook to net/minecraft/client/ClientBrandRetriever::getClientModName
[07:59:05] [main/DEBUG]: Applying brand name hook to net/minecraft/server/MinecraftServer::getServerModName
[07:59:05] [main/DEBUG]: Patched 3 classs
[07:59:05] [main/DEBUG]: Mod discovery time: 11.7 ms
[07:59:05] [main/DEBUG]: Mod resolution time: 29.8 ms
[07:59:05] [main/INFO]: Loading 4 mods:
    - fabricloader 0.14.9
    - java 17
    - mglmod 0.3.0
    - minecraft 1.19
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/.minecraft/mods/fabric-example-mod-1.0.0.jar to classpath.
[07:59:05] [main/DEBUG]: Registering new-style initializer com.github.r58playz.mgl.MGL for mod mglmod (key main)
[07:59:05] [main/DEBUG]: Registering new-style initializer com.github.r58playz.mgl.MGLInjector for mod mglmod (key preLaunch)
[07:59:05] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/sponge-mixin/0.11.4+mixin.0.8.5/sponge-mixin-0.11.4+mixin.0.8.5.jar Service=Knot/Fabric Env=CLIENT
[07:59:05] [main/DEBUG]: Error cleaning class output directory: .mixin.out
[07:59:05] [main/DEBUG]: Initialising Mixin Platform Manager
[07:59:05] [main/DEBUG]: Adding mixin platform agents for container ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[07:59:05] [main/DEBUG]: Instancing new MixinPlatformAgentDefault for ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[07:59:05] [main/DEBUG]: MixinPlatformAgentDefault accepted container ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[07:59:05] [main/DEBUG]: Instancing new MixinPlatformAgentDefault for ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[07:59:05] [main/DEBUG]: MixinPlatformAgentDefault accepted container ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)
[07:59:05] [main/DEBUG]: Processing prepare() for PlatformAgent[MixinPlatformAgentDefault:ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)]
[07:59:05] [main/DEBUG]: Processing prepare() for PlatformAgent[MixinPlatformAgentDefault:ContainerHandleURI(file:///Users/r58playz/Library/Application%20Support/ManyMC/libraries/net/fabricmc/fabric-loader/0.14.9/fabric-loader-0.14.9.jar)]
[07:59:05] [main/DEBUG]: Compatibility level JAVA_17 specified by com.github.r58playz.mgl.mixin.json is higher than the maximum level supported by this version of mixin (JAVA_13).
[07:59:05] [main/INFO]: Compatibility level set to JAVA_17
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/.minecraft/.fabric/remappedJars/minecraft-1.19-0.14.9/client-intermediary.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /private/var/folders/kw/63mpn_596s72yz4nbn2x3kvc0000gn/T/AppTranslocation/BB16F18A-CFE7-47C9-99F8-6CDE5F12EDB2/d/ManyMC.app/Contents/MacOS/jars/NewLaunch.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/blocklist/1.0.10/blocklist-1.0.10.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/patchy/2.2.10/patchy-2.2.10.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/github/oshi/oshi-core/5.8.5/oshi-core-5.8.5.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/net/java/dev/jna/jna/5.10.0/jna-5.10.0.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/net/java/dev/jna/jna-platform/5.10.0/jna-platform-5.10.0.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/ibm/icu/icu4j/70.1/icu4j-70.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/javabridge/1.2.24/javabridge-1.2.24.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-common/4.1.77.Final/netty-common-4.1.77.Final.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-buffer/4.1.77.Final/netty-buffer-4.1.77.Final.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-codec/4.1.77.Final/netty-codec-4.1.77.Final.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-handler/4.1.77.Final/netty-handler-4.1.77.Final.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-resolver/4.1.77.Final/netty-resolver-4.1.77.Final.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-transport/4.1.77.Final/netty-transport-4.1.77.Final.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-transport-native-unix-common/4.1.77.Final/netty-transport-native-unix-common-4.1.77.Final.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/io/netty/netty-transport-classes-epoll/4.1.77.Final/netty-transport-classes-epoll-4.1.77.Final.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/commons-codec/commons-codec/1.15/commons-codec-1.15.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/brigadier/1.0.18/brigadier-1.0.18.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/datafixerupper/5.0.28/datafixerupper-5.0.28.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/apache/commons/commons-compress/1.21/commons-compress-1.21.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/commons-logging/commons-logging/1.2/commons-logging-1.2.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/it/unimi/dsi/fastutil/8.5.6/fastutil-8.5.6.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/com/mojang/text2speech/1.13.9/text2speech-1.13.9.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/ca/weblite/java-objc-bridge/1.1/java-objc-bridge-1.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-glfw/3.3.1-mmachina.1/lwjgl-glfw-3.3.1-mmachina.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-jemalloc/3.3.1-mmachina.1/lwjgl-jemalloc-3.3.1-mmachina.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-openal/3.3.1-mmachina.1/lwjgl-openal-3.3.1-mmachina.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-opengl/3.3.1-mmachina.1/lwjgl-opengl-3.3.1-mmachina.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-stb/3.3.1-mmachina.1/lwjgl-stb-3.3.1-mmachina.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl-tinyfd/3.3.1-mmachina.1/lwjgl-tinyfd-3.3.1-mmachina.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/org/lwjgl/lwjgl/3.3.1-mmachina.1/lwjgl-3.3.1-mmachina.1.jar to classpath.
[07:59:05] [main/DEBUG]: Adding /Users/r58playz/Library/Application Support/ManyMC/libraries/net/fabricmc/intermediary/1.19/intermediary-1.19.jar to classpath.
[07:59:05] [main/DEBUG]: Iterating over entrypoint 'preLaunch'
[07:59:05] [main/DEBUG]: Preparing mixins for MixinEnvironment[DEFAULT]
[07:59:05] [main/DEBUG]: Selecting config com.github.r58playz.mgl.mixin.json
[07:59:05] [main/DEBUG]: Selecting config com.github.r58playz.mgl.mixin.render.json
[07:59:05] [main/DEBUG]: Selecting config com.github.r58playz.mgl.mixin.debug.json
[07:59:05] [main/DEBUG]: Preparing com.github.r58playz.mgl.mixin.json (2)
[07:59:05] [main/DEBUG]: Preparing com.github.r58playz.mgl.mixin.render.json (3)
[07:59:05] [main/DEBUG]: Preparing com.github.r58playz.mgl.mixin.debug.json (2)
[07:59:05] [main/DEBUG]: Registering new injector for @Inject with org.spongepowered.asm.mixin.injection.struct.CallbackInjectionInfo
[07:59:05] [main/DEBUG]: Registering new injector for @ModifyArg with org.spongepowered.asm.mixin.injection.struct.ModifyArgInjectionInfo
[07:59:05] [main/DEBUG]: Registering new injector for @ModifyArgs with org.spongepowered.asm.mixin.injection.struct.ModifyArgsInjectionInfo
[07:59:05] [main/DEBUG]: Registering new injector for @Redirect with org.spongepowered.asm.mixin.injection.struct.RedirectInjectionInfo
[07:59:05] [main/DEBUG]: Registering new injector for @ModifyVariable with org.spongepowered.asm.mixin.injection.struct.ModifyVariableInjectionInfo
[07:59:05] [main/DEBUG]: Registering new injector for @ModifyConstant with org.spongepowered.asm.mixin.injection.struct.ModifyConstantInjectionInfo
[07:59:05] [main/DEBUG]: mglmod: java.library.path is /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/natives
[07:59:05] [main/DEBUG]: mglmod: MGL library path is /Users/r58playz/Library/Application Support/ManyMC/instances/1.19/natives
[07:59:05] [main/DEBUG]: Using SLF4J as the default logging framework
[07:59:05] [main/DEBUG]: -Dio.netty.leakDetection.level: simple
[07:59:05] [main/DEBUG]: -Dio.netty.leakDetection.targetRecords: 4
[07:59:05] [main/WARN]: Configuration conflict: there is more than one oshi.properties file on the classpath
[07:59:06] [main/WARN]: Configuration conflict: there is more than one oshi.architecture.properties file on the classpath
[07:59:08] [main/INFO]: Building optimized datafixer
[07:59:10] [Render thread/DEBUG]: Mixing MGLMaxTextureSizeMixin from com.github.r58playz.mgl.mixin.render.json into com.mojang.blaze3d.systems.RenderSystem
[07:59:11] [Render thread/DEBUG]: Mixing MGLInitMixin from com.github.r58playz.mgl.mixin.json into net.minecraft.class_442
[07:59:11] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.json:MGLInitMixin from mod mglmod->@Inject::init(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:11] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.json:MGLInitMixin from mod mglmod->@Inject::init(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V has 0 override(s) in child classes
[07:59:11] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.json:MGLInitMixin from mod mglmod->@Inject::init(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V won't be passed a CallbackInfo as a result
[07:59:11] [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'
[07:59:11] [Render thread/DEBUG]: Connecting to https://api.minecraftservices.com/player/attributes
[07:59:12] [Render thread/INFO]: Setting user: blcy
[07:59:12] [Render thread/DEBUG]: (Session ID is token:<ACCESS TOKEN>:<PROFILE ID>)
[07:59:12] [Render thread/DEBUG]: Iterating over entrypoint 'main'
[07:59:12] [Render thread/INFO]: mglmod: modrinth > cursedfrog
[07:59:12] [Render thread/DEBUG]: No subscribers for entrypoint 'client'
[07:59:14] [Render thread/INFO]: Backend library: LWJGL version 3.3.1 SNAPSHOT
[07:59:14] [Render thread/DEBUG]: Mixing MGLWindowMixin from com.github.r58playz.mgl.mixin.json into net.minecraft.class_1041
[07:59:14] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.json:MGLWindowMixin from mod mglmod->@Inject::modifyRequestedContext(Lnet/minecraft/class_3678;Lnet/minecraft/class_323;Lnet/minecraft/class_543;Ljava/lang/String;Ljava/lang/String;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:15] [Render thread/INFO]: mglmod: GLFW's OGL context changed to 4.6.
[07:59:16] [Render thread/DEBUG]: Mixing MGLBindAttribLocationMixin from com.github.r58playz.mgl.mixin.render.json into com.mojang.blaze3d.platform.GlStateManager
[07:59:16] [Render thread/DEBUG]: Mixing MGLGlStateManagerDebugMixin from com.github.r58playz.mgl.mixin.debug.json into com.mojang.blaze3d.platform.GlStateManager
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.render.json:MGLBindAttribLocationMixin from mod mglmod->@Inject::glBindAttribLocation(IILjava/lang/CharSequence;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V does use it's CallbackInfo
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLGlStateManagerDebugMixin from mod mglmod->@Inject::genVertexArrays(ILorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLGlStateManagerDebugMixin from mod mglmod->@Inject::texImage2d(IIIIIIIILjava/nio/IntBuffer;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLGlStateManagerDebugMixin from mod mglmod->@Inject::genVertexArrays(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable;)V does use it's CallbackInfoReturnable
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLGlStateManagerDebugMixin from mod mglmod->@Inject::glBindBuffer(IILorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLGlStateManagerDebugMixin from mod mglmod->@Inject::enableVertexAttribArray(ILorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLGlStateManagerDebugMixin from mod mglmod->@Inject::vertexAttribPointer(IIIZIJLorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLGlStateManagerDebugMixin from mod mglmod->@Inject::bufferData1(ILjava/nio/ByteBuffer;ILorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:16] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLGlStateManagerDebugMixin from mod mglmod->@Inject::bufferData2(IJILorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:16] [Render thread/DEBUG]: mglmod: texture size function called
[07:59:16] [Render thread/DEBUG]: mglmod: texImage2D called with target 3553, level 0, internal format 32856, width 1708, height 960, border 0, format 6408, and type 5121
[07:59:16] [Render thread/DEBUG]: mglmod: texImage2D called with target 3553, level 0, internal format 6402, width 1708, height 960, border 0, format 6402, and type 5126
[07:59:16] [Render thread/DEBUG]: mglmod: texImage2D called with target 3553, level 0, internal format 6408, width 256, height 256, border 0, format 6408, and type 5121
[07:59:16] [Render thread/DEBUG]: Mixing MGLShaderRedirectMixin from com.github.r58playz.mgl.mixin.render.json into net.minecraft.class_5944
[07:59:16] [Render thread/DEBUG]: mglmod: texImage2D called with target 3553, level 0, internal format 6408, width 16, height 16, border 0, format 6408, and type 5121
[07:59:16] [Render thread/DEBUG]: mglmod: texImage2D called with target 3553, level 0, internal format 6408, width 16, height 16, border 0, format 6408, and type 5121
[07:59:16] [Render thread/DEBUG]: mglmod: glGenVertexArrays called, vao generated with id 1
[07:59:16] [Render thread/DEBUG]: mglmod: glBindVertexArray called, vao will be bound with id 1
[07:59:16] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34962 and buffer id 1
[07:59:16] [Render thread/DEBUG]: mglmod: glEnableVertexAttribArray called with index 0
[07:59:16] [Render thread/DEBUG]: mglmod: glVertexAttribPointer called with index 0, size 3, type 5126, normalized false and stride 12
[07:59:16] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34962 and usage 35044
[07:59:16] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34963 and buffer id 3
[07:59:16] [Render thread/DEBUG]: Growing IndexBuffer: Old limit 0, new limit 9360.
[07:59:16] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34963 and usage 35048
[07:59:16] [Render thread/DEBUG]: mglmod: glBindVertexArray called, vao will be bound with id 0
[07:59:16] [Render thread/DEBUG]: mglmod: glGenVertexArrays called, vao generated with id 2
[07:59:16] [Render thread/DEBUG]: mglmod: glBindVertexArray called, vao will be bound with id 2
[07:59:16] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34962 and buffer id 4
[07:59:16] [Render thread/DEBUG]: mglmod: glEnableVertexAttribArray called with index 0
[07:59:16] [Render thread/DEBUG]: mglmod: glVertexAttribPointer called with index 0, size 3, type 5126, normalized false and stride 12
[07:59:16] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34962 and usage 35044
[07:59:16] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34963 and buffer id 6
[07:59:16] [Render thread/DEBUG]: Growing IndexBuffer: Old limit 0, new limit 20.
[07:59:16] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34963 and usage 35048
[07:59:16] [Render thread/DEBUG]: mglmod: glBindVertexArray called, vao will be bound with id 0
[07:59:16] [Render thread/DEBUG]: mglmod: glGenVertexArrays called, vao generated with id 3
[07:59:16] [Render thread/DEBUG]: mglmod: glBindVertexArray called, vao will be bound with id 3
[07:59:16] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34962 and buffer id 7
[07:59:16] [Render thread/DEBUG]: mglmod: glEnableVertexAttribArray called with index 0
[07:59:16] [Render thread/DEBUG]: mglmod: glVertexAttribPointer called with index 0, size 3, type 5126, normalized false and stride 12
[07:59:16] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34962 and usage 35044
[07:59:16] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34963 and buffer id 6
[07:59:16] [Render thread/DEBUG]: mglmod: glBindVertexArray called, vao will be bound with id 0
[07:59:16] [Render thread/DEBUG]: mglmod: texture size function called
[07:59:16] [Render thread/DEBUG]: mglmod: texture size function called
[07:59:16] [Render thread/DEBUG]: mglmod: texture size function called
[07:59:17] [Render thread/DEBUG]: mglmod: texture size function called
[07:59:17] [Render thread/DEBUG]: mglmod: texImage2D called with target 3553, level 0, internal format 6402, width 1708, height 960, border 0, format 6402, and type 5126
[07:59:17] [Render thread/DEBUG]: mglmod: texImage2D called with target 3553, level 0, internal format 32856, width 1708, height 960, border 0, format 6408, and type 5121
[07:59:17] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/blit_screen.json to path: mglshaders/core/blit_screen.json (in <init>)
[07:59:17] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/blit_screen.vsh to path: mglshaders/core/blit_screen.vsh (in loadProgram)
[07:59:17] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/blit_screen.fsh to path: mglshaders/core/blit_screen.fsh (in loadProgram)
[07:59:17] [Render thread/DEBUG]: Mixing MGLProgramLinkedMixin from com.github.r58playz.mgl.mixin.debug.json into net.minecraft.class_285
[07:59:17] [Render thread/DEBUG]: com.github.r58playz.mgl.mixin.debug.json:MGLProgramLinkedMixin from mod mglmod->@Inject::maxSupportedTextureSize(Lnet/minecraft/class_3679;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V doesn't use it's CallbackInfo
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 1, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 1, index 1, and name UV cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 1, index 2, and name Color cancelled.
[07:59:18] [Render thread/WARN]: Error encountered when linking program containing VS blit_screen and FS blit_screen. Log output:
[07:59:18] [Render thread/WARN]: 
[07:59:18] [Render thread/DEBUG]: mglmod: Successfuly linked shader program with VS blit_screen and FS blit_screen
[07:59:18] [Render thread/WARN]: Shader blit_screen could not find sampler named DiffuseSampler in the specified shader program.
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position.json to path: mglshaders/core/position.json (in <init>)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position.vsh to path: mglshaders/core/position.vsh (in loadProgram)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position.fsh to path: mglshaders/core/position.fsh (in loadProgram)
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 2, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: Error encountered when linking program containing VS position and FS position. Log output:
[07:59:18] [Render thread/WARN]: 
[07:59:18] [Render thread/DEBUG]: mglmod: Successfuly linked shader program with VS position and FS position
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_color.json to path: mglshaders/core/position_color.json (in <init>)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_color.vsh to path: mglshaders/core/position_color.vsh (in loadProgram)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_color.fsh to path: mglshaders/core/position_color.fsh (in loadProgram)
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 3, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 3, index 1, and name Color cancelled.
[07:59:18] [Render thread/WARN]: Error encountered when linking program containing VS position_color and FS position_color. Log output:
[07:59:18] [Render thread/WARN]: 
[07:59:18] [Render thread/DEBUG]: mglmod: Successfuly linked shader program with VS position_color and FS position_color
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_color_tex.json to path: mglshaders/core/position_color_tex.json (in <init>)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_color_tex.vsh to path: mglshaders/core/position_color_tex.vsh (in loadProgram)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_color_tex.fsh to path: mglshaders/core/position_color_tex.fsh (in loadProgram)
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 4, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 4, index 1, and name Color cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 4, index 2, and name UV0 cancelled.
[07:59:18] [Render thread/WARN]: Error encountered when linking program containing VS position_color_tex and FS position_color_tex. Log output:
[07:59:18] [Render thread/WARN]: 
[07:59:18] [Render thread/DEBUG]: mglmod: Successfuly linked shader program with VS position_color_tex and FS position_color_tex
[07:59:18] [Render thread/WARN]: Shader position_color_tex could not find sampler named Sampler0 in the specified shader program.
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_tex.json to path: mglshaders/core/position_tex.json (in <init>)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_tex.vsh to path: mglshaders/core/position_tex.vsh (in loadProgram)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_tex.fsh to path: mglshaders/core/position_tex.fsh (in loadProgram)
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 5, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 5, index 1, and name UV0 cancelled.
[07:59:18] [Render thread/WARN]: Error encountered when linking program containing VS position_tex and FS position_tex. Log output:
[07:59:18] [Render thread/WARN]: 
[07:59:18] [Render thread/DEBUG]: mglmod: Successfuly linked shader program with VS position_tex and FS position_tex
[07:59:18] [Render thread/WARN]: Shader position_tex could not find sampler named Sampler0 in the specified shader program.
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_tex_color.json to path: mglshaders/core/position_tex_color.json (in <init>)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_tex_color.vsh to path: mglshaders/core/position_tex_color.vsh (in loadProgram)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/position_tex_color.fsh to path: mglshaders/core/position_tex_color.fsh (in loadProgram)
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 6, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 6, index 1, and name UV0 cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 6, index 2, and name Color cancelled.
[07:59:18] [Render thread/WARN]: Error encountered when linking program containing VS position_tex_color and FS position_tex_color. Log output:
[07:59:18] [Render thread/WARN]: 
[07:59:18] [Render thread/DEBUG]: mglmod: Successfuly linked shader program with VS position_tex_color and FS position_tex_color
[07:59:18] [Render thread/WARN]: Shader position_tex_color could not find sampler named Sampler0 in the specified shader program.
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/rendertype_text.json to path: mglshaders/core/rendertype_text.json (in <init>)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/rendertype_text.vsh to path: mglshaders/core/rendertype_text.vsh (in loadProgram)
[07:59:18] [Render thread/DEBUG]: mglmod: redirected shaders from path: shaders/core/rendertype_text.fsh to path: mglshaders/core/rendertype_text.fsh (in loadProgram)
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 1, and name Color cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 2, and name UV0 cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 3, and name UV2 cancelled.
[07:59:18] [Render thread/WARN]: Error encountered when linking program containing VS rendertype_text and FS rendertype_text. Log output:
[07:59:18] [Render thread/WARN]: 
[07:59:18] [Render thread/DEBUG]: mglmod: Successfuly linked shader program with VS rendertype_text and FS rendertype_text
[07:59:18] [Render thread/WARN]: Shader rendertype_text could not find sampler named Sampler0 in the specified shader program.
[07:59:18] [Render thread/WARN]: Shader rendertype_text could not find sampler named Sampler2 in the specified shader program.
[07:59:18] [Render thread/DEBUG]: mglmod: texImage2D called with target 3553, level 0, internal format 6408, width 512, height 512, border 0, format 6408, and type 5121
[07:59:18] [Render thread/INFO]: Reloading ResourceManager: Default
[07:59:18] [Render thread/INFO]: mglmod: PARTY! MGL WORKED UNTIL INIT!
[07:59:18] [Render thread/DEBUG]: mglmod: glGenVertexArrays called, vao generated with id 4
[07:59:18] [Render thread/DEBUG]: mglmod: glBindVertexArray called, vao will be bound with id 4
[07:59:18] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34962 and buffer id 9
[07:59:18] [Render thread/DEBUG]: mglmod: glEnableVertexAttribArray called with index 0
[07:59:18] [Render thread/DEBUG]: mglmod: glVertexAttribPointer called with index 0, size 3, type 5126, normalized false and stride 20
[07:59:18] [Render thread/DEBUG]: mglmod: glEnableVertexAttribArray called with index 1
[07:59:18] [Render thread/DEBUG]: mglmod: glVertexAttribPointer called with index 1, size 2, type 5126, normalized false and stride 20
[07:59:18] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34962 and usage 35044
[07:59:18] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34963 and buffer id 3
[07:59:18] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34962 and buffer id 9
[07:59:18] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34962 and usage 35044
[07:59:18] [Render thread/DEBUG]: mglmod: glGenVertexArrays called, vao generated with id 5
[07:59:18] [Render thread/DEBUG]: mglmod: glBindVertexArray called, vao will be bound with id 5
[07:59:18] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34962 and buffer id 11
[07:59:18] [Render thread/DEBUG]: mglmod: glEnableVertexAttribArray called with index 0
[07:59:18] [Render thread/DEBUG]: mglmod: glVertexAttribPointer called with index 0, size 3, type 5126, normalized false and stride 16
[07:59:18] [Render thread/DEBUG]: mglmod: glEnableVertexAttribArray called with index 1
[07:59:18] [Render thread/DEBUG]: mglmod: glVertexAttribPointer called with index 1, size 4, type 5121, normalized true and stride 16
[07:59:18] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34962 and usage 35044
[07:59:18] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34963 and buffer id 3
[07:59:18] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34962 and buffer id 11
[07:59:18] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34962 and usage 35044
[07:59:18] [Render thread/DEBUG]: mglmod: glBindBuffer called with target 34962 and buffer id 11
[07:59:18] [Render thread/DEBUG]: mglmod: _glBufferData called with target 34962 and usage 35044
created context in mgl_context.m
mgl context initialized
created context for jump tables
mgl context initialized
created context in window.c during window init
mgl context initialized
mglCheckFramebufferStatus need to fix this function
created buffer with id 2
created buffer with id 2
mglCheckFramebufferStatus need to fix this function
GL Error func: mglVertexAttribPointer type: 1282
tex id data update 8
tex id data update 4
created buffer with id 3
created buffer with id 1
GL Error func: mglVertexAttribPointer type: 1282
created buffer with id 3
created buffer with id 1
created buffer with id 3
Assertion failed: (ptr->data.mtl_data), function -[MGLRenderer bindBuffersToCurrentRenderEncoder], file MGLRenderer.m, line 621.
r58Playz commented 2 years ago

i took a quick look into what could be causing this behaviour but i wasnt able to see a cause, but it looks to me like MGL's shader compile functions are not working correctly

Given we are getting wrong MSL this could either be happening in the glsl -> spirv phase or the spirv -> msl phase, i will attempt to debug this more and update if i find anything

@mjwells2002 For now I've manually patched the shaders to have layout(location = 0) and injected those in. See above for the current log. I think this is in the logic for rendering so I might get a window showing soon.

khanhduytran0 commented 2 years ago

For now I've manually patched the shaders to have layout(location = 0) and injected those in.

It’s not just location 0, there’s more according to glBindAttribLocation calls as above.

[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 1, and name Color cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 2, and name UV0 cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 3, and name UV2 cancelled.

Since glBindAttribLocation was not implemented, linking would fail due to either duplicate location 0 or location not set.

r58Playz commented 2 years ago

For now I've manually patched the shaders to have layout(location = 0) and injected those in.

It’s not just location 0, there’s more according to glBindAttribLocation calls as above.

[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 0, and name Position cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 1, and name Color cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 2, and name UV0 cancelled.
[07:59:18] [Render thread/WARN]: mglmod: glBindAttribLocation call for program id 7, index 3, and name UV2 cancelled.

Since glBindAttribLocation was not implemented, linking would fail due to either duplicate location 0 or location not set.

I showed location 0 as an example, in reality as you can see in the code (here)


layout(location = 0) uniform sampler2D DiffuseSampler;

layout(location = 1) uniform vec4 ColorModulator;

layout(location = 3) in vec2 texCoord;
layout(location = 4) in vec4 vertexColor;

layout(location = 0) out vec4 fragColor;
IMS212 commented 1 year ago

For attributes, the attributes MC uses are dynamically changed locations. Small changes to the binding process would have to be made.

r58Playz commented 1 year ago

For attributes, the attributes MC uses are dynamically changed locations. Small changes to the binding process would have to be made.

from what i have seen in the code it takes the order of attributes in the json and uses that for the attribute #. i accounted for that

IMS212 commented 1 year ago

This is usually the case, but mods can and are allowed to change this. However, that’d work for now.

IMS212 commented 1 year ago

Here's my current log:


# C  [libobjc.A.dylib+0x7b80]  objc_retain+0x10
C  [libobjc.A.dylib+0x7b80]  objc_retain+0x10
C  [libMGL.dylib+0x5979f8]  -[MGLRenderer newRenderEncoder]+0x135c
C  [libMGL.dylib+0x599d3c]  -[MGLRenderer processGLState:]+0x5f0
C  [libMGL.dylib+0x59cf0c]  -[MGLRenderer mtlDrawElements:mode:count:type:indices:]+0x40
C  [libMGL.dylib+0x59d114]  mtlDrawElements+0x48
C  [libMGL.dylib+0x87b0bc]  mglDrawElements+0x188
C  [libMGL.dylib+0x81784]  glDrawElements+0x4c```

I've also once got an error at `C  [Metal+0x1f408]  -[MTLResourceList releaseAllObjectsAndReset]+0x48`
IMS212 commented 1 year ago

New error after removing glDrawElements calls: Assertion failed: (ptr), function -[MGLRenderer getProgramBindingCount:type:], file MGLRenderer.m, line 1436.

r58Playz commented 1 year ago

New error after removing glDrawElements calls: Assertion failed: (ptr), function -[MGLRenderer getProgramBindingCount:type:], file MGLRenderer.m, line 1436.

I am at the same point, but with all glDrawElements calls in place. I also have a window on the screen, even if briefly.

Screenshot 2023-01-05 at 10 15 38 AM