Skip to content

Commit

Permalink
scheduleRebuildOffThread (#316)
Browse files Browse the repository at this point in the history
* scheduleRebuildOffThread
  • Loading branch information
mitchej123 authored Feb 20, 2024
1 parent f73c698 commit 37f638a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,9 @@ public static void setFilter(boolean bilinear, boolean mipmap) {

public static void glDrawArrays(int mode, int first, int count) {
// Iris -- TODO: This doesn't seem to work and is related to matchPass()
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
if(AngelicaConfig.enableIris) {
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
}
GL11.glDrawArrays(mode, first, count);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.gtnewhorizons.angelica.compat.mojang.ChunkPos;
import com.gtnewhorizons.angelica.compat.toremove.MatrixStack;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
import com.gtnewhorizons.angelica.rendering.AngelicaRenderQueue;
import it.unimi.dsi.fastutil.ints.IntIterator;
import it.unimi.dsi.fastutil.ints.IntList;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
Expand Down Expand Up @@ -45,6 +46,7 @@
import java.util.Collection;
import java.util.Deque;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkStatusListener {
/**
Expand Down Expand Up @@ -639,9 +641,7 @@ public int getTotalSections() {
}

private void scheduleRebuildOffThread(int x, int y, int z, boolean important) {
// TODO: Sodium Threads
throw new RuntimeException("scheduleRebuildOffThread");
// Minecraft.getMinecraft().submit(() -> this.scheduleRebuild(x, y, z, important));
AngelicaRenderQueue.executor().execute(() -> this.scheduleRebuild(x, y, z, important));
}

public void scheduleRebuild(int x, int y, int z, boolean important) {
Expand Down

0 comments on commit 37f638a

Please sign in to comment.