Iris Shaders

Iris Shaders

36M Downloads

Crash on undefined 1.17+ uniforms

camplowell opened this issue ยท 0 comments

commented

Minecraft Version

Minecraft 1.20.1

Iris Version

iris-mc1.20-1.6.4.jar

Sodium Version

sodium-fabric-mc1.20-0.4.10+build.27.jar

Operating System

MacOS Monterey 12.6.7

What is your GPU?

Radeon Pro 555X 4GB

Java Version

Java 16

Reproduction Steps

  1. Start with any shaderpack using #version 150 or newer (core profile)
  2. In any vertex shader, use one (or more) of the following without defining it:
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 textureMatrix = mat4(1.0);
uniform vec3 chunkOffset;
uniform mat3 normalMatrix;
  1. Attempt to use the broken shaderpack.
  2. Minecraft crashes.

Attached is a minimal shaderpack with the normal matrix used but not defined to demonstrate.
crashTest.zip

Crash Report file and latest.log

---- Minecraft Crash Report ----
// You're mean.

Time: 2023-07-23 16:29:06
Description: Unexpected error

java.lang.RuntimeException: Shader compilation failed, see log for details
	at me.jellysquid.mods.sodium.client.gl.shader.GlShader.<init>(GlShader.java:34)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createVertexShader(IrisChunkProgramOverrides.java:55)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShader(IrisChunkProgramOverrides.java:140)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShaders(IrisChunkProgramOverrides.java:234)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.getProgramOverride(IrisChunkProgramOverrides.java:263)
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.handler$baf000$iris$begin(ShaderChunkRenderer.java:562)
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.begin(ShaderChunkRenderer.java)
	at me.jellysquid.mods.sodium.client.render.chunk.RegionChunkRenderer.render(RegionChunkRenderer.java:66)
	at me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.renderLayer(RenderSectionManager.java:289)
	at me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer.drawChunkLayer(SodiumWorldRenderer.java:215)
	at net.minecraft.class_761.method_3251(class_761.java:10015)
	at net.minecraft.class_761.method_22710(class_761.java:1253)
	at net.minecraft.class_757.method_3188(class_757.java:1110)
	at net.minecraft.class_757.method_3192(class_757.java:880)
	at net.minecraft.class_310.method_1523(class_310.java:1219)
	at net.minecraft.class_310.method_1514(class_310.java:802)
	at net.minecraft.client.main.Main.main(Main.java:250)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)


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.GlShader.<init>(GlShader.java:34)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createVertexShader(IrisChunkProgramOverrides.java:55)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShader(IrisChunkProgramOverrides.java:140)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.createShaders(IrisChunkProgramOverrides.java:234)
	at net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides.getProgramOverride(IrisChunkProgramOverrides.java:263)
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.handler$baf000$iris$begin(ShaderChunkRenderer.java:562)
	at me.jellysquid.mods.sodium.client.render.chunk.ShaderChunkRenderer.begin(ShaderChunkRenderer.java)
	at me.jellysquid.mods.sodium.client.render.chunk.RegionChunkRenderer.render(RegionChunkRenderer.java:66)
	at me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.renderLayer(RenderSectionManager.java:289)
	at me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer.drawChunkLayer(SodiumWorldRenderer.java:215)
	at net.minecraft.class_761.method_3251(class_761.java:10015)
	at net.minecraft.class_761.method_22710(class_761.java:1253)
	at net.minecraft.class_757.method_3188(class_757.java:1110)

-- Affected level --
Details:
	All players: 1 total; [class_746['lolwel21'/133, l='ClientLevel', x=107.89, y=75.00, z=489.03]]
	Chunk stats: 1024, 609
	Level dimension: minecraft:overworld
	Level spawn location: World: (144,72,384), Section: (at 0,8,0 in 9,4,24; chunk contains blocks 144,-64,384 to 159,319,399), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)
	Level time: 35636 game time, 5816 day time
	Server brand: fabric
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.class_638.method_8538(class_638.java:458)
	at net.minecraft.class_310.method_1587(class_310.java:2406)
	at net.minecraft.class_310.method_1514(class_310.java:826)
	at net.minecraft.client.main.Main.main(Main.java:250)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

