You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bench: --frames + --no-vsync + BENCH stdout line (Win32)
Adds the BabylonNative-side of the cross-app perf comparison driven by
webgpu-cross-platform-app/tools/bench/run-bench.mjs. Same CLI contract,
same BENCH stdout format, so the runner can treat both apps uniformly.
CLI
- Apps/Playground/Shared/CommandLine.{h,cpp}: new fields
PlaygroundOptions::Frames and PlaygroundOptions::NoVsync, parsed via
the existing FlagSpec table. --frames N also implicitly sets
NoVsync=true (matches DawnTest), --no-vsync standalone is supported
for indefinite runs where vsync should still be off.
Graphics
- Core/Graphics/Include/Shared/Babylon/Graphics/Device.h: add
Configuration::VSync (default true) so non-Playground consumers
keep current behavior.
- Core/Graphics/Source/DeviceImpl.cpp: drop the BGFX_RESET_VSYNC bit
from the reset mask when config.VSync is false. With vsync on the
loop is pinned to the display refresh and dwarfs the per-frame
measurement.
- Apps/Playground/Shared/AppContext.cpp: plumb options.NoVsync to
graphicsConfig.VSync.
Bench
- Apps/Playground/Shared/BenchTimer.{h,cpp}: PascalCase mirror of
DawnTest's framework/bench API (StartFrame/EndFrame/PrintBenchLine),
same metric set (min/avg/max/p95 + wall), first frame is warmup.
- Apps/Playground/Win32/App.cpp: wrap each main-loop iteration in the
timer (Finish -> FinishRender -> StartRender -> Start -> PeekMessage/
Dispatch). When --frames is set, PostQuitMessage(0) on hitting the
budget so the loop exits without depending on user input. Print the
BENCH line before returning. Scene name is derived from the script
stem so the runner can correlate cells across apps.
- Apps/Playground/CMakeLists.txt: register BenchTimer sources.
macOS/iOS/Android Playground entries are intentionally not wired here.
They route command-line args through MTKView delegates / JNI and need
larger refactors to feed --frames into the render loop. CI bench is
win32-only for now (no GPU on GH mac runners); local mac/Android bench
will follow.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments