Inheritance: TimestampQueryPool →
Manages a pool of WebGL timestamp queries for performance measurement. Handles creation, execution, and resolution of timer queries using WebGL extensions.
Creates a new WebGL timestamp query pool.
gl
The WebGL context.
type
The type identifier for this query pool.
maxQueries
Maximum number of queries this pool can hold.
Default is 2048.
Allocates a pair of queries for a given render context.
uid
A unique identifier for the render context.
Overrides: TimestampQueryPool#allocateQueriesForContext
Returns: The base offset for the allocated queries, or null if allocation failed.
Begins a timestamp query for the specified render context.
uid
A unique identifier for the render context.
Releases all resources held by this query pool. This includes deleting all query objects and clearing internal state.
Overrides: TimestampQueryPool#dispose
Ends the active timestamp query for the specified render context.
uid
A unique identifier for the render context.
Asynchronously resolves all completed queries and returns the total duration.
Overrides: TimestampQueryPool#resolveQueriesAsync
Returns: The total duration in milliseconds, or the last valid value if resolution fails.
Resolves a single query, checking for completion and disjoint operation.
query
The query object to resolve.
Returns: The elapsed time in milliseconds.
src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js