# SponzaBench — measuring the post-#40 performance work This example exists to answer issue **#155**: *starting with #40 a lot of performance-related issues were merged — what is the net performance gain, measured in a representative scene (Sponza)?* It is a headless benchmark harness built around the **native Vulkan** Sponza ray-tracing scene. Same asset bundle and camera as [`examples/Sponza`](../Sponza), but instead of opening an interactive window it times the work and prints machine-readable `BENCH …` lines, then exits. ## What it measures * **setup** — process start through the first command submission: asset decompression, BLAS build per mesh group, the multi-instance TLAS, the RT pipeline, GPU memory placement and the descriptor writes. This is the window most of the post-#40 *native* perf work acts on. * **frames** — a warmup followed by a measured loop calling `Window::Render()`, reporting per-frame wall-clock stats and throughput. Unlike the interactive Sponza example — which is single-material on native because of the hit-shader dynamic-`descriptor_heap`-index driver fault (see `examples/Sponza/README.md`) — SponzaBench's closest-hit shades from barycentric coordinates and samples **no** texture, so it can build the **full multi-mesh atrium** (25 mesh groups, ~262 k triangles) as one multi-instance TLAS. The albedo is still decompressed and uploaded during setup (to keep that path in the measurement) but is not bound. ## Running ```bash cd examples/SponzaBench crafter-build # native Vulkan # from the produced bin dir: VK_LOADER_LAYERS_DISABLE='~all~' \ CRAFTER_PRESENT_IMMEDIATE=1 \ BENCH_WARMUP=200 BENCH_FRAMES=2000 BENCH_MESHES=25 ./SponzaBench ``` `run-bench.sh