Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -86,7 +87,7 @@ private static void evictIfNeeded() {
@Nullable
private static SdfTextLayout computeLayout(SdfGlyphAtlas atlas, String text, float scale, int scaleInt) {
int penX = 0, maxHeight = 0;
java.util.Map<Integer, List<GlyphQuad>> buckets = new java.util.LinkedHashMap<>();
Map<Integer, List<GlyphQuad>> buckets = new LinkedHashMap<>();
boolean allAvailable = true;

Set<SdfGlyphPage> glyphPages = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.textures.FilterMode;
import com.mojang.blaze3d.textures.GpuSampler;
import dev.anvilcraft.lib.v2.font.ALFont;
import dev.anvilcraft.lib.v2.font.sdf.state.SdfTextRenderState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphicsExtractor;
Expand Down Expand Up @@ -231,7 +232,7 @@ private static int colorFromStyle(Style style, int defaultColor) {
}

private static List<String> wrapLines(SdfGlyphAtlas atlas, String text, int maxWidth, float scale) {
return dev.anvilcraft.lib.v2.font.ALFont.wrapLines(atlas, text, maxWidth, scale);
return ALFont.wrapLines(atlas, text, maxWidth, scale);
}

private static String flattenToString(FormattedCharSequence text) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,15 +484,15 @@ public void generateForEnabledBlockFamilies(FeatureFlagSet p_251836_) {
}

@Override
public void oneToOneConversionRecipe(ItemLike product, ItemLike resource, @org.jspecify.annotations.Nullable String group) {
public void oneToOneConversionRecipe(ItemLike product, ItemLike resource, @Nullable String group) {
super.oneToOneConversionRecipe(product, resource, group);
}

@Override
public void oneToOneConversionRecipe(
ItemLike product,
ItemLike resource,
@org.jspecify.annotations.Nullable String group,
@Nullable String group,
int productCount
) {
super.oneToOneConversionRecipe(product, resource, group, productCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.block.entity.BlockEntity;
import org.jetbrains.annotations.ApiStatus;

import java.util.ArrayList;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class RebuildTask implements Runnable {
private final CachedRenderingChunk owner;
private boolean cancelled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import com.mojang.blaze3d.buffers.GpuBufferSlice;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.pipeline.ALRComputePass;
import org.jetbrains.annotations.ApiStatus;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public interface ALRCommandEncoderBackendExtension {
void alrDispatchWorkgroups(
int groupCountX,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.pipeline.ALRComputePass;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.shader.ALRComputeProgramInstance;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.shader.ALRComputeProgramInstanceKey;
import org.jetbrains.annotations.ApiStatus;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public interface ALRGpuDeviceBackendExtension {
ALRComputeProgramInstance alrCompileComputeShader(ALRComputeProgramInstanceKey instanceKey);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.shader.ALRComputeShaderManager;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import org.jetbrains.annotations.ApiStatus;
import org.lwjgl.opengl.ARBShaderAtomicCounters;
import org.lwjgl.opengl.ARBShaderImageLoadStore;
import org.lwjgl.opengl.ARBShaderStorageBufferObject;
import org.lwjgl.opengl.GL13;
import org.lwjgl.opengl.GL33;
import org.lwjgl.opengl.GL46;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class GlComputePassBackend implements ALRComputePassBackend {
private final ALRGpuDeviceBackendExtension backendExtension;
private final ALRCommandEncoderBackendExtension commandEncoderExtension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.ApiStatus;


@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class BlockStatePipRenderer extends PictureInPictureRenderer<BlockStatePipRenderingState> {
public BlockStatePipRenderer(MultiBufferSource.BufferSource bufferSource) {
super(bufferSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.ApiStatus;
import org.joml.Matrix4f;
import org.joml.Vector3f;
import org.joml.Vector4f;
Expand All @@ -49,7 +50,7 @@
import java.util.OptionalInt;


@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class StructurePipRenderer extends PictureInPictureRenderer<StructurePipRenderingState> {

private final BlockAndTintGetter emptyTintedLevel = new SimpleTintedEmptyLevelAccess();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
import net.minecraft.core.BlockPos;
import net.minecraft.util.Mth;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.ApiStatus;
import org.joml.Matrix3x2f;
import org.jspecify.annotations.Nullable;

import static dev.anvilcraft.lib.v2.rendering.ALRSharedMath.SQRT_2;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public record BlockStatePipRenderingState(
BlockState blockState,
@Nullable BlockAndTintGetter level,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
import net.minecraft.client.gui.navigation.ScreenRectangle;
import net.minecraft.client.gui.render.TextureSetup;
import net.minecraft.client.renderer.state.gui.GuiElementRenderState;
import org.jetbrains.annotations.ApiStatus;
import org.joml.Matrix3x2f;
import org.jspecify.annotations.Nullable;

import java.util.function.Supplier;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public record DynamicTextureBlitRenderState(
RenderPipeline pipeline,
Supplier<TextureSetup> textureSetupSupplier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import dev.anvilcraft.lib.v2.rendering.integration.IrisSupport;
import net.neoforged.fml.loading.FMLLoader;
import net.neoforged.fml.loading.LoadingModList;
import org.jetbrains.annotations.ApiStatus;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

import java.util.List;
import java.util.Set;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class ALRIntegrationCompatMixinPlugin implements IMixinConfigPlugin {

private ImmutableMap<String, Boolean> mixinConditions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import dev.anvilcraft.lib.v2.rendering.cachedber.pipeline.CachedBlockEntityRenderingPipeline;
import dev.anvilcraft.lib.v2.rendering.integration.IrisSupport;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
Expand All @@ -10,7 +11,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(CachedBlockEntityRenderingPipeline.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public abstract class CachedBlockEntityRenderingPipelineMixin {

@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import dev.anvilcraft.lib.v2.rendering.cachedber.pipeline.RebuildTask;
import dev.anvilcraft.lib.v2.rendering.integration.IrisSupport;
import net.irisshaders.iris.vertices.ImmediateState;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(RebuildTask.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class RebuildTaskMixin {
@Inject(
method = "run",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import dev.anvilcraft.lib.v2.rendering.event.MainTargetResizeEvent;
import net.minecraft.client.renderer.GameRenderer;
import net.neoforged.fml.ModLoader;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(GameRenderer.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class GameRendererMixin {

@Inject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.ApiStatus;
import org.joml.Matrix3x2f;
import org.joml.Matrix3x2fStack;
import org.jspecify.annotations.Nullable;
Expand All @@ -23,7 +24,7 @@

@SuppressWarnings("AddedMixinMembersNamePattern")
@Mixin(GuiGraphicsExtractor.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class GuiGraphicsExtractorMixin implements GuiGraphicsExtractorExtension {

@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.client.renderer.state.gui.GuiItemRenderState;
import net.minecraft.client.renderer.state.gui.GuiRenderState;
import net.minecraft.util.ARGB;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -29,7 +30,7 @@
import java.util.Map;

@Mixin(GuiRenderer.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class GuiRendererMixin {
@Unique
private GuiElementRenderState anvillib$renderState = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import dev.anvilcraft.lib.v2.rendering.internal.ItemStackRenderStateInternals;
import net.minecraft.client.renderer.item.ItemStackRenderState;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

@Mixin(ItemStackRenderState.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class ItemStackRenderStateMixin implements ItemStackRenderStateInternals.Extension {
@Unique
private float anvillib_rendering$alpha = 1f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.main.GameConfig;
import net.minecraft.client.multiplayer.ClientLevel;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -14,7 +15,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Minecraft.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class MinecraftMixin {

@Shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import dev.anvilcraft.lib.v2.rendering.extension.ALRRenderTypeExtension;
import net.minecraft.client.renderer.rendertype.RenderType;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

@Mixin(RenderType.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class RenderTypeMixin implements ALRRenderTypeExtension {

@Unique
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.ALRCommandEncoderExtension;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.MemoryBarrierFlag;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.pipeline.ALRComputePass;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(CommandEncoder.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class CommandEncoderMixin implements ALRCommandEncoderExtension {
@Shadow
@Final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.pipeline.ALRComputePass;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.shader.ALRComputeProgramInstance;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.shader.ALRComputeProgramInstanceKey;
import org.jetbrains.annotations.ApiStatus;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;

@SuppressWarnings("AddedMixinMembersNamePattern")
@Mixin(GpuDevice.class)
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class GpuDeviceMixin implements ALRGpuDeviceExtension {
@Shadow
@Final
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package dev.anvilcraft.lib.v2.rendering.mixins.blaze3d.gl;

import dev.anvilcraft.lib.v2.rendering.foundation.buffers.GpuBufferConstants;
import org.jetbrains.annotations.ApiStatus;
import org.lwjgl.opengl.ARBShaderStorageBufferObject;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class DirectStateAccessMixin {

@Mixin(targets = "com.mojang.blaze3d.opengl.DirectStateAccess$Emulated")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.MemoryBarrierFlag;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.pipeline.ALRComputePass;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.pipeline.gl.GlComputePassBackend;
import org.jetbrains.annotations.ApiStatus;
import org.lwjgl.opengl.ARBComputeShader;
import org.lwjgl.opengl.ARBShaderImageLoadStore;
import org.lwjgl.opengl.GL46;
Expand All @@ -17,7 +18,7 @@
import org.spongepowered.asm.mixin.Shadow;

@Mixin(targets = "com.mojang.blaze3d.opengl.GlCommandEncoder")
@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class GlCommandEncoderMixin implements ALRCommandEncoderBackendExtension {
@Shadow
@Final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.ALRDebugLabelExtension;
import dev.anvilcraft.lib.v2.rendering.extension.blaze3d.compute.shader.ALRComputeProgramInstance;
import net.minecraft.util.StringUtil;
import org.jetbrains.annotations.ApiStatus;
import org.lwjgl.opengl.EXTDebugLabel;
import org.lwjgl.opengl.GL46;
import org.lwjgl.opengl.KHRDebug;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

@org.jetbrains.annotations.ApiStatus.Internal
@ApiStatus.Internal
public class GlDebugLabelMixin {
@Mixin(GlDebugLabel.class)
public static class Self implements ALRDebugLabelExtension {
Expand Down
Loading
Loading