From a135a5af63d139673fee7f36af3b937aee74d154 Mon Sep 17 00:00:00 2001 From: xCollateral <> Date: Fri, 27 Oct 2023 15:39:22 +0200 Subject: [PATCH] Texture bugfix --- .../java/net/vulkanmod/mixin/render/RenderSystemMixin.java | 2 +- .../java/net/vulkanmod/mixin/texture/MAbstractTexture.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/vulkanmod/mixin/render/RenderSystemMixin.java b/src/main/java/net/vulkanmod/mixin/render/RenderSystemMixin.java index 6004c7de5..6683425bb 100644 --- a/src/main/java/net/vulkanmod/mixin/render/RenderSystemMixin.java +++ b/src/main/java/net/vulkanmod/mixin/render/RenderSystemMixin.java @@ -53,7 +53,7 @@ public static void _setShaderTexture(int i, ResourceLocation location) { if (i >= 0 && i < shaderTextures.length) { TextureManager textureManager = Minecraft.getInstance().getTextureManager(); AbstractTexture abstractTexture = textureManager.getTexture(location); - abstractTexture.bind(); + VTextureSelector.bindTexture(i, ((VAbstractTextureI)abstractTexture).getVulkanImage()); //shaderTextures[i] = abstractTexture.getId(); } diff --git a/src/main/java/net/vulkanmod/mixin/texture/MAbstractTexture.java b/src/main/java/net/vulkanmod/mixin/texture/MAbstractTexture.java index 1d2642a9e..75d048036 100644 --- a/src/main/java/net/vulkanmod/mixin/texture/MAbstractTexture.java +++ b/src/main/java/net/vulkanmod/mixin/texture/MAbstractTexture.java @@ -74,7 +74,11 @@ public void bindTexture() { } public VulkanImage getVulkanImage() { - return vulkanImage; + if(vulkanImage != null) + return vulkanImage; + else { + return GlTexture.getTexture(this.id).getVulkanImage(); + } } public void setVulkanImage(VulkanImage image) {