11import type { AnyComputeBuiltin , AnyFragmentInputBuiltin , OmitBuiltins } from '../../builtin.ts' ;
22import type { TgpuQuerySet } from '../../core/querySet/querySet.ts' ;
33import type { AnyData , Disarray , UndecorateRecord } from '../../data/dataTypes.ts' ;
4+ import type { InstanceToSchema } from '../../data/instanceToSchema.ts' ;
45import type { WgslComparisonSamplerProps , WgslSamplerProps } from '../../data/sampler.ts' ;
56import type {
67 AnyWgslData ,
@@ -12,6 +13,7 @@ import type {
1213 Void ,
1314 WgslArray ,
1415} from '../../data/wgslTypes.ts' ;
16+ import type { TgpuNamable } from '../../shared/meta.ts' ;
1517import type {
1618 ExtractInvalidSchemaError ,
1719 InferGPURecord ,
@@ -33,7 +35,13 @@ import type { ShaderGenerator } from '../../tgsl/shaderGenerator.ts';
3335import type { Unwrapper } from '../../unwrapper.ts' ;
3436import type { TgpuBuffer , VertexFlag } from '../buffer/buffer.ts' ;
3537import type { TgpuMutable , TgpuReadonly , TgpuUniform } from '../buffer/bufferShorthand.ts' ;
36- import type { TgpuFixedComparisonSampler , TgpuFixedSampler } from '../sampler/sampler.ts' ;
38+ import type {
39+ AnyAutoCustoms ,
40+ AutoFragmentIn ,
41+ AutoFragmentOut ,
42+ AutoVertexIn ,
43+ AutoVertexOut ,
44+ } from '../function/autoIO.ts' ;
3745import type { IORecord } from '../function/fnTypes.ts' ;
3846import type {
3947 FragmentInConstrained ,
@@ -44,6 +52,7 @@ import type {
4452import type { TgpuVertexFn } from '../function/tgpuVertexFn.ts' ;
4553import type { TgpuComputePipeline } from '../pipeline/computePipeline.ts' ;
4654import type { FragmentOutToTargets , TgpuRenderPipeline } from '../pipeline/renderPipeline.ts' ;
55+ import type { TgpuFixedComparisonSampler , TgpuFixedSampler } from '../sampler/sampler.ts' ;
4756import type { Eventual , TgpuAccessor , TgpuMutableAccessor , TgpuSlot } from '../slot/slotTypes.ts' ;
4857import type { TgpuTexture } from '../texture/texture.ts' ;
4958import type {
@@ -52,15 +61,6 @@ import type {
5261} from '../vertexLayout/vertexAttribute.ts' ;
5362import type { TgpuVertexLayout } from '../vertexLayout/vertexLayout.ts' ;
5463import type { TgpuComputeFn } from './../function/tgpuComputeFn.ts' ;
55- import type { TgpuNamable } from '../../shared/meta.ts' ;
56- import type {
57- AnyAutoCustoms ,
58- AutoFragmentIn ,
59- AutoFragmentOut ,
60- AutoVertexIn ,
61- AutoVertexOut ,
62- } from '../function/autoIO.ts' ;
63- import type { InstanceToSchema } from '../../data/instanceToSchema.ts' ;
6464
6565// ----------
6666// Public API
@@ -80,6 +80,24 @@ export interface TgpuGuardedComputePipeline<TArgs extends number[] = number[]> e
8080 */
8181 with ( encoder : GPUCommandEncoder ) : TgpuGuardedComputePipeline < TArgs > ;
8282
83+ /**
84+ * Returns a pipeline wrapper with the given performance callback attached.
85+ * Analogous to `TgpuComputePipeline.withPerformanceCallback(callback)`.
86+ */
87+ withPerformanceCallback (
88+ callback : ( start : bigint , end : bigint ) => void | Promise < void > ,
89+ ) : TgpuGuardedComputePipeline < TArgs > ;
90+
91+ /**
92+ * Returns a pipeline wrapper with the given timestamp writes configuration.
93+ * Analogous to `TgpuComputePipeline.withTimestampWrites(options)`.
94+ */
95+ withTimestampWrites ( options : {
96+ querySet : TgpuQuerySet < 'timestamp' > | GPUQuerySet ;
97+ beginningOfPassWriteIndex ?: number ;
98+ endOfPassWriteIndex ?: number ;
99+ } ) : TgpuGuardedComputePipeline < TArgs > ;
100+
83101 /**
84102 * Dispatches the pipeline.
85103 * Unlike `TgpuComputePipeline.dispatchWorkgroups()`, this method takes in the
@@ -378,7 +396,7 @@ export interface WithBinding extends Withable<WithBinding> {
378396
379397 /**
380398 * Creates a compute pipeline that executes the given callback in an exact number of threads.
381- * This is different from `withCompute(...).createPipeline ()` in that it does a bounds check on the
399+ * This is different from `createComputePipeline ()` in that it does a bounds check on the
382400 * thread id, where as regular pipelines do not and work in units of workgroups.
383401 *
384402 * @param callback A function converted to WGSL and executed on the GPU.
0 commit comments