Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.20] Retrieve TEXTURE_MAX_VALUE from compact chunk vertex #516

Closed
wants to merge 1 commit into from
Closed
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 me.jellysquid.mods.sodium.client.render.chunk.vertex.format.ChunkVertexType;
import net.coderbot.iris.compat.sodium.impl.vertex_format.IrisChunkMeshAttributes;
import net.coderbot.iris.compat.sodium.impl.vertex_format.IrisGlVertexAttributeFormat;
import net.coderbot.iris.compat.sodium.mixin.vertex_format.CompactChunkVertexAccessor;

/**
* Like HFPModelVertexType, but extended to support Iris. The extensions aren't particularly efficient right now.
Expand All @@ -27,7 +28,7 @@ public class XHFPModelVertexType implements ChunkVertexType {
.build();

private static final int POSITION_MAX_VALUE = 65536;
private static final int TEXTURE_MAX_VALUE = 65536;
private static final int TEXTURE_MAX_VALUE = CompactChunkVertexAccessor.getTEXTURE_MAX_VALUE();

private static final float MODEL_ORIGIN = 8.0f;
private static final float MODEL_RANGE = 32.0f;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.coderbot.iris.compat.sodium.mixin.vertex_format;

import me.jellysquid.mods.sodium.client.render.chunk.vertex.format.impl.CompactChunkVertex;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(CompactChunkVertex.class)
public interface CompactChunkVertexAccessor {
@Accessor
static int getTEXTURE_MAX_VALUE() {
throw new AssertionError();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"sky.MixinLevelRenderer",
"vertex_format.entity.MixinEntityRenderDispatcher",
"vertex_format.entity.MixinModelVertex",
"vertex_format.CompactChunkVertexAccessor",
"vertex_format.ChunkMeshAttributeAccessor",
"vertex_format.GlVertexAttributeFormatAccessor",
"vertex_format.MixinChunkMeshAttribute",
Expand Down
Loading