Archive incari-client (client, 26.3, clean)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Wed, 30 Sep 2026 21:55:23 -0400
|
||||
Subject: [PATCH] textures: Cap atlas sizes by the device's tier
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/client/renderer/texture/SpriteLoader.java b/src/main/java/net/minecraft/client/renderer/texture/SpriteLoader.java
|
||||
index be3e9cfac371fde4c875493521d13b7afb907cd8..1c4de0d15b194dacd5381c11b11dc6a59108e260 100644
|
||||
--- a/src/main/java/net/minecraft/client/renderer/texture/SpriteLoader.java
|
||||
+++ b/src/main/java/net/minecraft/client/renderer/texture/SpriteLoader.java
|
||||
@@ -47,3 +47,5 @@
|
||||
try (Zone ignored = Profiler.get().zone(() -> "stitch " + this.location)) {
|
||||
- int maxTextureSize = this.maxSupportedTextureSize;
|
||||
+ // Incari start: the tier's largest atlas
|
||||
+ int maxTextureSize = incari.client.render.AtlasBudget.maxSize(this.maxSupportedTextureSize);
|
||||
+ // Incari end
|
||||
int minTexelSize = Integer.MAX_VALUE;
|
||||
@@ -131,3 +133,5 @@
|
||||
.thenCompose(sprites -> runSpriteSuppliers(spriteResourceLoader, (List<SpriteSource.Loader>)sprites, taskExecutor))
|
||||
- .thenApply(resources -> this.stitch((List<SpriteContents>)resources, maxMipmapLevels, taskExecutor));
|
||||
+ // Incari start: sprites that don't fit the tier's largest atlas at full resolution are halved
|
||||
+ .thenApply(resources -> this.stitch(incari.client.render.AtlasBudget.fit(this.location, (List<SpriteContents>)resources, this.maxSupportedTextureSize, maxMipmapLevels), maxMipmapLevels, taskExecutor));
|
||||
+ // Incari end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/client/renderer/texture/atlas/SpriteResourceLoader.java b/src/main/java/net/minecraft/client/renderer/texture/atlas/SpriteResourceLoader.java
|
||||
index 6f0204fca659a316dba8d04b8df3de2dc0aa4d03..ccb90e67d981d154c838efc4019c3d0a703d0cc8 100644
|
||||
--- a/src/main/java/net/minecraft/client/renderer/texture/atlas/SpriteResourceLoader.java
|
||||
+++ b/src/main/java/net/minecraft/client/renderer/texture/atlas/SpriteResourceLoader.java
|
||||
@@ -67,3 +67,5 @@
|
||||
|
||||
- return new SpriteContents(spriteLocation, frameSize, image, animationInfo, additionalMetadata, textureInfo);
|
||||
+ // Incari start: the atlas size cap may load it again at a lower resolution
|
||||
+ return incari.client.render.AtlasBudget.loaded(spriteLocation, frameSize, image, animationInfo, additionalMetadata, textureInfo);
|
||||
+ // Incari end
|
||||
};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Thu, 1 Oct 2026 00:52:04 -0400
|
||||
Subject: [PATCH] textures: Make vanilla sprites from the build's decoded
|
||||
copies
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/client/renderer/texture/SpriteContents.java b/src/main/java/net/minecraft/client/renderer/texture/SpriteContents.java
|
||||
index d3847e145302810fe6b32af20a345efc217379d2..d9ab9090b545c4513a5517f2ec4570b16c8b1aac 100644
|
||||
--- a/src/main/java/net/minecraft/client/renderer/texture/SpriteContents.java
|
||||
+++ b/src/main/java/net/minecraft/client/renderer/texture/SpriteContents.java
|
||||
@@ -85,2 +85,6 @@
|
||||
public void increaseMipLevel(final int mipLevel) {
|
||||
+ // Incari start: the build's mip levels of a vanilla sprite, where it has them
|
||||
+ NativeImage[] prebuilt = incari.client.render.SpriteCache.mipLevels(this.originalImage, mipLevel);
|
||||
+ if (prebuilt != null) { this.byMipLevel = prebuilt; return; }
|
||||
+ // Incari end
|
||||
try {
|
||||
diff --git a/src/main/java/net/minecraft/client/renderer/texture/atlas/SpriteResourceLoader.java b/src/main/java/net/minecraft/client/renderer/texture/atlas/SpriteResourceLoader.java
|
||||
index ccb90e67d981d154c838efc4019c3d0a703d0cc8..c4dcdbda98bd6907417a6e2b25b603f67dbb8f2d 100644
|
||||
--- a/src/main/java/net/minecraft/client/renderer/texture/atlas/SpriteResourceLoader.java
|
||||
+++ b/src/main/java/net/minecraft/client/renderer/texture/atlas/SpriteResourceLoader.java
|
||||
@@ -41,2 +41,6 @@
|
||||
NativeImage image;
|
||||
+ // Incari start: the build's decoded copy of a vanilla sprite, where it has one
|
||||
+ NativeImage prebuilt = incari.client.render.SpriteCache.image(spriteLocation, resource);
|
||||
+ if (prebuilt != null) image = prebuilt; else
|
||||
+ // Incari end
|
||||
try (InputStream is = resource.open()) {
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Fri, 2 Oct 2026 07:51:32 -0400
|
||||
Subject: [PATCH] textures: Animate only the block sprites something draws
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/client/renderer/texture/SpriteContents.java b/src/main/java/net/minecraft/client/renderer/texture/SpriteContents.java
|
||||
index d9ab9090b545c4513a5517f2ec4570b16c8b1aac..475ecb570a34405a471c46fdc9549ca630f50d87 100644
|
||||
--- a/src/main/java/net/minecraft/client/renderer/texture/SpriteContents.java
|
||||
+++ b/src/main/java/net/minecraft/client/renderer/texture/SpriteContents.java
|
||||
@@ -378,2 +378,8 @@
|
||||
|
||||
+ // Incari start: draw the current frame though it didn't change this tick (ADR 0030)
|
||||
+ public void incariRedraw() {
|
||||
+ this.isDirty = true;
|
||||
+ }
|
||||
+ // Incari end
|
||||
+
|
||||
public void drawToAtlas(final RenderPass renderPass, final GpuBufferSlice ubo) {
|
||||
diff --git a/src/main/java/net/minecraft/client/renderer/texture/TextureAtlas.java b/src/main/java/net/minecraft/client/renderer/texture/TextureAtlas.java
|
||||
index ecc446aa05c36f9ab3c52b85a7d77fc731d8ccd6..e972301bfdea564c798f73e516e5fa182be915df 100644
|
||||
--- a/src/main/java/net/minecraft/client/renderer/texture/TextureAtlas.java
|
||||
+++ b/src/main/java/net/minecraft/client/renderer/texture/TextureAtlas.java
|
||||
@@ -132,2 +132,5 @@
|
||||
}
|
||||
+ // Incari start: animate only the block sprites something draws (ADR 0030)
|
||||
+ incari.client.render.AnimatedSprites.atlasBuilt(this, this.sprites, this.animatedTexturesStates, this.mipViews);
|
||||
+ // Incari end
|
||||
|
||||
@@ -241,3 +244,5 @@
|
||||
|
||||
- this.uploadAnimationFrames();
|
||||
+ // Incari start: animate only the block sprites something draws (ADR 0030)
|
||||
+ if (!incari.client.render.AnimatedSprites.upload(this, this.animatedTexturesStates)) this.uploadAnimationFrames();
|
||||
+ // Incari end
|
||||
}
|
||||
@@ -286,2 +291,5 @@
|
||||
this.animatedTexturesStates = List.of();
|
||||
+ // Incari start: animate only the block sprites something draws (ADR 0030)
|
||||
+ incari.client.render.AnimatedSprites.atlasCleared(this);
|
||||
+ // Incari end
|
||||
this.texturesByName = Map.of();
|
||||
diff --git a/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java b/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
|
||||
index dadf4974ded93b48bf2def353c530100dad59d78..ac2104b25a0a358616b9ddc1cfce2e87d83121f1 100644
|
||||
--- a/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
|
||||
+++ b/src/main/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
|
||||
@@ -37,2 +37,6 @@
|
||||
|
||||
+ // Incari start: the blocks atlas's id for an animated sprite, else -1 (ADR 0030)
|
||||
+ public int incariAnimatedId = -1;
|
||||
+ // Incari end
|
||||
+
|
||||
public int getX() {
|
||||
@@ -46,2 +50,5 @@
|
||||
public float getU0() {
|
||||
+ // Incari start: note an animated sprite as drawn (ADR 0030)
|
||||
+ if (this.incariAnimatedId >= 0) incari.client.render.AnimatedSprites.used(this.incariAnimatedId);
|
||||
+ // Incari end
|
||||
return this.u0;
|
||||
@@ -50,2 +57,5 @@
|
||||
public float getU1() {
|
||||
+ // Incari start: note an animated sprite as drawn (ADR 0030)
|
||||
+ if (this.incariAnimatedId >= 0) incari.client.render.AnimatedSprites.used(this.incariAnimatedId);
|
||||
+ // Incari end
|
||||
return this.u1;
|
||||
@@ -67,2 +77,5 @@
|
||||
public float getU(final float offset) {
|
||||
+ // Incari start: note an animated sprite as drawn (ADR 0030)
|
||||
+ if (this.incariAnimatedId >= 0) incari.client.render.AnimatedSprites.used(this.incariAnimatedId);
|
||||
+ // Incari end
|
||||
float diff = this.u1 - this.u0;
|
||||
Reference in New Issue
Block a user