import type { WebGPURenderer } from 'three/webgpu'; /** * WebGPU device limits hosts should request for VLAM beyond the spec defaults. * * The WebGPU default `maxStorageBufferBindingSize` is 128 MiB. Unified work * buffers and large streamed pools allocate storage attributes past that * (16 bytes per splat for an RGBA32F centers buffer). Desktop adapters often * advertise ~2 GiB, but only when those values are passed as `requiredLimits` * to `adapter.requestDevice()` / Three.js `WebGPURenderer`. * * `maxTextureDimension2D` is here for the same reason: the default is 8192, * which caps a pool at 8192 rows of {@link SPLAT_DATA_TEXTURE_WIDTH} (≈16.7 M * splats of *capacity*, so ≈11.2 M resident at the usual 1.5 slack). Desktop * adapters commonly advertise 16384 and double that ceiling for free. */ export interface WebGpuRequiredLimits { maxStorageBufferBindingSize: number; maxBufferSize: number; maxTextureDimension2D: number; [limit: string]: number; } /** * WebGPU's default `maxStorageBufferBindingSize` when the host does not raise * it via `requiredLimits` (128 MiB). */ export declare const WEBGPU_DEFAULT_MAX_STORAGE_BUFFER_BINDING_SIZE = 134217728; /** * Copies the adapter's advertised buffer maxima for use as * `WebGPURenderer({ requiredLimits })`. * * Does not call `requestDevice` - the host owns device creation. */ export declare function recommendedWebGpuRequiredLimits(adapter: { limits: { maxStorageBufferBindingSize: number; maxBufferSize: number; maxTextureDimension2D?: number; }; }): WebGpuRequiredLimits; /** Mirrors WebGPU `GPUPowerPreference` without requiring `@webgpu/types`. */ export type WebGpuPowerPreference = 'high-performance' | 'low-power'; type NavigatorPlatformProbe = Pick & { userAgentData?: { platform?: string; }; }; /** * Whether the host should pass `powerPreference` to `navigator.gpu.requestAdapter` * / Three.js `WebGPURenderer`. * * Chrome on Windows ignores the option and logs a console warning when it is * present ([crbug.com/369219127](https://crbug.com/369219127)). Prefer * {@link webGpuPowerPreferenceOptions} so Windows hosts omit it automatically. */ export declare function supportsWebGpuPowerPreference(nav?: NavigatorPlatformProbe | undefined): boolean; /** * Options to spread into `requestAdapter(...)` and `WebGPURenderer({...})`. * Empty on Windows so Chrome does not warn about an ignored `powerPreference`. */ export declare function webGpuPowerPreferenceOptions(powerPreference?: WebGpuPowerPreference, nav?: NavigatorPlatformProbe): { powerPreference: WebGpuPowerPreference; } | Record; /** * The renderer's WebGPU `maxStorageBufferBindingSize`, or 0 when it cannot be * read (WebGL2 fallback, or device not yet available). Callers skip the check * when 0 rather than falsely reject. */ export declare function deviceMaxStorageBufferBindingSize(renderer: WebGPURenderer): number; /** * Throws when a planned storage buffer would exceed the device bind limit. * No-ops when the limit cannot be read (WebGL2 / uninitialized backend). */ export declare function assertStorageBufferFitsDevice(renderer: WebGPURenderer, byteSize: number, capacity: number): void; export {};