@luma.gl/webgl 8.5.8 → 8.6.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (763) hide show
  1. package/dist/api/device2.d.ts +52 -0
  2. package/dist/api/device2.d.ts.map +1 -0
  3. package/dist/api/device2.js +23 -0
  4. package/dist/api/device2.js.map +1 -0
  5. package/dist/bundle.d.ts +2 -0
  6. package/dist/bundle.d.ts.map +1 -0
  7. package/dist/bundle.js +5 -0
  8. package/dist/bundle.js.map +1 -0
  9. package/dist/classes/accessor.d.ts +28 -0
  10. package/dist/classes/accessor.d.ts.map +1 -0
  11. package/dist/classes/accessor.js +112 -0
  12. package/dist/classes/accessor.js.map +1 -0
  13. package/dist/classes/accessor.ts.disabled +159 -0
  14. package/dist/classes/clear.d.ts +17 -0
  15. package/dist/classes/clear.d.ts.map +1 -0
  16. package/{src → dist}/classes/clear.js +29 -23
  17. package/dist/classes/clear.js.map +1 -0
  18. package/dist/classes/copy-and-blit.d.ts +86 -0
  19. package/dist/classes/copy-and-blit.d.ts.map +1 -0
  20. package/dist/classes/copy-and-blit.js +338 -0
  21. package/dist/classes/copy-and-blit.js.map +1 -0
  22. package/dist/classes/framebuffer.d.ts +139 -0
  23. package/dist/classes/framebuffer.d.ts.map +1 -0
  24. package/dist/classes/framebuffer.js +656 -0
  25. package/dist/classes/framebuffer.js.map +1 -0
  26. package/dist/classes/program-configuration.d.ts +27 -0
  27. package/dist/classes/program-configuration.d.ts.map +1 -0
  28. package/dist/classes/program-configuration.js +160 -0
  29. package/dist/classes/program-configuration.js.map +1 -0
  30. package/dist/classes/program.d.ts +61 -0
  31. package/dist/classes/program.d.ts.map +1 -0
  32. package/dist/classes/program.js +370 -0
  33. package/dist/classes/program.js.map +1 -0
  34. package/dist/classes/query.d.ts +27 -0
  35. package/dist/classes/query.d.ts.map +1 -0
  36. package/dist/classes/query.js +145 -0
  37. package/dist/classes/query.js.map +1 -0
  38. package/dist/classes/renderbuffer-formats.d.ts +16 -0
  39. package/dist/classes/renderbuffer-formats.d.ts.map +1 -0
  40. package/dist/classes/renderbuffer-formats.js +185 -0
  41. package/dist/classes/renderbuffer-formats.js.map +1 -0
  42. package/dist/classes/renderbuffer.d.ts +60 -0
  43. package/dist/classes/renderbuffer.d.ts.map +1 -0
  44. package/dist/classes/renderbuffer.js +128 -0
  45. package/dist/classes/renderbuffer.js.map +1 -0
  46. package/dist/classes/texture-2d.d.ts +9 -0
  47. package/dist/classes/texture-2d.d.ts.map +1 -0
  48. package/dist/classes/texture-2d.js +36 -0
  49. package/dist/classes/texture-2d.js.map +1 -0
  50. package/dist/classes/texture-3d.d.ts +29 -0
  51. package/dist/classes/texture-3d.d.ts.map +1 -0
  52. package/dist/classes/texture-3d.js +76 -0
  53. package/dist/classes/texture-3d.js.map +1 -0
  54. package/dist/classes/texture-cube.d.ts +28 -0
  55. package/dist/classes/texture-cube.d.ts.map +1 -0
  56. package/dist/classes/texture-cube.js +130 -0
  57. package/dist/classes/texture-cube.js.map +1 -0
  58. package/dist/classes/texture-formats.d.ts +37 -0
  59. package/dist/classes/texture-formats.d.ts.map +1 -0
  60. package/dist/classes/texture-formats.js +98 -0
  61. package/dist/classes/texture-formats.js.map +1 -0
  62. package/dist/classes/texture.d.ts +123 -0
  63. package/dist/classes/texture.d.ts.map +1 -0
  64. package/dist/classes/texture.js +786 -0
  65. package/dist/classes/texture.js.map +1 -0
  66. package/dist/classes/transform-feedback.d.ts +33 -0
  67. package/dist/classes/transform-feedback.d.ts.map +1 -0
  68. package/dist/classes/transform-feedback.js +198 -0
  69. package/dist/classes/transform-feedback.js.map +1 -0
  70. package/dist/classes/uniform-buffer-layout.d.ts +17 -0
  71. package/dist/classes/uniform-buffer-layout.d.ts.map +1 -0
  72. package/dist/classes/uniform-buffer-layout.js +104 -0
  73. package/dist/classes/uniform-buffer-layout.js.map +1 -0
  74. package/dist/classes/uniforms.d.ts +37 -0
  75. package/dist/classes/uniforms.d.ts.map +1 -0
  76. package/dist/classes/uniforms.js +250 -0
  77. package/dist/classes/uniforms.js.map +1 -0
  78. package/dist/classes/vertex-array-object.d.ts +75 -0
  79. package/dist/classes/vertex-array-object.d.ts.map +1 -0
  80. package/dist/classes/vertex-array-object.js +261 -0
  81. package/dist/classes/vertex-array-object.js.map +1 -0
  82. package/dist/classes/vertex-array.d.ts +75 -0
  83. package/dist/classes/vertex-array.d.ts.map +1 -0
  84. package/dist/classes/vertex-array.js +408 -0
  85. package/dist/classes/vertex-array.js.map +1 -0
  86. package/dist/classes/webgl-buffer.d.ts +100 -0
  87. package/dist/classes/webgl-buffer.d.ts.map +1 -0
  88. package/dist/{esm/classes/buffer.js → classes/webgl-buffer.js} +100 -73
  89. package/dist/classes/webgl-buffer.js.map +1 -0
  90. package/dist/classes/webgl-resource.d.ts +56 -0
  91. package/dist/classes/webgl-resource.d.ts.map +1 -0
  92. package/dist/{esm/classes/resource.js → classes/webgl-resource.js} +35 -52
  93. package/dist/classes/webgl-resource.js.map +1 -0
  94. package/dist/classes/webgl-shader.d.ts +53 -0
  95. package/dist/classes/webgl-shader.d.ts.map +1 -0
  96. package/dist/classes/webgl-shader.js +193 -0
  97. package/dist/classes/webgl-shader.js.map +1 -0
  98. package/dist/context/context/context-state.d.ts +18 -0
  99. package/dist/context/context/context-state.d.ts.map +1 -0
  100. package/dist/context/context/context-state.js +26 -0
  101. package/dist/context/context/context-state.js.map +1 -0
  102. package/dist/context/context/create-context.d.ts +40 -0
  103. package/dist/context/context/create-context.d.ts.map +1 -0
  104. package/dist/context/context/create-context.js +37 -0
  105. package/dist/context/context/create-context.js.map +1 -0
  106. package/dist/context/context/device-pixels.d.ts +25 -0
  107. package/dist/context/context/device-pixels.d.ts.map +1 -0
  108. package/dist/context/context/device-pixels.js +98 -0
  109. package/dist/context/context/device-pixels.js.map +1 -0
  110. package/dist/context/context/get-canvas.d.ts +13 -0
  111. package/dist/context/context/get-canvas.d.ts.map +1 -0
  112. package/dist/context/context/get-canvas.js +31 -0
  113. package/dist/context/context/get-canvas.js.map +1 -0
  114. package/dist/context/context/resize-context.d.ts +20 -0
  115. package/dist/context/context/resize-context.d.ts.map +1 -0
  116. package/dist/context/context/resize-context.js +15 -0
  117. package/dist/context/context/resize-context.js.map +1 -0
  118. package/dist/context/context/webgl-checks.d.ts +13 -0
  119. package/dist/context/context/webgl-checks.d.ts.map +1 -0
  120. package/dist/context/context/webgl-checks.js +34 -0
  121. package/dist/context/context/webgl-checks.js.map +1 -0
  122. package/dist/context/parameters/unified-parameter-api.d.ts +30 -0
  123. package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -0
  124. package/dist/context/parameters/unified-parameter-api.js +65 -0
  125. package/dist/context/parameters/unified-parameter-api.js.map +1 -0
  126. package/dist/context/parameters/webgl-parameter-tables.d.ts +169 -0
  127. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -0
  128. package/dist/context/parameters/webgl-parameter-tables.js +445 -0
  129. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -0
  130. package/dist/context/parameters/webgl-parameters.d.ts +144 -0
  131. package/dist/context/parameters/webgl-parameters.d.ts.map +1 -0
  132. package/dist/context/parameters/webgl-parameters.js +2 -0
  133. package/dist/context/parameters/webgl-parameters.js.map +1 -0
  134. package/dist/context/polyfill/get-parameter-polyfill.d.ts +2 -0
  135. package/dist/context/polyfill/get-parameter-polyfill.d.ts.map +1 -0
  136. package/dist/context/polyfill/get-parameter-polyfill.js +91 -0
  137. package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -0
  138. package/dist/context/polyfill/polyfill-context.d.ts +5 -0
  139. package/dist/context/polyfill/polyfill-context.d.ts.map +1 -0
  140. package/dist/context/polyfill/polyfill-context.js +91 -0
  141. package/dist/context/polyfill/polyfill-context.js.map +1 -0
  142. package/dist/context/polyfill/polyfill-table.d.ts +48 -0
  143. package/dist/context/polyfill/polyfill-table.d.ts.map +1 -0
  144. package/dist/context/polyfill/polyfill-table.js +160 -0
  145. package/dist/context/polyfill/polyfill-table.js.map +1 -0
  146. package/dist/context/polyfill/polyfill-vertex-array-object.d.ts +2 -0
  147. package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +1 -0
  148. package/dist/context/polyfill/polyfill-vertex-array-object.js +335 -0
  149. package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -0
  150. package/dist/context/state-tracker/deep-array-equal.d.ts +3 -0
  151. package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -0
  152. package/dist/context/state-tracker/deep-array-equal.js +21 -0
  153. package/dist/context/state-tracker/deep-array-equal.js.map +1 -0
  154. package/dist/context/state-tracker/track-context-state.d.ts +22 -0
  155. package/dist/context/state-tracker/track-context-state.d.ts.map +1 -0
  156. package/dist/context/state-tracker/track-context-state.js +169 -0
  157. package/dist/context/state-tracker/track-context-state.js.map +1 -0
  158. package/dist/context/state-tracker/with-parameters.d.ts +13 -0
  159. package/dist/context/state-tracker/with-parameters.d.ts.map +1 -0
  160. package/dist/context/state-tracker/with-parameters.js +36 -0
  161. package/dist/context/state-tracker/with-parameters.js.map +1 -0
  162. package/dist/debug/debug-program-configuration.d.ts +2 -0
  163. package/dist/debug/debug-program-configuration.d.ts.map +1 -0
  164. package/dist/debug/debug-program-configuration.js +40 -0
  165. package/dist/debug/debug-program-configuration.js.map +1 -0
  166. package/dist/debug/debug-uniforms.d.ts +12 -0
  167. package/dist/debug/debug-uniforms.d.ts.map +1 -0
  168. package/dist/debug/debug-uniforms.js +108 -0
  169. package/dist/debug/debug-uniforms.js.map +1 -0
  170. package/dist/debug/debug-vertex-array.d.ts +5 -0
  171. package/dist/debug/debug-vertex-array.d.ts.map +1 -0
  172. package/dist/debug/debug-vertex-array.js +118 -0
  173. package/dist/debug/debug-vertex-array.js.map +1 -0
  174. package/dist/device/check-glsl-extension.d.ts +4 -0
  175. package/dist/device/check-glsl-extension.d.ts.map +1 -0
  176. package/dist/device/check-glsl-extension.js +22 -0
  177. package/dist/device/check-glsl-extension.js.map +1 -0
  178. package/dist/device/device-features.d.ts +12 -0
  179. package/dist/device/device-features.d.ts.map +1 -0
  180. package/dist/device/device-features.js +123 -0
  181. package/dist/device/device-features.js.map +1 -0
  182. package/dist/device/device-limits.d.ts +51 -0
  183. package/dist/device/device-limits.d.ts.map +1 -0
  184. package/dist/device/device-limits.js +90 -0
  185. package/dist/device/device-limits.js.map +1 -0
  186. package/dist/device/get-device-info.d.ts +4 -0
  187. package/dist/device/get-device-info.d.ts.map +1 -0
  188. package/dist/device/get-device-info.js +44 -0
  189. package/dist/device/get-device-info.js.map +1 -0
  190. package/dist/device/webgl-device.d.ts +111 -0
  191. package/dist/device/webgl-device.d.ts.map +1 -0
  192. package/dist/device/webgl-device.js +208 -0
  193. package/dist/device/webgl-device.js.map +1 -0
  194. package/dist/es5/api/device2.js +42 -0
  195. package/dist/es5/api/device2.js.map +1 -0
  196. package/dist/es5/bundle.js +2 -4
  197. package/dist/es5/bundle.js.map +1 -1
  198. package/dist/es5/classes/accessor.js +36 -38
  199. package/dist/es5/classes/accessor.js.map +1 -1
  200. package/dist/es5/classes/accessor.ts.disabled +159 -0
  201. package/dist/es5/classes/clear.js +17 -11
  202. package/dist/es5/classes/clear.js.map +1 -1
  203. package/dist/es5/classes/copy-and-blit.js +121 -117
  204. package/dist/es5/classes/copy-and-blit.js.map +1 -1
  205. package/dist/es5/classes/framebuffer.js +435 -423
  206. package/dist/es5/classes/framebuffer.js.map +1 -1
  207. package/dist/es5/classes/program-configuration.js +14 -11
  208. package/dist/es5/classes/program-configuration.js.map +1 -1
  209. package/dist/es5/classes/program.js +79 -67
  210. package/dist/es5/classes/program.js.map +1 -1
  211. package/dist/es5/classes/query.js +58 -59
  212. package/dist/es5/classes/query.js.map +1 -1
  213. package/dist/es5/classes/renderbuffer-formats.js +79 -52
  214. package/dist/es5/classes/renderbuffer-formats.js.map +1 -1
  215. package/dist/es5/classes/renderbuffer.js +129 -100
  216. package/dist/es5/classes/renderbuffer.js.map +1 -1
  217. package/dist/es5/classes/texture-2d.js +25 -21
  218. package/dist/es5/classes/texture-2d.js.map +1 -1
  219. package/dist/es5/classes/texture-3d.js +49 -29
  220. package/dist/es5/classes/texture-3d.js.map +1 -1
  221. package/dist/es5/classes/texture-cube.js +45 -36
  222. package/dist/es5/classes/texture-cube.js.map +1 -1
  223. package/dist/es5/classes/texture-formats.js +35 -33
  224. package/dist/es5/classes/texture-formats.js.map +1 -1
  225. package/dist/es5/classes/texture.js +213 -101
  226. package/dist/es5/classes/texture.js.map +1 -1
  227. package/dist/es5/classes/transform-feedback.js +37 -34
  228. package/dist/es5/classes/transform-feedback.js.map +1 -1
  229. package/dist/es5/classes/uniform-buffer-layout.js +4 -4
  230. package/dist/es5/classes/uniform-buffer-layout.js.map +1 -1
  231. package/dist/es5/classes/uniforms.js +73 -73
  232. package/dist/es5/classes/uniforms.js.map +1 -1
  233. package/dist/es5/classes/vertex-array-object.js +106 -149
  234. package/dist/es5/classes/vertex-array-object.js.map +1 -1
  235. package/dist/es5/classes/vertex-array.js +47 -38
  236. package/dist/es5/classes/vertex-array.js.map +1 -1
  237. package/dist/es5/classes/{buffer.js → webgl-buffer.js} +120 -111
  238. package/dist/es5/classes/webgl-buffer.js.map +1 -0
  239. package/dist/es5/classes/{resource.js → webgl-resource.js} +78 -99
  240. package/dist/es5/classes/webgl-resource.js.map +1 -0
  241. package/dist/es5/classes/webgl-shader.js +309 -0
  242. package/dist/es5/classes/webgl-shader.js.map +1 -0
  243. package/dist/es5/context/context/context-state.js +31 -0
  244. package/dist/es5/context/context/context-state.js.map +1 -0
  245. package/dist/es5/context/context/create-context.js +57 -0
  246. package/dist/es5/context/context/create-context.js.map +1 -0
  247. package/dist/es5/context/context/device-pixels.js +115 -0
  248. package/dist/es5/context/context/device-pixels.js.map +1 -0
  249. package/dist/es5/context/context/get-canvas.js +40 -0
  250. package/dist/es5/context/context/get-canvas.js.map +1 -0
  251. package/dist/es5/context/context/resize-context.js +23 -0
  252. package/dist/es5/context/context/resize-context.js.map +1 -0
  253. package/dist/es5/context/context/webgl-checks.js +54 -0
  254. package/dist/es5/context/context/webgl-checks.js.map +1 -0
  255. package/dist/es5/context/parameters/unified-parameter-api.js +95 -0
  256. package/dist/es5/context/parameters/unified-parameter-api.js.map +1 -0
  257. package/dist/es5/context/parameters/webgl-parameter-tables.js +392 -0
  258. package/dist/es5/context/parameters/webgl-parameter-tables.js.map +1 -0
  259. package/dist/es5/context/parameters/webgl-parameters.js +6 -0
  260. package/dist/es5/context/parameters/webgl-parameters.js.map +1 -0
  261. package/dist/es5/context/polyfill/get-parameter-polyfill.js +81 -0
  262. package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +1 -0
  263. package/dist/es5/context/polyfill/polyfill-context.js +134 -0
  264. package/dist/es5/context/polyfill/polyfill-context.js.map +1 -0
  265. package/dist/es5/context/polyfill/polyfill-table.js +166 -0
  266. package/dist/es5/context/polyfill/polyfill-table.js.map +1 -0
  267. package/dist/es5/context/polyfill/polyfill-vertex-array-object.js +341 -0
  268. package/dist/es5/context/polyfill/polyfill-vertex-array-object.js.map +1 -0
  269. package/dist/es5/context/state-tracker/deep-array-equal.js +28 -0
  270. package/dist/es5/context/state-tracker/deep-array-equal.js.map +1 -0
  271. package/dist/es5/context/state-tracker/track-context-state.js +196 -0
  272. package/dist/es5/context/state-tracker/track-context-state.js.map +1 -0
  273. package/dist/es5/context/state-tracker/with-parameters.js +44 -0
  274. package/dist/es5/context/state-tracker/with-parameters.js.map +1 -0
  275. package/dist/es5/debug/debug-program-configuration.js +1 -1
  276. package/dist/es5/debug/debug-program-configuration.js.map +1 -1
  277. package/dist/es5/debug/debug-uniforms.js +18 -20
  278. package/dist/es5/debug/debug-uniforms.js.map +1 -1
  279. package/dist/es5/debug/debug-vertex-array.js +16 -16
  280. package/dist/es5/debug/debug-vertex-array.js.map +1 -1
  281. package/dist/es5/device/check-glsl-extension.js +33 -0
  282. package/dist/es5/device/check-glsl-extension.js.map +1 -0
  283. package/dist/es5/device/device-features.js +152 -0
  284. package/dist/es5/device/device-features.js.map +1 -0
  285. package/dist/es5/device/device-limits.js +64 -0
  286. package/dist/es5/device/device-limits.js.map +1 -0
  287. package/dist/es5/device/get-device-info.js +55 -0
  288. package/dist/es5/device/get-device-info.js.map +1 -0
  289. package/dist/es5/device/webgl-device.js +279 -0
  290. package/dist/es5/device/webgl-device.js.map +1 -0
  291. package/dist/es5/index.js +140 -96
  292. package/dist/es5/index.js.map +1 -1
  293. package/dist/es5/init.js +21 -41
  294. package/dist/es5/init.js.map +1 -1
  295. package/dist/es5/types.js +2 -0
  296. package/dist/es5/types.js.map +1 -0
  297. package/dist/es5/webgl-utils/attribute-utils.js +4 -4
  298. package/dist/es5/webgl-utils/attribute-utils.js.map +1 -1
  299. package/dist/es5/webgl-utils/constants-to-keys.js +3 -3
  300. package/dist/es5/webgl-utils/constants-to-keys.js.map +1 -1
  301. package/dist/es5/webgl-utils/format-utils.js +21 -17
  302. package/dist/es5/webgl-utils/format-utils.js.map +1 -1
  303. package/dist/es5/webgl-utils/get-error.js.map +1 -1
  304. package/dist/es5/webgl-utils/index.js +74 -0
  305. package/dist/es5/webgl-utils/index.js.map +1 -0
  306. package/dist/es5/{features/check-old-ie.js → webgl-utils/is-old-ie.js} +3 -3
  307. package/dist/es5/webgl-utils/is-old-ie.js.map +1 -0
  308. package/dist/es5/webgl-utils/parse-shader-compiler-log.js +72 -0
  309. package/dist/es5/webgl-utils/parse-shader-compiler-log.js.map +1 -0
  310. package/dist/es5/webgl-utils/request-animation-frame.js.map +1 -1
  311. package/dist/es5/webgl-utils/texture-utils.js +6 -4
  312. package/dist/es5/webgl-utils/texture-utils.js.map +1 -1
  313. package/dist/es5/webgl-utils/typed-array-utils.js +39 -34
  314. package/dist/es5/webgl-utils/typed-array-utils.js.map +1 -1
  315. package/dist/es5/webgl-utils/webgl-info.ts.disabled +135 -0
  316. package/dist/esm/api/device2.js +23 -0
  317. package/dist/esm/api/device2.js.map +1 -0
  318. package/dist/esm/bundle.js +2 -4
  319. package/dist/esm/bundle.js.map +1 -1
  320. package/dist/esm/classes/accessor.js +6 -6
  321. package/dist/esm/classes/accessor.js.map +1 -1
  322. package/dist/esm/classes/accessor.ts.disabled +159 -0
  323. package/dist/esm/classes/clear.js +19 -14
  324. package/dist/esm/classes/clear.js.map +1 -1
  325. package/dist/esm/classes/copy-and-blit.js +67 -64
  326. package/dist/esm/classes/copy-and-blit.js.map +1 -1
  327. package/dist/esm/classes/framebuffer.js +341 -313
  328. package/dist/esm/classes/framebuffer.js.map +1 -1
  329. package/dist/esm/classes/program-configuration.js +18 -10
  330. package/dist/esm/classes/program-configuration.js.map +1 -1
  331. package/dist/esm/classes/program.js +71 -44
  332. package/dist/esm/classes/program.js.map +1 -1
  333. package/dist/esm/classes/query.js +20 -16
  334. package/dist/esm/classes/query.js.map +1 -1
  335. package/dist/esm/classes/renderbuffer-formats.js +72 -49
  336. package/dist/esm/classes/renderbuffer-formats.js.map +1 -1
  337. package/dist/esm/classes/renderbuffer.js +86 -73
  338. package/dist/esm/classes/renderbuffer.js.map +1 -1
  339. package/dist/esm/classes/texture-2d.js +13 -9
  340. package/dist/esm/classes/texture-2d.js.map +1 -1
  341. package/dist/esm/classes/texture-3d.js +28 -16
  342. package/dist/esm/classes/texture-3d.js.map +1 -1
  343. package/dist/esm/classes/texture-cube.js +45 -31
  344. package/dist/esm/classes/texture-cube.js.map +1 -1
  345. package/dist/esm/classes/texture-formats.js +52 -51
  346. package/dist/esm/classes/texture-formats.js.map +1 -1
  347. package/dist/esm/classes/texture.js +174 -58
  348. package/dist/esm/classes/texture.js.map +1 -1
  349. package/dist/esm/classes/transform-feedback.js +26 -14
  350. package/dist/esm/classes/transform-feedback.js.map +1 -1
  351. package/dist/esm/classes/uniform-buffer-layout.js +1 -1
  352. package/dist/esm/classes/uniform-buffer-layout.js.map +1 -1
  353. package/dist/esm/classes/uniforms.js +111 -113
  354. package/dist/esm/classes/uniforms.js.map +1 -1
  355. package/dist/esm/classes/vertex-array-object.js +52 -89
  356. package/dist/esm/classes/vertex-array-object.js.map +1 -1
  357. package/dist/esm/classes/vertex-array.js +50 -29
  358. package/dist/esm/classes/vertex-array.js.map +1 -1
  359. package/dist/esm/classes/webgl-buffer.js +382 -0
  360. package/dist/esm/classes/webgl-buffer.js.map +1 -0
  361. package/dist/esm/classes/webgl-resource.js +212 -0
  362. package/dist/esm/classes/webgl-resource.js.map +1 -0
  363. package/dist/esm/classes/webgl-shader.js +193 -0
  364. package/dist/esm/classes/webgl-shader.js.map +1 -0
  365. package/dist/esm/context/context/context-state.js +26 -0
  366. package/dist/esm/context/context/context-state.js.map +1 -0
  367. package/dist/esm/context/context/create-context.js +37 -0
  368. package/dist/esm/context/context/create-context.js.map +1 -0
  369. package/dist/esm/context/context/device-pixels.js +98 -0
  370. package/dist/esm/context/context/device-pixels.js.map +1 -0
  371. package/dist/esm/context/context/get-canvas.js +31 -0
  372. package/dist/esm/context/context/get-canvas.js.map +1 -0
  373. package/dist/esm/context/context/resize-context.js +15 -0
  374. package/dist/esm/context/context/resize-context.js.map +1 -0
  375. package/dist/esm/context/context/webgl-checks.js +34 -0
  376. package/dist/esm/context/context/webgl-checks.js.map +1 -0
  377. package/dist/esm/context/parameters/unified-parameter-api.js +65 -0
  378. package/dist/esm/context/parameters/unified-parameter-api.js.map +1 -0
  379. package/dist/esm/context/parameters/webgl-parameter-tables.js +445 -0
  380. package/dist/esm/context/parameters/webgl-parameter-tables.js.map +1 -0
  381. package/dist/esm/context/parameters/webgl-parameters.js +2 -0
  382. package/dist/esm/context/parameters/webgl-parameters.js.map +1 -0
  383. package/dist/esm/context/polyfill/get-parameter-polyfill.js +91 -0
  384. package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +1 -0
  385. package/dist/esm/context/polyfill/polyfill-context.js +91 -0
  386. package/dist/esm/context/polyfill/polyfill-context.js.map +1 -0
  387. package/dist/esm/context/polyfill/polyfill-table.js +160 -0
  388. package/dist/esm/context/polyfill/polyfill-table.js.map +1 -0
  389. package/dist/esm/context/polyfill/polyfill-vertex-array-object.js +335 -0
  390. package/dist/esm/context/polyfill/polyfill-vertex-array-object.js.map +1 -0
  391. package/dist/esm/context/state-tracker/deep-array-equal.js +21 -0
  392. package/dist/esm/context/state-tracker/deep-array-equal.js.map +1 -0
  393. package/dist/esm/context/state-tracker/track-context-state.js +169 -0
  394. package/dist/esm/context/state-tracker/track-context-state.js.map +1 -0
  395. package/dist/esm/context/state-tracker/with-parameters.js +36 -0
  396. package/dist/esm/context/state-tracker/with-parameters.js.map +1 -0
  397. package/dist/esm/debug/debug-program-configuration.js +4 -4
  398. package/dist/esm/debug/debug-program-configuration.js.map +1 -1
  399. package/dist/esm/debug/debug-uniforms.js +9 -9
  400. package/dist/esm/debug/debug-uniforms.js.map +1 -1
  401. package/dist/esm/debug/debug-vertex-array.js +18 -16
  402. package/dist/esm/debug/debug-vertex-array.js.map +1 -1
  403. package/dist/esm/device/check-glsl-extension.js +22 -0
  404. package/dist/esm/device/check-glsl-extension.js.map +1 -0
  405. package/dist/esm/device/device-features.js +123 -0
  406. package/dist/esm/device/device-features.js.map +1 -0
  407. package/dist/esm/device/device-limits.js +90 -0
  408. package/dist/esm/device/device-limits.js.map +1 -0
  409. package/dist/esm/device/get-device-info.js +44 -0
  410. package/dist/esm/device/get-device-info.js.map +1 -0
  411. package/dist/esm/device/webgl-device.js +208 -0
  412. package/dist/esm/device/webgl-device.js.map +1 -0
  413. package/dist/esm/index.js +15 -15
  414. package/dist/esm/index.js.map +1 -1
  415. package/dist/esm/init.js +12 -28
  416. package/dist/esm/init.js.map +1 -1
  417. package/dist/esm/types.js +2 -0
  418. package/dist/esm/types.js.map +1 -0
  419. package/dist/esm/webgl-utils/attribute-utils.js +1 -1
  420. package/dist/esm/webgl-utils/attribute-utils.js.map +1 -1
  421. package/dist/esm/webgl-utils/constants-to-keys.js +4 -4
  422. package/dist/esm/webgl-utils/constants-to-keys.js.map +1 -1
  423. package/dist/esm/webgl-utils/format-utils.js +16 -15
  424. package/dist/esm/webgl-utils/format-utils.js.map +1 -1
  425. package/dist/esm/webgl-utils/get-error.js +1 -1
  426. package/dist/esm/webgl-utils/get-error.js.map +1 -1
  427. package/dist/esm/webgl-utils/index.js +5 -0
  428. package/dist/esm/webgl-utils/index.js.map +1 -0
  429. package/dist/esm/{features/check-old-ie.js → webgl-utils/is-old-ie.js} +3 -3
  430. package/dist/esm/webgl-utils/is-old-ie.js.map +1 -0
  431. package/dist/esm/webgl-utils/parse-shader-compiler-log.js +37 -0
  432. package/dist/esm/webgl-utils/parse-shader-compiler-log.js.map +1 -0
  433. package/dist/esm/webgl-utils/request-animation-frame.js.map +1 -1
  434. package/dist/esm/webgl-utils/texture-utils.js +4 -3
  435. package/dist/esm/webgl-utils/texture-utils.js.map +1 -1
  436. package/dist/esm/webgl-utils/typed-array-utils.js +41 -36
  437. package/dist/esm/webgl-utils/typed-array-utils.js.map +1 -1
  438. package/dist/esm/webgl-utils/webgl-info.ts.disabled +135 -0
  439. package/dist/index.d.ts +49 -0
  440. package/dist/index.d.ts.map +1 -0
  441. package/dist/index.js +35 -0
  442. package/dist/index.js.map +1 -0
  443. package/dist/init.d.ts +5 -0
  444. package/dist/init.d.ts.map +1 -0
  445. package/dist/init.js +33 -0
  446. package/dist/init.js.map +1 -0
  447. package/dist/types.d.ts +9 -0
  448. package/dist/types.d.ts.map +1 -0
  449. package/dist/types.js +2 -0
  450. package/dist/types.js.map +1 -0
  451. package/dist/webgl-utils/attribute-utils.d.ts +18 -0
  452. package/dist/webgl-utils/attribute-utils.d.ts.map +1 -0
  453. package/dist/webgl-utils/attribute-utils.js +182 -0
  454. package/dist/webgl-utils/attribute-utils.js.map +1 -0
  455. package/dist/webgl-utils/constants-to-keys.d.ts +4 -0
  456. package/dist/webgl-utils/constants-to-keys.d.ts.map +1 -0
  457. package/dist/webgl-utils/constants-to-keys.js +41 -0
  458. package/dist/webgl-utils/constants-to-keys.js.map +1 -0
  459. package/dist/webgl-utils/format-utils.d.ts +3 -0
  460. package/dist/webgl-utils/format-utils.d.ts.map +1 -0
  461. package/dist/webgl-utils/format-utils.js +45 -0
  462. package/dist/webgl-utils/format-utils.js.map +1 -0
  463. package/dist/webgl-utils/get-error.d.ts +3 -0
  464. package/dist/webgl-utils/get-error.d.ts.map +1 -0
  465. package/dist/webgl-utils/get-error.js +41 -0
  466. package/dist/webgl-utils/get-error.js.map +1 -0
  467. package/dist/webgl-utils/index.d.ts +5 -0
  468. package/dist/webgl-utils/index.d.ts.map +1 -0
  469. package/dist/webgl-utils/index.js +5 -0
  470. package/dist/webgl-utils/index.js.map +1 -0
  471. package/dist/webgl-utils/is-old-ie.d.ts +2 -0
  472. package/dist/webgl-utils/is-old-ie.d.ts.map +1 -0
  473. package/dist/webgl-utils/is-old-ie.js +8 -0
  474. package/dist/webgl-utils/is-old-ie.js.map +1 -0
  475. package/dist/webgl-utils/parse-shader-compiler-log.d.ts +8 -0
  476. package/dist/webgl-utils/parse-shader-compiler-log.d.ts.map +1 -0
  477. package/dist/webgl-utils/parse-shader-compiler-log.js +37 -0
  478. package/dist/webgl-utils/parse-shader-compiler-log.js.map +1 -0
  479. package/dist/webgl-utils/request-animation-frame.d.ts +4 -0
  480. package/dist/webgl-utils/request-animation-frame.d.ts.map +1 -0
  481. package/dist/webgl-utils/request-animation-frame.js +7 -0
  482. package/dist/webgl-utils/request-animation-frame.js.map +1 -0
  483. package/dist/webgl-utils/texture-utils.d.ts +15 -0
  484. package/dist/webgl-utils/texture-utils.d.ts.map +1 -0
  485. package/dist/webgl-utils/texture-utils.js +48 -0
  486. package/dist/webgl-utils/texture-utils.js.map +1 -0
  487. package/dist/webgl-utils/typed-array-utils.d.ts +43 -0
  488. package/dist/webgl-utils/typed-array-utils.d.ts.map +1 -0
  489. package/{src → dist}/webgl-utils/typed-array-utils.js +45 -27
  490. package/dist/webgl-utils/typed-array-utils.js.map +1 -0
  491. package/dist/webgl-utils/webgl-info.ts.disabled +135 -0
  492. package/package.json +9 -9
  493. package/src/.DS_Store +0 -0
  494. package/src/api/device2.ts +71 -0
  495. package/src/bundle.ts +4 -0
  496. package/src/classes/accessor.js +2 -3
  497. package/src/classes/accessor.ts.disabled +159 -0
  498. package/src/classes/clear.ts +108 -0
  499. package/src/classes/{copy-and-blit.js → copy-and-blit.ts} +143 -55
  500. package/src/classes/{framebuffer.js → framebuffer.ts} +381 -321
  501. package/src/classes/{program-configuration.js → program-configuration.ts} +19 -12
  502. package/src/classes/{program.js → program.ts} +66 -40
  503. package/src/classes/{query.js → query.ts} +31 -25
  504. package/src/classes/{renderbuffer-formats.js → renderbuffer-formats.ts} +42 -14
  505. package/src/classes/renderbuffer.ts +154 -0
  506. package/src/classes/texture-2d.ts +35 -0
  507. package/src/classes/{texture-3d.js → texture-3d.ts} +48 -18
  508. package/src/classes/{texture-cube.js → texture-cube.ts} +52 -34
  509. package/src/classes/{texture-formats.js → texture-formats.ts} +10 -2
  510. package/src/classes/{texture.js → texture.ts} +223 -57
  511. package/src/classes/{transform-feedback.js → transform-feedback.ts} +34 -25
  512. package/src/classes/{uniform-buffer-layout.js → uniform-buffer-layout.ts} +10 -6
  513. package/src/classes/{uniforms.js → uniforms.ts} +123 -77
  514. package/src/classes/{vertex-array-object.js → vertex-array-object.ts} +133 -112
  515. package/src/classes/{vertex-array.js → vertex-array.ts} +74 -55
  516. package/src/classes/{buffer.js → webgl-buffer.ts} +126 -50
  517. package/src/classes/{resource.js → webgl-resource.ts} +55 -46
  518. package/src/classes/webgl-shader.ts +202 -0
  519. package/src/context/context/context-state.ts +39 -0
  520. package/src/context/context/create-context.ts +83 -0
  521. package/src/context/context/device-pixels.ts +147 -0
  522. package/src/context/context/get-canvas.ts +37 -0
  523. package/src/context/context/resize-context.ts +37 -0
  524. package/src/context/context/webgl-checks.ts +49 -0
  525. package/src/context/parameters/unified-parameter-api.ts +127 -0
  526. package/src/context/parameters/webgl-parameter-tables.ts +625 -0
  527. package/src/context/parameters/webgl-parameters.ts +197 -0
  528. package/src/context/polyfill/get-parameter-polyfill.ts +118 -0
  529. package/src/context/polyfill/polyfill-context.ts +98 -0
  530. package/src/context/polyfill/polyfill-table.ts +162 -0
  531. package/src/context/polyfill/polyfill-vertex-array-object.ts +360 -0
  532. package/src/context/state-tracker/deep-array-equal.ts +20 -0
  533. package/src/context/state-tracker/track-context-state.ts +250 -0
  534. package/src/context/state-tracker/with-parameters.ts +50 -0
  535. package/src/debug/{debug-program-configuration.js → debug-program-configuration.ts} +0 -0
  536. package/src/debug/{debug-uniforms.js → debug-uniforms.ts} +18 -8
  537. package/src/debug/{debug-vertex-array.js → debug-vertex-array.ts} +6 -5
  538. package/src/device/check-glsl-extension.ts +44 -0
  539. package/src/device/device-features.ts +227 -0
  540. package/src/device/device-limits.ts +150 -0
  541. package/src/device/get-device-info.ts +49 -0
  542. package/src/device/webgl-device.ts +406 -0
  543. package/src/index.ts +127 -0
  544. package/src/{init.js → init.ts} +11 -25
  545. package/src/{types.d.ts → types.ts} +1 -1
  546. package/src/webgl-utils/{attribute-utils.js → attribute-utils.ts} +1 -2
  547. package/src/webgl-utils/{constants-to-keys.js → constants-to-keys.ts} +1 -1
  548. package/src/webgl-utils/{format-utils.js → format-utils.ts} +1 -1
  549. package/src/webgl-utils/{get-error.js → get-error.ts} +0 -0
  550. package/src/webgl-utils/index.ts +12 -0
  551. package/src/{features/check-old-ie.js → webgl-utils/is-old-ie.ts} +3 -3
  552. package/src/webgl-utils/parse-shader-compiler-log.ts +48 -0
  553. package/src/webgl-utils/{request-animation-frame.js → request-animation-frame.ts} +3 -2
  554. package/src/webgl-utils/{texture-utils.js → texture-utils.ts} +14 -10
  555. package/src/webgl-utils/typed-array-utils.ts +137 -0
  556. package/src/webgl-utils/webgl-info.ts.disabled +135 -0
  557. package/dist/dist.js +0 -13710
  558. package/dist/dist.min.js +0 -1
  559. package/dist/es5/classes/buffer.d.ts +0 -84
  560. package/dist/es5/classes/buffer.js.map +0 -1
  561. package/dist/es5/classes/clear.d.ts +0 -11
  562. package/dist/es5/classes/copy-and-blit.d.ts +0 -101
  563. package/dist/es5/classes/framebuffer.d.ts +0 -96
  564. package/dist/es5/classes/program-configuration.d.ts +0 -15
  565. package/dist/es5/classes/program.d.ts +0 -44
  566. package/dist/es5/classes/query.d.ts +0 -21
  567. package/dist/es5/classes/renderbuffer.d.ts +0 -34
  568. package/dist/es5/classes/resource.d.ts +0 -47
  569. package/dist/es5/classes/resource.js.map +0 -1
  570. package/dist/es5/classes/shader.d.ts +0 -29
  571. package/dist/es5/classes/shader.js +0 -221
  572. package/dist/es5/classes/shader.js.map +0 -1
  573. package/dist/es5/classes/texture-2d.d.ts +0 -11
  574. package/dist/es5/classes/texture-3d.d.ts +0 -29
  575. package/dist/es5/classes/texture-cube.d.ts +0 -23
  576. package/dist/es5/classes/texture.d.ts +0 -80
  577. package/dist/es5/classes/transform-feedback.d.ts +0 -16
  578. package/dist/es5/classes/uniform-buffer-layout.d.ts +0 -18
  579. package/dist/es5/classes/uniforms.d.ts +0 -63
  580. package/dist/es5/classes/vertex-array-object.d.ts +0 -25
  581. package/dist/es5/classes/vertex-array.d.ts +0 -37
  582. package/dist/es5/debug/debug-program-configuration.d.ts +0 -1
  583. package/dist/es5/debug/debug-uniforms.d.ts +0 -11
  584. package/dist/es5/debug/debug-vertex-array.d.ts +0 -1
  585. package/dist/es5/features/check-glsl-extension.js +0 -41
  586. package/dist/es5/features/check-glsl-extension.js.map +0 -1
  587. package/dist/es5/features/check-old-ie.js.map +0 -1
  588. package/dist/es5/features/features.js +0 -99
  589. package/dist/es5/features/features.js.map +0 -1
  590. package/dist/es5/features/index.js +0 -64
  591. package/dist/es5/features/index.js.map +0 -1
  592. package/dist/es5/features/limits.js +0 -64
  593. package/dist/es5/features/limits.js.map +0 -1
  594. package/dist/es5/features/webgl-features-table.js +0 -64
  595. package/dist/es5/features/webgl-features-table.js.map +0 -1
  596. package/dist/es5/features/webgl-limits-table.js +0 -132
  597. package/dist/es5/features/webgl-limits-table.js.map +0 -1
  598. package/dist/es5/glsl-utils/format-glsl-error.d.ts +0 -16
  599. package/dist/es5/glsl-utils/format-glsl-error.js +0 -108
  600. package/dist/es5/glsl-utils/format-glsl-error.js.map +0 -1
  601. package/dist/es5/glsl-utils/get-shader-name.js +0 -14
  602. package/dist/es5/glsl-utils/get-shader-name.js.map +0 -1
  603. package/dist/es5/glsl-utils/get-shader-type-name.js +0 -22
  604. package/dist/es5/glsl-utils/get-shader-type-name.js.map +0 -1
  605. package/dist/es5/glsl-utils/get-shader-version.js +0 -22
  606. package/dist/es5/glsl-utils/get-shader-version.js.map +0 -1
  607. package/dist/es5/glsl-utils/index.js +0 -48
  608. package/dist/es5/glsl-utils/index.js.map +0 -1
  609. package/dist/es5/index.d.ts +0 -71
  610. package/dist/es5/init.d.ts +0 -12
  611. package/dist/es5/types.d.ts +0 -8
  612. package/dist/es5/utils/array-utils-flat.js +0 -51
  613. package/dist/es5/utils/array-utils-flat.js.map +0 -1
  614. package/dist/es5/utils/assert.d.ts +0 -1
  615. package/dist/es5/utils/assert.js +0 -13
  616. package/dist/es5/utils/assert.js.map +0 -1
  617. package/dist/es5/utils/check-props.js +0 -51
  618. package/dist/es5/utils/check-props.js.map +0 -1
  619. package/dist/es5/utils/format-value.js +0 -57
  620. package/dist/es5/utils/format-value.js.map +0 -1
  621. package/dist/es5/utils/is-old-ie.d.ts +0 -1
  622. package/dist/es5/utils/is-old-ie.js +0 -14
  623. package/dist/es5/utils/is-old-ie.js.map +0 -1
  624. package/dist/es5/utils/load-file.js +0 -50
  625. package/dist/es5/utils/load-file.js.map +0 -1
  626. package/dist/es5/utils/stub-methods.js +0 -25
  627. package/dist/es5/utils/stub-methods.js.map +0 -1
  628. package/dist/es5/utils/utils.d.ts +0 -13
  629. package/dist/es5/utils/utils.js +0 -36
  630. package/dist/es5/utils/utils.js.map +0 -1
  631. package/dist/es5/webgl-utils/request-animation-frame.d.ts +0 -3
  632. package/dist/es5/webgl-utils/texture-utils.d.ts +0 -11
  633. package/dist/es5/webgl-utils/typed-array-utils.d.ts +0 -36
  634. package/dist/esm/classes/buffer.d.ts +0 -84
  635. package/dist/esm/classes/buffer.js.map +0 -1
  636. package/dist/esm/classes/clear.d.ts +0 -11
  637. package/dist/esm/classes/copy-and-blit.d.ts +0 -101
  638. package/dist/esm/classes/framebuffer.d.ts +0 -96
  639. package/dist/esm/classes/program-configuration.d.ts +0 -15
  640. package/dist/esm/classes/program.d.ts +0 -44
  641. package/dist/esm/classes/query.d.ts +0 -21
  642. package/dist/esm/classes/renderbuffer.d.ts +0 -34
  643. package/dist/esm/classes/resource.d.ts +0 -47
  644. package/dist/esm/classes/resource.js.map +0 -1
  645. package/dist/esm/classes/shader.d.ts +0 -29
  646. package/dist/esm/classes/shader.js +0 -138
  647. package/dist/esm/classes/shader.js.map +0 -1
  648. package/dist/esm/classes/texture-2d.d.ts +0 -11
  649. package/dist/esm/classes/texture-3d.d.ts +0 -29
  650. package/dist/esm/classes/texture-cube.d.ts +0 -23
  651. package/dist/esm/classes/texture.d.ts +0 -80
  652. package/dist/esm/classes/transform-feedback.d.ts +0 -16
  653. package/dist/esm/classes/uniform-buffer-layout.d.ts +0 -18
  654. package/dist/esm/classes/uniforms.d.ts +0 -63
  655. package/dist/esm/classes/vertex-array-object.d.ts +0 -25
  656. package/dist/esm/classes/vertex-array.d.ts +0 -37
  657. package/dist/esm/debug/debug-program-configuration.d.ts +0 -1
  658. package/dist/esm/debug/debug-uniforms.d.ts +0 -11
  659. package/dist/esm/debug/debug-vertex-array.d.ts +0 -1
  660. package/dist/esm/features/check-glsl-extension.js +0 -27
  661. package/dist/esm/features/check-glsl-extension.js.map +0 -1
  662. package/dist/esm/features/check-old-ie.js.map +0 -1
  663. package/dist/esm/features/features.js +0 -66
  664. package/dist/esm/features/features.js.map +0 -1
  665. package/dist/esm/features/index.js +0 -5
  666. package/dist/esm/features/index.js.map +0 -1
  667. package/dist/esm/features/limits.js +0 -52
  668. package/dist/esm/features/limits.js.map +0 -1
  669. package/dist/esm/features/webgl-features-table.js +0 -71
  670. package/dist/esm/features/webgl-features-table.js.map +0 -1
  671. package/dist/esm/features/webgl-limits-table.js +0 -160
  672. package/dist/esm/features/webgl-limits-table.js.map +0 -1
  673. package/dist/esm/glsl-utils/format-glsl-error.d.ts +0 -16
  674. package/dist/esm/glsl-utils/format-glsl-error.js +0 -93
  675. package/dist/esm/glsl-utils/format-glsl-error.js.map +0 -1
  676. package/dist/esm/glsl-utils/get-shader-name.js +0 -6
  677. package/dist/esm/glsl-utils/get-shader-name.js.map +0 -1
  678. package/dist/esm/glsl-utils/get-shader-type-name.js +0 -15
  679. package/dist/esm/glsl-utils/get-shader-type-name.js.map +0 -1
  680. package/dist/esm/glsl-utils/get-shader-version.js +0 -15
  681. package/dist/esm/glsl-utils/get-shader-version.js.map +0 -1
  682. package/dist/esm/glsl-utils/index.js +0 -5
  683. package/dist/esm/glsl-utils/index.js.map +0 -1
  684. package/dist/esm/index.d.ts +0 -71
  685. package/dist/esm/init.d.ts +0 -12
  686. package/dist/esm/types.d.ts +0 -8
  687. package/dist/esm/utils/array-utils-flat.js +0 -39
  688. package/dist/esm/utils/array-utils-flat.js.map +0 -1
  689. package/dist/esm/utils/assert.d.ts +0 -1
  690. package/dist/esm/utils/assert.js +0 -6
  691. package/dist/esm/utils/assert.js.map +0 -1
  692. package/dist/esm/utils/check-props.js +0 -38
  693. package/dist/esm/utils/check-props.js.map +0 -1
  694. package/dist/esm/utils/format-value.js +0 -50
  695. package/dist/esm/utils/format-value.js.map +0 -1
  696. package/dist/esm/utils/is-old-ie.d.ts +0 -1
  697. package/dist/esm/utils/is-old-ie.js +0 -5
  698. package/dist/esm/utils/is-old-ie.js.map +0 -1
  699. package/dist/esm/utils/load-file.js +0 -30
  700. package/dist/esm/utils/load-file.js.map +0 -1
  701. package/dist/esm/utils/stub-methods.js +0 -17
  702. package/dist/esm/utils/stub-methods.js.map +0 -1
  703. package/dist/esm/utils/utils.d.ts +0 -13
  704. package/dist/esm/utils/utils.js +0 -22
  705. package/dist/esm/utils/utils.js.map +0 -1
  706. package/dist/esm/webgl-utils/request-animation-frame.d.ts +0 -3
  707. package/dist/esm/webgl-utils/texture-utils.d.ts +0 -11
  708. package/dist/esm/webgl-utils/typed-array-utils.d.ts +0 -36
  709. package/src/bundle.js +0 -8
  710. package/src/classes/buffer.d.ts +0 -84
  711. package/src/classes/clear.d.ts +0 -11
  712. package/src/classes/copy-and-blit.d.ts +0 -101
  713. package/src/classes/framebuffer.d.ts +0 -96
  714. package/src/classes/program-configuration.d.ts +0 -15
  715. package/src/classes/program.d.ts +0 -44
  716. package/src/classes/query.d.ts +0 -21
  717. package/src/classes/renderbuffer.d.ts +0 -34
  718. package/src/classes/renderbuffer.js +0 -105
  719. package/src/classes/resource.d.ts +0 -47
  720. package/src/classes/shader.d.ts +0 -29
  721. package/src/classes/shader.js +0 -147
  722. package/src/classes/texture-2d.d.ts +0 -11
  723. package/src/classes/texture-2d.js +0 -30
  724. package/src/classes/texture-3d.d.ts +0 -29
  725. package/src/classes/texture-cube.d.ts +0 -23
  726. package/src/classes/texture.d.ts +0 -80
  727. package/src/classes/transform-feedback.d.ts +0 -16
  728. package/src/classes/uniform-buffer-layout.d.ts +0 -18
  729. package/src/classes/uniforms.d.ts +0 -63
  730. package/src/classes/vertex-array-object.d.ts +0 -25
  731. package/src/classes/vertex-array.d.ts +0 -37
  732. package/src/debug/debug-program-configuration.d.ts +0 -1
  733. package/src/debug/debug-uniforms.d.ts +0 -11
  734. package/src/debug/debug-vertex-array.d.ts +0 -1
  735. package/src/features/check-glsl-extension.js +0 -34
  736. package/src/features/features.js +0 -79
  737. package/src/features/index.js +0 -5
  738. package/src/features/limits.js +0 -65
  739. package/src/features/webgl-features-table.js +0 -104
  740. package/src/features/webgl-limits-table.js +0 -51
  741. package/src/glsl-utils/format-glsl-error.d.ts +0 -16
  742. package/src/glsl-utils/format-glsl-error.js +0 -107
  743. package/src/glsl-utils/get-shader-name.js +0 -7
  744. package/src/glsl-utils/get-shader-type-name.js +0 -13
  745. package/src/glsl-utils/get-shader-version.js +0 -12
  746. package/src/glsl-utils/index.js +0 -8
  747. package/src/index.d.ts +0 -71
  748. package/src/index.js +0 -70
  749. package/src/init.d.ts +0 -12
  750. package/src/utils/array-utils-flat.js +0 -56
  751. package/src/utils/assert.d.ts +0 -1
  752. package/src/utils/assert.js +0 -7
  753. package/src/utils/check-props.js +0 -68
  754. package/src/utils/format-value.js +0 -37
  755. package/src/utils/is-old-ie.d.ts +0 -1
  756. package/src/utils/is-old-ie.js +0 -6
  757. package/src/utils/load-file.js +0 -39
  758. package/src/utils/stub-methods.js +0 -20
  759. package/src/utils/utils.d.ts +0 -13
  760. package/src/utils/utils.js +0 -36
  761. package/src/webgl-utils/request-animation-frame.d.ts +0 -3
  762. package/src/webgl-utils/texture-utils.d.ts +0 -11
  763. package/src/webgl-utils/typed-array-utils.d.ts +0 -36
