diff options
author | Sven Gothel <[email protected]> | 2008-08-21 19:08:03 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-08-21 19:08:03 +0000 |
commit | d6bbeb86e3a2d42953c7ccca4ec7287869687bbe (patch) | |
tree | ff2ffef345aa0c135be1beea1b5658530434dfc2 | |
parent | 489ef12b7c618d485a3f6db288dd441f380096af (diff) |
ES2.PerfTst: Fix avg fps
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@279 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
-rwxr-xr-x | src/demos/es2/perftst/PerfUniLoad.java | 13 | ||||
-rwxr-xr-x | src/demos/es2/perftst/PerfVBOLoad.java | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/demos/es2/perftst/PerfUniLoad.java b/src/demos/es2/perftst/PerfUniLoad.java index 8cb753a..d3174e2 100755 --- a/src/demos/es2/perftst/PerfUniLoad.java +++ b/src/demos/es2/perftst/PerfUniLoad.java @@ -88,7 +88,6 @@ public class PerfUniLoad extends PerfModule { // long dtC, dt, dt2, dt3, dtF, dtS, dtT; - long tStart; long[] tC = new long[loops]; long[] t0 = new long[loops]; long[][] t1 = new long[loops][numObjs]; @@ -96,8 +95,6 @@ public class PerfUniLoad extends PerfModule { long[] tF = new long[loops]; long[] tS = new long[loops]; - tStart = System.currentTimeMillis(); - for(int i=0; i<loops; i++) { tC[i] = System.currentTimeMillis(); @@ -124,16 +121,20 @@ public class PerfUniLoad extends PerfModule { tS[i] = System.currentTimeMillis(); } - dt = tS[loops-1] - tStart; int uniElements = numObjs * numArrayElem ; int uniBytes = uniElements * BufferUtil.SIZEOF_FLOAT; - System.out.println(""); + dt = 0; + for(int i=1; i<loops; i++) { + dt += tS[i] - tC[i]; + } + + System.out.println(""); System.out.println("Loops "+loops+", uniform arrays "+dummyUni.length+", type FLOAT"+ ", uniforms array size "+numArrayElem+ ",\n total elements "+uniElements+ ", total bytes "+uniBytes+", total time: "+dt + - "ms, fps: "+((loops*1000)/dt)+ + "ms, fps(-1): "+(((loops-1)*1000)/dt)+ ",\n uni elem/s: " + ((double)(loops*uniElements)/((double)dt/1000.0))); for(int i=0; i<loops; i++) { diff --git a/src/demos/es2/perftst/PerfVBOLoad.java b/src/demos/es2/perftst/PerfVBOLoad.java index a909e79..a832e36 100755 --- a/src/demos/es2/perftst/PerfVBOLoad.java +++ b/src/demos/es2/perftst/PerfVBOLoad.java @@ -65,7 +65,6 @@ public class PerfVBOLoad extends PerfModule { // long dtC, dt, dt2, dt3, dtF, dtS, dtT; - long tStart; long[] tC = new long[loops]; long[] t0 = new long[loops]; long[][] t1 = new long[loops][numObjs]; @@ -77,8 +76,6 @@ public class PerfVBOLoad extends PerfModule { // Push the 1st uniform down the path st.glUseProgram(gl, true); - tStart = System.currentTimeMillis(); - for(int i=0; i<loops; i++) { tC[i] = System.currentTimeMillis(); @@ -119,19 +116,23 @@ public class PerfVBOLoad extends PerfModule { tS[i] = System.currentTimeMillis(); } - dt = tS[loops-1] - tStart; int verticesElements = vertices[0].getElementNumber() * numObjs; int verticesBytes = verticesElements * vertices[0].getComponentSize()* vertices[0].getComponentNumber(); int colorsElements = colors[0].getElementNumber() * colors.length; int colorsBytes = colorsElements * colors[0].getComponentSize()* colors[0].getComponentNumber(); - System.out.println(""); + dt = 0; + for(int i=1; i<loops; i++) { + dt += tS[i] - tC[i]; + } + + System.out.println(""); System.out.println("Loops "+loops+", objects "+numObjs+", type "+getTypeName(dataType)+ ", vertices p.o. "+vertices[0].getElementNumber()+ ", colors p.o. "+colors[0].getElementNumber()+ ",\n total elements "+(verticesElements+colorsElements)+ ", total bytes "+(verticesBytes+colorsBytes)+", total time: "+dt + - "ms, fps: "+((loops*1000)/dt)+ + "ms, fps(-1): "+(((loops-1)*1000)/dt)+ ",\n col.vert./s: " + ((double)(loops*verticesElements)/((double)dt/1000.0))); for(int i=0; i<loops; i++) { |