Iris Shaders

Iris Shaders

36M Downloads

Intel UHD Graphics 600/Mesa: Some shaders do not work with Iris, unlike Optifine.

Lolothepro opened this issue · 4 comments

commented

What happened?

Some shaders do not work with Iris, unlike Optifine.

Screenshots

No response

Relevant log output

[14:26:27] [Render thread/WARN]: Shader compilation log for iris:sodium-terrain-gbuffer_solid.fsh: WARNING: 0:338: Divide by zero error during constant folding
WARNING: 0:338: Divide by zero error during constant folding
WARNING: 0:338: Divide by zero error during constant folding


[14:26:27] [Render thread/WARN]: Shader compilation log for iris:sodium-terrain-gbuffer_cutout.fsh: WARNING: 0:338: Divide by zero error during constant folding
WARNING: 0:338: Divide by zero error during constant folding
WARNING: 0:338: Divide by zero error during constant folding


[14:26:27] [Render thread/INFO]: [STDERR]: [LWJGL] OpenGL debug message
[14:26:27] [Render thread/WARN]: Program link log for sodium:chunk_shader_for_gbuffers_water: Varying "lmcoord" has different type width across different shaders.

[14:26:32] [Render thread/ERROR]: Unreported exception thrown!
java.lang.RuntimeException: Shader program linking failed, see log for details
	at me.jellysquid.mods.sodium.client.gl.shader.GlProgram$Builder.link(GlProgram.java:113) ~[sodium-fabric-mc1.18.2-0.4.1+build.15.jar:?]
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShader(IrisChunkProgramOverrides.java:155) ~[iris-mc1.18.2-1.2.3-pre-.jar:?]
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShaders(IrisChunkProgramOverrides.java:194) ~[iris-mc1.18.2-1.2.3-pre-.jar:?]
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.getProgramOverride(IrisChunkProgramOverrides.java:210) ~[iris-mc1.18.2-1.2.3-pre-.jar:?]
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.handler$zfh000$iris$begin(ShaderChunkRenderer.java:548) ~[sodium-fabric-mc1.18.2-0.4.1+build.15.jar:?]
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.begin(ShaderChunkRenderer.java) ~[sodium-fabric-mc1.18.2-0.4.1+build.15.jar:?]
	at me.jellysquid.mods.sodium.client.render.chunk.RegionChunkRenderer.render(RegionChunkRenderer.java:70) ~[sodium-fabric-mc1.18.2-0.4.1+build.15.jar:?]
	at me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.renderLayer(RenderSectionManager.java:289) ~[sodium-fabric-mc1.18.2-0.4.1+build.15.jar:?]
	at me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer.drawChunkLayer(SodiumWorldRenderer.java:221) ~[sodium-fabric-mc1.18.2-0.4.1+build.15.jar:?]
	at net.minecraft.class_761.method_3251(class_761.java:8966) ~[client-intermediary.jar:?]
	at net.minecraft.class_761.invokeRenderChunkLayer(class_761.java) ~[client-intermediary.jar:?]
	at net.coderbot.iris.pipeline.ShadowRenderer.renderShadows(ShadowRenderer.java:472) ~[iris-mc1.18.2-1.2.3-pre-.jar:?]
	at net.coderbot.iris.pipeline.newshader.NewWorldRenderingPipeline.renderShadows(NewWorldRenderingPipeline.java:506) ~[iris-mc1.18.2-1.2.3-pre-.jar:?]
	at net.minecraft.class_761.handler$zck000$iris$renderTerrainShadows(class_761.java:5471) ~[client-intermediary.jar:?]
	at net.minecraft.class_761.method_22710(class_761.java:1235) ~[client-intermediary.jar:?]
	at net.minecraft.class_757.method_3188(class_757.java:1034) ~[client-intermediary.jar:?]
	at net.minecraft.class_757.method_3192(class_757.java:813) ~[client-intermediary.jar:?]
	at net.minecraft.class_310.method_1523(class_310.java:1122) ~[client-intermediary.jar:?]
	at net.minecraft.class_310.method_1514(class_310.java:737) [client-intermediary.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:236) [client-intermediary.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:416) [fabric-loader-0.13.3.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77) [fabric-loader-0.13.3.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.13.3.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210) [NewLaunch.jar:?]
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245) [NewLaunch.jar:?]
	at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?]
	at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?]


--------------------------------------------

---- Minecraft Crash Report ----
// Hi. I'm Minecraft, and I'm a crashaholic.

Time: 4/10/22, 2:26 PM
Description: Unexpected error

