Skip to content

Commit

Permalink
Partial fix for CaffeineMC#2601 class of issues, however it assumes t…
Browse files Browse the repository at this point in the history
…hat a new SpriteCoordinateExpander is created every frame.
  • Loading branch information
mcrcortex authored and mcrcortex committed Jul 23, 2024
1 parent d649cac commit 308c68b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.caffeinemc.mods.sodium.api.vertex.attributes.CommonVertexAttribute;
import net.caffeinemc.mods.sodium.api.vertex.attributes.common.TextureAttribute;
import net.caffeinemc.mods.sodium.api.vertex.format.VertexFormatDescription;
import net.caffeinemc.mods.sodium.client.render.texture.SpriteUtil;
import net.minecraft.client.renderer.SpriteCoordinateExpander;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.caffeinemc.mods.sodium.api.vertex.buffer.VertexBufferWriter;
Expand Down Expand Up @@ -33,6 +34,7 @@ public class SpriteCoordinateExpanderMixin implements VertexBufferWriter {

@Inject(method = "<init>", at = @At("RETURN"))
private void onInit(VertexConsumer delegate, TextureAtlasSprite sprite, CallbackInfo ci) {
SpriteUtil.markSpriteActive(sprite);
this.minU = sprite.getU0();
this.minV = sprite.getV0();

Expand Down

0 comments on commit 308c68b

Please # to comment.