UWAL / GPUTiming
Classes
GPUTiming
Utility class levering the "timestamp-query" feature when available to monitor GPU performance. Check the WebGPU Timing Performance lesson and this example for its usefulness, common pitfalls, and the basic usage.
Constructors
Constructor
new GPUTiming(stage): GPUTiming;Parameters
| Parameter | Type | Description |
|---|---|---|
stage | RenderStage | ComputeStage | Computation or Renderer instance used for monitoring. |
Returns
Throws
ERROR.TIMESTAMP_QUERY_NOT_FOUND when "timestamp-query" feature is not supported.
Methods
ResolveAndSubmit()
ResolveAndSubmit(): Promise<number>;Copy timestamp results into a GPUBuffer and measure the duration between the current and the previous pass. Must be called after Computation.Compute or Renderer.Render (with the submit flag set to false).
Returns
Promise<number>
GPU duration of the current pass. NaN if the measurement failed for configuration reasons.
Destroy()
Destroy(): void;Destroy the query set and internal buffers.
Returns
void
Accessors
QuerySet
Get Signature
get QuerySet(): Promise<GPUQuerySet | undefined>;Throws
ERROR.TIMESTAMP_QUERY_NOT_FOUND when "timestamp-query" feature is not supported.
Returns
Promise<GPUQuerySet | undefined>
A query set to use in the CreateTimestampWrites method.
Enabled
Get Signature
get Enabled(): boolean;Returns
boolean
Whether the "timestamp-query" feature is available after initialization.