import type { Node, NodeBuilder, Storage3DTexture, StorageTextureNode } from 'three/webgpu'; /** 3D storage binding surface used by the smoke compute kernels. */ export interface SmokeStorageTextureNode extends StorageTextureNode { setUpdateMatrix?: (value: boolean) => SmokeStorageTextureNode; generateUV?: (builder: NodeBuilder, uvNode: Node) => ReturnType; } /** Integer coordinates accepted by read/write 3D smoke storage bindings. */ export type SmokeStorageCoordinate3D = Node<'ivec3'> | Node<'uvec3'>; /** * Shared TSL helpers for the smoke simulation compute kernels. * * @module SmokeKernelUtils * @private */ /** * Early-out for threads dispatched beyond the grid bounds (grids are padded to the workgroup size). * * @param {Node} gridDim Grid dimensions. */ export declare function guardGrid(gridDim: Node<'uvec3'>): void; /** * Create a read_write storage binding for an r32float 3D texture so a kernel can update it in place. * WebGPU only guarantees read_write storage access for single-channel 32-bit formats. * * @param {Storage3DTexture} texture Single-channel float storage texture. * @returns {StorageTextureNode} Read-write storage texture node (use with textureStore and {@link loadInPlace3D}). */ export declare function storage3DReadWrite(texture: Storage3DTexture): SmokeStorageTextureNode; /** * Load a texel through a read_write storage binding. * three r185 emits 2D float coordinates for storage-texture loads; force ivec3 until that is fixed upstream. * * @param {StorageTextureNode} storageNode Node returned by {@link storage3DReadWrite}. * @param {Node} coord Integer texel coordinate. * @returns {Node} Loaded texel. */ export declare function loadInPlace3D(storageNode: SmokeStorageTextureNode, coord: Node<'ivec3'>): SmokeStorageTextureNode; /** * Store a texel through a read_write 3D storage binding. * On three r185+ this delegates to StorageTextureNode.store(), which shares the base node's * binding via referenceNode. r184's textureStore() clones WITHOUT referenceNode, forking a second * storage binding of the same texture in the dispatch, so the fallback replicates the r185 * semantics by hand. * * @param {StorageTextureNode} storageNode Node returned by {@link storage3DReadWrite}. * @param {Node} coord Integer texel coordinate. * @param {Node} value Value to store. * @returns {StorageTextureNode} Store node. */ export declare function storeInPlace3D(storageNode: SmokeStorageTextureNode, coord: SmokeStorageCoordinate3D, value: Node<'vec4'>): SmokeStorageTextureNode;