From 0b25335f8e395183c14a5449310b6255bc59f3c0 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Fri, 31 Dec 2021 12:11:30 -0800 Subject: [PATCH] Compile everything on the fly --- .../simibubi/create/foundation/render/CreateContexts.java | 8 ++++---- .../foundation/render/RainbowDebugStateProvider.java | 4 ++-- .../resources/assets/create/flywheel/programs/belt.json | 5 +---- .../create/flywheel/programs/contraption_actor.json | 5 +---- .../resources/assets/create/flywheel/programs/flap.json | 5 +---- .../assets/create/flywheel/programs/passthru.json | 5 +---- .../assets/create/flywheel/programs/rotating.json | 5 +---- 7 files changed, 11 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/render/CreateContexts.java b/src/main/java/com/simibubi/create/foundation/render/CreateContexts.java index 65ccd0d39..96029bb2b 100644 --- a/src/main/java/com/simibubi/create/foundation/render/CreateContexts.java +++ b/src/main/java/com/simibubi/create/foundation/render/CreateContexts.java @@ -4,12 +4,12 @@ import java.util.stream.Stream; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.GameStateRegistry; -import com.jozufozu.flywheel.backend.pipeline.ShaderPipeline; -import com.jozufozu.flywheel.backend.pipeline.WorldShaderPipeline; import com.jozufozu.flywheel.backend.source.FileResolution; import com.jozufozu.flywheel.backend.source.Resolver; import com.jozufozu.flywheel.core.Templates; import com.jozufozu.flywheel.core.WorldContext; +import com.jozufozu.flywheel.core.pipeline.PipelineCompiler; +import com.jozufozu.flywheel.core.pipeline.WorldCompiler; import com.jozufozu.flywheel.event.GatherContextEvent; import com.jozufozu.flywheel.util.ResourceUtil; import com.simibubi.create.Create; @@ -32,8 +32,8 @@ public class CreateContexts { GameStateRegistry.register(RainbowDebugStateProvider.INSTANCE); FileResolution header = Resolver.INSTANCE.findShader(ResourceUtil.subPath(CONTRAPTION, ".glsl")); - ShaderPipeline instancing = new WorldShaderPipeline<>(ContraptionProgram::new, Templates.INSTANCING, header); - ShaderPipeline structure = new WorldShaderPipeline<>(ContraptionProgram::new, Templates.ONE_SHOT, header); + PipelineCompiler instancing = new WorldCompiler<>(ContraptionProgram::new, Templates.INSTANCING, header); + PipelineCompiler structure = new WorldCompiler<>(ContraptionProgram::new, Templates.ONE_SHOT, header); CWORLD = backend.register(WorldContext.builder(backend, CONTRAPTION) .build(instancing)); diff --git a/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java b/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java index 7aafc712b..21c1eeab9 100644 --- a/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java +++ b/src/main/java/com/simibubi/create/foundation/render/RainbowDebugStateProvider.java @@ -1,12 +1,12 @@ package com.simibubi.create.foundation.render; -import com.jozufozu.flywheel.core.shader.spec.BooleanStateProvider; +import com.jozufozu.flywheel.core.shader.gamestate.IGameStateProvider; import com.simibubi.create.Create; import com.simibubi.create.content.contraptions.KineticDebugger; import net.minecraft.resources.ResourceLocation; -public class RainbowDebugStateProvider implements BooleanStateProvider { +public class RainbowDebugStateProvider implements IGameStateProvider { public static final RainbowDebugStateProvider INSTANCE = new RainbowDebugStateProvider(); public static final ResourceLocation NAME = Create.asResource("rainbow_debug"); diff --git a/src/main/resources/assets/create/flywheel/programs/belt.json b/src/main/resources/assets/create/flywheel/programs/belt.json index 78d6b64d5..47f867e68 100644 --- a/src/main/resources/assets/create/flywheel/programs/belt.json +++ b/src/main/resources/assets/create/flywheel/programs/belt.json @@ -6,10 +6,7 @@ "define": "DEBUG_RAINBOW" }, { - "when": { - "provider": "flywheel:normal_debug", - "value": "true" - }, + "when": "flywheel:normal_debug", "define": "DEBUG_NORMAL" } ] diff --git a/src/main/resources/assets/create/flywheel/programs/contraption_actor.json b/src/main/resources/assets/create/flywheel/programs/contraption_actor.json index 30dabe741..db423a474 100644 --- a/src/main/resources/assets/create/flywheel/programs/contraption_actor.json +++ b/src/main/resources/assets/create/flywheel/programs/contraption_actor.json @@ -2,10 +2,7 @@ "source": "create:contraption_actor.vert", "states": [ { - "when": { - "provider": "flywheel:normal_debug", - "value": "true" - }, + "when": "flywheel:normal_debug", "define": "DEBUG_NORMAL" } ] diff --git a/src/main/resources/assets/create/flywheel/programs/flap.json b/src/main/resources/assets/create/flywheel/programs/flap.json index 5ccd04188..49f0f4719 100644 --- a/src/main/resources/assets/create/flywheel/programs/flap.json +++ b/src/main/resources/assets/create/flywheel/programs/flap.json @@ -2,10 +2,7 @@ "source": "create:flap.vert", "states": [ { - "when": { - "provider": "flywheel:normal_debug", - "value": "true" - }, + "when": "flywheel:normal_debug", "define": "DEBUG_NORMAL" } ] diff --git a/src/main/resources/assets/create/flywheel/programs/passthru.json b/src/main/resources/assets/create/flywheel/programs/passthru.json index 6a5b96ba6..129d94950 100644 --- a/src/main/resources/assets/create/flywheel/programs/passthru.json +++ b/src/main/resources/assets/create/flywheel/programs/passthru.json @@ -2,10 +2,7 @@ "source": "create:passthru.vert", "states": [ { - "when": { - "provider": "flywheel:normal_debug", - "value": "true" - }, + "when": "flywheel:normal_debug", "define": "DEBUG_NORMAL" } ] diff --git a/src/main/resources/assets/create/flywheel/programs/rotating.json b/src/main/resources/assets/create/flywheel/programs/rotating.json index 443035a6a..079023b0d 100644 --- a/src/main/resources/assets/create/flywheel/programs/rotating.json +++ b/src/main/resources/assets/create/flywheel/programs/rotating.json @@ -6,10 +6,7 @@ "define": "DEBUG_RAINBOW" }, { - "when": { - "provider": "flywheel:normal_debug", - "value": "true" - }, + "when": "flywheel:normal_debug", "define": "DEBUG_NORMAL" } ]