diff options
Diffstat (limited to 'src/demos/es2')
-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++) { |