{"version":3,"file":"detectBasis.js","sources":["../../../src/compressed-textures/basis/detectBasis.ts"],"sourcesContent":["import { ExtensionType } from '../../extensions/Extensions';\nimport { isWebGLSupported } from '../../utils/browser/isWebGLSupported';\nimport { isWebGPUSupported } from '../../utils/browser/isWebGPUSupported';\n\nimport type { FormatDetectionParser } from '../../assets/detections/types';\n\n/**\n * Detects if Basis textures are supported by the browser.\n * This is done by checking if WebGL or WebGPU is supported.\n * If either is supported, Basis textures can be used.\n * @category assets\n * @internal\n */\nexport const detectBasis = {\n    extension: {\n        type: ExtensionType.DetectionParser,\n        priority: 3,\n    },\n    test: async (): Promise<boolean> =>\n    {\n        if (await isWebGPUSupported()) return true;\n        if (isWebGLSupported()) return true;\n\n        return false;\n    },\n    add: async (formats) => [...formats, 'basis'],\n    remove: async (formats) => formats.filter((f) => f !== 'basis'),\n} as FormatDetectionParser;\n"],"names":["ExtensionType","isWebGPUSupported","isWebGLSupported"],"mappings":";;;;;;;AAaO,MAAM,WAAc,GAAA;AAAA,EACvB,SAAW,EAAA;AAAA,IACP,MAAMA,wBAAc,CAAA,eAAA;AAAA,IACpB,QAAU,EAAA,CAAA;AAAA,GACd;AAAA,EACA,MAAM,YACN;AACI,IAAA,IAAI,MAAMC,mCAAkB,EAAA;AAAG,MAAO,OAAA,IAAA,CAAA;AACtC,IAAA,IAAIC,iCAAiB,EAAA;AAAG,MAAO,OAAA,IAAA,CAAA;AAE/B,IAAO,OAAA,KAAA,CAAA;AAAA,GACX;AAAA,EACA,KAAK,OAAO,OAAA,KAAY,CAAC,GAAG,SAAS,OAAO,CAAA;AAAA,EAC5C,MAAA,EAAQ,OAAO,OAAY,KAAA,OAAA,CAAQ,OAAO,CAAC,CAAA,KAAM,MAAM,OAAO,CAAA;AAClE;;;;"}