@@ -15,7 +15,7 @@ const GL_ERROR_MESSAGES = {
15
15
  };
16
16
 
17
17
  function glGetErrorMessage(gl, glError) {
18
- return GL_ERROR_MESSAGES[glError] || `WebGL unknown error ${glError}`;
18
+ return GL_ERROR_MESSAGES[glError] || "WebGL unknown error ".concat(glError);
19
19
  }
20
20
 
21
21
  export function glGetError(gl) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webgl-utils/get-error.js"],"names":["GL_NO_ERROR","GL_INVALID_ENUM","GL_INVALID_VALUE","GL_INVALID_OPERATION","GL_OUT_OF_MEMORY","GL_CONTEXT_LOST_WEBGL","GL_INVALID_FRAMEBUFFER_OPERATION","GL_ERROR_MESSAGES","glGetErrorMessage","gl","glError","glGetError","errorStack","getError","push","length","Error","join","glCheckError","debug","error"],"mappings":"AAIA,MAAMA,WAAW,GAAG,CAApB;AACA,MAAMC,eAAe,GAAG,MAAxB;AACA,MAAMC,gBAAgB,GAAG,MAAzB;AACA,MAAMC,oBAAoB,GAAG,MAA7B;AACA,MAAMC,gBAAgB,GAAG,MAAzB;AACA,MAAMC,qBAAqB,GAAG,MAA9B;AACA,MAAMC,gCAAgC,GAAG,MAAzC;AAIA,MAAMC,iBAAiB,GAAG;AAIxB,GAACF,qBAAD,GAAyB,oBAJD;AAMxB,GAACJ,eAAD,GAAmB,mCANK;AAQxB,GAACC,gBAAD,GAAoB,qBARI;AAUxB,GAACC,oBAAD,GAAwB,yBAVA;AAaxB,GAACG,gCAAD,GAAoC,qCAbZ;AAexB,GAACF,gBAAD,GAAoB;AAfI,CAA1B;;AAkBA,SAASI,iBAAT,CAA2BC,EAA3B,EAA+BC,OAA/B,EAAwC;AACtC,SAAOH,iBAAiB,CAACG,OAAD,CAAjB,IAA+B,uBAAsBA,OAAQ,EAApE;AACD;;AAGD,OAAO,SAASC,UAAT,CAAoBF,EAApB,EAAwB;AAE7B,QAAMG,UAAU,GAAG,EAAnB;AACA,MAAIF,OAAO,GAAGD,EAAE,CAACI,QAAH,EAAd;;AACA,SAAOH,OAAO,KAAKV,WAAnB,EAAgC;AAC9BY,IAAAA,UAAU,CAACE,IAAX,CAAgBN,iBAAiB,CAACC,EAAD,EAAKC,OAAL,CAAjC;AACAA,IAAAA,OAAO,GAAGD,EAAE,CAACI,QAAH,EAAV;AACD;;AACD,SAAOD,UAAU,CAACG,MAAX,GAAoB,IAAIC,KAAJ,CAAUJ,UAAU,CAACK,IAAX,CAAgB,IAAhB,CAAV,CAApB,GAAuD,IAA9D;AACD;AAED,OAAO,SAASC,YAAT,CAAsBT,EAAtB,EAA0B;AAC/B,MAAIA,EAAE,CAACU,KAAP,EAAc;AACZ,UAAMC,KAAK,GAAGT,UAAU,CAACF,EAAD,CAAxB;;AACA,QAAIW,KAAJ,EAAW;AACT,YAAMA,KAAN;AACD;AACF;AACF","sourcesContent":["// Helper definitions for validation of webgl parameters\n/* eslint-disable no-inline-comments, max-len */\n\n// Errors - Constants returned from getError().\nconst GL_NO_ERROR = 0; // Returned from getError.\nconst GL_INVALID_ENUM = 0x0500; // Returned from getError.\nconst GL_INVALID_VALUE = 0x0501; // Returned from getError.\nconst GL_INVALID_OPERATION = 0x0502; // Returned from getError.\nconst GL_OUT_OF_MEMORY = 0x0505; // Returned from getError.\nconst GL_CONTEXT_LOST_WEBGL = 0x9242; // Returned from getError.\nconst GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;\n\n// GL errors\n\nconst GL_ERROR_MESSAGES = {\n // If the WebGL context is lost, this error is returned on the\n // first call to getError. Afterwards and until the context has been\n // restored, it returns gl.NO_ERROR.\n [GL_CONTEXT_LOST_WEBGL]: 'WebGL context lost',\n // An unacceptable value has been specified for an enumerated argument.\n [GL_INVALID_ENUM]: 'WebGL invalid enumerated argument',\n // A numeric argument is out of range.\n [GL_INVALID_VALUE]: 'WebGL invalid value',\n // The specified command is not allowed for the current state.\n [GL_INVALID_OPERATION]: 'WebGL invalid operation',\n // The currently bound framebuffer is not framebuffer complete\n // when trying to render to or to read from it.\n [GL_INVALID_FRAMEBUFFER_OPERATION]: 'WebGL invalid framebuffer operation',\n // Not enough memory is left to execute the command.\n [GL_OUT_OF_MEMORY]: 'WebGL out of memory'\n};\n\nfunction glGetErrorMessage(gl, glError) {\n return GL_ERROR_MESSAGES[glError] || `WebGL unknown error ${glError}`;\n}\n\n// Returns an Error representing the Latest webGl error or null\nexport function glGetError(gl) {\n // Loop to ensure all errors are cleared\n const errorStack = [];\n let glError = gl.getError();\n while (glError !== GL_NO_ERROR) {\n errorStack.push(glGetErrorMessage(gl, glError));\n glError = gl.getError();\n }\n return errorStack.length ? new Error(errorStack.join('\\n')) : null;\n}\n\nexport function glCheckError(gl) {\n if (gl.debug) {\n const error = glGetError(gl);\n if (error) {\n throw error;\n }\n }\n}\n"],"file":"get-error.js"}
