From 3d537d4239e3772ffdb33592e5e66844d94ac9f3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 24 Feb 2023 15:33:39 +0100 Subject: GLArrayData*: Shorten methods (*API Change*), use proper constructor and finalize immutables, add growthFactor (default golden ratio 1.618), add getCapacity*() and printStats(..) The growthFactor becomes essential for better growth behavior and can be set via setGrowthFactor(). The other changes were merely to clean up the GLArrayData interface and its 4 implementations. Not great to change its API, but one name was misleading ['getComponentCount' -> 'getCompsPerEleme'], so overall .. readability is enhanced. Motivation for this change was the performance analysis and improvement of our Graph Curve Renderer. --- .../com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java | 2 +- .../com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java | 2 +- .../jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java | 2 +- src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java | 2 +- .../com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/test/com/jogamp/opengl') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java index d6ea7cfe5..ccd3a1ef0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java @@ -79,7 +79,7 @@ public class GearsObjectES1 extends GearsObject { ", Name[exp "+bufferName+", has "+hasBufferName+", Size exp "+bufferSize+", Storage "+hasStorage+"]"); } } - gl.glDrawArrays(mode, 0, array.getElementCount()); + gl.glDrawArrays(mode, 0, array.getElemCount()); array.enableBuffer(gl, false); } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java index 4fddd6f0e..763dbd1ba 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java @@ -113,7 +113,7 @@ public class GearsObjectES2 extends GearsObject { } array.enableBuffer(gl, true); // System.err.println("XXX Draw face "+face+" of "+this); - gl.glDrawArrays(mode, 0, array.getElementCount()); + gl.glDrawArrays(mode, 0, array.getElemCount()); array.enableBuffer(gl, false); } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java index eb9412366..aade02efa 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java @@ -397,7 +397,7 @@ public class TextureSequenceCubeES2 implements GLEventListener { } } cubeIndicesVBO.bindBuffer(gl, true); // keeps VBO binding - gl.glDrawElements(GL.GL_TRIANGLES, cubeIndicesVBO.getElementCount() * cubeIndicesVBO.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0); + gl.glDrawElements(GL.GL_TRIANGLES, cubeIndicesVBO.getElemCount() * cubeIndicesVBO.getCompsPerElem(), GL.GL_UNSIGNED_SHORT, 0); cubeIndicesVBO.bindBuffer(gl, false); if(null != tex) { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java index afad9b49f..696c02490 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java @@ -149,7 +149,7 @@ public class GLSLMiscHelper { vDataArray.seal(gl, true); Assert.assertTrue(vDataArray.isVBOWritten()); Assert.assertTrue(vDataArray.sealed()); - Assert.assertEquals(4, vDataArray.getElementCount()); + Assert.assertEquals(4, vDataArray.getElemCount()); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); Assert.assertEquals(0, gl.getBoundBuffer(GL.GL_ARRAY_BUFFER)); // should be cleared ASAP validateGLArrayDataServerState(gl, st, vDataArray); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java index 4b75a3ca4..2d7f38423 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java @@ -144,7 +144,7 @@ public class ReadBuffer2Screen extends ReadBufferBase { if(null!=readTextureCoords) { readTextureCoords.enableBuffer(gl, true); } - gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, readTextureVertices.getElementCount()); + gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, readTextureVertices.getElemCount()); /** if(null!=readTextureCoords) { readTextureCoords.enableBuffer(gl, false); -- cgit v1.2.3