java.lang.RuntimeException: Shader program linking failed, see log for details
	at me.jellysquid.mods.sodium.client.gl.shader.GlProgram$Builder.link(GlProgram.java:113)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShader(IrisChunkProgramOverrides.java:155)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShaders(IrisChunkProgramOverrides.java:194)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.getProgramOverride(IrisChunkProgramOverrides.java:210)
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.handler$zfh000$iris$begin(ShaderChunkRenderer.java:548)
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.begin(ShaderChunkRenderer.java)
	at me.jellysquid.mods.sodium.client.render.chunk.RegionChunkRenderer.render(RegionChunkRenderer.java:70)
	at me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.renderLayer(RenderSectionManager.java:289)
	at me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer.drawChunkLayer(SodiumWorldRenderer.java:221)
	at net.minecraft.class_761.method_3251(class_761.java:8966)
	at net.minecraft.class_761.invokeRenderChunkLayer(class_761.java)
	at net.coderbot.iris.pipeline.ShadowRenderer.renderShadows(ShadowRenderer.java:472)
	at net.coderbot.iris.pipeline.newshader.NewWorldRenderingPipeline.renderShadows(NewWorldRenderingPipeline.java:506)
	at net.minecraft.class_761.handler$zck000$iris$renderTerrainShadows(class_761.java:5471)
	at net.minecraft.class_761.method_22710(class_761.java:1235)
	at net.minecraft.class_757.method_3188(class_757.java:1034)
	at net.minecraft.class_757.method_3192(class_757.java:813)
	at net.minecraft.class_310.method_1523(class_310.java:1122)
	at net.minecraft.class_310.method_1514(class_310.java:737)
	at net.minecraft.client.main.Main.main(Main.java:236)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:416)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
	at org.multimc.EntryPoint.listen(EntryPoint.java:143)
	at org.multimc.EntryPoint.main(EntryPoint.java:34)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
	at me.jellysquid.mods.sodium.client.gl.shader.GlProgram$Builder.link(GlProgram.java:113)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShader(IrisChunkProgramOverrides.java:155)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShaders(IrisChunkProgramOverrides.java:194)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.getProgramOverride(IrisChunkProgramOverrides.java:210)
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.handler$zfh000$iris$begin(ShaderChunkRenderer.java:548)
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.begin(ShaderChunkRenderer.java)
	at me.jellysquid.mods.sodium.client.render.chunk.RegionChunkRenderer.render(RegionChunkRenderer.java:70)
	at me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.renderLayer(RenderSectionManager.java:289)
	at me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer.drawChunkLayer(SodiumWorldRenderer.java:221)
	at net.minecraft.class_761.method_3251(class_761.java:8966)
	at net.minecraft.class_761.invokeRenderChunkLayer(class_761.java)
	at net.coderbot.iris.pipeline.ShadowRenderer.renderShadows(ShadowRenderer.java:472)
	at net.coderbot.iris.pipeline.newshader.NewWorldRenderingPipeline.renderShadows(NewWorldRenderingPipeline.java:506)
	at net.minecraft.class_761.handler$zck000$iris$renderTerrainShadows(class_761.java:5471)
	at net.minecraft.class_761.method_22710(class_761.java:1235)
	at net.minecraft.class_757.method_3188(class_757.java:1034)

-- Affected level --
Details:
	All players: 1 total; [class_746['Lolothepro29'/199, l='ClientLevel', x=-191.73, y=89.81, z=267.18]]
	Chunk stats: 1024, 307
	Level dimension: minecraft:overworld
	Level spawn location: World: (-144,84,176), Section: (at 0,4,0 in -9,5,11; chunk contains blocks -144,-64,176 to -129,319,191), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,-64,0 to -1,319,511)
	Level time: 26576 game time, 26576 day time
	Server brand: fabric
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.class_638.method_8538(class_638.java:407)
	at net.minecraft.class_310.method_1587(class_310.java:2376)
	at net.minecraft.class_310.method_1514(class_310.java:761)
	at net.minecraft.client.main.Main.main(Main.java:236)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:416)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
	at org.multimc.EntryPoint.listen(EntryPoint.java:143)
	at org.multimc.EntryPoint.main(EntryPoint.java:34)

-- Last reload --
Details:
	Reload number: 1
	Reload reason: initial
	Finished: Yes
	Packs: Default, Fabric Mods

