-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to improve entity render performance
- Loading branch information
Showing
13 changed files
with
278 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/net/coderbot/iris/vertices/BlockSensitiveBufferBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
package net.coderbot.iris.vertices; | ||
|
||
import com.mojang.blaze3d.vertex.VertexFormat; | ||
|
||
public interface BlockSensitiveBufferBuilder { | ||
void beginBlock(short block, short renderType, int localPosX, int localPosY, int localPosZ); | ||
|
||
void endBlock(); | ||
short getCurrentBlock(); | ||
|
||
VertexFormat.Mode getMode(); | ||
|
||
int getStride(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...mCompatibility/java/net/coderbot/iris/compat/sodium/impl/vertex_format/SodiumTriView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.coderbot.iris.compat.sodium.impl.vertex_format; | ||
|
||
import net.coderbot.iris.vertices.QuadView; | ||
import net.coderbot.iris.vertices.TriView; | ||
|
||
public class SodiumTriView implements QuadView { | ||
private long address; | ||
private int stride; | ||
private int textureOffset; | ||
|
||
public void setInfo(long address, int stride, int textureOffset) { | ||
this.address = address; | ||
this.stride = stride; | ||
this.textureOffset = textureOffset; | ||
} | ||
|
||
@Override | ||
public float x(int index) { | ||
return address - stride * (3L - index); | ||
} | ||
|
||
@Override | ||
public float y(int index) { | ||
return address + 4 - stride * (3L - index); | ||
} | ||
|
||
@Override | ||
public float z(int index) { | ||
return address + 8 - stride * (3L - index); | ||
} | ||
|
||
@Override | ||
public float u(int index) { | ||
return address + textureOffset - stride * (3L - index); | ||
} | ||
|
||
@Override | ||
public float v(int index) { | ||
return address + (textureOffset + 4 | ||
) - stride * (3L - index); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.