UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

20 lines (19 loc) 816 B
/** * Standalone GPU compute benchmark using raw WebGPU API. Measures compute throughput * (shared memory + barriers + atomics) to determine whether the GPU is efficient enough * for the compute-based GSplat renderer vs the vertex/fragment path. * * Runs during device creation before engine infrastructure is initialized. * * @ignore */ export class WebgpuComputeBenchmark { /** * Run a short compute benchmark and return the elapsed time in milliseconds. * * @param {GPUDevice} device - The raw WebGPU device. * @param {boolean} supportsTimestamp - Whether the device supports timestamp queries. * @returns {Promise<number>} Elapsed milliseconds, or -1 if timestamp queries unavailable. */ static run(device: GPUDevice, supportsTimestamp: boolean): Promise<number>; }