-- System Details --
Details:
	Minecraft Version: 1.18.2
	Minecraft Version ID: 1.18.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 17.0.1, IBM Corporation
	Java VM Version: Eclipse OpenJ9 VM (JRE 17 Windows 10 amd64-64-Bit Compressed References 20211207_55 (JIT enabled, AOT enabled)
OpenJ9   - 7d055dfcb
OMR      - e30892e2b
JCL      - fc67fbe50a0 based on jdk-17.0.1+12), Eclipse OpenJ9
	Memory: 300118824 bytes (286 MiB) / 1073741824 bytes (1024 MiB) up to 1073741824 bytes (1024 MiB)
	CPUs: 4
	Processor Vendor: GenuineIntel
	Processor Name: Intel(R) Celeron(R) N4120 CPU @ 1.10GHz
	Identifier: Intel64 Family 6 Model 122 Stepping 8
	Microarchitecture: Goldmont Plus
	Frequency (GHz): 1.09
	Number of physical packages: 1
	Number of physical CPUs: 4
	Number of logical CPUs: 4
	Graphics card #0 name: Intel(R) UHD Graphics 600
	Graphics card #0 vendor: Intel Corporation (0x8086)
	Graphics card #0 VRAM (MB): 1024.00
	Graphics card #0 deviceId: 0x3185
	Graphics card #0 versionInfo: DriverVersion=30.0.101.1660
	Memory slot #0 capacity (MB): 4096.00
	Memory slot #0 clockSpeed (GHz): 2.40
	Memory slot #0 type: DDR4
	Virtual memory max (MB): 9291.74
	Virtual memory used (MB): 6339.73
	Swap memory total (MB): 5376.00
	Swap memory used (MB): 588.05
	JVM Flags: 6 total; -Xoptionsfile=C:\Program Files\Semeru\jdk-17.0.1.12-openj9\lib\options.default -Xlockword:mode=default,noLockword=java/lang/String,noLockword=java/util/MapEntry,noLockword=java/util/HashMap$Entry,noLockword=org/apache/harmony/luni/util/ModifiedMap$Entry,noLockword=java/util/Hashtable$Entry,noLockword=java/lang/invoke/MethodType,noLockword=java/lang/invoke/MethodHandle,noLockword=java/lang/invoke/CollectHandle,noLockword=java/lang/invoke/ConstructorHandle,noLockword=java/lang/invoke/ConvertHandle,noLockword=java/lang/invoke/ArgumentConversionHandle,noLockword=java/lang/invoke/AsTypeHandle,noLockword=java/lang/invoke/ExplicitCastHandle,noLockword=java/lang/invoke/FilterReturnHandle,noLockword=java/lang/invoke/DirectHandle,noLockword=java/lang/invoke/ReceiverBoundHandle,noLockword=java/lang/invoke/DynamicInvokerHandle,noLockword=java/lang/invoke/FieldHandle,noLockword=java/lang/invoke/FieldGetterHandle,noLockword=java/lang/invoke/FieldSetterHandle,noLockword=java/lang/invoke/StaticFieldGetterHandle,noLockword=java/lang/invoke/StaticFieldSetterHandle,noLockword=java/lang/invoke/IndirectHandle,noLockword=java/lang/invoke/InterfaceHandle,noLockword=java/lang/invoke/VirtualHandle,noLockword=java/lang/invoke/PrimitiveHandle,noLockword=java/lang/invoke/InvokeExactHandle,noLockword=java/lang/invoke/InvokeGenericHandle,noLockword=java/lang/invoke/VarargsCollectorHandle,noLockword=java/lang/invoke/ThunkTuple -Xjcl:jclse29 -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms512m -Xmx1024m
	Loaded Shaderpack: Edi´s Shader OFFICIAL V3 ULTRA.zip
		Profile: Custom (+0 options changed by user)
	Launched Version: MultiMC5
	Backend library: LWJGL version 3.3.0 build 21
	Backend API: Intel(R) UHD Graphics 600 GL version 3.2.0 - Build 30.0.101.1660, Intel
	Window size: 854x480
	GL Caps: Using framebuffer using OpenGL 3.2
	GL debug messages: 
	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'fabric'; Server brand changed to 'fabric'
	Type: Integrated Server (map_client.txt)
	Graphics mode: fancy
	Resource Packs: Fabric Mods
	Current Language: English (US)
	CPU: 4x Intel(R) Celeron(R) N4120 CPU @ 1.10GHz
	Server Running: true
	Player Count: 1 / 8; [class_3222['Lolothepro29'/199, l='ServerLevel[New World]', x=-191.73, y=89.81, z=267.18]]
	Data Packs: vanilla
	World Generation: Stable

Minecraft Version

Minecraft 1.18.2

Iris Version

iris-1.18.2-1.2.2/1.2.3/1.2.2-5eaf8878-dirty

Sodium Version

sodium 0.4.1

Operating System

Windows 11

What is your GPU?

.

Java Version

Java 17

Additional context

No response

commented

While this might just be a driver bug, the fact that it's crashing like this means that the vanilla-patched shader compiles fine but the sodium-patched shader fails to compile. This should be investigated at some point.

commented

To "fix" this issue, Iris needs to check that the shaders declare the correct vector type (vec2 is vec2, vec4 is vec4) before patching Sodium (and this should only be done on non-Nvidia cards).
(later, maybe this can be fixed with #775)
(Iris (OpenGL) already do this, but Iris with Minecraft 1.17+ ignores this)

commented

1.17+

commented

fixed by 1e43aad