typegpu
Version:
A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.
22 lines (21 loc) • 1.18 kB
TypeScript
import type { TgpuMutable } from '../../core/buffer/bufferBinding.ts';
import { type TgpuFn } from '../../core/function/tgpuFn.ts';
import { type AnyWgslData, type Atomic, type U32, type Void, type WgslArray } from '../../data/wgslTypes.ts';
import type { LogGeneratorOptions, SerializedLogCallData } from './types.ts';
type SerializerMap = {
[K in AnyWgslData['type']]?: TgpuFn<(args_0: Extract<AnyWgslData, {
type: K;
}>) => Void>;
};
export declare const serializerMap: SerializerMap;
/**
* Creates a TGPU function that serializes data to the log buffer.
*
* @param id - Identifier for this logging function instance
* @param dataTypes - Array of WGSL data types that will be logged by this function
* @param dataBuffer - Mutable buffer array to store serialized log call data
* @param indexBuffer - Atomic counter buffer to track the next available log data slot
* @param logOptions - Configuration options
*/
export declare function createLoggingFunction(id: number, dataTypes: AnyWgslData[], dataBuffer: TgpuMutable<WgslArray<SerializedLogCallData>>, indexBuffer: TgpuMutable<Atomic<U32>>, logOptions: Required<LogGeneratorOptions>): TgpuFn;
export {};