From 56150b2645f9cb2d37188acb18d1fd2cadd6dc90 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Sun, 12 Dec 2021 22:30:46 -0800 Subject: [PATCH 01/10] Fix vanishing minecarts --- .../flywheel/backend/instancing/InstanceWorld.java | 11 +++++++++++ .../backend/instancing/InstancedRenderDispatcher.java | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java index 47bf41aa4..278fbe7cf 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java @@ -12,6 +12,7 @@ import com.jozufozu.flywheel.event.BeginFrameEvent; import com.jozufozu.flywheel.event.RenderLayerEvent; import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.block.entity.BlockEntity; @@ -100,4 +101,14 @@ public class InstanceWorld { public void renderLayer(RenderLayerEvent event) { engine.render(event, event.buffers.bufferSource()); } + + /** + * Instantiate all the necessary instances to render the given world. + */ + public void loadEntities(ClientLevel world) { + // Block entities are loaded while chunks are baked. + // Entities are loaded with the world, so when chunks are reloaded they need to be re-added. + world.entitiesForRendering() + .forEach(entityInstanceManager::add); + } } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java index 8e59f6f15..426ff035b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderDispatcher.java @@ -93,7 +93,8 @@ public class InstancedRenderDispatcher { } public static void resetInstanceWorld(ClientLevel world) { - instanceWorlds.replace(world, InstanceWorld::delete); + instanceWorlds.replace(world, InstanceWorld::delete) + .loadEntities(world); } } From 7cf2741e68dd67e29d9b396db25577cce486106a Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Sun, 12 Dec 2021 22:53:22 -0800 Subject: [PATCH 02/10] Ready for release --- build.gradle | 1 - changelog.txt | 1 + gradle.properties | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index d8ff50a1b..eeda96d6d 100644 --- a/build.gradle +++ b/build.gradle @@ -180,7 +180,6 @@ curseforge { changelog = file('changelog.txt') releaseType = project.curse_type mainArtifact jar - addGameVersion '1.18' addGameVersion '1.18.1' } } diff --git a/changelog.txt b/changelog.txt index 91456a3e9..31c1a0667 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Fixes - Fix crash affecting systems that don't support persistent mapping - Fix crash when Create contraptions extend below Y=0 - Fix Create contraptions having misaligned light when launched after world load + - Fix minecarts disappearing on chunk reload 0.4.0: Update to 1.18 diff --git a/gradle.properties b/gradle.properties index eb0337376..e94c2f5a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ parchment_version = 2021.10.31 # curseforge info projectId = 486392 -curse_type = beta +curse_type = release # github info github_project = Jozufozu/Flywheel From d094595f2ed247c9482aabbaee630dbb6d2d6d53 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Mon, 13 Dec 2021 11:38:32 -0800 Subject: [PATCH 03/10] Add GPU field to bug report template --- .github/ISSUE_TEMPLATE/bug_report.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index bb34d1d85..f26012d33 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -47,6 +47,13 @@ body: placeholder: Windows 11 validations: required: true + - type: input + attributes: + label: What is your GPU? + description: Enter the vendor and model of the GPU you were using when the bug occured + placeholder: Nvidia GeForce RTX 3060 + validations: + required: true - type: dropdown attributes: label: Mod Version From d9fd668bbb0a4eec3eb1dad39a94ff19da4b4557 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Mon, 13 Dec 2021 19:55:50 -0800 Subject: [PATCH 04/10] AMD driver workaround - Just don't pool models --- .../backend/gl/versioned/GlCompat.java | 18 ++- .../instancing/instancing/GPUInstancer.java | 2 +- .../instancing/InstancedMaterial.java | 15 +- .../instancing/InstancedMaterialRenderer.java | 7 +- .../flywheel/backend/model/IndexedModel.java | 2 + .../flywheel/backend/model/ModelPool.java | 3 + .../flywheel/vanilla/ChestInstance.java | 132 +++++++++--------- 7 files changed, 103 insertions(+), 76 deletions(-) diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/versioned/GlCompat.java b/src/main/java/com/jozufozu/flywheel/backend/gl/versioned/GlCompat.java index 9abdebfed..c44355940 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/versioned/GlCompat.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/versioned/GlCompat.java @@ -9,6 +9,8 @@ import org.lwjgl.opengl.GLCapabilities; import org.lwjgl.system.MemoryStack; import org.lwjgl.system.MemoryUtil; +import net.minecraft.Util; + /** * An instance of this class stores information about what OpenGL features are available. *
@@ -19,13 +21,27 @@ public class GlCompat { public final InstancedArrays instancedArrays; public final BufferStorage bufferStorage; + public final boolean amd; public GlCompat(GLCapabilities caps) { instancedArrays = getLatest(InstancedArrays.class, caps); bufferStorage = getLatest(BufferStorage.class, caps); + + + if (Util.getPlatform() == Util.OS.WINDOWS) { + String vendor = GL20C.glGetString(GL20C.GL_VENDOR); + // vendor string I got was "ATI Technologies Inc." + amd = vendor.contains("ATI") || vendor.contains("AMD"); + } else { + amd = false; + } } - public boolean instancedArraysSupported() { + public boolean onAMDWindows() { + return amd; + } + + public boolean instancedArraysSupported() { return instancedArrays != InstancedArrays.UNSUPPORTED; } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java index efc77ce9a..a2c0075d3 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java @@ -77,7 +77,7 @@ public class GPUInstancer extends AbstractInstancer { model = modelAllocator.alloc(modelData, arenaModel -> { vao.bind(); - model.setupState(); + arenaModel.setupState(); }); vao.bind(); diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterial.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterial.java index dc8678362..791dea79d 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterial.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterial.java @@ -5,10 +5,13 @@ import java.util.function.Supplier; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.RenderWork; import com.jozufozu.flywheel.api.InstanceData; import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Material; +import com.jozufozu.flywheel.backend.model.ImmediateAllocator; +import com.jozufozu.flywheel.backend.model.ModelAllocator; import com.jozufozu.flywheel.backend.model.ModelPool; import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.core.Formats; @@ -20,14 +23,18 @@ import com.jozufozu.flywheel.core.model.Model; */ public class InstancedMaterial implements Material { - final ModelPool modelPool; + final ModelAllocator allocator; protected final Cache> models; protected final StructType type; public InstancedMaterial(StructType spec) { this.type = spec; - modelPool = new ModelPool(Formats.UNLIT_MODEL, 64); + if (Backend.getInstance().compat.onAMDWindows()) { + allocator = ImmediateAllocator.INSTANCE; + } else { + allocator = new ModelPool(Formats.UNLIT_MODEL, 64); + } this.models = CacheBuilder.newBuilder() .removalListener(notification -> { GPUInstancer instancer = (GPUInstancer) notification.getValue(); @@ -46,7 +53,7 @@ public class InstancedMaterial implements Material { @Override public Instancer model(Object key, Supplier modelSupplier) { try { - return models.get(key, () -> new GPUInstancer<>(type, modelSupplier.get(), modelPool)); + return models.get(key, () -> new GPUInstancer<>(type, modelSupplier.get(), allocator)); } catch (ExecutionException e) { throw new RuntimeException("error creating instancer", e); } @@ -61,7 +68,7 @@ public class InstancedMaterial implements Material { public void delete() { models.invalidateAll(); - modelPool.delete(); + if (allocator instanceof ModelPool pool) pool.delete(); } /** diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialRenderer.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialRenderer.java index 9d52ea695..a6ab47680 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialRenderer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialRenderer.java @@ -4,6 +4,7 @@ import java.util.Collection; import java.util.function.Consumer; import java.util.function.Supplier; +import com.jozufozu.flywheel.backend.model.ModelPool; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.mojang.math.Matrix4f; @@ -28,8 +29,10 @@ public class InstancedMaterialRenderer

{ // initialize all uninitialized instancers... instancers.forEach(GPUInstancer::init); - // ...and then flush the model arena in case anything was marked for upload - material.modelPool.flush(); + if (material.allocator instanceof ModelPool pool) { + // ...and then flush the model arena in case anything was marked for upload + pool.flush(); + } P program = this.program.get(); diff --git a/src/main/java/com/jozufozu/flywheel/backend/model/IndexedModel.java b/src/main/java/com/jozufozu/flywheel/backend/model/IndexedModel.java index f22818d32..02ab9606b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/model/IndexedModel.java +++ b/src/main/java/com/jozufozu/flywheel/backend/model/IndexedModel.java @@ -43,6 +43,8 @@ public class IndexedModel extends BufferedModel { public void drawInstances(int instanceCount) { if (!valid()) return; + ebo.bind(); + GL31.glDrawElementsInstanced(primitiveMode.glEnum, ebo.elementCount, ebo.eboIndexType.getGlEnum(), 0, instanceCount); } } diff --git a/src/main/java/com/jozufozu/flywheel/backend/model/ModelPool.java b/src/main/java/com/jozufozu/flywheel/backend/model/ModelPool.java index 5a1d033f6..72f7973e2 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/model/ModelPool.java +++ b/src/main/java/com/jozufozu/flywheel/backend/model/ModelPool.java @@ -120,9 +120,12 @@ public class ModelPool implements ModelAllocator { VecBufferWriter consumer = new VecBufferWriter(buffer); + int vertices = 0; for (PooledModel model : models) { + model.first = vertices; model.model.buffer(consumer); if (model.callback != null) model.callback.onAlloc(model); + vertices += model.getVertexCount(); } } catch (Exception e) { diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java index 674f48255..1935c5406 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java @@ -125,80 +125,76 @@ public class ChestInstance extends TileE private ModelPart getBaseModel() { - switch (chestType) { - case LEFT: - return ModelPart.builder("chest_base_left", 64, 64) - .sprite(renderMaterial.sprite()) - .cuboid() - .textureOffset(0, 19) - .start(0, 0, 1) - .size(15, 10, 14) - .endCuboid() - .build(); - case RIGHT: - return ModelPart.builder("chest_base_right", 64, 64) - .sprite(renderMaterial.sprite()) - .cuboid() - .textureOffset(0, 19) - .start(1, 0, 1) - .size(15, 10, 14) - .endCuboid() - .build(); - } + return switch (chestType) { + case LEFT -> ModelPart.builder("chest_base_left", 64, 64) + .sprite(renderMaterial.sprite()) + .cuboid() + .textureOffset(0, 19) + .start(0, 0, 1) + .size(15, 10, 14) + .endCuboid() + .build(); + case RIGHT -> ModelPart.builder("chest_base_right", 64, 64) + .sprite(renderMaterial.sprite()) + .cuboid() + .textureOffset(0, 19) + .start(1, 0, 1) + .size(15, 10, 14) + .endCuboid() + .build(); + default -> ModelPart.builder("chest_base", 64, 64) + .sprite(renderMaterial.sprite()) + .cuboid() + .textureOffset(0, 19) + .start(1, 0, 1) + .end(15, 10, 15) + .endCuboid() + .build(); + }; - return ModelPart.builder("chest_base", 64, 64) - .sprite(renderMaterial.sprite()) - .cuboid() - .textureOffset(0, 19) - .start(1, 0, 1) - .end(15, 10, 15) - .endCuboid() - .build(); } private ModelPart getLidModel() { - switch (chestType) { - case LEFT: - return ModelPart.builder("chest_lid_left", 64, 64) - .sprite(renderMaterial.sprite()) - .cuboid() - .textureOffset(0, 0) - .start(0, 0, 1) - .size(15, 5, 14) - .endCuboid() - .cuboid() - .start(0, -2, 15) - .size(1, 4, 1) - .endCuboid() - .build(); - case RIGHT: - return ModelPart.builder("chest_lid_right", 64, 64) - .sprite(renderMaterial.sprite()) - .cuboid() - .textureOffset(0, 0) - .start(1, 0, 1) - .size(15, 5, 14) - .endCuboid() - .cuboid() - .start(15, -2, 15) - .size(1, 4, 1) - .endCuboid() - .build(); - } + return switch (chestType) { + case LEFT -> ModelPart.builder("chest_lid_left", 64, 64) + .sprite(renderMaterial.sprite()) + .cuboid() + .textureOffset(0, 0) + .start(0, 0, 1) + .size(15, 5, 14) + .endCuboid() + .cuboid() + .start(0, -2, 15) + .size(1, 4, 1) + .endCuboid() + .build(); + case RIGHT -> ModelPart.builder("chest_lid_right", 64, 64) + .sprite(renderMaterial.sprite()) + .cuboid() + .textureOffset(0, 0) + .start(1, 0, 1) + .size(15, 5, 14) + .endCuboid() + .cuboid() + .start(15, -2, 15) + .size(1, 4, 1) + .endCuboid() + .build(); + default -> ModelPart.builder("chest_lid", 64, 64) + .sprite(renderMaterial.sprite()) + .cuboid() + .textureOffset(0, 0) + .start(1, 0, 1) + .size(14, 5, 14) + .endCuboid() + .cuboid() + .start(7, -2, 15) + .size(2, 4, 1) + .endCuboid() + .build(); + }; - return ModelPart.builder("chest_lid", 64, 64) - .sprite(renderMaterial.sprite()) - .cuboid() - .textureOffset(0, 0) - .start(1, 0, 1) - .size(14, 5, 14) - .endCuboid() - .cuboid() - .start(7, -2, 15) - .size(2, 4, 1) - .endCuboid() - .build(); } public static boolean isChristmas() { From 64a7443ddea6f0b9e5a4acc546b019b9aebce6da Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Mon, 13 Dec 2021 21:27:15 -0800 Subject: [PATCH 05/10] No need for InstancedMaterialRenderer - Here's to premature abstraction --- .../batching/BatchedMaterialGroup.java | 6 -- .../instancing/InstancedMaterialGroup.java | 56 +++++++++++-------- .../instancing/InstancedMaterialRenderer.java | 48 ---------------- .../core/crumbling/CrumblingGroup.java | 5 +- 4 files changed, 34 insertions(+), 81 deletions(-) delete mode 100644 src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialRenderer.java diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMaterialGroup.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMaterialGroup.java index 70e092e75..7cad92ecb 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMaterialGroup.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchedMaterialGroup.java @@ -22,12 +22,6 @@ public class BatchedMaterialGroup implements MaterialGroup { this.state = state; } - /** - * Get the material as defined by the given {@link StructType type}. - * @param spec The material you want to create instances with. - * @param The type representing the per instance data. - * @return A - */ @SuppressWarnings("unchecked") @Override public BatchedMaterial material(StructType spec) { diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialGroup.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialGroup.java index ac7f9b36f..466c82e15 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialGroup.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialGroup.java @@ -1,12 +1,13 @@ package com.jozufozu.flywheel.backend.instancing.instancing; -import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import com.jozufozu.flywheel.api.InstanceData; import com.jozufozu.flywheel.api.MaterialGroup; import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.backend.model.ModelPool; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.util.TextureBinder; import com.mojang.math.Matrix4f; @@ -24,8 +25,6 @@ public class InstancedMaterialGroup

implements MaterialG protected final InstancingEngine

owner; protected final RenderType type; - protected final ArrayList> renderers = new ArrayList<>(); - private final Map, InstancedMaterial> materials = new HashMap<>(); public InstancedMaterialGroup(InstancingEngine

owner, RenderType type) { @@ -33,27 +32,48 @@ public class InstancedMaterialGroup

implements MaterialG this.type = type; } - /** - * Get the material as defined by the given {@link MaterialSpec spec}. - * @param spec The material you want to create instances with. - * @param The type representing the per instance data. - * @return A - */ @SuppressWarnings("unchecked") @Override public InstancedMaterial material(StructType spec) { - return (InstancedMaterial) materials.computeIfAbsent(spec, this::createInstanceMaterial); + return (InstancedMaterial) materials.computeIfAbsent(spec, InstancedMaterial::new); } public void render(Matrix4f viewProjection, double camX, double camY, double camZ) { type.setupRenderState(); TextureBinder.bindActiveTextures(); - for (InstancedMaterialRenderer

renderer : renderers) { - renderer.render(viewProjection, camX, camY, camZ); - } + renderAll(viewProjection, camX, camY, camZ); type.clearRenderState(); } + protected void renderAll(Matrix4f viewProjection, double camX, double camY, double camZ) { + for (Map.Entry, InstancedMaterial> entry : materials.entrySet()) { + InstancedMaterial material = entry.getValue(); + if (material.nothingToRender()) continue; + + Collection> instancers = material.models.asMap() + .values(); + + // initialize all uninitialized instancers... + instancers.forEach(GPUInstancer::init); + if (material.allocator instanceof ModelPool pool) { + // ...and then flush the model arena in case anything was marked for upload + pool.flush(); + } + + P program = owner.getProgram(entry.getKey() + .asInstanced() + .getProgramSpec()).get(); + + program.bind(); + program.uploadViewProjection(viewProjection); + program.uploadCameraPos(camX, camY, camZ); + + setup(program); + + instancers.forEach(GPUInstancer::render); + } + } + public void setup(P program) { } @@ -67,15 +87,5 @@ public class InstancedMaterialGroup

implements MaterialG .forEach(InstancedMaterial::delete); materials.clear(); - renderers.clear(); - } - - private InstancedMaterial createInstanceMaterial(StructType type) { - InstancedMaterial material = new InstancedMaterial<>(type); - - this.renderers.add(new InstancedMaterialRenderer<>(owner.getProgram(type.asInstanced() - .getProgramSpec()), material, this::setup)); - - return material; } } diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialRenderer.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialRenderer.java deleted file mode 100644 index a6ab47680..000000000 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterialRenderer.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.jozufozu.flywheel.backend.instancing.instancing; - -import java.util.Collection; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import com.jozufozu.flywheel.backend.model.ModelPool; -import com.jozufozu.flywheel.core.shader.WorldProgram; -import com.mojang.math.Matrix4f; - -public class InstancedMaterialRenderer

{ - - protected final Supplier

program; - protected final InstancedMaterial material; - - protected final Consumer

setupFunc; - - public InstancedMaterialRenderer(Supplier

programSupplier, InstancedMaterial material, Consumer

setupFunc) { - this.program = programSupplier; - this.material = material; - this.setupFunc = setupFunc; - } - - public void render(Matrix4f viewProjection, double camX, double camY, double camZ) { - if (material.nothingToRender()) return; - - Collection> instancers = material.models.asMap() - .values(); - - // initialize all uninitialized instancers... - instancers.forEach(GPUInstancer::init); - if (material.allocator instanceof ModelPool pool) { - // ...and then flush the model arena in case anything was marked for upload - pool.flush(); - } - - P program = this.program.get(); - - program.bind(); - program.uploadViewProjection(viewProjection); - program.uploadCameraPos(camX, camY, camZ); - - setupFunc.accept(program); - - instancers.forEach(GPUInstancer::render); - } - -} diff --git a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingGroup.java b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingGroup.java index a5093fbe5..c0eff27ae 100644 --- a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingGroup.java +++ b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingGroup.java @@ -2,7 +2,6 @@ package com.jozufozu.flywheel.core.crumbling; import com.jozufozu.flywheel.backend.instancing.instancing.InstancedMaterialGroup; import com.jozufozu.flywheel.backend.instancing.instancing.InstancingEngine; -import com.jozufozu.flywheel.backend.instancing.instancing.InstancedMaterialRenderer; import com.jozufozu.flywheel.core.atlas.AtlasInfo; import com.jozufozu.flywheel.core.atlas.SheetData; import com.jozufozu.flywheel.util.RenderTextures; @@ -39,9 +38,7 @@ public class CrumblingGroup

extends InstancedMateria RenderSystem.setShaderTexture(4, breakingTex); TextureBinder.bindActiveTextures(); - for (InstancedMaterialRenderer

renderer : renderers) { - renderer.render(viewProjection, camX, camY, camZ); - } + renderAll(viewProjection, camX, camY, camZ); CrumblingRenderer._currentLayer.clearRenderState(); } From cb5047f67772202c6b9f3e80db03cbc267d897fe Mon Sep 17 00:00:00 2001 From: PepperBell <44146161+PepperCode1@users.noreply.github.com> Date: Tue, 14 Dec 2021 22:00:44 -0800 Subject: [PATCH 06/10] Sweeping up - Remove deprecated methods and fields - Bump pack format - Fix CI badge link - Update VanillaInstances javadoc - Organize imports --- README.md | 2 +- .../api/instance/IDynamicInstance.java | 2 +- .../jozufozu/flywheel/backend/Backend.java | 2 +- .../flywheel/backend/gl/GLSLVersion.java | 4 --- .../backend/gl/buffer/MappedGlBuffer.java | 1 - .../flywheel/backend/gl/buffer/VecBuffer.java | 2 -- .../backend/instancing/AbstractInstance.java | 4 +-- .../backend/instancing/InstanceManager.java | 4 +-- .../backend/instancing/InstanceWorld.java | 4 +-- .../instancing/InstancedRenderRegistry.java | 25 +++-------------- .../instancing/batching/BatchingEngine.java | 2 +- .../instancing/batching/CPUInstancer.java | 2 +- .../instancing/entity/EntityInstance.java | 6 ++-- .../entity/EntityInstanceManager.java | 2 +- .../instancing/instancing/GPUInstancer.java | 6 ++-- .../instancing/InstancedMaterial.java | 6 ++-- .../instancing/InstancingEngine.java | 4 +-- .../instancing/tile/TileEntityInstance.java | 6 ++-- .../instancing/tile/TileInstanceManager.java | 2 +- .../backend/pipeline/WorldShaderPipeline.java | 2 +- .../com/jozufozu/flywheel/core/Contexts.java | 2 +- .../flywheel/core/FullscreenQuad.java | 7 +++-- .../com/jozufozu/flywheel/core/Materials.java | 2 +- .../crumbling/CrumblingInstanceManager.java | 2 +- .../core/materials/model/ModelType.java | 6 ++-- .../model/writer/UnsafeModelWriter.java | 2 +- .../core/materials/oriented/OrientedType.java | 6 ++-- .../oriented/writer/UnsafeOrientedWriter.java | 2 +- .../flywheel/core/model/PartBuilder.java | 3 -- .../flywheel/light/GPULightVolume.java | 4 --- .../flywheel/mixin/RenderHooksMixin.java | 1 - .../flywheel/mixin/matrix/PoseStackMixin.java | 1 - .../flywheel/vanilla/BellInstance.java | 2 +- .../flywheel/vanilla/ChestInstance.java | 2 +- .../flywheel/vanilla/MinecartInstance.java | 2 +- .../flywheel/vanilla/ShulkerBoxInstance.java | 2 +- .../flywheel/vanilla/VanillaInstances.java | 28 +++++++++---------- src/main/resources/pack.mcmeta | 2 +- 38 files changed, 66 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index 3de6e12e7..95d7ba6ba 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Logo by @voxel_dani on Twitter

Flywheel

A modern engine for modded Minecraft.
-Jenkins +Jenkins Discord Curseforge Downloads
diff --git a/src/main/java/com/jozufozu/flywheel/api/instance/IDynamicInstance.java b/src/main/java/com/jozufozu/flywheel/api/instance/IDynamicInstance.java index fdc684913..75b4bdc15 100644 --- a/src/main/java/com/jozufozu/flywheel/api/instance/IDynamicInstance.java +++ b/src/main/java/com/jozufozu/flywheel/api/instance/IDynamicInstance.java @@ -1,7 +1,7 @@ package com.jozufozu.flywheel.api.instance; -import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.InstanceData; +import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; /** diff --git a/src/main/java/com/jozufozu/flywheel/backend/Backend.java b/src/main/java/com/jozufozu/flywheel/backend/Backend.java index 2be21c97e..2a14e44ff 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/Backend.java +++ b/src/main/java/com/jozufozu/flywheel/backend/Backend.java @@ -14,9 +14,9 @@ import org.lwjgl.opengl.GL; import org.lwjgl.opengl.GLCapabilities; import com.jozufozu.flywheel.api.FlywheelWorld; -import com.jozufozu.flywheel.backend.gl.versioned.GlCompat; import com.jozufozu.flywheel.api.InstanceData; import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.backend.gl.versioned.GlCompat; import com.jozufozu.flywheel.config.FlwConfig; import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/GLSLVersion.java b/src/main/java/com/jozufozu/flywheel/backend/gl/GLSLVersion.java index 5473de7ad..978a6ecbd 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/GLSLVersion.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/GLSLVersion.java @@ -1,10 +1,6 @@ package com.jozufozu.flywheel.backend.gl; public enum GLSLVersion { - @Deprecated - V110(110), - @Deprecated - V120(120), V150(150), V330(330), ; diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/MappedGlBuffer.java b/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/MappedGlBuffer.java index 8fe3ba243..8df8ebea0 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/MappedGlBuffer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/MappedGlBuffer.java @@ -7,7 +7,6 @@ import org.lwjgl.opengl.GL30; import com.jozufozu.flywheel.backend.gl.error.GlError; import com.jozufozu.flywheel.backend.gl.error.GlException; -import com.jozufozu.flywheel.util.StringUtil; public class MappedGlBuffer extends GlBuffer implements Mappable { diff --git a/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/VecBuffer.java b/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/VecBuffer.java index ab957169c..8d5a14eb6 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/VecBuffer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/gl/buffer/VecBuffer.java @@ -5,8 +5,6 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; -import javax.annotation.Nullable; - public class VecBuffer { protected ByteBuffer internal; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java index 1feadfa37..3bf0c14b2 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/AbstractInstance.java @@ -3,14 +3,14 @@ package com.jozufozu.flywheel.backend.instancing; import java.util.Arrays; import java.util.stream.Stream; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.IInstance; import com.jozufozu.flywheel.api.instance.ITickableInstance; import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; -import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.core.materials.FlatLit; -import com.jozufozu.flywheel.light.LightListener; import com.jozufozu.flywheel.light.ImmutableBox; +import com.jozufozu.flywheel.light.LightListener; import com.jozufozu.flywheel.light.LightProvider; import com.jozufozu.flywheel.light.ListenerStatus; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java index ba55db9f5..14c51f360 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceManager.java @@ -8,10 +8,10 @@ import java.util.Set; import javax.annotation.Nullable; -import com.jozufozu.flywheel.backend.Backend; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.ITickableInstance; -import com.jozufozu.flywheel.api.MaterialManager; +import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.instancing.InstancingEngine; import com.jozufozu.flywheel.light.LightUpdater; import com.mojang.math.Vector3f; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java index 278fbe7cf..7f127021f 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstanceWorld.java @@ -2,10 +2,10 @@ package com.jozufozu.flywheel.backend.instancing; import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.ITickableInstance; -import com.jozufozu.flywheel.backend.instancing.entity.EntityInstanceManager; -import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; import com.jozufozu.flywheel.backend.instancing.batching.BatchingEngine; +import com.jozufozu.flywheel.backend.instancing.entity.EntityInstanceManager; import com.jozufozu.flywheel.backend.instancing.instancing.InstancingEngine; +import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; import com.jozufozu.flywheel.core.Contexts; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.event.BeginFrameEvent; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderRegistry.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderRegistry.java index 524b03e78..db0c325a4 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderRegistry.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/InstancedRenderRegistry.java @@ -6,11 +6,11 @@ import javax.annotation.Nullable; import com.google.common.collect.Maps; import com.jozufozu.flywheel.api.FlywheelRendered; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance; import com.jozufozu.flywheel.backend.instancing.entity.IEntityInstanceFactory; import com.jozufozu.flywheel.backend.instancing.tile.ITileInstanceFactory; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; -import com.jozufozu.flywheel.api.MaterialManager; import it.unimi.dsi.fastutil.objects.Object2BooleanLinkedOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2BooleanMap; @@ -58,24 +58,6 @@ public class InstancedRenderRegistry { return new EntityConfig<>(type); } - /** - * @deprecated will be removed in 0.3.0, use {@link #tile} - */ - @Deprecated - public void register(BlockEntityType type, ITileInstanceFactory rendererFactory) { - this.tile(type) - .factory(rendererFactory); - } - - /** - * @deprecated will be removed in 0.3.0, use {@link #entity} - */ - @Deprecated - public void register(EntityType type, IEntityInstanceFactory rendererFactory) { - this.entity(type) - .factory(rendererFactory); - } - @SuppressWarnings("unchecked") @Nullable public TileEntityInstance create(MaterialManager manager, T tile) { @@ -110,7 +92,6 @@ public class InstancedRenderRegistry { public class TileConfig implements Config, ITileInstanceFactory> { - private final BlockEntityType type; public TileConfig(BlockEntityType type) { @@ -121,14 +102,15 @@ public class InstancedRenderRegistry { tiles.put(type, rendererFactory); return this; } + public TileConfig setSkipRender(boolean skipRender) { InstancedRenderRegistry.this.skipRender.put(type, skipRender); return this; } } - public class EntityConfig implements Config, IEntityInstanceFactory> { + public class EntityConfig implements Config, IEntityInstanceFactory> { private final EntityType type; @@ -140,6 +122,7 @@ public class InstancedRenderRegistry { entities.put(type, rendererFactory); return this; } + public EntityConfig setSkipRender(boolean skipRender) { InstancedRenderRegistry.this.skipRender.put(type, skipRender); diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingEngine.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingEngine.java index 427115dde..27535864a 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingEngine.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/BatchingEngine.java @@ -4,9 +4,9 @@ import java.util.EnumMap; import java.util.HashMap; import java.util.Map; -import com.jozufozu.flywheel.backend.instancing.Engine; import com.jozufozu.flywheel.api.MaterialGroup; import com.jozufozu.flywheel.backend.RenderLayer; +import com.jozufozu.flywheel.backend.instancing.Engine; import com.jozufozu.flywheel.event.RenderLayerEvent; import net.minecraft.client.Camera; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/CPUInstancer.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/CPUInstancer.java index 270812f92..955c52a1c 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/CPUInstancer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/batching/CPUInstancer.java @@ -1,9 +1,9 @@ package com.jozufozu.flywheel.backend.instancing.batching; -import com.jozufozu.flywheel.backend.instancing.AbstractInstancer; import com.jozufozu.flywheel.api.InstanceData; import com.jozufozu.flywheel.api.struct.BatchingTransformer; import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.backend.instancing.AbstractInstancer; import com.jozufozu.flywheel.core.model.Model; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstance.java index f8e84e2fc..ac6443bf0 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstance.java @@ -1,14 +1,14 @@ package com.jozufozu.flywheel.backend.instancing.entity; -import com.jozufozu.flywheel.backend.instancing.AbstractInstance; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.ITickableInstance; +import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; -import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.light.GridAlignedBB; import com.jozufozu.flywheel.light.LightListener; -import com.jozufozu.flywheel.light.MovingListener; import com.jozufozu.flywheel.light.LightProvider; +import com.jozufozu.flywheel.light.MovingListener; import com.mojang.math.Vector3f; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java index 95bef0093..223f725fb 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/entity/EntityInstanceManager.java @@ -1,10 +1,10 @@ package com.jozufozu.flywheel.backend.instancing.entity; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.backend.instancing.InstanceManager; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; -import com.jozufozu.flywheel.api.MaterialManager; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java index a2c0075d3..879f35785 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/GPUInstancer.java @@ -3,6 +3,9 @@ package com.jozufozu.flywheel.backend.instancing.instancing; import java.util.BitSet; import com.jozufozu.flywheel.Flywheel; +import com.jozufozu.flywheel.api.InstanceData; +import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.api.struct.StructWriter; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.gl.GlVertexArray; import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; @@ -11,11 +14,8 @@ import com.jozufozu.flywheel.backend.gl.buffer.GlBufferType; import com.jozufozu.flywheel.backend.gl.buffer.MappedBuffer; import com.jozufozu.flywheel.backend.gl.error.GlError; import com.jozufozu.flywheel.backend.instancing.AbstractInstancer; -import com.jozufozu.flywheel.api.InstanceData; import com.jozufozu.flywheel.backend.model.IBufferedModel; import com.jozufozu.flywheel.backend.model.ModelAllocator; -import com.jozufozu.flywheel.api.struct.StructType; -import com.jozufozu.flywheel.api.struct.StructWriter; import com.jozufozu.flywheel.core.model.Model; import com.jozufozu.flywheel.util.AttribUtil; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterial.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterial.java index 791dea79d..24b569b30 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterial.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancedMaterial.java @@ -5,15 +5,15 @@ import java.util.function.Supplier; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.backend.RenderWork; import com.jozufozu.flywheel.api.InstanceData; import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Material; +import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.backend.Backend; +import com.jozufozu.flywheel.backend.RenderWork; import com.jozufozu.flywheel.backend.model.ImmediateAllocator; import com.jozufozu.flywheel.backend.model.ModelAllocator; import com.jozufozu.flywheel.backend.model.ModelPool; -import com.jozufozu.flywheel.api.struct.StructType; import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.core.model.Model; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java index e257a381f..7d1fa1cbe 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/instancing/InstancingEngine.java @@ -8,11 +8,11 @@ import java.util.stream.Stream; import javax.annotation.Nullable; +import com.jozufozu.flywheel.api.MaterialGroup; +import com.jozufozu.flywheel.backend.RenderLayer; import com.jozufozu.flywheel.backend.gl.GlVertexArray; import com.jozufozu.flywheel.backend.gl.buffer.GlBufferType; import com.jozufozu.flywheel.backend.instancing.Engine; -import com.jozufozu.flywheel.api.MaterialGroup; -import com.jozufozu.flywheel.backend.RenderLayer; import com.jozufozu.flywheel.core.WorldContext; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.event.RenderLayerEvent; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileEntityInstance.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileEntityInstance.java index 506b220a4..b064d214f 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileEntityInstance.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileEntityInstance.java @@ -1,10 +1,10 @@ package com.jozufozu.flywheel.backend.instancing.tile; -import com.jozufozu.flywheel.backend.instancing.AbstractInstance; -import com.jozufozu.flywheel.api.instance.IDynamicInstance; -import com.jozufozu.flywheel.api.instance.ITickableInstance; import com.jozufozu.flywheel.api.Material; import com.jozufozu.flywheel.api.MaterialManager; +import com.jozufozu.flywheel.api.instance.IDynamicInstance; +import com.jozufozu.flywheel.api.instance.ITickableInstance; +import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData; diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileInstanceManager.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileInstanceManager.java index 57eb8c8e9..aa4e6c274 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/tile/TileInstanceManager.java @@ -1,10 +1,10 @@ package com.jozufozu.flywheel.backend.instancing.tile; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.instancing.AbstractInstance; import com.jozufozu.flywheel.backend.instancing.InstanceManager; import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry; -import com.jozufozu.flywheel.api.MaterialManager; import net.minecraft.core.BlockPos; import net.minecraft.world.level.BlockGetter; diff --git a/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShaderPipeline.java b/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShaderPipeline.java index 985a60ad7..9129cb514 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShaderPipeline.java +++ b/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShaderPipeline.java @@ -7,9 +7,9 @@ import javax.annotation.Nullable; import com.jozufozu.flywheel.backend.gl.shader.ShaderType; import com.jozufozu.flywheel.backend.source.FileResolution; import com.jozufozu.flywheel.backend.source.SourceFile; +import com.jozufozu.flywheel.core.shader.ContextAwareProgram; import com.jozufozu.flywheel.core.shader.ExtensibleGlProgram; import com.jozufozu.flywheel.core.shader.GameStateProgram; -import com.jozufozu.flywheel.core.shader.ContextAwareProgram; import com.jozufozu.flywheel.core.shader.WorldProgram; import com.jozufozu.flywheel.core.shader.spec.ProgramSpec; import com.jozufozu.flywheel.core.shader.spec.ProgramState; diff --git a/src/main/java/com/jozufozu/flywheel/core/Contexts.java b/src/main/java/com/jozufozu/flywheel/core/Contexts.java index 49821aaf9..5c702124a 100644 --- a/src/main/java/com/jozufozu/flywheel/core/Contexts.java +++ b/src/main/java/com/jozufozu/flywheel/core/Contexts.java @@ -3,8 +3,8 @@ package com.jozufozu.flywheel.core; import com.jozufozu.flywheel.Flywheel; 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.InstancingTemplate; +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; diff --git a/src/main/java/com/jozufozu/flywheel/core/FullscreenQuad.java b/src/main/java/com/jozufozu/flywheel/core/FullscreenQuad.java index a1269b613..1436dab6c 100644 --- a/src/main/java/com/jozufozu/flywheel/core/FullscreenQuad.java +++ b/src/main/java/com/jozufozu/flywheel/core/FullscreenQuad.java @@ -1,8 +1,9 @@ package com.jozufozu.flywheel.core; -import static org.lwjgl.opengl.GL20.*; - -import org.lwjgl.opengl.GL20; +import static org.lwjgl.opengl.GL11.GL_TRIANGLES; +import static org.lwjgl.opengl.GL11.glDrawArrays; +import static org.lwjgl.opengl.GL20.glEnableVertexAttribArray; +import static org.lwjgl.opengl.GL20.glVertexAttribPointer; import com.jozufozu.flywheel.Flywheel; import com.jozufozu.flywheel.backend.gl.GlNumericType; diff --git a/src/main/java/com/jozufozu/flywheel/core/Materials.java b/src/main/java/com/jozufozu/flywheel/core/Materials.java index ccae21eaf..3de4d5f1b 100644 --- a/src/main/java/com/jozufozu/flywheel/core/Materials.java +++ b/src/main/java/com/jozufozu/flywheel/core/Materials.java @@ -1,7 +1,7 @@ package com.jozufozu.flywheel.core; -import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelType; import com.jozufozu.flywheel.core.materials.oriented.OrientedData; diff --git a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingInstanceManager.java b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingInstanceManager.java index 63ee63425..30e427f6b 100644 --- a/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingInstanceManager.java +++ b/src/main/java/com/jozufozu/flywheel/core/crumbling/CrumblingInstanceManager.java @@ -1,7 +1,7 @@ package com.jozufozu.flywheel.core.crumbling; -import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; import com.jozufozu.flywheel.api.MaterialManager; +import com.jozufozu.flywheel.backend.instancing.tile.TileInstanceManager; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/model/ModelType.java b/src/main/java/com/jozufozu/flywheel/core/materials/model/ModelType.java index 6b824890f..c815df2f9 100644 --- a/src/main/java/com/jozufozu/flywheel/core/materials/model/ModelType.java +++ b/src/main/java/com/jozufozu/flywheel/core/materials/model/ModelType.java @@ -1,11 +1,11 @@ package com.jozufozu.flywheel.core.materials.model; -import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; -import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.api.struct.Batched; import com.jozufozu.flywheel.api.struct.BatchingTransformer; -import com.jozufozu.flywheel.api.struct.StructWriter; import com.jozufozu.flywheel.api.struct.Instanced; +import com.jozufozu.flywheel.api.struct.StructWriter; +import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; +import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.core.Programs; import com.jozufozu.flywheel.core.materials.model.writer.UnsafeModelWriter; diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/model/writer/UnsafeModelWriter.java b/src/main/java/com/jozufozu/flywheel/core/materials/model/writer/UnsafeModelWriter.java index f7dba06ad..9b04a8534 100644 --- a/src/main/java/com/jozufozu/flywheel/core/materials/model/writer/UnsafeModelWriter.java +++ b/src/main/java/com/jozufozu/flywheel/core/materials/model/writer/UnsafeModelWriter.java @@ -2,8 +2,8 @@ package com.jozufozu.flywheel.core.materials.model.writer; import org.lwjgl.system.MemoryUtil; -import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter; import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.util.WriteUnsafe; diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/oriented/OrientedType.java b/src/main/java/com/jozufozu/flywheel/core/materials/oriented/OrientedType.java index f5203d69c..55f0097f4 100644 --- a/src/main/java/com/jozufozu/flywheel/core/materials/oriented/OrientedType.java +++ b/src/main/java/com/jozufozu/flywheel/core/materials/oriented/OrientedType.java @@ -1,11 +1,11 @@ package com.jozufozu.flywheel.core.materials.oriented; -import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; -import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.api.struct.Batched; import com.jozufozu.flywheel.api.struct.BatchingTransformer; -import com.jozufozu.flywheel.api.struct.StructWriter; import com.jozufozu.flywheel.api.struct.Instanced; +import com.jozufozu.flywheel.api.struct.StructWriter; +import com.jozufozu.flywheel.backend.gl.attrib.VertexFormat; +import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.core.Formats; import com.jozufozu.flywheel.core.Programs; import com.jozufozu.flywheel.core.materials.oriented.writer.UnsafeOrientedWriter; diff --git a/src/main/java/com/jozufozu/flywheel/core/materials/oriented/writer/UnsafeOrientedWriter.java b/src/main/java/com/jozufozu/flywheel/core/materials/oriented/writer/UnsafeOrientedWriter.java index b33cefa58..3818985e0 100644 --- a/src/main/java/com/jozufozu/flywheel/core/materials/oriented/writer/UnsafeOrientedWriter.java +++ b/src/main/java/com/jozufozu/flywheel/core/materials/oriented/writer/UnsafeOrientedWriter.java @@ -2,8 +2,8 @@ package com.jozufozu.flywheel.core.materials.oriented.writer; import org.lwjgl.system.MemoryUtil; -import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.api.struct.StructType; +import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.jozufozu.flywheel.backend.struct.UnsafeBufferWriter; import com.jozufozu.flywheel.core.materials.oriented.OrientedData; diff --git a/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java b/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java index 9edb6e721..0fb6f2383 100644 --- a/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java +++ b/src/main/java/com/jozufozu/flywheel/core/model/PartBuilder.java @@ -1,13 +1,10 @@ package com.jozufozu.flywheel.core.model; -import static com.jozufozu.flywheel.util.RenderMath.nb; - import java.util.ArrayList; import java.util.EnumSet; import java.util.List; import java.util.Set; -import com.jozufozu.flywheel.backend.gl.buffer.VecBuffer; import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Matrix3f; import com.mojang.math.Quaternion; diff --git a/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java b/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java index cb7d3727e..68985220b 100644 --- a/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java +++ b/src/main/java/com/jozufozu/flywheel/light/GPULightVolume.java @@ -11,16 +11,12 @@ import static org.lwjgl.opengl.GL11.GL_UNPACK_SKIP_PIXELS; import static org.lwjgl.opengl.GL11.GL_UNPACK_SKIP_ROWS; import static org.lwjgl.opengl.GL11.GL_UNSIGNED_BYTE; import static org.lwjgl.opengl.GL11.glPixelStorei; -import static org.lwjgl.opengl.GL11.glTexParameteri; import static org.lwjgl.opengl.GL12.GL_TEXTURE_3D; import static org.lwjgl.opengl.GL12.GL_TEXTURE_WRAP_R; import static org.lwjgl.opengl.GL12.GL_UNPACK_IMAGE_HEIGHT; import static org.lwjgl.opengl.GL12.GL_UNPACK_SKIP_IMAGES; import static org.lwjgl.opengl.GL12.glTexImage3D; import static org.lwjgl.opengl.GL12.glTexSubImage3D; -import static org.lwjgl.opengl.GL13.GL_TEXTURE0; -import static org.lwjgl.opengl.GL13.GL_TEXTURE4; -import static org.lwjgl.opengl.GL13.glActiveTexture; import static org.lwjgl.opengl.GL14.GL_MIRRORED_REPEAT; import org.lwjgl.opengl.GL30; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java index 5f67b4d83..f0c0d2851 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/RenderHooksMixin.java @@ -15,7 +15,6 @@ import com.jozufozu.flywheel.core.crumbling.CrumblingRenderer; import com.jozufozu.flywheel.event.BeginFrameEvent; import com.jozufozu.flywheel.event.ReloadRenderersEvent; import com.jozufozu.flywheel.event.RenderLayerEvent; -import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Matrix4f; diff --git a/src/main/java/com/jozufozu/flywheel/mixin/matrix/PoseStackMixin.java b/src/main/java/com/jozufozu/flywheel/mixin/matrix/PoseStackMixin.java index 40db441c4..781540838 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/matrix/PoseStackMixin.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/matrix/PoseStackMixin.java @@ -1,7 +1,6 @@ package com.jozufozu.flywheel.mixin.matrix; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import com.jozufozu.flywheel.util.transform.TransformStack; import com.mojang.blaze3d.vertex.PoseStack; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java index 1574a5fb4..5cfd8eb60 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/BellInstance.java @@ -1,8 +1,8 @@ package com.jozufozu.flywheel.vanilla; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; -import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.model.ModelPart; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java index 1935c5406..0dddeefb7 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ChestInstance.java @@ -4,9 +4,9 @@ import java.util.Calendar; import javax.annotation.Nonnull; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; -import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java index f14e7dfde..bf53ae248 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/MinecartInstance.java @@ -1,9 +1,9 @@ package com.jozufozu.flywheel.vanilla; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.api.instance.ITickableInstance; import com.jozufozu.flywheel.backend.instancing.entity.EntityInstance; -import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.model.Model; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java b/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java index f96710d8e..1f3ecbfe1 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/ShulkerBoxInstance.java @@ -1,8 +1,8 @@ package com.jozufozu.flywheel.vanilla; +import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.instance.IDynamicInstance; import com.jozufozu.flywheel.backend.instancing.tile.TileEntityInstance; -import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.model.ModelPart; diff --git a/src/main/java/com/jozufozu/flywheel/vanilla/VanillaInstances.java b/src/main/java/com/jozufozu/flywheel/vanilla/VanillaInstances.java index c14a6ed04..2e759d1ea 100644 --- a/src/main/java/com/jozufozu/flywheel/vanilla/VanillaInstances.java +++ b/src/main/java/com/jozufozu/flywheel/vanilla/VanillaInstances.java @@ -8,21 +8,21 @@ import net.minecraft.world.level.block.entity.BlockEntityType; /** * TODO: * - * - * - * - * - * - * - * + * + * + * + * + * + * + * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * *
{@link TileEntityType#SIGN} {@link net.minecraft.client.renderer.tileentity.SignTileEntityRenderer SignTileEntityRenderer}
{@link TileEntityType#PISTON} {@link net.minecraft.client.renderer.tileentity.PistonTileEntityRenderer PistonTileEntityRenderer}
{@link TileEntityType#CONDUIT} {@link net.minecraft.client.renderer.tileentity.ConduitTileEntityRenderer ConduitTileEntityRenderer}
{@link TileEntityType#ENCHANTING_TABLE} {@link net.minecraft.client.renderer.tileentity.EnchantmentTableTileEntityRenderer EnchantmentTableTileEntityRenderer}
{@link TileEntityType#LECTERN} {@link net.minecraft.client.renderer.tileentity.LecternTileEntityRenderer LecternTileEntityRenderer}
{@link TileEntityType#MOB_SPAWNER} {@link net.minecraft.client.renderer.tileentity.MobSpawnerTileEntityRenderer MobSpawnerTileEntityRenderer}
{@link TileEntityType#BED} {@link net.minecraft.client.renderer.tileentity.BedTileEntityRenderer BedTileEntityRenderer}
{@link BlockEntityType#SIGN} {@link net.minecraft.client.renderer.blockentity.SignRenderer SignRenderer}
{@link BlockEntityType#PISTON} {@link net.minecraft.client.renderer.blockentity.PistonHeadRenderer PistonHeadRenderer}
{@link BlockEntityType#CONDUIT} {@link net.minecraft.client.renderer.blockentity.ConduitRenderer ConduitRenderer}
{@link BlockEntityType#ENCHANTING_TABLE} {@link net.minecraft.client.renderer.blockentity.EnchantTableRenderer EnchantTableRenderer}
{@link BlockEntityType#LECTERN} {@link net.minecraft.client.renderer.blockentity.LecternRenderer LecternRenderer}
{@link BlockEntityType#MOB_SPAWNER} {@link net.minecraft.client.renderer.blockentity.SpawnerRenderer SpawnerRenderer}
{@link BlockEntityType#BED} {@link net.minecraft.client.renderer.blockentity.BedRenderer BedRenderer}
^^ Interesting - Major vv
{@link TileEntityType#END_PORTAL} {@link net.minecraft.client.renderer.tileentity.EndPortalTileEntityRenderer EndPortalTileEntityRenderer}
{@link TileEntityType#END_GATEWAY} {@link net.minecraft.client.renderer.tileentity.EndGatewayTileEntityRenderer EndGatewayTileEntityRenderer}
{@link TileEntityType#BEACON} {@link net.minecraft.client.renderer.tileentity.BeaconTileEntityRenderer BeaconTileEntityRenderer}
{@link TileEntityType#SKULL} {@link net.minecraft.client.renderer.tileentity.SkullTileEntityRenderer SkullTileEntityRenderer}
{@link TileEntityType#BANNER} {@link net.minecraft.client.renderer.tileentity.BannerTileEntityRenderer BannerTileEntityRenderer}
{@link TileEntityType#STRUCTURE_BLOCK} {@link net.minecraft.client.renderer.tileentity.StructureTileEntityRenderer StructureTileEntityRenderer}
{@link TileEntityType#CAMPFIRE} {@link net.minecraft.client.renderer.tileentity.CampfireTileEntityRenderer CampfireTileEntityRenderer}
{@link BlockEntityType#END_PORTAL} {@link net.minecraft.client.renderer.blockentity.TheEndPortalRenderer TheEndPortalRenderer}
{@link BlockEntityType#END_GATEWAY} {@link net.minecraft.client.renderer.blockentity.TheEndGatewayRenderer TheEndGatewayRenderer}
{@link BlockEntityType#BEACON} {@link net.minecraft.client.renderer.blockentity.BeaconRenderer BeaconRenderer}
{@link BlockEntityType#SKULL} {@link net.minecraft.client.renderer.blockentity.SkullBlockRenderer SkullBlockRenderer}
{@link BlockEntityType#BANNER} {@link net.minecraft.client.renderer.blockentity.BannerRenderer BannerRenderer}
{@link BlockEntityType#STRUCTURE_BLOCK} {@link net.minecraft.client.renderer.debug.StructureRenderer StructureRenderer}
{@link BlockEntityType#CAMPFIRE} {@link net.minecraft.client.renderer.blockentity.CampfireRenderer CampfireRenderer}
*/ public class VanillaInstances { diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index a9069afef..2d8d4da03 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "description": "Flywheel resources", - "pack_format": 7 + "pack_format": 8 } } From 17fb8d34ed80f6147052886976b0e911247aa5e0 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Wed, 15 Dec 2021 13:27:06 -0800 Subject: [PATCH 07/10] Fix #extension crash on intel --- .../java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java | 1 + .../assets/flywheel/flywheel/shaders/context/world.glsl | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java b/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java index 2cb7defbb..cffa9142b 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java +++ b/src/main/java/com/jozufozu/flywheel/backend/pipeline/WorldShader.java @@ -56,6 +56,7 @@ public class WorldShader { finalSource.append("#version ") .append(template.getVersion()) .append('\n') + .append("#extension GL_ARB_conservative_depth : enable\n") .append("#define ") .append(type.define) // special case shader type declaration .append('\n') diff --git a/src/main/resources/assets/flywheel/flywheel/shaders/context/world.glsl b/src/main/resources/assets/flywheel/flywheel/shaders/context/world.glsl index 51afad2eb..1503ed993 100644 --- a/src/main/resources/assets/flywheel/flywheel/shaders/context/world.glsl +++ b/src/main/resources/assets/flywheel/flywheel/shaders/context/world.glsl @@ -28,7 +28,6 @@ void FLWFinalizeWorldPos(inout vec4 worldPos) { // optimize discard usage #if defined(ALPHA_DISCARD) #if defined(GL_ARB_conservative_depth) -#extension GL_ARB_conservative_depth : enable layout (depth_greater) out float gl_FragDepth; #endif #endif From cd4d5d1b7244e835a7d48e88862fbf8a7366c08f Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Wed, 15 Dec 2021 15:08:06 -0800 Subject: [PATCH 08/10] Update forge - 39.0.5 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index e94c2f5a3..270183ea8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.daemon = false mod_version = 0.4.1 mc_update_version = 1.18 minecraft_version = 1.18.1 -forge_version = 39.0.0 +forge_version = 39.0.5 # build dependency versions forgegradle_version = 5.1.+ From 15ea38ede7dfc3e136216b63bde6149359ef4080 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Wed, 15 Dec 2021 15:13:42 -0800 Subject: [PATCH 09/10] Possible fix(es) for accessor crash - Haven't been able to reproduce - Try forcing PausedPartialTickAccessor to load early - Try renaming the method --- src/main/java/com/jozufozu/flywheel/FlywheelClient.java | 8 ++++++++ .../flywheel/mixin/PausedPartialTickAccessor.java | 2 +- .../com/jozufozu/flywheel/util/AnimationTickHolder.java | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/jozufozu/flywheel/FlywheelClient.java b/src/main/java/com/jozufozu/flywheel/FlywheelClient.java index a8b7b19ae..dc0e7b4e4 100644 --- a/src/main/java/com/jozufozu/flywheel/FlywheelClient.java +++ b/src/main/java/com/jozufozu/flywheel/FlywheelClient.java @@ -5,6 +5,7 @@ import com.jozufozu.flywheel.core.Contexts; import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.StitchedSprite; +import com.jozufozu.flywheel.mixin.PausedPartialTickAccessor; import com.jozufozu.flywheel.vanilla.VanillaInstances; import net.minecraftforge.eventbus.api.IEventBus; @@ -26,5 +27,12 @@ public class FlywheelClient { modEventBus.addListener(StitchedSprite::onTextureStitchPost); VanillaInstances.init(); + + // https://github.com/Jozufozu/Flywheel/issues/69 + // Weird issue with accessor loading. + // Only thing I've seen that's close to a fix is to force the class to load before trying to use it. + // From the SpongePowered discord: + // https://discord.com/channels/142425412096491520/626802111455297538/675007581168599041 + Flywheel.log.info("Successfully loaded {}", PausedPartialTickAccessor.class.getName()); } } diff --git a/src/main/java/com/jozufozu/flywheel/mixin/PausedPartialTickAccessor.java b/src/main/java/com/jozufozu/flywheel/mixin/PausedPartialTickAccessor.java index 550f6d4ab..ab5e5aa18 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/PausedPartialTickAccessor.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/PausedPartialTickAccessor.java @@ -9,5 +9,5 @@ import net.minecraft.client.Minecraft; public interface PausedPartialTickAccessor { @Accessor("pausePartialTick") - float getPausePartialTick(); + float flywheel$getPartialTicksPaused(); } diff --git a/src/main/java/com/jozufozu/flywheel/util/AnimationTickHolder.java b/src/main/java/com/jozufozu/flywheel/util/AnimationTickHolder.java index 0a8374f42..c16da14d8 100644 --- a/src/main/java/com/jozufozu/flywheel/util/AnimationTickHolder.java +++ b/src/main/java/com/jozufozu/flywheel/util/AnimationTickHolder.java @@ -37,6 +37,6 @@ public class AnimationTickHolder { public static float getPartialTicks() { Minecraft mc = Minecraft.getInstance(); - return (mc.isPaused() ? ((PausedPartialTickAccessor) mc).getPausePartialTick() : mc.getFrameTime()); + return (mc.isPaused() ? ((PausedPartialTickAccessor) mc).flywheel$getPartialTicksPaused() : mc.getFrameTime()); } } From 249ec5e5e5e5b7da302d17a120d8215700a38607 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Wed, 15 Dec 2021 16:52:58 -0800 Subject: [PATCH 10/10] Bump version 0.4.2-rc - rc so Create 0.4a can still be compatible - also still not sure if the accessor bug is fixed --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + changelog.txt | 5 +++++ gradle.properties | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index f26012d33..b4f0908b7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -59,6 +59,7 @@ body: label: Mod Version description: The version of the mod you were using when the bug occured options: + - "0.4.2-rc" - "0.4.1" - "0.4.0" - "0.3.0" diff --git a/changelog.txt b/changelog.txt index 31c1a0667..e2e1695aa 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +0.4.1a: +Fixes + - Partially fix crash on intel and mesa drivers (needs Create to update) + - Fix garbage rendering on AMD GPUs + 0.4.1: Update to 1.18.1 Changes diff --git a/gradle.properties b/gradle.properties index 270183ea8..5f7161780 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs = -Xmx3G org.gradle.daemon = false # mod version info -mod_version = 0.4.1 +mod_version = 0.4.2-rc mc_update_version = 1.18 minecraft_version = 1.18.1 forge_version = 39.0.5