1
+ {"version":3,"sources":["../../../src/webgl-utils/get-error.ts"],"names":["GL_NO_ERROR","GL_INVALID_ENUM","GL_INVALID_VALUE","GL_INVALID_OPERATION","GL_OUT_OF_MEMORY","GL_CONTEXT_LOST_WEBGL","GL_INVALID_FRAMEBUFFER_OPERATION","GL_ERROR_MESSAGES","glGetErrorMessage","gl","glError","glGetError","errorStack","getError","push","length","Error","join","glCheckError","debug","error"],"mappings":"AAIA,MAAMA,WAAW,GAAG,CAApB;AACA,MAAMC,eAAe,GAAG,MAAxB;AACA,MAAMC,gBAAgB,GAAG,MAAzB;AACA,MAAMC,oBAAoB,GAAG,MAA7B;AACA,MAAMC,gBAAgB,GAAG,MAAzB;AACA,MAAMC,qBAAqB,GAAG,MAA9B;AACA,MAAMC,gCAAgC,GAAG,MAAzC;AAIA,MAAMC,iBAAiB,GAAG;AAIxB,GAACF,qBAAD,GAAyB,oBAJD;AAMxB,GAACJ,eAAD,GAAmB,mCANK;AAQxB,GAACC,gBAAD,GAAoB,qBARI;AAUxB,GAACC,oBAAD,GAAwB,yBAVA;AAaxB,GAACG,gCAAD,GAAoC,qCAbZ;AAexB,GAACF,gBAAD,GAAoB;AAfI,CAA1B;;AAkBA,SAASI,iBAAT,CAA2BC,EAA3B,EAA+BC,OAA/B,EAAwC;AACtC,SAAOH,iBAAiB,CAACG,OAAD,CAAjB,kCAAqDA,OAArD,CAAP;AACD;;AAGD,OAAO,SAASC,UAAT,CAAoBF,EAApB,EAAwB;AAE7B,QAAMG,UAAU,GAAG,EAAnB;AACA,MAAIF,OAAO,GAAGD,EAAE,CAACI,QAAH,EAAd;;AACA,SAAOH,OAAO,KAAKV,WAAnB,EAAgC;AAC9BY,IAAAA,UAAU,CAACE,IAAX,CAAgBN,iBAAiB,CAACC,EAAD,EAAKC,OAAL,CAAjC;AACAA,IAAAA,OAAO,GAAGD,EAAE,CAACI,QAAH,EAAV;AACD;;AACD,SAAOD,UAAU,CAACG,MAAX,GAAoB,IAAIC,KAAJ,CAAUJ,UAAU,CAACK,IAAX,CAAgB,IAAhB,CAAV,CAApB,GAAuD,IAA9D;AACD;AAED,OAAO,SAASC,YAAT,CAAsBT,EAAtB,EAA0B;AAC/B,MAAIA,EAAE,CAACU,KAAP,EAAc;AACZ,UAAMC,KAAK,GAAGT,UAAU,CAACF,EAAD,CAAxB;;AACA,QAAIW,KAAJ,EAAW;AACT,YAAMA,KAAN;AACD;AACF;AACF","sourcesContent":["// Helper definitions for validation of webgl parameters\n/* eslint-disable no-inline-comments, max-len */\n\n// Errors - Constants returned from getError().\nconst GL_NO_ERROR = 0; // Returned from getError.\nconst GL_INVALID_ENUM = 0x0500; // Returned from getError.\nconst GL_INVALID_VALUE = 0x0501; // Returned from getError.\nconst GL_INVALID_OPERATION = 0x0502; // Returned from getError.\nconst GL_OUT_OF_MEMORY = 0x0505; // Returned from getError.\nconst GL_CONTEXT_LOST_WEBGL = 0x9242; // Returned from getError.\nconst GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506;\n\n// GL errors\n\nconst GL_ERROR_MESSAGES = {\n // If the WebGL context is lost, this error is returned on the\n // first call to getError. Afterwards and until the context has been\n // restored, it returns gl.NO_ERROR.\n [GL_CONTEXT_LOST_WEBGL]: 'WebGL context lost',\n // An unacceptable value has been specified for an enumerated argument.\n [GL_INVALID_ENUM]: 'WebGL invalid enumerated argument',\n // A numeric argument is out of range.\n [GL_INVALID_VALUE]: 'WebGL invalid value',\n // The specified command is not allowed for the current state.\n [GL_INVALID_OPERATION]: 'WebGL invalid operation',\n // The currently bound framebuffer is not framebuffer complete\n // when trying to render to or to read from it.\n [GL_INVALID_FRAMEBUFFER_OPERATION]: 'WebGL invalid framebuffer operation',\n // Not enough memory is left to execute the command.\n [GL_OUT_OF_MEMORY]: 'WebGL out of memory'\n};\n\nfunction glGetErrorMessage(gl, glError) {\n return GL_ERROR_MESSAGES[glError] || `WebGL unknown error ${glError}`;\n}\n\n// Returns an Error representing the Latest webGl error or null\nexport function glGetError(gl) {\n // Loop to ensure all errors are cleared\n const errorStack = [];\n let glError = gl.getError();\n while (glError !== GL_NO_ERROR) {\n errorStack.push(glGetErrorMessage(gl, glError));\n glError = gl.getError();\n }\n return errorStack.length ? new Error(errorStack.join('\\n')) : null;\n}\n\nexport function glCheckError(gl) {\n if (gl.debug) {\n const error = glGetError(gl);\n if (error) {\n throw error;\n }\n }\n}\n"],"file":"get-error.js"}
@@ -0,0 +1,5 @@
1
+ export { requestAnimationFrame, cancelAnimationFrame } from './request-animation-frame';
2
+ export { getGLTypeFromTypedArray, getTypedArrayFromGLType, flipRows, scalePixels } from './typed-array-utils';
3
+ export { getKeyValue, getKey, getKeyType } from './constants-to-keys';
4
+ export { cloneTextureFrom } from './texture-utils';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/webgl-utils/index.ts"],"names":["requestAnimationFrame","cancelAnimationFrame","getGLTypeFromTypedArray","getTypedArrayFromGLType","flipRows","scalePixels","getKeyValue","getKey","getKeyType","cloneTextureFrom"],"mappings":"AAAA,SAAQA,qBAAR,EAA+BC,oBAA/B,QAA0D,2BAA1D;AAEA,SACEC,uBADF,EAEEC,uBAFF,EAGEC,QAHF,EAIEC,WAJF,QAKO,qBALP;AAOA,SAAQC,WAAR,EAAqBC,MAArB,EAA6BC,UAA7B,QAA8C,qBAA9C;AAEA,SAAQC,gBAAR,QAA+B,iBAA/B","sourcesContent":["export {requestAnimationFrame, cancelAnimationFrame} from './request-animation-frame';\n\nexport {\n getGLTypeFromTypedArray,\n getTypedArrayFromGLType,\n flipRows,\n scalePixels\n} from './typed-array-utils';\n\nexport {getKeyValue, getKey, getKeyType} from './constants-to-keys';\n\nexport {cloneTextureFrom} from './texture-utils';\n"],"file":"index.js"}
@@ -1,8 +1,8 @@
1
- export default function isOldIE(opts = {}) {
2
- const navigator = typeof window !== 'undefined' && window.navigator || {};
1
+ export function isOldIE(opts = {}) {
2
+ const navigator = typeof window !== 'undefined' ? window.navigator || {} : {};
3
3
  const userAgent = opts.userAgent || navigator.userAgent || '';
4
4
  const isMSIE = userAgent.indexOf('MSIE ') !== -1;
5
5
  const isTrident = userAgent.indexOf('Trident/') !== -1;
6
6
  return isMSIE || isTrident;
7
7
  }
8
- //# sourceMappingURL=check-old-ie.js.map
8
+ //# sourceMappingURL=is-old-ie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/webgl-utils/is-old-ie.ts"],"names":["isOldIE","opts","navigator","window","userAgent","isMSIE","indexOf","isTrident"],"mappings":"AACA,OAAO,SAASA,OAAT,CAAiBC,IAAI,GAAG,EAAxB,EAA4B;AACjC,QAAMC,SAAS,GAAG,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAM,CAACD,SAAP,IAAoB,EAApD,GAAyD,EAA3E;AAEA,QAAME,SAAS,GAAGH,IAAI,CAACG,SAAL,IAAkBF,SAAS,CAACE,SAA5B,IAAyC,EAA3D;AAGA,QAAMC,MAAM,GAAGD,SAAS,CAACE,OAAV,CAAkB,OAAlB,MAA+B,CAAC,CAA/C;AACA,QAAMC,SAAS,GAAGH,SAAS,CAACE,OAAV,CAAkB,UAAlB,MAAkC,CAAC,CAArD;AACA,SAAOD,MAAM,IAAIE,SAAjB;AACD","sourcesContent":["// opts allows user agent to be overridden for testing\nexport function isOldIE(opts = {}) {\n const navigator = typeof window !== 'undefined' ? window.navigator || {} : {};\n // @ts-expect-error\n const userAgent = opts.userAgent || navigator.userAgent || '';\n // We only care about older versions of IE (IE 11 and below). Newer versions of IE (Edge)\n // have much better web standards support.\n const isMSIE = userAgent.indexOf('MSIE ') !== -1;\n const isTrident = userAgent.indexOf('Trident/') !== -1;\n return isMSIE || isTrident;\n}\n"],"file":"is-old-ie.js"}
@@ -0,0 +1,37 @@
1
+ const MESSAGE_TYPES = ['warning', 'error', 'info'];
2
+ export function parseShaderCompilerLog(errLog) {
3
+ const lines = errLog.split(/\r?\n/);
4
+ const messages = [];
5
+
6
+ for (const line of lines) {
7
+ if (line.length <= 1) {
8
+ continue;
9
+ }
10
+
11
+ const segments = line.split(':');
12
+ const [messageType, linePosition, lineNumber, ...rest] = segments;
13
+ let lineNum = parseInt(lineNumber, 10);
14
+
15
+ if (isNaN(lineNum)) {
16
+ lineNum = 0;
17
+ }
18
+
19
+ let linePos = parseInt(linePosition, 10);
20
+
21
+ if (isNaN(linePos)) {
22
+ linePos = 0;
23
+ }
24
+
25
+ const lowerCaseType = messageType.toLowerCase();
26
+ const type = MESSAGE_TYPES.includes(lowerCaseType) ? lowerCaseType : 'info';
27
+ messages.push({
28
+ message: rest.join(':').trim(),
29
+ type,
30
+ lineNum,
31
+ linePos
32
+ });
33
+ }
34
+
35
+ return messages;
36
+ }
37
+ //# sourceMappingURL=parse-shader-compiler-log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/webgl-utils/parse-shader-compiler-log.ts"],"names":["MESSAGE_TYPES","parseShaderCompilerLog","errLog","lines","split","messages","line","length","segments","messageType","linePosition","lineNumber","rest","lineNum","parseInt","isNaN","linePos","lowerCaseType","toLowerCase","type","includes","push","message","join","trim"],"mappings":"AAGA,MAAMA,aAAa,GAAG,CAAC,SAAD,EAAY,OAAZ,EAAqB,MAArB,CAAtB;AAOA,OAAO,SAASC,sBAAT,CAAgCC,MAAhC,EAA6E;AAElF,QAAMC,KAAK,GAAGD,MAAM,CAACE,KAAP,CAAa,OAAb,CAAd;AAEA,QAAMC,QAA2B,GAAG,EAApC;;AAEA,OAAK,MAAMC,IAAX,IAAmBH,KAAnB,EAA0B;AACxB,QAAIG,IAAI,CAACC,MAAL,IAAe,CAAnB,EAAsB;AACpB;AACD;;AAED,UAAMC,QAAkB,GAAGF,IAAI,CAACF,KAAL,CAAW,GAAX,CAA3B;AACA,UAAM,CAACK,WAAD,EAAcC,YAAd,EAA4BC,UAA5B,EAAwC,GAAGC,IAA3C,IAAmDJ,QAAzD;AAEA,QAAIK,OAAO,GAAGC,QAAQ,CAACH,UAAD,EAAa,EAAb,CAAtB;;AACA,QAAII,KAAK,CAACF,OAAD,CAAT,EAAoB;AAClBA,MAAAA,OAAO,GAAG,CAAV;AACD;;AAED,QAAIG,OAAO,GAAGF,QAAQ,CAACJ,YAAD,EAAe,EAAf,CAAtB;;AACA,QAAIK,KAAK,CAACC,OAAD,CAAT,EAAoB;AAClBA,MAAAA,OAAO,GAAG,CAAV;AACD;;AAGD,UAAMC,aAAa,GAAGR,WAAW,CAACS,WAAZ,EAAtB;AACA,UAAMC,IAAI,GAAInB,aAAa,CAACoB,QAAd,CAAuBH,aAAvB,IAAwCA,aAAxC,GAAwD,MAAtE;AAEAZ,IAAAA,QAAQ,CAACgB,IAAT,CAAc;AACZC,MAAAA,OAAO,EAAEV,IAAI,CAACW,IAAL,CAAU,GAAV,EAAeC,IAAf,EADG;AAEZL,MAAAA,IAFY;AAGZN,MAAAA,OAHY;AAIZG,MAAAA;AAJY,KAAd;AAMD;;AAED,SAAOX,QAAP;AACD","sourcesContent":["// luma.gl, MIT license\nimport type {CompilerMessage} from '@luma.gl/shadertools';\n\nconst MESSAGE_TYPES = ['warning', 'error', 'info'];\n\n/**\n * Parse a WebGL-format GLSL compilation log into an array of WebGPU style message records.\n * This follows documented WebGL conventions for compilation logs.\n * Based on https://github.com/wwwtyro/gl-format-compiler-error (public domain)\n */\nexport function parseShaderCompilerLog(errLog: string) : readonly CompilerMessage[] {\n // Parse the error - note: browser and driver dependent\n const lines = errLog.split(/\\r?\\n/);\n\n const messages: CompilerMessage[] = [];\n\n for (const line of lines) {\n if (line.length <= 1) {\n continue;\n }\n\n const segments: string[] = line.split(':');\n const [messageType, linePosition, lineNumber, ...rest] = segments;\n\n let lineNum = parseInt(lineNumber, 10);\n if (isNaN(lineNum)) {\n lineNum = 0;\n }\n\n let linePos = parseInt(linePosition, 10);\n if (isNaN(linePos)) {\n linePos = 0;\n }\n\n // Ensure supported type\n const lowerCaseType = messageType.toLowerCase();\n const type = (MESSAGE_TYPES.includes(lowerCaseType) ? lowerCaseType : 'info') as 'warning' | 'error' | 'info';\n\n messages.push({\n message: rest.join(':').trim(),\n type,\n lineNum,\n linePos // TODO\n })\n }\n\n return messages;\n}\n"],"file":"parse-shader-compiler-log.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webgl-utils/request-animation-frame.js"],"names":["requestAnimationFrame","callback","window","setTimeout","cancelAnimationFrame","timerId","clearTimeout"],"mappings":"AAEA,OAAO,SAASA,qBAAT,CAA+BC,QAA/B,EAAyC;AAC9C,SAAO,OAAOC,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACF,qBAAxC,GACHE,MAAM,CAACF,qBAAP,CAA6BC,QAA7B,CADG,GAEHE,UAAU,CAACF,QAAD,EAAW,OAAO,EAAlB,CAFd;AAGD;AAED,OAAO,SAASG,oBAAT,CAA8BC,OAA9B,EAAuC;AAC5C,SAAO,OAAOH,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACE,oBAAxC,GACHF,MAAM,CAACE,oBAAP,CAA4BC,OAA5B,CADG,GAEHC,YAAY,CAACD,OAAD,CAFhB;AAGD","sourcesContent":["// Node.js polyfills for requestAnimationFrame and cancelAnimationFrame\n\nexport function requestAnimationFrame(callback) {\n return typeof window !== 'undefined' && window.requestAnimationFrame\n ? window.requestAnimationFrame(callback)\n : setTimeout(callback, 1000 / 60);\n}\n\nexport function cancelAnimationFrame(timerId) {\n return typeof window !== 'undefined' && window.cancelAnimationFrame\n ? window.cancelAnimationFrame(timerId)\n : clearTimeout(timerId);\n}\n"],"file":"request-animation-frame.js"}
1
+ {"version":3,"sources":["../../../src/webgl-utils/request-animation-frame.ts"],"names":["requestAnimationFrame","callback","window","setTimeout","cancelAnimationFrame","timerId","clearTimeout"],"mappings":"AAGA,OAAO,SAASA,qBAAT,CAA+BC,QAA/B,EAAkE;AACvE,SAAO,OAAOC,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACF,qBAAxC,GACHE,MAAM,CAACF,qBAAP,CAA6BC,QAA7B,CADG,GAEHE,UAAU,CAACF,QAAD,EAAW,OAAO,EAAlB,CAFd;AAGD;AAED,OAAO,SAASG,oBAAT,CAA8BC,OAA9B,EAA6C;AAClD,SAAO,OAAOH,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACE,oBAAxC,GACHF,MAAM,CAACE,oBAAP,CAA4BC,OAA5B,CADG,GAEHC,YAAY,CAACD,OAAD,CAFhB;AAGD","sourcesContent":["// Node.js polyfills for requestAnimationFrame and cancelAnimationFrame\n// / <reference types=\"@types/node\" />\n\nexport function requestAnimationFrame(callback): number | NodeJS.Timeout {\n return typeof window !== 'undefined' && window.requestAnimationFrame\n ? window.requestAnimationFrame(callback)\n : setTimeout(callback, 1000 / 60);\n}\n\nexport function cancelAnimationFrame(timerId): void {\n return typeof window !== 'undefined' && window.cancelAnimationFrame\n ? window.cancelAnimationFrame(timerId)\n : clearTimeout(timerId);\n}\n"],"file":"request-animation-frame.js"}
@@ -1,8 +1,9 @@
1
+ import { assert } from '@luma.gl/api';
2
+ import GL from '@luma.gl/constants';
1
3
  import Texture2D from '../classes/texture-2d';
2
4
  import TextureCube from '../classes/texture-cube';
3
5
  import Texture3D from '../classes/texture-3d';
4
6
  import Framebuffer from '../classes/framebuffer';
5
- import { assert } from '../utils/assert';
6
7
  export function cloneTextureFrom(refTexture, overrides) {
7
8
  assert(refTexture instanceof Texture2D || refTexture instanceof TextureCube || refTexture instanceof Texture3D);
8
9
  const TextureType = refTexture.constructor;
@@ -35,11 +36,11 @@ export function toFramebuffer(texture, opts) {
35
36
  id
36
37
  } = texture;
37
38
  const framebuffer = new Framebuffer(gl, Object.assign({}, opts, {
38
- id: `framebuffer-for-${id}`,
39
+ id: "framebuffer-for-".concat(id),
39
40
  width,
40
41
  height,
41
42
  attachments: {
42
- [36064]: texture
43
+ [GL.COLOR_ATTACHMENT0]: texture
43
44
  }
44
45
  }));
45
46
  return framebuffer;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webgl-utils/texture-utils.js"],"names":["Texture2D","TextureCube","Texture3D","Framebuffer","assert","cloneTextureFrom","refTexture","overrides","TextureType","constructor","gl","width","height","format","type","dataFormat","border","mipmaps","textureOptions","Object","assign","toFramebuffer","texture","opts","id","framebuffer","attachments"],"mappings":"AACA,OAAOA,SAAP,MAAsB,uBAAtB;AACA,OAAOC,WAAP,MAAwB,yBAAx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;AAJS,GAAxB,CAFkB,CAApB;AAWA,SAAOG,WAAP;AACD","sourcesContent":["// TODO: Two subdirectories must not depend on each other (classes vs utils)!\nimport Texture2D from '../classes/texture-2d';\nimport TextureCube from '../classes/texture-cube';\nimport Texture3D from '../classes/texture-3d';\nimport Framebuffer from '../classes/framebuffer';\nimport GL from '@luma.gl/constants';\nimport {assert} from '../utils/assert';\n\n// Clone a new texture object from a reference texture object.\n/** @type {import('./texture-utils').cloneTextureFrom} */\nexport function cloneTextureFrom(refTexture, overrides) {\n assert(\n refTexture instanceof Texture2D ||\n refTexture instanceof TextureCube ||\n refTexture instanceof Texture3D\n );\n\n const TextureType = refTexture.constructor;\n\n const {gl, width, height, format, type, dataFormat, border, mipmaps} = refTexture;\n\n const textureOptions = Object.assign(\n {\n width,\n height,\n format,\n type,\n dataFormat,\n border,\n mipmaps\n },\n overrides\n );\n\n // TODO: move this to `Texture` class as instance method and use this.constructor\n return new TextureType(gl, textureOptions);\n}\n\n// Wraps a given texture into a framebuffer object, that can be further used\n// to read data from the texture object.\n/** @type {import('./texture-utils').toFramebuffer} */\nexport function toFramebuffer(texture, opts) {\n const {gl, width, height, id} = texture;\n const framebuffer = new Framebuffer(\n gl,\n Object.assign({}, opts, {\n id: `framebuffer-for-${id}`,\n width,\n height,\n attachments: {\n [GL.COLOR_ATTACHMENT0]: texture\n }\n })\n );\n return framebuffer;\n}\n"],"file":"texture-utils.js"}
1
+ {"version":3,"sources":["../../../src/webgl-utils/texture-utils.ts"],"names":["assert","GL","Texture2D","TextureCube","Texture3D","Framebuffer","cloneTextureFrom","refTexture","overrides","TextureType","constructor","gl","width","height","format","type","dataFormat","border","mipmaps","textureOptions","Object","assign","toFramebuffer","texture","opts","id","framebuffer","attachments","COLOR_ATTACHMENT0"],"mappings":"AACA,SAAQA,MAAR,QAAqB,cAArB;AACA,OAAOC,EAAP,MAAe,oBAAf;AAEA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,WAAP,MAAwB,yBA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GAAxB,CAFkB,CAApB;AAWA,SAAOG,WAAP;AACD","sourcesContent":["// TODO: Two subdirectories must not depend on each other (classes vs utils)!\nimport {assert} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport Texture from '../classes/texture';\nimport Texture2D from '../classes/texture-2d';\nimport TextureCube from '../classes/texture-cube';\nimport Texture3D from '../classes/texture-3d';\nimport Framebuffer, {FramebufferProps} from '../classes/framebuffer';\n\ntype TextureType = Texture2D | TextureCube | Texture3D;\n\n/** Clone a new texture object from a reference texture object. */\nexport function cloneTextureFrom<T extends TextureType>(refTexture: T, overrides?: any): T {\n assert(\n refTexture instanceof Texture2D ||\n refTexture instanceof TextureCube ||\n refTexture instanceof Texture3D\n );\n\n const TextureType = refTexture.constructor;\n\n const {gl, width, height, format, type, dataFormat, border, mipmaps} = refTexture;\n\n const textureOptions = Object.assign(\n {\n width,\n height,\n format,\n type,\n dataFormat,\n border,\n mipmaps\n },\n overrides\n );\n\n // TODO: move this to `Texture` class as instance method and use this.constructor\n // @ts-expect-error\n return new TextureType(gl, textureOptions);\n}\n\n/**\n * Wraps a given texture into a framebuffer object, that can be further used\n * to read data from the texture object.\n */ \nexport function toFramebuffer(texture: Texture, opts?: FramebufferProps): Framebuffer {\n const {gl, width, height, id} = texture;\n const framebuffer = new Framebuffer(\n gl,\n Object.assign({}, opts, {\n id: `framebuffer-for-${id}`,\n width,\n height,\n attachments: {\n [GL.COLOR_ATTACHMENT0]: texture\n }\n })\n );\n return framebuffer;\n}\n"],"file":"texture-utils.js"}
@@ -1,91 +1,96 @@
1
+ import GL from '@luma.gl/constants';
1
2
  const ERR_TYPE_DEDUCTION = 'Failed to deduce GL constant from typed array';
2
3
  export function getGLTypeFromTypedArray(arrayOrType) {
3
4
  const type = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;
4
5
 
5
6
  switch (type) {
6
7
  case Float32Array:
7
- return 5126;
8
+ return GL.FLOAT;
8
9
 
9
10
  case Uint16Array:
10
- return 5123;
11
+ return GL.UNSIGNED_SHORT;
11
12
 
12
13
  case Uint32Array:
13
- return 5125;
14
+ return GL.UNSIGNED_INT;
14
15
 
15
16
  case Uint8Array:
16
- return 5121;
17
+ return GL.UNSIGNED_BYTE;
17
18
 
18
19
  case Uint8ClampedArray:
19
- return 5121;
20
+ return GL.UNSIGNED_BYTE;
20
21
 
21
22
  case Int8Array:
22
- return 5120;
23
+ return GL.BYTE;
23
24
 
24
25
  case Int16Array:
25
- return 5122;
26
+ return GL.SHORT;
26
27
 
27
28
  case Int32Array:
28
- return 5124;
29
+ return GL.INT;
29
30
 
30
31
  default:
31
32
  throw new Error(ERR_TYPE_DEDUCTION);
32
33
  }
33
34
  }
34
- export function getTypedArrayFromGLType(glType, {
35
- clamped = true
36
- } = {}) {
35
+ export function getTypedArrayFromGLType(glType, options) {
36
+ const {
37
+ clamped = true
38
+ } = options || {};
39
+
37
40
  switch (glType) {
38
- case 5126:
41
+ case GL.FLOAT:
39
42
  return Float32Array;
40
43
 
41
- case 5123:
42
- case 33635:
43
- case 32819:
44
- case 32820:
44
+ case GL.UNSIGNED_SHORT:
45
+ case GL.UNSIGNED_SHORT_5_6_5:
46
+ case GL.UNSIGNED_SHORT_4_4_4_4:
47
+ case GL.UNSIGNED_SHORT_5_5_5_1:
45
48
  return Uint16Array;
46
49
 
47
- case 5125:
50
+ case GL.UNSIGNED_INT:
48
51
  return Uint32Array;
49
52
 
50
- case 5121:
53
+ case GL.UNSIGNED_BYTE:
51
54
  return clamped ? Uint8ClampedArray : Uint8Array;
52
55
 
53
- case 5120:
56
+ case GL.BYTE:
54
57
  return Int8Array;
55
58
 
56
- case 5122:
59
+ case GL.SHORT:
57
60
  return Int16Array;
58
61
 
59
- case 5124:
62
+ case GL.INT:
60
63
  return Int32Array;
61
64
 
62
65
  default:
63
66
  throw new Error('Failed to deduce typed array type from GL constant');
64
67
  }
65
68
  }
66
- export function flipRows({
67
- data,
68
- width,
69
- height,
70
- bytesPerPixel = 4,
71
- temp
72
- }) {
69
+ export function flipRows(options) {
70
+ const {
71
+ data,
72
+ width,
73
+ height,
74
+ bytesPerPixel = 4,
75
+ temp
76
+ } = options;
73
77
  const bytesPerRow = width * bytesPerPixel;
74
- temp = temp || new Uint8Array(bytesPerRow);
78
+ const tempBuffer = temp || new Uint8Array(bytesPerRow);
75
79
 
76
80
  for (let y = 0; y < height / 2; ++y) {
77
81
  const topOffset = y * bytesPerRow;
78
82
  const bottomOffset = (height - y - 1) * bytesPerRow;
79
- temp.set(data.subarray(topOffset, topOffset + bytesPerRow));
83
+ tempBuffer.set(data.subarray(topOffset, topOffset + bytesPerRow));
80
84
  data.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);
81
- data.set(temp, bottomOffset);
85
+ data.set(tempBuffer, bottomOffset);
82
86
  }
83
87
  }
84
- export function scalePixels({
85
- data,
86
- width,
87
- height
88
- }) {
88
+ export function scalePixels(options) {
89
+ const {
90
+ data,
91
+ width,
92
+ height
93
+ } = options;
89
94
  const newWidth = Math.round(width / 2);
90
95
  const newHeight = Math.round(height / 2);
91
96
  const newData = new Uint8Array(newWidth * newHeight * 4);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webgl-utils/typed-array-utils.js"],"names":["ERR_TYPE_DEDUCTION","getGLTypeFromTypedArray","arrayOrType","type","ArrayBuffer","isView","constructor","Float32Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","Int8Array","Int16Array","Int32Array","Error","getTypedArrayFromGLType","glType","clamped","flipRows","data","width","height","bytesPerPixel","temp","bytesPerRow","y","topOffset","bottomOffset","set","subarray","copyWithin","scalePixels","newWidth","Math","round","newHeight","newData","x","c"],"mappings":"AAEA,MAAMA,kBAAkB,GAAG,+CAA3B;AAIA,OAAO,SAASC,uBAAT,CAAiCC,WAAjC,EAA8C;AAEnD,QAAMC,IAAI,GAAGC,WAAW,CAACC,MAAZ,CAAmBH,WAAnB,IAAkCA,WAAW,CAACI,WAA9C,GAA4DJ,WAAzE;;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esContent":["import GL from '@luma.gl/constants';\n\nconst ERR_TYPE_DEDUCTION = 'Failed to deduce GL constant from typed array';\n\n// Converts TYPED ARRAYS to corresponding GL constant\n// Used to auto deduce gl parameter types\nexport function getGLTypeFromTypedArray(arrayOrType) {\n // If typed array, look up constructor\n const type = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;\n switch (type) {\n case Float32Array:\n return GL.FLOAT;\n case Uint16Array:\n return GL.UNSIGNED_SHORT;\n case Uint32Array:\n return GL.UNSIGNED_INT;\n case Uint8Array:\n return GL.UNSIGNED_BYTE;\n case Uint8ClampedArray:\n return GL.UNSIGNED_BYTE;\n case Int8Array:\n return GL.BYTE;\n case Int16Array:\n return GL.SHORT;\n case Int32Array:\n return GL.INT;\n default:\n throw new Error(ERR_TYPE_DEDUCTION);\n }\n}\n\n// Converts GL constant to corresponding TYPED ARRAY\n// Used to auto deduce gl parameter types\n\n/* eslint-disable complexity */\nexport function getTypedArrayFromGLType(glType, {clamped = true} = {}) {\n // Sorted in some order of likelihood to reduce amount of comparisons\n switch (glType) {\n case GL.FLOAT:\n return Float32Array;\n case GL.UNSIGNED_SHORT:\n case GL.UNSIGNED_SHORT_5_6_5:\n case GL.UNSIGNED_SHORT_4_4_4_4:\n case GL.UNSIGNED_SHORT_5_5_5_1:\n return Uint16Array;\n case GL.UNSIGNED_INT:\n return Uint32Array;\n case GL.UNSIGNED_BYTE:\n return clamped ? Uint8ClampedArray : Uint8Array;\n case GL.BYTE:\n return Int8Array;\n case GL.SHORT:\n return Int16Array;\n case GL.INT:\n return Int32Array;\n default:\n throw new Error('Failed to deduce typed array type from GL constant');\n }\n}\n/* eslint-enable complexity */\n\n// Flip rows (can be used on arrays returned from `Framebuffer.readPixels`)\n// https://stackoverflow.com/questions/41969562/\n// how-can-i-flip-the-result-of-webglrenderingcontext-readpixels\nexport function flipRows({data, width, height, bytesPerPixel = 4, temp}) {\n const bytesPerRow = width * bytesPerPixel;\n\n // make a temp buffer to hold one row\n temp = temp || new Uint8Array(bytesPerRow);\n for (let y = 0; y < height / 2; ++y) {\n const topOffset = y * bytesPerRow;\n const bottomOffset = (height - y - 1) * bytesPerRow;\n // make copy of a row on the top half\n temp.set(data.subarray(topOffset, topOffset + bytesPerRow));\n // copy a row from the bottom half to the top\n data.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);\n // copy the copy of the top half row to the bottom half\n data.set(temp, bottomOffset);\n }\n}\n\nexport function scalePixels({data, width, height}) {\n const newWidth = Math.round(width / 2);\n const newHeight = Math.round(height / 2);\n const newData = new Uint8Array(newWidth * newHeight * 4);\n for (let y = 0; y < newHeight; y++) {\n for (let x = 0; x < newWidth; x++) {\n for (let c = 0; c < 4; c++) {\n newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];\n }\n }\n }\n return {data: newData, width: newWidth, height: newHeight};\n}\n"],"file":"typed-array-utils.js"}
1
+ {"version":3,"sources":["../../../src/webgl-utils/typed-array-utils.ts"],"names":["GL","ERR_TYPE_DEDUCTION","getGLTypeFromTypedArray","arrayOrType","type","ArrayBuffer","isView","constructor","Float32Array","FLOAT","Uint16Array","UNSIGNED_SHORT","Uint32Array","UNSIGNED_INT","Uint8Array","UNSIGNED_BYTE","Uint8ClampedArray","Int8Array","BYTE","Int16Array","SHORT","Int32Array","INT","Error","getTypedArrayFromGLType","glType","options","clamped","UNSIGNED_SHORT_5_6_5","UNSIGNED_SHORT_4_4_4_4","UNSIGNED_SHORT_5_5_5_1","flipRows","data","width","height","bytesPerPixel","temp","bytesPerRow","tempBuffer","y","topOffset","bottomOffset","set","subarray","copyWithin","scalePixels","newWidth","Math","round","newHeight","newData","x","c"],"mappings":"AAAA,OAAOA,EAAP,MAAe,oBAAf;AAEA,MAAMC,kBAAkB,GAAG,+CAA3B;AAkBA,OAAO,SAASC,uBAAT,CAAiCC,WAAjC,EAA8C;AAEnD,QAAMC,IAAI,GAAGC,WAAW,CAACC,MAAZ,CAAmBH,WAAnB,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,EAAgBA,CAAC,GAAGU,SAApB,EAA+BV,CAAC,EAAhC,EAAoC;AAClC,SAAK,IAAIY,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGL,QAApB,EAA8BK,CAAC,EAA/B,EAAmC;AACjC,WAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG,CAApB,EAAuBA,CAAC,EAAxB,EAA4B;AAC1BF,QAAAA,OAAO,CAAC,CAACX,CAAC,GAAGO,QAAJ,GAAeK,CAAhB,IAAqB,CAArB,GAAyBC,CAA1B,CAAP,GAAsCpB,IAAI,CAAC,CAACO,CAAC,GAAG,CAAJ,GAAQN,KAAR,GAAgBkB,CAAC,GAAG,CAArB,IAA0B,CAA1B,GAA8BC,CAA/B,CAA1C;AACD;AACF;AACF;;AACD,SAAO;AAACpB,IAAAA,IAAI,EAAEkB,OAAP;AAAgBjB,IAAAA,KAAK,EAAEa,QAAvB;AAAiCZ,IAAAA,MAAM,EAAEe;AAAzC,GAAP;AACD","sourcesContent":["import GL from '@luma.gl/constants';\n\nconst ERR_TYPE_DEDUCTION = 'Failed to deduce GL constant from typed array';\n\ntype TypedArrayConstructor =\n | Float32ArrayConstructor\n | Uint16ArrayConstructor\n | Uint32ArrayConstructor\n | Uint8ArrayConstructor\n | Uint8ClampedArrayConstructor\n | Int8ArrayConstructor\n | Int16ArrayConstructor\n | Int32ArrayConstructor;\n\n/**\n * Converts TYPED ARRAYS to corresponding GL constant\n * Used to auto deduce gl parameter types\n * @param {*} arrayOrType\n * @returns\n */\nexport function getGLTypeFromTypedArray(arrayOrType) {\n // If typed array, look up constructor\n const type = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;\n switch (type) {\n case Float32Array:\n return GL.FLOAT;\n case Uint16Array:\n return GL.UNSIGNED_SHORT;\n case Uint32Array:\n return GL.UNSIGNED_INT;\n case Uint8Array:\n return GL.UNSIGNED_BYTE;\n case Uint8ClampedArray:\n return GL.UNSIGNED_BYTE;\n case Int8Array:\n return GL.BYTE;\n case Int16Array:\n return GL.SHORT;\n case Int32Array:\n return GL.INT;\n default:\n throw new Error(ERR_TYPE_DEDUCTION);\n }\n}\n\n/**\n * Converts GL constant to corresponding TYPED ARRAY\n * Used to auto deduce gl parameter types\n * @param {*} glType\n * @param {*} param1\n * @returns\n */\n// eslint-disable-next-line complexity\nexport function getTypedArrayFromGLType(\n glType: any,\n options?: {\n clamped?: boolean;\n }\n): TypedArrayConstructor {\n const {clamped = true} = options || {};\n // Sorted in some order of likelihood to reduce amount of comparisons\n switch (glType) {\n case GL.FLOAT:\n return Float32Array;\n case GL.UNSIGNED_SHORT:\n case GL.UNSIGNED_SHORT_5_6_5:\n case GL.UNSIGNED_SHORT_4_4_4_4:\n case GL.UNSIGNED_SHORT_5_5_5_1:\n return Uint16Array;\n case GL.UNSIGNED_INT:\n return Uint32Array;\n case GL.UNSIGNED_BYTE:\n return clamped ? Uint8ClampedArray : Uint8Array;\n case GL.BYTE:\n return Int8Array;\n case GL.SHORT:\n return Int16Array;\n case GL.INT:\n return Int32Array;\n default:\n throw new Error('Failed to deduce typed array type from GL constant');\n }\n}\n\n/**\n * Flip rows (can be used on arrays returned from `Framebuffer.readPixels`)\n * https: *stackoverflow.com/questions/41969562/\n * how-can-i-flip-the-result-of-webglrenderingcontext-readpixels\n * @param {*} param0\n */\n export function flipRows(options: {\n data: any;\n width: any;\n height: any;\n bytesPerPixel?: number;\n temp?: any;\n}): void {\n const {data, width, height, bytesPerPixel = 4, temp} = options;\n const bytesPerRow = width * bytesPerPixel;\n\n // make a temp buffer to hold one row\n const tempBuffer = temp || new Uint8Array(bytesPerRow);\n for (let y = 0; y < height / 2; ++y) {\n const topOffset = y * bytesPerRow;\n const bottomOffset = (height - y - 1) * bytesPerRow;\n // make copy of a row on the top half\n tempBuffer.set(data.subarray(topOffset, topOffset + bytesPerRow));\n // copy a row from the bottom half to the top\n data.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);\n // copy the copy of the top half row to the bottom half\n data.set(tempBuffer, bottomOffset);\n }\n}\n\n\nexport function scalePixels(options: {\n data: any;\n width: any;\n height: any;\n}): {\n data: Uint8Array;\n width: number;\n height: number;\n} {\n const {data, width, height} = options;\n const newWidth = Math.round(width / 2);\n const newHeight = Math.round(height / 2);\n const newData = new Uint8Array(newWidth * newHeight * 4);\n for (let y = 0; y < newHeight; y++) {\n for (let x = 0; x < newWidth; x++) {\n for (let c = 0; c < 4; c++) {\n newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];\n }\n }\n }\n return {data: newData, width: newWidth, height: newHeight};\n}\n"],"file":"typed-array-utils.js"}
@@ -0,0 +1,135 @@
1
+ // Feature detection for WebGL
2
+ //
3
+ // Provides a function that enables simple checking of which WebGL features are
4
+ // available in an WebGL1 or WebGL2 environment.
5
+
6
+ /* eslint-disable no-inline-comments, max-len */
7
+ import isOldIE from './is-old-ie';
8
+ import {assert} from './assert';
9
+
10
+ const GL_VENDOR = 0x1f00;
11
+ const GL_RENDERER = 0x1f01;
12
+ const GL_VERSION = 0x1f02;
13
+ const GL_SHADING_LANGUAGE_VERSION = 0x8b8c;
14
+
15
+ // Defines luma.gl "feature" names and semantics
16
+ const WEBGL_FEATURES = {
17
+ // GLSL extensions
18
+ GLSL_FRAG_DATA: ['WEBGL_draw_buffers', true], // TODO - name makes no sense in GLSL 3.00
19
+ GLSL_FRAG_DEPTH: ['EXT_frag_depth', true],
20
+ GLSL_DERIVATIVES: ['OES_standard_derivatives', true],
21
+ GLSL_TEXTURE_LOD: ['EXT_shader_texture_lod', true]
22
+ };
23
+
24
+ // Create a key-mirrored FEATURES array
25
+ export const FEATURES = {
26
+ GLSL_FRAG_DATA: 'GLSL_FRAG_DATA',
27
+ GLSL_FRAG_DEPTH: 'GLSL_FRAG_DEPTH',
28
+ GLSL_DERIVATIVES: 'GLSL_DERIVATIVES',
29
+ GLSL_TEXTURE_LOD: 'GLSL_TEXTURE_LOD',
30
+ };
31
+
32
+ function isWebGL2(gl) {
33
+ if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {
34
+ return true;
35
+ }
36
+ return Boolean(gl && gl._version === 2);
37
+ }
38
+
39
+ export function getContextInfo(gl) {
40
+ const info = gl.getExtension('WEBGL_debug_renderer_info');
41
+ const vendor = gl.getParameter((info && info.UNMASKED_VENDOR_WEBGL) || GL_VENDOR);
42
+ const renderer = gl.getParameter((info && info.UNMASKED_RENDERER_WEBGL) || GL_RENDERER);
43
+ const gpuVendor = identifyGPUVendor(vendor, renderer);
44
+ const gpuInfo = {
45
+ gpuVendor,
46
+ vendor,
47
+ renderer,
48
+ version: gl.getParameter(GL_VERSION),
49
+ shadingLanguageVersion: gl.getParameter(GL_SHADING_LANGUAGE_VERSION)
50
+ };
51
+ return gpuInfo;
52
+ }
53
+
54
+ function identifyGPUVendor(vendor, renderer) {
55
+ if (vendor.match(/NVIDIA/i) || renderer.match(/NVIDIA/i)) {
56
+ return 'NVIDIA';
57
+ }
58
+ if (vendor.match(/INTEL/i) || renderer.match(/INTEL/i)) {
59
+ return 'INTEL';
60
+ }
61
+ if (vendor.match(/Apple/i) || renderer.match(/Apple/i)) {
62
+ return 'APPLE';
63
+ }
64
+ if (
65
+ vendor.match(/AMD/i) ||
66
+ renderer.match(/AMD/i) ||
67
+ vendor.match(/ATI/i) ||
68
+ renderer.match(/ATI/i)
69
+ ) {
70
+ return 'AMD';
71
+ }
72
+ return 'UNKNOWN';
73
+ }
74
+
75
+ const compiledGlslExtensions = {};
76
+
77
+ // Enables feature detection in IE11 due to a bug where gl.getExtension may return true
78
+ // but fail to compile when the extension is enabled in the shader. Specifically,
79
+ // the OES_standard_derivatives and WEBGL_draw_buffers extensions fails to compile in IE11 even though its included
80
+ // in the list of supported extensions.
81
+ // opts allows user agent to be overridden for testing
82
+ /*
83
+ * Inputs :
84
+ * gl : WebGL context
85
+ * cap : Key of WEBGL_FEATURES object identifying the extension
86
+ * opts :
87
+ * behavior : behavior of extension to be tested, by defualt `enable` is used
88
+ * Returns : true, if shader is compiled successfully, false otherwise
89
+ */
90
+ export function canCompileGLGSExtension(gl, cap, opts: {behavior?} = {}) {
91
+ const feature = WEBGL_FEATURES[cap];
92
+ assert(feature, cap);
93
+
94
+ if (!isOldIE(opts)) {
95
+ return true;
96
+ }
97
+
98
+ if (cap in compiledGlslExtensions) {
99
+ return compiledGlslExtensions[cap];
100
+ }
101
+
102
+ const extensionName = feature[0];
103
+ const behavior = opts.behavior || 'enable';
104
+ const source = `#extension GL_${extensionName} : ${behavior}\nvoid main(void) {}`;
105
+
106
+ const shader = gl.createShader(gl.VERTEX_SHADER);
107
+ gl.shaderSource(shader, source);
108
+ gl.compileShader(shader);
109
+ const canCompile = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
110
+ gl.deleteShader(shader);
111
+ compiledGlslExtensions[cap] = canCompile;
112
+ return canCompile;
113
+ }
114
+
115
+ // TODO - cache the value
116
+ function getFeature(gl, cap) {
117
+ const feature = WEBGL_FEATURES[cap];
118
+ assert(feature, cap);
119
+
120
+ // Get extension name from table
121
+ const extensionName = isWebGL2(gl) ? feature[1] || feature[0] : feature[0];
122
+
123
+ // Check if the value is dependent on checking an extension
124
+ const value =
125
+ typeof extensionName === 'string' ? Boolean(gl.getExtension(extensionName)) : extensionName;
126
+
127
+ assert(value === false || value === true);
128
+
129
+ return value;
130
+ }
131
+
132
+ export function hasFeatures(gl, features) {
133
+ features = Array.isArray(features) ? features : [features];
134
+ return features.every((feature) => getFeature(gl, feature));
135
+ }
@@ -0,0 +1,49 @@
1
+ import './init';
2
+ export type { WebGLDeviceProps } from './device/webgl-device';
3
+ export { default as WebGLDevice, getWebGLDevice } from './device/webgl-device';
4
+ export { requestAnimationFrame, cancelAnimationFrame } from './webgl-utils/request-animation-frame';
5
+ export { cloneTextureFrom } from './webgl-utils/texture-utils';
6
+ export { getKeyValue, getKey } from './webgl-utils/constants-to-keys';
7
+ export { default as Accessor } from './classes/accessor';
8
+ export type { BufferProps } from '@luma.gl/api';
9
+ export { default as Buffer } from './classes/webgl-buffer';
10
+ export type { Texture2DProps } from './classes/texture-2d';
11
+ export { default as Texture2D } from './classes/texture-2d';
12
+ export type { TextureCubeProps } from './classes/texture-cube';
13
+ export { default as TextureCube } from './classes/texture-cube';
14
+ export type { ShaderProps } from './classes/webgl-shader';
15
+ export { Shader, VertexShader, FragmentShader } from './classes/webgl-shader';
16
+ export type { ProgramProps } from './classes/program';
17
+ export { default as Program } from './classes/program';
18
+ export type { FramebufferProps } from './classes/framebuffer';
19
+ export { default as Framebuffer } from './classes/framebuffer';
20
+ export type { RenderbufferProps } from './classes/renderbuffer';
21
+ export { default as Renderbuffer } from './classes/renderbuffer';
22
+ export { clear, clearBuffer } from './classes/clear';
23
+ export { readPixelsToArray, readPixelsToBuffer, copyToDataUrl, copyToImage, copyToTexture, blit } from './classes/copy-and-blit';
24
+ export type { QueryProps } from './classes/query';
25
+ export { default as Query } from './classes/query';
26
+ export type { Texture3DProps } from './classes/texture-3d';
27
+ export { default as Texture3D } from './classes/texture-3d';
28
+ export type { TransformFeedbackProps } from './classes/transform-feedback';
29
+ export { default as TransformFeedback } from './classes/transform-feedback';
30
+ export type { VertexArrayObjectProps } from './classes/vertex-array-object';
31
+ export { default as VertexArrayObject } from './classes/vertex-array-object';
32
+ export type { VertexArrayProps } from './classes/vertex-array';
33
+ export { default as VertexArray } from './classes/vertex-array';
34
+ export { default as UniformBufferLayout } from './classes/uniform-buffer-layout';
35
+ export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from './context/context/webgl-checks';
36
+ export { cssToDeviceRatio, cssToDevicePixels } from './context/context/device-pixels';
37
+ export type { GLParameters } from './context/parameters/webgl-parameters';
38
+ export { getParameters, setParameters, resetParameters } from './context/parameters/unified-parameter-api';
39
+ export { withParameters } from './context/state-tracker/with-parameters';
40
+ export { trackContextState, pushContextState, popContextState } from './context/state-tracker/track-context-state';
41
+ export { polyfillContext } from './context/polyfill/polyfill-context';
42
+ export { parseUniformName, getUniformSetter } from './classes/uniforms';
43
+ export { getDebugTableForUniforms } from './debug/debug-uniforms';
44
+ export { getDebugTableForVertexArray } from './debug/debug-vertex-array';
45
+ export { getDebugTableForProgramConfiguration } from './debug/debug-program-configuration';
46
+ export { lumaStats } from './init';
47
+ export { log, assert, uid, isObjectEmpty } from '@luma.gl/api';
48
+ export { setPathPrefix, loadFile, loadImage } from '@luma.gl/api';
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,QAAQ,CAAC;AAGhB,YAAY,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAC,OAAO,IAAI,WAAW,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAG7E,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,MAAM,uCAAuC,CAAC;AAGlG,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAE,MAAM,EAAC,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAE9D,YAAY,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAC,MAAM,EAAE,YAAY,EAAE,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ACP,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AAIpF,YAAY,EAAC,YAAY,EAAC,MAAM,uCAAuC,CAAC;AACxE,OAAO,EACL,aAAa,EACb,aAAa,EACb,eAAe,EAChB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EACL,cAAc,EACf,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAGpE,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAC,wBAAwB,EAAC,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAC,2BAA2B,EAAC,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAC,oCAAoC,EAAC,MAAM,qCAAqC,CAAC;AAKzF,OAAO,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,35 @@
1
+ import './init';
2
+ export { default as WebGLDevice, getWebGLDevice } from './device/webgl-device';
3
+ export { requestAnimationFrame, cancelAnimationFrame } from './webgl-utils/request-animation-frame';
4
+ export { cloneTextureFrom } from './webgl-utils/texture-utils';
5
+ export { getKeyValue, getKey } from './webgl-utils/constants-to-keys';
6
+ export { default as Accessor } from './classes/accessor';
7
+ export { default as Buffer } from './classes/webgl-buffer';
8
+ export { default as Texture2D } from './classes/texture-2d';
9
+ export { default as TextureCube } from './classes/texture-cube';
10
+ export { Shader, VertexShader, FragmentShader } from './classes/webgl-shader';
11
+ export { default as Program } from './classes/program';
12
+ export { default as Framebuffer } from './classes/framebuffer';
13
+ export { default as Renderbuffer } from './classes/renderbuffer';
14
+ export { clear, clearBuffer } from './classes/clear';
15
+ export { readPixelsToArray, readPixelsToBuffer, copyToDataUrl, copyToImage, copyToTexture, blit } from './classes/copy-and-blit';
16
+ export { default as Query } from './classes/query';
17
+ export { default as Texture3D } from './classes/texture-3d';
18
+ export { default as TransformFeedback } from './classes/transform-feedback';
19
+ export { default as VertexArrayObject } from './classes/vertex-array-object';
20
+ export { default as VertexArray } from './classes/vertex-array';
21
+ export { default as UniformBufferLayout } from './classes/uniform-buffer-layout';
22
+ export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from './context/context/webgl-checks';
23
+ export { cssToDeviceRatio, cssToDevicePixels } from './context/context/device-pixels';
24
+ export { getParameters, setParameters, resetParameters } from './context/parameters/unified-parameter-api';
25
+ export { withParameters } from './context/state-tracker/with-parameters';
26
+ export { trackContextState, pushContextState, popContextState } from './context/state-tracker/track-context-state';
27
+ export { polyfillContext } from './context/polyfill/polyfill-context';
28
+ export { parseUniformName, getUniformSetter } from './classes/uniforms';
29
+ export { getDebugTableForUniforms } from './debug/debug-uniforms';
30
+ export { getDebugTableForVertexArray } from './debug/debug-vertex-array';
31
+ export { getDebugTableForProgramConfiguration } from './debug/debug-program-configuration';
32
+ export { lumaStats } from './init';
33
+ export { log, assert, uid, isObjectEmpty } from '@luma.gl/api';
34
+ export { setPathPrefix, loadFile, loadImage } from '@luma.gl/api';
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":["default","WebGLDevice","getWebGLDevice","requestAnimationFrame","cancelAnimationFrame","cloneTextureFrom","getKeyValue","getKey","Accessor","Buffer","Texture2D","TextureCube","Shader","VertexShader","FragmentShader","Program","Framebuffer","Renderbuffer","clear","clearBuffer","readPixelsToArray","readPixelsToBuffer","copyToDataUrl","copyToImage","copyToTexture","blit","Query","Texture3D","TransformFeedback","VertexArrayObject","VertexArray","UniformBufferLayout","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","cssToDeviceRatio","cssToDevicePixels","getParameters","setParameters","resetParameters","withParameters","trackContextState","pushContextState","popContextState","polyfillContext","parseUniformName","getUniformSetter","getDebugTableForUniforms","getDebugTableForVertexArray","getDebugTableForProgramConfiguration","lumaStats","log","assert","uid","isObjectEmpty","setPathPrefix","loadFile","loadImage"],"mappings":"AAOA,OAAO,QAAP;AAIA,SAAQA,OAAO,IAAIC,WAAnB,EAAgCC,cAAhC,QAAqD,uBAArD;AAGA,SAAQC,qBAAR,EAA+BC,oBAA/B,QAA0D,uCAA1D;AAGA,SAAQC,gBAAR,QAA+B,6BAA/B;AACA,SAAQC,WAAR,EAAqBC,MAArB,QAAkC,iCAAlC;AAGA,SAAQP,OAAO,IAAIQ,QAAnB,QAAkC,oBAAlC;AAIA,SAAQR,OAAO,IAAIS,MAAnB,QAAgC,wBAAhC;AAEA,SAAQT,OAAO,IAAIU,SAAnB,QAAmC,sBAAnC;AAEA,SAAQV,OAAO,IAAIW,WAAnB,QAAqC,wBAArC;AAGA,SAAQC,MAAR,EAAgBC,YAAhB,EAA8BC,cAA9B,QAAmD,wBAAnD;AAEA,SAAQd,OAAO,IAAIe,OAAnB,QAAiC,mBAAjC;AAEA,SAAQf,OAAO,IAAIgB,WAAnB,QAAqC,uBAArC;AAEA,SAAQhB,OAAO,IAAIiB,YAAnB,QAAsC,wBAAtC;AAEA,SAAQC,KAAR,EAAeC,WAAf,QAAiC,iBAAjC;AAGA,SACEC,iBADF,EAEEC,kBAFF,EAGEC,aAHF,EAIEC,WAJF,EAKEC,aALF,EAMEC,IANF,QAOO,yBAPP;AAWA,SAAQzB,OAAO,IAAI0B,KAAnB,QAA+B,iBAA/B;AAEA,SAAQ1B,OAAO,IAAI2B,SAAnB,QAAmC,sBAAnC;AAEA,SAAQ3B,OAAO,IAAI4B,iBAAnB,QAA2C,8BAA3C;AAEA,SAAQ5B,OAAO,IAAI6B,iBAAnB,QAA2C,+BAA3C;AAEA,SAAQ7B,OAAO,IAAI8B,WAAnB,QAAqC,wBAArC;AACA,SAAQ9B,OAAO,IAAI+B,mBAAnB,QAA6C,iCAA7C;AAKA,SACEC,OADF,EAEEC,QAFF,EAGEC,gBAHF,EAIEC,kBAJF,EAKEC,mBALF,QAMO,gCANP;AASA,SAAQC,gBAAR,EAA0BC,iBAA1B,QAAkD,iCAAlD;AAKA,SACEC,aADF,EAEEC,aAFF,EAGEC,eAHF,QAIO,4CAJP;AAMA,SACEC,cADF,QAEO,yCAFP;AAKA,SACEC,iBADF,EAEEC,gBAFF,EAGEC,eAHF,QAIO,6CAJP;AAOA,SAAQC,eAAR,QAA8B,qCAA9B;AAGA,SAAQC,gBAAR,EAA0BC,gBAA1B,QAAiD,oBAAjD;AACA,SAAQC,wBAAR,QAAuC,wBAAvC;AACA,SAAQC,2BAAR,QAA0C,4BAA1C;AACA,SAAQC,oCAAR,QAAmD,qCAAnD;AAKA,SAAQC,SAAR,QAAwB,QAAxB;AACA,SAAQC,GAAR,EAAaC,MAAb,EAAqBC,GAArB,EAA0BC,aAA1B,QAA8C,cAA9C;AACA,SAAQC,aAAR,EAAuBC,QAAvB,EAAiCC,SAAjC,QAAiD,cAAjD","sourcesContent":["// luma.gl Base WebGL wrapper library\n// Provides simple class/function wrappers around the low level webgl objects\n// These classes are intentionally close to the WebGL API\n// but make it easier to use.\n// Higher level abstractions can be built on these classes\n\n// Initialize any global state\nimport './init';\n\n// export type {WebGLDeviceProps, WebGLDeviceInfo, WebGPUDeviceLimits} from './lib/webgl-device';\nexport type {WebGLDeviceProps} from './device/webgl-device';\nexport {default as WebGLDevice, getWebGLDevice} from './device/webgl-device';\n\n// UTILS\nexport {requestAnimationFrame, cancelAnimationFrame} from './webgl-utils/request-animation-frame';\n\n// WebGL Functions\nexport {cloneTextureFrom} from './webgl-utils/texture-utils';\nexport {getKeyValue, getKey} from './webgl-utils/constants-to-keys';\n\n// WebGL Helper Classes\nexport {default as Accessor} from './classes/accessor';\n\n// WebGL1 classes\nexport type {BufferProps} from '@luma.gl/api';\nexport {default as Buffer} from './classes/webgl-buffer';\nexport type {Texture2DProps} from './classes/texture-2d';\nexport {default as Texture2D} from './classes/texture-2d';\nexport type {TextureCubeProps} from './classes/texture-cube';\nexport {default as TextureCube} from './classes/texture-cube';\n\nexport type {ShaderProps} from './classes/webgl-shader';\nexport {Shader, VertexShader, FragmentShader} from './classes/webgl-shader';\nexport type {ProgramProps} from './classes/program';\nexport {default as Program} from './classes/program';\nexport type {FramebufferProps} from './classes/framebuffer';\nexport {default as Framebuffer} from './classes/framebuffer';\nexport type {RenderbufferProps} from './classes/renderbuffer';\nexport {default as Renderbuffer} from './classes/renderbuffer';\n\nexport {clear, clearBuffer} from './classes/clear';\n\n// Copy and Blit\nexport {\n readPixelsToArray,\n readPixelsToBuffer,\n copyToDataUrl,\n copyToImage,\n copyToTexture,\n blit\n} from './classes/copy-and-blit';\n\n// WebGL2 classes & Extensions\nexport type {QueryProps} from './classes/query';\nexport {default as Query} from './classes/query';\nexport type {Texture3DProps} from './classes/texture-3d';\nexport {default as Texture3D} from './classes/texture-3d';\nexport type {TransformFeedbackProps} from './classes/transform-feedback';\nexport {default as TransformFeedback} from './classes/transform-feedback';\nexport type {VertexArrayObjectProps} from './classes/vertex-array-object';\nexport {default as VertexArrayObject} from './classes/vertex-array-object';\nexport type {VertexArrayProps} from './classes/vertex-array';\nexport {default as VertexArray} from './classes/vertex-array';\nexport {default as UniformBufferLayout} from './classes/uniform-buffer-layout';\n\n// experimental WebGL exports\n\n// UTILS\nexport {\n isWebGL,\n isWebGL2,\n getWebGL2Context,\n assertWebGLContext,\n assertWebGL2Context\n} from './context/context/webgl-checks';\n\n// Device ratio\nexport {cssToDeviceRatio, cssToDevicePixels} from './context/context/device-pixels';\n\n// Unified parameter API\n\nexport type {GLParameters} from './context/parameters/webgl-parameters';\nexport {\n getParameters,\n setParameters,\n resetParameters\n} from './context/parameters/unified-parameter-api';\n\nexport {\n withParameters\n} from './context/state-tracker/with-parameters';\n\n// State tracking\nexport {\n trackContextState,\n pushContextState,\n popContextState\n} from './context/state-tracker/track-context-state';\n\n// Polyfills (supports a subset of WebGL2 APIs on WebGL1 contexts)\nexport {polyfillContext} from './context/polyfill/polyfill-context';\n\n// INTERNAL\nexport {parseUniformName, getUniformSetter} from './classes/uniforms';\nexport {getDebugTableForUniforms} from './debug/debug-uniforms';\nexport {getDebugTableForVertexArray} from './debug/debug-vertex-array';\nexport {getDebugTableForProgramConfiguration} from './debug/debug-program-configuration';\n\n// DEPRECATED\n\n// Deprecated re-exports\nexport {lumaStats} from './init';\nexport {log, assert, uid, isObjectEmpty} from '@luma.gl/api';\nexport {setPathPrefix, loadFile, loadImage} from '@luma.gl/api';\n\n\n// export {\n// getContextInfo, getGLContextInfo, getContextLimits,\n// FEATURES,\n// getFeatures,\n// canCompileGLGSExtension\n// } from '@luma.gl/gltools';\n\n// REMOVED in v8.6\n// getShaderInfo,\n// getShaderName\n// getShaderVersion\n"],"file":"index.js"}
package/dist/init.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { lumaStats } from '@luma.gl/api';
2
+ export { lumaStats };
3
+ declare const _default: any;
4
+ export default _default;
5
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAO,SAAS,EAAC,MAAM,cAAc,CAAC;AA4C7C,OAAO,EAAC,SAAS,EAAC,CAAC;;AACnB,wBAA+B"}