// Native WebGPU example

import Stats from 'stats-gl'

const stats = new Stats({ trackGPU: true });
await stats.init(device);
document.body.appendChild(stats.dom);

function render() {
    const encoder = device.createCommandEncoder();
    stats.begin();

    const pass = encoder.beginRenderPass({
        colorAttachments: [...],
        timestampWrites: stats.getTimestampWrites()
    });
    // draw calls
    pass.end();

    stats.end(encoder);
    device.queue.submit([encoder.finish()]);
    stats.update();
    requestAnimationFrame(render);
}