UNPKG

1.17 kBJavaScriptView Raw
1import _regeneratorRuntime from "@babel/runtime/regenerator";
2import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3import { loadScriptAsync } from '../utils/dom';
4var glslang;
5export default function () {
6 return _ref.apply(this, arguments);
7}
8
9function _ref() {
10 _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
11 return _regeneratorRuntime.wrap(function _callee$(_context) {
12 while (1) {
13 switch (_context.prev = _context.next) {
14 case 0:
15 if (!glslang) {
16 _context.next = 2;
17 break;
18 }
19
20 return _context.abrupt("return", glslang);
21
22 case 2:
23 _context.next = 4;
24 return loadScriptAsync('https://preview.babylonjs.com/glslang/glslang.js');
25
26 case 4:
27 glslang = window.glslang('https://preview.babylonjs.com/glslang/glslang.wasm');
28 return _context.abrupt("return", glslang);
29
30 case 6:
31 case "end":
32 return _context.stop();
33 }
34 }
35 }, _callee);
36 }));
37 return _ref.apply(this, arguments);
38}
39//# sourceMappingURL=glslang.js.map
\No newline at end of file