wgpu backend: --benchmark N parity with the GL minimal

Stage 11 of the wgpu port. WgpuViewportWindow gains setBenchmarkFrames(N);
the minimal driver wires it to a --benchmark N flag. Renders N frames
after a 5-frame warmup, yaw-sweeping the camera at 0.5°/frame, captures
per-frame wall time with QElapsedTimer (cull + encode + present), and
prints avg/median/p1/p99 + last-frame stats in the same line format as
IfcViewerMinimal so a script can diff them line for line.

Per-frame stats (visible_objects, visible_triangles, sub_draws) are now
summed in render() from m.mesh_draws. hiz_rej reports 0 until stage 7
adds HiZ occlusion.

Verified on basic.ifc (3 instances): wgpu 11.68 ms avg vs GL 11.75 ms
avg — same scene, same camera sweep, same window size. Noise-level
delta as expected on a tiny scene; the interesting comparison is on
real BIM corpora once you bake them to v13 sidecars.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-05-27 14:14:40 +10:00
parent ddef8c65b5
commit 819196b3ce
3 changed files with 107 additions and 0 deletions
+5
View File
@@ -43,6 +43,8 @@ int main(int argc, char* argv[]) {
"[files...]");
parser.addOption({{"s", "screenshot"},
"Render one frame, save to PATH as PNG, exit.", "path"});
parser.addOption({{"b", "benchmark"},
"Render N frames (yaw-sweeping the camera), print stats, exit.", "frames"});
parser.process(app);
auto* viewport = new WgpuViewportWindow;
@@ -67,6 +69,9 @@ int main(int argc, char* argv[]) {
viewport->captureNextFrameToPng(parser.value("screenshot"),
/*quit_after=*/true);
}
if (parser.isSet("benchmark")) {
viewport->setBenchmarkFrames(parser.value("benchmark").toInt());
}
return app.exec();
}