aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-04 15:55:06 +0200
committermakamys <makamys@outlook.com>2022-06-04 15:55:06 +0200
commita4553bb86b1ed25e035abd9ddd4d7452e3f0a151 (patch)
tree2fd8f3dae721f538fbb2f7912df004bdb4169a83 /src/main
parent657858e8d9c619c308339bbf3ed70f78bb2fb2ef (diff)
downloadNeodymium-a4553bb86b1ed25e035abd9ddd4d7452e3f0a151.tar.gz
Neodymium-a4553bb86b1ed25e035abd9ddd4d7452e3f0a151.tar.bz2
Neodymium-a4553bb86b1ed25e035abd9ddd4d7452e3f0a151.zip
Remove unnecessary buffer usage
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index 4e75403..942acdb 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -167,8 +167,8 @@ public class LODRenderer {
private void initIndexBuffers() {
for(int i = 0; i < 2; i++) {
- piFirst[i].limit(sentMeshes[i].size() + sentMeshes[i].size());
- piCount[i].limit(sentMeshes[i].size() + sentMeshes[i].size());
+ piFirst[i].limit(sentMeshes[i].size());
+ piCount[i].limit(sentMeshes[i].size());
for(Mesh mesh : sentMeshes[i]) {
if(mesh.visible && (LODMod.maxMeshesPerFrame == -1 || renderedMeshes < LODMod.maxMeshesPerFrame)) {
renderedMeshes++;
@@ -279,9 +279,6 @@ public class LODRenderer {
long t0 = System.nanoTime();
for(int i = 0; i < 2; i++) {
- piFirst[i].limit(0);
- piCount[i].limit(0);
-
for(Iterator<Mesh> it = sentMeshes[i].iterator(); it.hasNext(); ) {
Mesh mesh = it.next();
if(mesh.gpuStatus == GPUStatus.SENT) {
@@ -293,11 +290,6 @@ public class LODRenderer {
nextMeshOffset += mesh.bufferSize();
nextTri += mesh.quadCount * 6;
-
- piFirst[i].limit(piFirst[i].limit() + 1);
- piFirst[i].put(mesh.iFirst);
- piCount[i].limit(piCount[i].limit() + 1);
- piCount[i].put(mesh.iCount);
} else if(mesh.gpuStatus == GPUStatus.PENDING_DELETE) {
mesh.iFirst = mesh.offset = -1;
mesh.visible = false;