compute_benchmark
English | 日本語

Overview
compute_benchmark measures every runtime stage used to build PBR output through ComputeEffectPipeline, covering PBR geometry, lighting, reflection, transparency, and output conversion. The measurement covers the stages that build PBR output, making the workload of each stage comparable.
The fixed scene contains opaque objects with varied roughness and metallic values, a closed transmission sphere, a floor, and walls. Lighting combines a directional light, a selectable number of point lights, and a linear-HDR procedural IBL environment. SSR uses pbr-ssr to replace specular IBL, and the transparent sphere specifies IOR and attenuation distance. Deferred PBR, IBL, PBR SSR, transmission, frost, and transparent forward shading therefore all execute in every baseline run.
Measured Stages
gbuffer-render renders opaque geometry into albedo, view-space normal, PBR material, emissive, and Reverse-Z depth targets. shadow-map renders the directional shadow map, while shadow-visibility derives screen-space direct-light visibility from the G-buffer and shadow map.
ssao includes both low-resolution AO generation and depth/normal bilateral reconstruction in SsaoPass. deferred-lighting-pbr evaluates GGX lighting with the directional light, local lights, SSAO, and precomputed IBL, producing both HDR lighting and the specular IBL component. ssr-pbr measures the ComputeSsrPass sequence of ray marching, roughness pyramid, and roughness filtering. pbr-ssr-composer measures the independent specular-IBL replacement pass. ssr-pbr-fused performs ray marching and the pyramid, then combines roughness filtering and specular-IBL replacement in one final dispatch. The two-stage sum and the fused case can therefore be compared in the same run.
transparency-pbr measures the whole transparent-surface stage. The sample also reads the named GPU profiler built into TransparencyPass and adds the following internal intervals as transparency:* rows:
transmissionMask: draws front-surface normal, transmission strength, and depthtransmissionVolume: draws attenuation color and attenuation distancetransmissionExit: draws back-face position, normal, and IORtransmissionComposite: applies two-surface refraction and Beer-Lambert absorption to the backgroundfrostPyramid: builds lower-frequency backgrounds for transparent roughnessroughnessMask: draws the maximum transparent-surface roughnessfrostComposite: selects and combines the frost background through the roughness maskforward: shades transparent PBR surfaces with shadows, local lights, and IBL
tone-map converts the linear HDR color after transparency into display color with Reinhard tone mapping. The final full-pbr-pipeline case records all top-level stages in one frame through renderScene() and encode(). It is an end-to-end measurement baseline that includes the actual texture handoffs and command sequence.
CPU or GPU preprocessing of an environment map happens at application startup or asset-build time and is measured separately from per-frame PBR. This sample creates a small precomputed procedural environment at startup and excludes its generation time. Fog, Toon, DoF, Bloom, Edge, and Vignette are also excluded from the PBR baseline.
How to Run
- Open compute_benchmark.html in a browser that supports WebGPU and
timestamp-query - Enter the number of recorded runs in
Samplesand the excluded pre-runs inWarmup - Enter a point-light count from
0through128inLocal Lights; the default is8 PBR SSRdefaults toFused; selectTwo-pass referencewhen comparing the two SSR execution modes- Use
Refresh Previewto inspect the fixed scene, IBL background, reflections, and transmission sphere - Press
Run PBR Baseline, then keep the browser tab and window in the foreground until every case finishes - Save the result with
Download JSONorDownload CSVwhen needed
Input values are validated against their documented ranges. An invalid integer or light count stops the measurement and reports the allowed setting. Resolution uses the canvas physical pixel size, so comparisons use the same window size and DPR. Keep canvas dimensions, DPR, local-light count, power state, browser, and GPU driver consistent when comparing two runs.
Reading the Results
A top-level row containing one render/compute pass, or a sequence that can receive beginning and ending timestamps in its internal pass descriptors, uses timestamp-query GPU time and displays gpu in the timer column. full-pbr-pipeline places its beginning timestamp on the first shadow-map render pass and its ending timestamp on the final tone-map pass, measuring every PBR pass between them as GPU time. Standalone transparency cannot attach one outer interval to a single pass descriptor, so only transparency-pbr measures from immediately before command submission through queue completion and displays queue. avg ms is the mean, median is the median, P95 is the slow-side five-percent boundary, min/max is the observed range, and n is the recorded count. Start with the median for normal cost, inspect P95 and max for instability, and investigate outliers when the mean differs substantially from the median.
The timer column shows profile for transparency:* rows. These values come from the rolling GPU timestamp statistics retained by TransparencyPass for at most 60 frames. The table shows their median, mean, minimum, and maximum. P95 and standard deviation are --; this pass exposes rolling median, mean, minimum, and maximum values. The outer transparency-pbr interval includes the transparent stage and its surrounding composition and connection work, so it will not exactly equal the sum of its internal intervals.
full-pbr-pipeline includes the G-buffer and shadow-map render passes together with the PBR compute and transparent render passes in one command sequence. The measurement covers GPU execution; CPU scene traversal and JavaScript command encoding are outside this measurement scope. Use isolated rows to find stage proportions and full-pbr-pipeline to confirm the end-to-end runtime PBR improvement.
The JSON output stores rawSamplesMs together with physical resolution, display dimensions, DPR, local-light count, PBR SSR fusion state, shadow-map size, SSAO, SSR, transmission, IBL, tone-map, excluded stages, and browser metadata. Before comparing two results, confirm that this metadata matches.
Implementation Checkpoints
- The sample uses the published
ComputeEffectPipelineand its pass objects directly, without a sample-local shader or duplicate pipeline - Every PBR case uses the same Camera Frame, fixed scene, directional light, local lights, IBL, SSR, and transmission settings
- Each isolated case is timed after its shared inputs are prepared
- PBR SSR composition explicitly receives Deferred Lighting's specular IBL, G-buffer material, AO, and BRDF LUT
Fusedreproduces the roughness output'srgba16floatrounding and low-resolution pixel mapping, removing only the independent composer dispatchTwo-pass referenceruns the roughness filter and composer sequentially only when comparison is explicitly selected- Transparency detail comes from
TransparencyPass.getPerformanceSnapshot()and missing intervals are distinguished from measured values - The last result is exposed as
window.pbrBenchmarkResult, and completion is visible throughbody[data-benchmark-status="ready"]