1 |
- {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { Engine } from \"./engine.js\";\nimport { NullEngine } from \"./nullEngine.js\";\nimport { WebGPUEngine } from \"./webgpuEngine.js\";\n/**\n * Helper class to create the best engine depending on the current hardware\n */\nexport class EngineFactory {\n /**\n * Creates an engine based on the capabilities of the underlying hardware\n * @param canvas Defines the canvas to use to display the result\n * @param options Defines the options passed to the engine to create the context dependencies\n * @returns a promise that resolves with the created engine\n */\n static CreateAsync(canvas, options) {\n return _asyncToGenerator(function* () {\n const supported = yield WebGPUEngine.IsSupportedAsync;\n if (supported) {\n return WebGPUEngine.CreateAsync(canvas, options);\n }\n if (Engine.IsSupported) {\n return new Engine(canvas, undefined, options);\n }\n return new NullEngine(options);\n })();\n }\n}","map":{"version":3,"names":["Engine","NullEngine","WebGPUEngine","EngineFactory","CreateAsync","canvas","options","_asyncToGenerator","supported","IsSupportedAsync","IsSupported","undefined"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/engineFactory.js"],"sourcesContent":["import { Engine } from \"./engine.js\";\nimport { NullEngine } from \"./nullEngine.js\";\nimport { WebGPUEngine } from \"./webgpuEngine.js\";\n/**\n * Helper class to create the best engine depending on the current hardware\n */\nexport class EngineFactory {\n /**\n * Creates an engine based on the capabilities of the underlying hardware\n * @param canvas Defines the canvas to use to display the result\n * @param options Defines the options passed to the engine to create the context dependencies\n * @returns a promise that resolves with the created engine\n */\n static async CreateAsync(canvas, options) {\n const supported = await WebGPUEngine.IsSupportedAsync;\n if (supported) {\n return WebGPUEngine.CreateAsync(canvas, options);\n }\n if (Engine.IsSupported) {\n return new Engine(canvas, undefined, options);\n }\n return new NullEngine(options);\n }\n}\n"],"mappings":";AAAA,SAASA,MAAM,QAAQ,aAAa;AACpC,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,YAAY,QAAQ,mBAAmB;AAChD;AACA;AACA;AACA,OAAO,MAAMC,aAAa,CAAC;EACvB;AACJ;AACA;AACA;AACA;AACA;EACI,OAAaC,WAAWA,CAACC,MAAM,EAAEC,OAAO,EAAE;IAAA,OAAAC,iBAAA;MACtC,MAAMC,SAAS,SAASN,YAAY,CAACO,gBAAgB;MACrD,IAAID,SAAS,EAAE;QACX,OAAON,YAAY,CAACE,WAAW,CAACC,MAAM,EAAEC,OAAO,CAAC;MACpD;MACA,IAAIN,MAAM,CAACU,WAAW,EAAE;QACpB,OAAO,IAAIV,MAAM,CAACK,MAAM,EAAEM,SAAS,EAAEL,OAAO,CAAC;MACjD;MACA,OAAO,IAAIL,UAAU,CAACK,OAAO,CAAC;IAAC;EACnC;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|