Texture cache fixes (#1198)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2025-12-23 17:38:52 -08:00
1 parent 89132f3ef9
commit 92b6dcc010
8 files changed
+615 -68

No files matched your search

@@ -72,7 +72,7 @@ public final class CommonUniforms {
// TODO: OptiFine doesn't think that atlasSize is a "dynamic" uniform,
// but we do. How will custom uniforms depending on atlasSize work?
uniforms.uniform2i("atlasSize", () -> {
final int glId = GLStateManager.getBoundTexture();
final int glId = GLStateManager.getBoundTextureForServerState();
final AbstractTexture texture = TextureTracker.INSTANCE.getTexture(glId);
if (texture instanceof TextureMap) {
@@ -84,7 +84,7 @@ public final class CommonUniforms {
}, StateUpdateNotifiers.bindTextureNotifier);
uniforms.uniform2i("gtextureSize", () -> {
final int glId = GLStateManager.getBoundTexture();
final int glId = GLStateManager.getBoundTextureForServerState();
final TextureInfo info = TextureInfoCache.INSTANCE.getInfo(glId);
return new Vector2i(info.getWidth(), info.getHeight());