export class ShaderLoader {
    type = "shader";
    canLoad(request) {
        return /\.(?:wgsl|glsl|vert|frag)(?:\?.*)?$/i.test(request.url);
    }
    async load(request, context) {
        context.throwIfAborted(request.url);
        if (typeof fetch !== "function") {
            throw new Error("ShaderLoader requires fetch");
        }
        const response = await fetch(request.url, { signal: request.signal });
        if (!response.ok) {
            throw new Error(`Shader request failed with ${response.status}`);
        }
        return { url: request.url, source: await response.text() };
    }
}
//# sourceMappingURL=ShaderLoader.js.map