diff --git a/src/main/java/net/coderbot/iris/compat/dh/DHCompatInternal.java b/src/main/java/net/coderbot/iris/compat/dh/DHCompatInternal.java index 82c011a24c..61012f3fc9 100644 --- a/src/main/java/net/coderbot/iris/compat/dh/DHCompatInternal.java +++ b/src/main/java/net/coderbot/iris/compat/dh/DHCompatInternal.java @@ -60,11 +60,19 @@ public void prepareNewPipeline(NewWorldRenderingPipeline pipeline, boolean dhSha shadowProgram = null; } + if (depthTexNoTranslucent != null) { + depthTexNoTranslucent.destroy(); + depthTexNoTranslucent = null; + } + if (pipeline.getDHTerrainShader().isEmpty() && pipeline.getDHWaterShader().isEmpty()) { Iris.logger.warn("No DH shader found in this pack."); return; } + createDepthTex(Minecraft.getInstance().getMainRenderTarget().width, Minecraft.getInstance().getMainRenderTarget().height); + translucentDepthDirty = true; + ProgramSource terrain = pipeline.getDHTerrainShader().get(); solidProgram = IrisLodRenderProgram.createProgram(terrain.getName(), false, false, terrain, pipeline.getCustomUniforms(), pipeline); diff --git a/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java b/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java index 34752dcf13..fbf8e2f2ed 100644 --- a/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java +++ b/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java @@ -1229,8 +1229,8 @@ public void destroy() { Minecraft.getInstance().getMainRenderTarget().bindWrite(false); - renderTargets.destroy(); DHCompat.clearPipeline(); + renderTargets.destroy(); customImages.forEach(GlImage::destroy);