From b011409ee65553c53e2ca54a8165b0049c0931cc Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 28 Mar 2024 22:04:09 -0400 Subject: [PATCH] Optimizations for GL30 (cherry picked from commit e312cc96f5c044df9235b2d68b592720171cc215) --- arc-core/src/arc/graphics/g2d/SpriteBatch.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arc-core/src/arc/graphics/g2d/SpriteBatch.java b/arc-core/src/arc/graphics/g2d/SpriteBatch.java index 45c7c94a..a1b04f5b 100644 --- a/arc-core/src/arc/graphics/g2d/SpriteBatch.java +++ b/arc-core/src/arc/graphics/g2d/SpriteBatch.java @@ -80,6 +80,9 @@ public SpriteBatch(int size, Shader defaultShader){ }else{ shader = defaultShader; } + + //mark indices as dirty once for GL30 + mesh.getIndicesBuffer(); }else{ vertices = new float[0]; shader = null; @@ -126,8 +129,6 @@ protected void flush(){ // } Mesh mesh = this.mesh; mesh.setVertices(vertices, 0, idx); - mesh.getIndicesBuffer().position(0); - mesh.getIndicesBuffer().limit(count); mesh.render(getShader(), Gl.triangles, 0, count); idx = 0;