-- Last reload --
Details:
	Reload number: 1
	Reload reason: initial
	Finished: Yes
	Packs: vanilla, fabric

-- System Details --
Details:
	Minecraft Version: 1.20.1
	Minecraft Version ID: 1.20.1
	Operating System: Mac OS X (x86_64) version 12.6.7
	Java Version: 17.0.3, Microsoft
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
	Memory: 1194432624 bytes (1139 MiB) / 2013265920 bytes (1920 MiB) up to 4294967296 bytes (4096 MiB)
	CPUs: 12
	Processor Vendor: GenuineIntel
	Processor Name: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
	Identifier: Intel64 Family 6 Model 158 Stepping 10
	Microarchitecture: Coffee Lake
	Frequency (GHz): 2.20
	Number of physical packages: 1
	Number of physical CPUs: 6
	Number of logical CPUs: 12
	Graphics card #0 name: Intel UHD Graphics 630
	Graphics card #0 vendor: Intel
	Graphics card #0 VRAM (MB): 1536.00
	Graphics card #0 deviceId: 0x3e9b
	Graphics card #0 versionInfo: Revision ID: 0x0000, gMux Version: 5.0.0
	Graphics card #1 name: Radeon Pro 555X
	Graphics card #1 vendor: AMD (0x1002)
	Graphics card #1 VRAM (MB): 4096.00
	Graphics card #1 deviceId: 0x67ef
	Graphics card #1 versionInfo: Revision ID: 0x00e3, ROM Revision: 113-C980AL-075, VBIOS Version: 113-C97501P-005, EFI Driver Version: 01.A1.075, gMux Version: 5.0.0, Adapter Firmware Version: 7.55
	Memory slot #0 capacity (MB): 8192.00
	Memory slot #0 clockSpeed (GHz): 2.40
	Memory slot #0 type: DDR4
	Memory slot #1 capacity (MB): 8192.00
	Memory slot #1 clockSpeed (GHz): 2.40
	Memory slot #1 type: DDR4
	Virtual memory max (MB): 20480.00
	Virtual memory used (MB): 13926.11
	Swap memory total (MB): 4096.00
	Swap memory used (MB): 2779.50
	JVM Flags: 9 total; -Xmx4096M -XX:MetaspaceSize=256M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -Xss1M
	Fabric Mods: 
		fabric-api: Fabric API 0.86.0+1.20.1
			fabric-api-base: Fabric API Base 0.4.30+7abfd51577
			fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.6.35+4d8536c977
			fabric-biome-api-v1: Fabric Biome API (v1) 13.0.10+b3afc78b77
			fabric-block-api-v1: Fabric Block API (v1) 1.0.9+e022e5d177
			fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.40+b3afc78b77
			fabric-client-tags-api-v1: Fabric Client Tags 1.1.1+97bb207577
			fabric-command-api-v1: Fabric Command API (v1) 1.2.33+f71b366f77
			fabric-command-api-v2: Fabric Command API (v2) 2.2.12+b3afc78b77
			fabric-commands-v0: Fabric Commands (v0) 0.2.50+df3654b377
			fabric-containers-v0: Fabric Containers (v0) 0.1.62+df3654b377
			fabric-content-registries-v0: Fabric Content Registries (v0) 4.0.9+b3afc78b77
			fabric-convention-tags-v1: Fabric Convention Tags 1.5.4+a1a980da77
			fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.2.18+aeb40ebe77
			fabric-data-generation-api-v1: Fabric Data Generation API (v1) 12.2.0+6c31357e77
			fabric-dimensions-v1: Fabric Dimensions API (v1) 2.1.52+b3afc78b77
			fabric-entity-events-v1: Fabric Entity Events (v1) 1.5.22+b3afc78b77
			fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.6.1+e91849a877
			fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.62+df3654b377
			fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.38+b04edc7a77
			fabric-item-api-v1: Fabric Item API (v1) 2.1.27+b3afc78b77
			fabric-item-group-api-v1: Fabric Item Group API (v1) 4.0.9+132c48c177
			fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.36+fb8d95da77
			fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.34+df3654b377
			fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 2.2.21+b3afc78b77
			fabric-loot-api-v2: Fabric Loot API (v2) 1.1.39+b3afc78b77
			fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.1.43+9e7660c677
			fabric-message-api-v1: Fabric Message API (v1) 5.1.7+3265161977
			fabric-mining-level-api-v1: Fabric Mining Level API (v1) 2.1.49+b3afc78b77
			fabric-model-loading-api-v1: Fabric Model Loading API (v1) 1.0.1+9386d8a777
			fabric-models-v0: Fabric Models (v0) 0.4.0+9386d8a777
			fabric-networking-api-v1: Fabric Networking API (v1) 1.3.9+b3afc78b77
			fabric-networking-v0: Fabric Networking (v0) 0.3.49+df3654b377
			fabric-object-builder-api-v1: Fabric Object Builder API (v1) 11.1.1+6beca84877
			fabric-particles-v1: Fabric Particles (v1) 1.1.1+201a23a077
			fabric-recipe-api-v1: Fabric Recipe API (v1) 1.0.19+b3afc78b77
			fabric-registry-sync-v0: Fabric Registry Sync (v0) 2.3.0+2e061fd477
			fabric-renderer-api-v1: Fabric Renderer API (v1) 3.1.1+9386d8a777
			fabric-renderer-indigo: Fabric Renderer - Indigo 1.4.1+9172968c77
			fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 3.2.45+df3654b377
			fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.3.34+b3afc78b77
			fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 3.0.27+b3afc78b77
			fabric-rendering-v0: Fabric Rendering (v0) 1.1.48+df3654b377
			fabric-rendering-v1: Fabric Rendering (v1) 3.0.7+b3afc78b77
			fabric-resource-conditions-api-v1: Fabric Resource Conditions API (v1) 2.3.5+ea08f9d877
			fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.11.9+132c48c177
			fabric-screen-api-v1: Fabric Screen API (v1) 2.0.7+b3afc78b77
			fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.3.28+b3afc78b77
			fabric-sound-api-v1: Fabric Sound API (v1) 1.0.12+b3afc78b77
			fabric-transfer-api-v1: Fabric Transfer API (v1) 3.3.0+cdf060b277
			fabric-transitive-access-wideners-v1: Fabric Transitive Access Wideners (v1) 4.3.0+6c31357e77
		fabricloader: Fabric Loader 0.14.21
		iris: Iris 1.6.4
			io_github_douira_glsl-transformer: glsl-transformer 2.0.0-pre13
			org_anarres_jcpp: jcpp 1.4.14
			org_antlr_antlr4-runtime: antlr4-runtime 4.11.1
		java: OpenJDK 64-Bit Server VM 17
		minecraft: Minecraft 1.20.1
		sodium: Sodium 0.4.10+build.27
	Loaded Shaderpack: crashTest
		Profile: Custom (+0 options changed by user)
	NEC status: No NEC detected
	Launched Version: 1.20.1
	Backend library: LWJGL version 3.3.1 SNAPSHOT
	Backend API: AMD Radeon Pro 555X OpenGL Engine GL version 4.1 ATI-4.8.101, ATI Technologies Inc.
	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'; Server brand changed to 'fabric'
	Type: Integrated Server (map_client.txt)
	Graphics mode: fancy
	Resource Packs: fabric
	Current Language: en_us
	CPU: 12x Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
	Server Running: true
	Player Count: 1 / 8; [class_3222['lolwel21'/133, l='ServerLevel[Testing 1]', x=107.89, y=75.00, z=489.03]]
	Data Packs: vanilla, fabric
	Enabled Feature Flags: minecraft:vanilla
	World Generation: Stable

Additional context

There may be other missing uniforms for which Minecraft crashes, but I encountered issues with these while attempting to migrate a shaderpack to core profile.