@luma.gl/core
Version:
The luma.gl core Device API
42 lines • 2.04 kB
TypeScript
import type { Device } from "../device.js";
import { Resource, ResourceProps } from "./resource.js";
/**
* Properties for creating a QuerySet
* - 'timestamp' - query the GPU timestamp counter at the start and end of render passes
* timestamp queries are available if the 'timestamp-query' feature is present.
* - 'occlusion' - query the number of fragment samples that pass all per-fragment tests for a set of drawing commands
* including scissor, sample mask, alpha to coverage, stencil, and depth tests
*/
export type QuerySetProps = ResourceProps & {
/**
* The type of query set
* occlusion - query the number of fragment samples that pass all the per-fragment tests for a set of drawing commands, including scissor, sample mask, alpha to coverage, stencil, and depth tests
* timestamp - query the GPU timestamp counter. Timestamp queries are available if the
* `timestamp-query` feature is present.
*/
type: 'occlusion' | 'timestamp';
/** The number of queries managed by the query set */
count: number;
};
/** Immutable QuerySet object */
export declare abstract class QuerySet extends Resource<QuerySetProps> {
get [Symbol.toStringTag](): string;
constructor(device: Device, props: QuerySetProps);
static defaultProps: Required<QuerySetProps>;
/**
* Returns true if the requested result has been captured and can be read without blocking.
* Backends may implement this conservatively.
*/
abstract isResultAvailable(queryIndex?: number): boolean;
/** Reads query results as 64-bit values. */
abstract readResults(options?: {
firstQuery?: number;
queryCount?: number;
}): Promise<bigint[]>;
/**
* Reads a timestamp duration in milliseconds between a begin and end query index.
* Portable duration profiling requires adjacent indices that identify one logical pair.
*/
abstract readTimestampDuration(beginIndex: number, endIndex: number): Promise<number>;
}
//# sourceMappingURL=query-set.d.ts.map