aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-14 14:20:50 +0200
committermakamys <makamys@outlook.com>2022-06-19 21:07:05 +0200
commit8131a2c49dfcad48e5bfaa08f29b84065e9ceaf6 (patch)
tree854e83a7796c2f4243bc6212cc251c7bc7f205c3 /src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java
parent90aafc433a5aa74b8921c930c7b679bb084bf2d7 (diff)
downloadNeodymium-8131a2c49dfcad48e5bfaa08f29b84065e9ceaf6.tar.gz
Neodymium-8131a2c49dfcad48e5bfaa08f29b84065e9ceaf6.tar.bz2
Neodymium-8131a2c49dfcad48e5bfaa08f29b84065e9ceaf6.zip
Render quads instead of triangles
So apparently, glDrawArrays has a secret undocumented feature that lets you draw quads. This increases my framerate by 50% on my integrated GPU, so you bet I'm going to make use of it. On my dedicated GPU there's no significant framerate difference. For the record, using EBOs didn't improve performance on the integrated GPU.
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java b/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java
index e35cc30..9dd9b04 100644
--- a/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java
+++ b/src/main/java/makamys/neodymium/renderer/GPUMemoryManager.java
@@ -153,7 +153,7 @@ public class GPUMemoryManager {
glBufferSubData(GL_ARRAY_BUFFER, nextBase, mesh.buffer);
mesh.iFirst = nextBase / mesh.getStride();
- mesh.iCount = mesh.quadCount * 6;
+ mesh.iCount = mesh.quadCount * 4;
mesh.offset = nextBase;
if(insertIndex == -1) {