|
@@ -68,7 +68,7 @@
|
|
// WebGL Backend
|
|
// WebGL Backend
|
|
init( true );
|
|
init( true );
|
|
|
|
|
|
- function init( forceWebGL = false ) {
|
|
|
|
|
|
+ async function init( forceWebGL = false ) {
|
|
|
|
|
|
const aspect = ( window.innerWidth / 2 ) / window.innerHeight;
|
|
const aspect = ( window.innerWidth / 2 ) / window.innerHeight;
|
|
const camera = new THREE.OrthographicCamera( - aspect, aspect, 1, - 1, 0, 2 );
|
|
const camera = new THREE.OrthographicCamera( - aspect, aspect, 1, - 1, 0, 2 );
|
|
@@ -177,8 +177,6 @@
|
|
|
|
|
|
} )();
|
|
} )();
|
|
|
|
|
|
- // TODO: Add toAttribute() test
|
|
|
|
-
|
|
|
|
//
|
|
//
|
|
|
|
|
|
const plane = new THREE.Mesh( new THREE.PlaneGeometry( 1, 1 ), material );
|
|
const plane = new THREE.Mesh( new THREE.PlaneGeometry( 1, 1 ), material );
|
|
@@ -207,18 +205,24 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- // Init Positions
|
|
|
|
- renderer.compute( computeInit );
|
|
|
|
|
|
+
|
|
|
|
+ await renderer.computeAsync( computeInit );
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+
|
|
|
|
+ renderer.info.autoReset = false;
|
|
|
|
|
|
const stepAnimation = async function () {
|
|
const stepAnimation = async function () {
|
|
|
|
|
|
|
|
+ renderer.info.reset();
|
|
|
|
+
|
|
await renderer.computeAsync( compute );
|
|
await renderer.computeAsync( compute );
|
|
await renderer.renderAsync( scene, camera );
|
|
await renderer.renderAsync( scene, camera );
|
|
|
|
|
|
timestamps[ forceWebGL ? 'webgl' : 'webgpu' ].innerHTML = `
|
|
timestamps[ forceWebGL ? 'webgl' : 'webgpu' ].innerHTML = `
|
|
|
|
|
|
- Compute ${renderer.info.compute.computeCalls} pass in ${renderer.info.timestamp.compute.toFixed( 6 )}ms<br>
|
|
|
|
- Draw ${renderer.info.render.drawCalls} pass in ${renderer.info.timestamp.render.toFixed( 6 )}ms`;
|
|
|
|
|
|
+ Compute ${renderer.info.compute.computeCalls} pass in ${renderer.info.compute.timestamp.toFixed( 6 )}ms<br>
|
|
|
|
+ Draw ${renderer.info.render.drawCalls} pass in ${renderer.info.render.timestamp.toFixed( 6 )}ms`;
|
|
|
|
|
|
setTimeout( stepAnimation, 1000 );
|
|
setTimeout( stepAnimation, 1000 );
|
|
|
|
|