From ffeecfdce03a5a6166038cb4c5d8916f73a69aab Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Mon, 27 Dec 2021 19:14:20 -0800 Subject: [PATCH] Go through GlVertexArray - VAO state is now handled by GlVertexArray objects - IndexedModel no longer inherits from VBOModel - BufferedModel doesn't need #clearState - Likely fixes crash on intel drivers --- gradle.properties | 2 +- .../structureMovement/render/FlwContraption.java | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index c13670115..784b6a0fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ parchment_version = 2021.12.19 # dependency versions registrate_version = MC1.18-1.0.21 -flywheel_version = 1.18-0.5.0.31 +flywheel_version = 1.18-0.5.0.33 jei_minecraft_version = 1.18 jei_version = 9.0.0.40 diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java index 9bef13bca..f02aced9f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java @@ -4,7 +4,6 @@ import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Supplier; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.Engine; @@ -13,7 +12,6 @@ import com.jozufozu.flywheel.backend.instancing.SerialTaskEngine; import com.jozufozu.flywheel.backend.instancing.batching.BatchingEngine; import com.jozufozu.flywheel.backend.instancing.instancing.InstancingEngine; import com.jozufozu.flywheel.backend.model.ArrayModelRenderer; -import com.jozufozu.flywheel.backend.model.ModelRenderer; import com.jozufozu.flywheel.core.model.Model; import com.jozufozu.flywheel.core.model.WorldModel; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; @@ -38,7 +36,7 @@ public class FlwContraption extends ContraptionRenderInfo { private final ContraptionLighter lighter; - private final Map renderLayers = new HashMap<>(); + private final Map renderLayers = new HashMap<>(); private final Matrix4f modelViewPartial = new Matrix4f(); private final ContraptionInstanceWorld instanceWorld; @@ -64,7 +62,7 @@ public class FlwContraption extends ContraptionRenderInfo { } public void renderStructureLayer(RenderType layer, ContraptionProgram shader) { - ModelRenderer structure = renderLayers.get(layer); + ArrayModelRenderer structure = renderLayers.get(layer); if (structure != null) { setup(shader); structure.draw(); @@ -119,7 +117,7 @@ public class FlwContraption extends ContraptionRenderInfo { } public void invalidate() { - for (ModelRenderer buffer : renderLayers.values()) { + for (ArrayModelRenderer buffer : renderLayers.values()) { buffer.delete(); } renderLayers.clear(); @@ -130,7 +128,7 @@ public class FlwContraption extends ContraptionRenderInfo { } private void buildLayers() { - for (ModelRenderer buffer : renderLayers.values()) { + for (ArrayModelRenderer buffer : renderLayers.values()) { buffer.delete(); } @@ -139,7 +137,7 @@ public class FlwContraption extends ContraptionRenderInfo { List blockLayers = RenderType.chunkBufferLayers(); for (RenderType layer : blockLayers) { - Supplier layerModel = () -> new WorldModel(renderWorld, layer, contraption.getBlocks().values(), layer + "_" + contraption.entity.getId()); + Model layerModel = new WorldModel(renderWorld, layer, contraption.getBlocks().values(), layer + "_" + contraption.entity.getId()); renderLayers.put(layer, new ArrayModelRenderer(layerModel)); }