From c2a0cacaaeb68d7580137d5d2db3086079133dc7 Mon Sep 17 00:00:00 2001 From: Asek3 <64613894+Asek3@users.noreply.github.com> Date: Tue, 21 Nov 2023 23:30:44 +0200 Subject: [PATCH] Fix up GlStateManager bindings too Co-Authored-By: IMS --- src/main/java/net/coderbot/iris/gl/IrisRenderSystem.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/coderbot/iris/gl/IrisRenderSystem.java b/src/main/java/net/coderbot/iris/gl/IrisRenderSystem.java index f1746f3dc2..e18dae93ab 100644 --- a/src/main/java/net/coderbot/iris/gl/IrisRenderSystem.java +++ b/src/main/java/net/coderbot/iris/gl/IrisRenderSystem.java @@ -4,6 +4,7 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; +import net.coderbot.iris.mixin.GlStateManagerAccessor; import org.jetbrains.annotations.Nullable; import org.lwjgl.opengl.ARBDirectStateAccess; import org.lwjgl.opengl.EXTShaderImageLoadStore; @@ -378,6 +379,9 @@ public void bindTextureToUnit(int unit, int texture) { super.bindTextureToUnit(unit, texture); } else { ARBDirectStateAccess.glBindTextureUnit(unit, texture); + + // Manually fix GLStateManager bindings... + GlStateManagerAccessor.getTEXTURES()[unit].binding = texture; } }