(ts: number)
| 514 | * Auto-schedules next frame only if in benchmark mode for continuous loop. |
| 515 | */ |
| 516 | const renderFrame = (ts: number): void => { |
| 517 | rafId = null; // Clear at start (single-shot pattern) |
| 518 | |
| 519 | if (lastFrameTs > 0) frameDtMs.push(ts - lastFrameTs); |
| 520 | lastFrameTs = ts; |
| 521 | |
| 522 | if (coordinator && gpuContext?.device) { |
| 523 | const t0 = performance.now(); |
| 524 | coordinator.render(); |
| 525 | const t1 = performance.now(); |
| 526 | renderMs.push(t1 - t0); |
| 527 | scheduleGpuTimingProbe(t1); |
| 528 | } |
| 529 | |
| 530 | updateStatsDom(ts); |
| 531 | |
| 532 | // Auto-schedule next frame only if in benchmark mode (continuous loop) |
| 533 | if (benchmarkMode) { |
| 534 | rafId = requestAnimationFrame(renderFrame); |
| 535 | } |
| 536 | }; |
| 537 | |
| 538 | /** |
| 539 | * Cleanup: stops render loop, disposes GPU resources, cancels observers. |
nothing calls this directly
no test coverage detected