/** * Shader Cache - Shader loading and compilation utilities * * Handles loading WGSL shader sources from disk/network and compiling * them into GPUShaderModules with caching. * * @module gpu/kernels/shader-cache */ // ============================================================================ // Shader Loading // ============================================================================ /** * Load a WGSL shader file via fetch */ export declare function loadShaderSource(filename: string): Promise; /** Content identity of a loaded or preseeded source; null before loading. */ export declare function getShaderSourceIdentity(filename: string): string | null; /** Content identity captured when this cached shader module was compiled. */ export declare function getShaderModuleIdentity(module: GPUShaderModule): string | undefined; // ============================================================================ // Shader Compilation // ============================================================================ /** * Compile a shader module */ export declare function compileShader( device: GPUDevice, source: string, label: string ): Promise; /** * Get or create a cached shader module for a shader file. */ export declare function getShaderModule( device: GPUDevice, shaderFile: string, label: string ): Promise; // ============================================================================ // Cache Management // ============================================================================ /** * Clear the shader caches */ export declare function clearShaderCaches(): void; /** * Get shader cache statistics */ export declare function getShaderCacheStats(device?: GPUDevice | null): { sources: number; modules: number; }; /** * Register pre-fetched shader sources so the runtime does not have to fetch * them over HTTP. Consumer-provided bundles call this at startup. */ export declare function registerShaderSources( sources: Record | Map ): void; /** * Report whether a pre-seeded source is registered for a given shader file. */ export declare function hasPreseededShaderSource(shaderFile: string): boolean;