Higher-performance laser rendering 更高性能的激光渲染#2792
Higher-performance laser rendering 更高性能的激光渲染#2792ZhuRuoLing wants to merge 8 commits intoAnvil-Dev:dev/1.21/1.6from
Conversation
| import dev.dubhe.anvilcraft.api.rendering.foundation.Disposable; | ||
| import org.lwjgl.opengl.GL; | ||
|
|
||
| import static org.lwjgl.opengl.GL45.*; |
There was a problem hiding this comment.
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..
| import org.lwjgl.opengl.ARBBufferStorage; | ||
| import org.lwjgl.system.MemoryUtil; | ||
|
|
||
| import static org.lwjgl.opengl.GL45.*; |
There was a problem hiding this comment.
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..
| import org.joml.Vector3f; | ||
|
|
||
| public class QuadSorter { | ||
| public static int[] buildSortedIndexByDistance(QuadSortingState state, Vector3f point){ |
There was a problem hiding this comment.
WhitespaceAround: '{' is not preceded with whitespace.
| distances[i] = state.quadCenters().get(i).distanceSquared(point); | ||
| indexes[i] = i; | ||
| } | ||
| IntArrays.mergeSort(indexes, (a,b) -> Float.compare(distances[a], distances[b])); |
There was a problem hiding this comment.
',' is not followed by whitespace.
| private static class Edge implements Comparable<Edge> { | ||
| int u, v; | ||
| double weight; | ||
| Edge(int u, int v, double weight) { this.u = u; this.v = v; this.weight = weight; } |
There was a problem hiding this comment.
'CTOR_DEF' should be separated from previous line.
| double weight; | ||
| Edge(int u, int v, double weight) { this.u = u; this.v = v; this.weight = weight; } | ||
| @Override | ||
| public int compareTo(Edge o) { return Double.compare(this.weight, o.weight); } |
There was a problem hiding this comment.
'{' at column 38 should have line break after.
| double weight; | ||
| Edge(int u, int v, double weight) { this.u = u; this.v = v; this.weight = weight; } | ||
| @Override | ||
| public int compareTo(Edge o) { return Double.compare(this.weight, o.weight); } |
There was a problem hiding this comment.
'}' at column 86 should be alone on a line.
|
|
||
| private static class UnionFind { | ||
| int[] parent, rank; | ||
| UnionFind(int n) { |
There was a problem hiding this comment.
'CTOR_DEF' should be separated from previous line.
| rank = new int[n]; | ||
| for (int i = 0; i < n; i++) parent[i] = i; | ||
| } | ||
| int find(int x) { |
There was a problem hiding this comment.
'METHOD_DEF' should be separated from previous line.
| if (parent[x] != x) parent[x] = find(parent[x]); | ||
| return parent[x]; | ||
| } | ||
| void union(int x, int y) { |
There was a problem hiding this comment.
'METHOD_DEF' should be separated from previous line.
| import com.mojang.blaze3d.systems.RenderSystem; | ||
| import dev.dubhe.anvilcraft.api.rendering.foundation.Disposable; | ||
|
|
||
| import static org.lwjgl.opengl.GL45.*; |
There was a problem hiding this comment.
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..
|
|
||
| @Override | ||
| public void waitForReady() { | ||
| if (!syncSupport.isSyncSet()){ |
There was a problem hiding this comment.
WhitespaceAround: '{' is not preceded with whitespace.
| if (!syncSupport.isSyncSet()){ | ||
| return; | ||
| } | ||
| if (!syncSupport.isSyncSignaled()){ |
There was a problem hiding this comment.
WhitespaceAround: '{' is not preceded with whitespace.
| @@ -0,0 +1,32 @@ | |||
| package dev.dubhe.anvilcraft.api.rendering.util; | |||
|
|
|||
| import static org.lwjgl.opengl.GL45.*; | |||
There was a problem hiding this comment.
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..
|
|
||
| public abstract class GlBufferStorageLegacy<C> extends GlBufferStorage<C> { | ||
|
|
||
| protected GlBufferStorageLegacy(int target,C configureContext) { |
There was a problem hiding this comment.
',' is not followed by whitespace.
|
|
||
| private long clientPtr; | ||
|
|
||
| protected GlBufferStorageModern(int target,C configureContext) { |
There was a problem hiding this comment.
',' is not followed by whitespace.
|
|
||
| @Override | ||
| public void dispose() { | ||
| if (!valid)return; |
There was a problem hiding this comment.
WhitespaceAround: 'return' is not preceded with whitespace.
|
|
||
| void unbind(); | ||
|
|
||
| int getIndexCount(); |
There was a problem hiding this comment.
WhitespaceAround: '{' is not preceded with whitespace.
| import org.lwjgl.opengl.GL45; | ||
|
|
||
| public class GlIndexBufferStorage { | ||
| public static GlBufferStorage<?> create() { |
There was a problem hiding this comment.
WhitespaceAround: '{' is not preceded with whitespace.
|
|
||
| public class GlIndexBufferStorage { | ||
| public static GlBufferStorage<?> create() { | ||
| if (GlBufferStorage.BUFFER_STORAGE_SUPPORT) { |
There was a problem hiding this comment.
WhitespaceAround: '{' is not preceded with whitespace.
| import net.minecraft.client.renderer.RenderType; | ||
| import net.minecraft.world.phys.Vec3; | ||
| import net.neoforged.fml.ModList; | ||
| import org.jetbrains.annotations.Nullable; |
There was a problem hiding this comment.
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..
GL_ARB_buffer_storage替换Blaze3D的VertexBufferanvilcraft.enforceLegacyBuffers以强制使用传统顶点存储