From 42b98bce285d24dd1b112ef39672f227390c93b0 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Tue, 26 Apr 2022 22:39:34 +0100 Subject: [PATCH] Reset the BufferUploader state on Linux GlStateManager.glDeleteBuffers clears a buffer before deleting it on Linux - I assume otherwise there's memory leaks on some drivers? - which clobbers BufferUploader's cache. Roll our own version which resets the cache when needed. Also always reset the cache when deleting/creating a DirectVertexBuffer. --- .../render/TileEntityMonitorRenderer.java | 1 - .../client/util/DirectBuffers.java | 28 ++++++++++++++++--- .../client/util/DirectVertexBuffer.java | 9 ++++++ .../peripheral/monitor/ClientMonitor.java | 5 ++-- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java index 5f42dbde2..d5e393b57 100644 --- a/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/TileEntityMonitorRenderer.java @@ -163,7 +163,6 @@ public class TileEntityMonitorRenderer implements BlockEntityRenderer