-
Notifications
You must be signed in to change notification settings - Fork 65
Higher-performance laser rendering 更高性能的激光渲染 #2792
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
base: releases/1.21
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..
|
||
void unbind(); | ||
|
||
static GlIndexBuffer forQuad(VertexFormat.IndexType indexType){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WhitespaceAround: '{' is not preceded with whitespace.
import org.joml.Vector3f; | ||
|
||
public class QuadSorter { | ||
public static int[] buildSortedIndexByDistance(QuadSortingState state, Vector3f point){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
',' is not followed by whitespace.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'{' 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'}' 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WhitespaceAround: '{' is not preceded with whitespace.
if (!syncSupport.isSyncSet()){ | ||
return; | ||
} | ||
if (!syncSupport.isSyncSignaled()){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
',' is not followed by whitespace.
|
||
private long clientPtr; | ||
|
||
protected GlBufferStorageModern(int target,C configureContext) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
',' is not followed by whitespace.
|
||
@Override | ||
public void dispose() { | ||
if (!valid)return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WhitespaceAround: 'return' is not preceded with whitespace.
import org.lwjgl.opengl.GL45; | ||
|
||
public class GlIndexBufferStorage { | ||
public static GlBufferStorage<?> create(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WhitespaceAround: '{' is not preceded with whitespace.
import org.jetbrains.annotations.Nullable; | ||
import org.joml.Vector3f; | ||
|
||
import static org.lwjgl.opengl.GL45.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..
glBindVertexArray(0); | ||
} | ||
|
||
public void upload(long ptr, int size,int vertexCount, int indexCount, Disposable uploadSrc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
',' is not followed by whitespace.
this.upload(ptr, size, vertexCount, indexCount, null, null, uploadSrc); | ||
} | ||
|
||
public void upload(long ptr, int size, int vertexCount,int indexCount, @Nullable QuadSortingState sortingState, @Nullable Vector3f origin, Disposable uploadSrc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
',' is not followed by whitespace.
GL_ARB_buffer_storage
替换Blaze3D的VertexBufferanvilcraft.enforceLegacyBuffers
以强制使用传统顶点存储