mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-19 20:09:39 +00:00
properly clear PBRAtlasTexture (#2085)
This commit is contained in:
1 parent
37a10eee3f
commit
6f054a09a9
4 files changed
+17
-2
No files matched your search
@@ -828,6 +828,7 @@ public class Iris {
|
||||
currentPack = null;
|
||||
|
||||
getPipelineManager().destroyPipeline();
|
||||
PBRTextureManager.INSTANCE.clear();
|
||||
|
||||
// Close the zip filesystem that the shaderpack was loaded from
|
||||
//
|
||||
|
||||
@@ -140,5 +140,8 @@ public class PBRAtlasTexture extends AutoClosableAbstractTexture {
|
||||
case SPECULAR -> pbrHolder.setSpecularAtlas(null);
|
||||
}
|
||||
}
|
||||
|
||||
clear();
|
||||
super.close();
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,16 @@ public class PBRTextureManager {
|
||||
}
|
||||
|
||||
private static void closeTexture(AbstractTexture texture) {
|
||||
texture.deleteGlTexture();
|
||||
if (texture instanceof AutoCloseable closeable) {
|
||||
try {
|
||||
closeable.close();
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
Iris.logger.error("Failed to close PBR texture", e);
|
||||
}
|
||||
}
|
||||
|
||||
texture.deleteGlTexture();
|
||||
}
|
||||
|
||||
public static void notifyPBRTexturesChanged() {
|
||||
|
||||
Reference in new issue
Block a user