Taos API Reference
    Preparing search index...

    Class GpuProfiler

    Index

    Properties

    MAX_PASSES: 128

    Max passes bracketed per frame. Crafty runs ~30-40; leaves headroom.

    enabled: boolean = false

    Toggle live. When false, writesFor returns undefined so passes run without timestampWrites and the whole path costs nothing.

    Accessors

    Methods

    • Timestamp-writes descriptor for one render/compute pass, or undefined when profiling is off or the per-frame capacity is exhausted (the pass then runs untimed). The same shape satisfies both render and compute pass descriptors.

      Parameters

      • name: string

      Returns GPURenderPassTimestampWrites | undefined

    • Record the query-set resolve + copy into a readback buffer. Call after all passes are encoded and before encoder.finish(). No-op when nothing was bracketed or no readback buffer is free (that frame's timings are skipped).

      Parameters

      Returns void

    • Kick off the async map of the buffer captured by resolve. Call once after queue.submit(). The map completes a frame or two later; when it does the per-pass EMA is updated and the buffer returned to the pool.

      Returns void