@luma.gl/webgl 8.6.0-alpha.4 → 9.0.0-alpha.10

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 (783) hide show
  1. package/README.md +3 -67
  2. package/dist/adapter/converters/device-parameters.d.ts +27 -0
  3. package/dist/adapter/converters/device-parameters.d.ts.map +1 -0
  4. package/dist/adapter/converters/{set-device-parameters.js → device-parameters.js} +50 -6
  5. package/dist/adapter/converters/device-parameters.js.map +1 -0
  6. package/dist/{classes → adapter/converters}/renderbuffer-formats.d.ts +0 -0
  7. package/dist/adapter/converters/renderbuffer-formats.d.ts.map +1 -0
  8. package/dist/{classes → adapter/converters}/renderbuffer-formats.js +1 -1
  9. package/dist/adapter/converters/renderbuffer-formats.js.map +1 -0
  10. package/dist/adapter/converters/sampler-parameters.d.ts +19 -0
  11. package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -0
  12. package/dist/adapter/converters/sampler-parameters.js +227 -0
  13. package/dist/adapter/converters/sampler-parameters.js.map +1 -0
  14. package/dist/adapter/converters/texture-formats.d.ts +93 -0
  15. package/dist/adapter/converters/texture-formats.d.ts.map +1 -0
  16. package/dist/adapter/converters/texture-formats.js +954 -0
  17. package/dist/adapter/converters/texture-formats.js.map +1 -0
  18. package/dist/adapter/converters/vertex-formats.d.ts +4 -0
  19. package/dist/adapter/converters/vertex-formats.d.ts.map +1 -0
  20. package/dist/adapter/converters/vertex-formats.js +35 -0
  21. package/dist/adapter/converters/vertex-formats.js.map +1 -0
  22. package/dist/adapter/device-helpers/device-features.d.ts +3 -6
  23. package/dist/adapter/device-helpers/device-features.d.ts.map +1 -1
  24. package/dist/adapter/device-helpers/device-features.js +39 -50
  25. package/dist/adapter/device-helpers/device-features.js.map +1 -1
  26. package/dist/adapter/device-helpers/device-limits.d.ts +1 -0
  27. package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
  28. package/dist/adapter/device-helpers/device-limits.js +1 -0
  29. package/dist/adapter/device-helpers/device-limits.js.map +1 -1
  30. package/dist/adapter/device-helpers/get-device-info.js +7 -7
  31. package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
  32. package/dist/adapter/helpers/attribute-utils.d.ts +11 -0
  33. package/dist/adapter/helpers/attribute-utils.d.ts.map +1 -0
  34. package/dist/adapter/helpers/attribute-utils.js +81 -0
  35. package/dist/adapter/helpers/attribute-utils.js.map +1 -0
  36. package/dist/adapter/helpers/get-shader-layout.d.ts +55 -0
  37. package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -0
  38. package/dist/adapter/helpers/get-shader-layout.js +330 -0
  39. package/dist/adapter/helpers/get-shader-layout.js.map +1 -0
  40. package/dist/{webgl-utils → adapter/helpers}/parse-shader-compiler-log.d.ts +0 -0
  41. package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -0
  42. package/dist/{esm/webgl-utils → adapter/helpers}/parse-shader-compiler-log.js +0 -0
  43. package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
  44. package/dist/adapter/helpers/set-uniform.d.ts +4 -0
  45. package/dist/adapter/helpers/set-uniform.d.ts.map +1 -0
  46. package/dist/adapter/helpers/set-uniform.js +115 -0
  47. package/dist/adapter/helpers/set-uniform.js.map +1 -0
  48. package/dist/adapter/helpers/uniforms.d.ts +26 -0
  49. package/dist/adapter/helpers/uniforms.d.ts.map +1 -0
  50. package/dist/adapter/helpers/uniforms.js +99 -0
  51. package/dist/adapter/helpers/uniforms.js.map +1 -0
  52. package/dist/adapter/objects/constants-to-keys.d.ts +5 -0
  53. package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -0
  54. package/dist/{esm/webgl-utils → adapter/objects}/constants-to-keys.js +1 -0
  55. package/dist/adapter/objects/constants-to-keys.js.map +1 -0
  56. package/dist/adapter/objects/webgl-renderbuffer.d.ts +40 -0
  57. package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -0
  58. package/dist/{esm/classes/renderbuffer.js → adapter/objects/webgl-renderbuffer.js} +38 -72
  59. package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -0
  60. package/dist/{classes → adapter/objects}/webgl-resource.d.ts +15 -14
  61. package/dist/adapter/objects/webgl-resource.d.ts.map +1 -0
  62. package/dist/{classes → adapter/objects}/webgl-resource.js +7 -3
  63. package/dist/adapter/objects/webgl-resource.js.map +1 -0
  64. package/dist/adapter/objects/webgl-vertex-array-object.d.ts +27 -0
  65. package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -0
  66. package/dist/adapter/objects/webgl-vertex-array-object.js +84 -0
  67. package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -0
  68. package/dist/adapter/resources/webgl-buffer.d.ts +27 -0
  69. package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -0
  70. package/dist/adapter/resources/webgl-buffer.js +164 -0
  71. package/dist/adapter/resources/webgl-buffer.js.map +1 -0
  72. package/dist/adapter/resources/webgl-command-buffer.d.ts +25 -0
  73. package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -0
  74. package/dist/adapter/resources/webgl-command-buffer.js +65 -0
  75. package/dist/adapter/resources/webgl-command-buffer.js.map +1 -0
  76. package/dist/adapter/resources/webgl-command-encoder.d.ts +18 -0
  77. package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -0
  78. package/dist/adapter/resources/webgl-command-encoder.js +53 -0
  79. package/dist/adapter/resources/webgl-command-encoder.js.map +1 -0
  80. package/dist/adapter/resources/webgl-external-texture.d.ts +1 -0
  81. package/dist/adapter/resources/webgl-external-texture.d.ts.map +1 -0
  82. package/dist/adapter/resources/webgl-external-texture.js +2 -0
  83. package/dist/{es5/helpers/program-bindings.js.map → adapter/resources/webgl-external-texture.js.map} +1 -1
  84. package/dist/adapter/resources/webgl-framebuffer.d.ts +41 -0
  85. package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -0
  86. package/dist/adapter/resources/webgl-framebuffer.js +267 -0
  87. package/dist/adapter/resources/webgl-framebuffer.js.map +1 -0
  88. package/dist/adapter/resources/webgl-render-pass.d.ts +11 -0
  89. package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -0
  90. package/dist/adapter/resources/webgl-render-pass.js +21 -0
  91. package/dist/adapter/resources/webgl-render-pass.js.map +1 -0
  92. package/dist/adapter/resources/webgl-render-pipeline.d.ts +55 -0
  93. package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -0
  94. package/dist/adapter/resources/webgl-render-pipeline.js +428 -0
  95. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -0
  96. package/dist/adapter/resources/webgl-sampler.d.ts +20 -0
  97. package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -0
  98. package/dist/adapter/resources/webgl-sampler.js +50 -0
  99. package/dist/adapter/resources/webgl-sampler.js.map +1 -0
  100. package/dist/adapter/{webgl-shader.d.ts → resources/webgl-shader.d.ts} +3 -6
  101. package/dist/adapter/resources/webgl-shader.d.ts.map +1 -0
  102. package/dist/{esm/adapter → adapter/resources}/webgl-shader.js +17 -23
  103. package/dist/adapter/resources/webgl-shader.js.map +1 -0
  104. package/dist/adapter/resources/webgl-texture.d.ts +193 -0
  105. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -0
  106. package/dist/{classes/texture.js → adapter/resources/webgl-texture.js} +280 -232
  107. package/dist/adapter/resources/webgl-texture.js.map +1 -0
  108. package/dist/adapter/webgl-canvas-context.d.ts +36 -0
  109. package/dist/adapter/webgl-canvas-context.d.ts.map +1 -0
  110. package/dist/adapter/webgl-canvas-context.js +54 -0
  111. package/dist/adapter/webgl-canvas-context.js.map +1 -0
  112. package/dist/adapter/webgl-device.d.ts +63 -76
  113. package/dist/adapter/webgl-device.d.ts.map +1 -1
  114. package/dist/adapter/webgl-device.js +244 -115
  115. package/dist/adapter/webgl-device.js.map +1 -1
  116. package/dist/classic/accessor.d.ts +32 -0
  117. package/dist/classic/accessor.d.ts.map +1 -0
  118. package/dist/{classes → classic}/accessor.js +33 -1
  119. package/dist/classic/accessor.js.map +1 -0
  120. package/dist/{classes/webgl-buffer.d.ts → classic/buffer.d.ts} +28 -33
  121. package/dist/classic/buffer.d.ts.map +1 -0
  122. package/dist/{esm/classes/webgl-buffer.js → classic/buffer.js} +67 -57
  123. package/dist/classic/buffer.js.map +1 -0
  124. package/dist/{webgl-utils → classic}/typed-array-utils.d.ts +3 -2
  125. package/dist/classic/typed-array-utils.d.ts.map +1 -0
  126. package/dist/{esm/webgl-utils → classic}/typed-array-utils.js +0 -0
  127. package/dist/classic/typed-array-utils.js.map +1 -0
  128. package/dist/context/context/context-state.d.ts.map +1 -1
  129. package/dist/context/context/context-state.js +1 -1
  130. package/dist/context/context/context-state.js.map +1 -1
  131. package/dist/context/context/{create-context.d.ts → create-browser-context.d.ts} +2 -1
  132. package/dist/context/context/create-browser-context.d.ts.map +1 -0
  133. package/dist/{esm/context/context/create-context.js → context/context/create-browser-context.js} +27 -3
  134. package/dist/context/context/create-browser-context.js.map +1 -0
  135. package/dist/context/context/create-headless-context.d.ts +9 -0
  136. package/dist/context/context/create-headless-context.d.ts.map +1 -0
  137. package/dist/context/context/create-headless-context.js +43 -0
  138. package/dist/context/context/create-headless-context.js.map +1 -0
  139. package/dist/context/context/device-pixels.d.ts +1 -1
  140. package/dist/context/context/device-pixels.d.ts.map +1 -1
  141. package/dist/context/context/device-pixels.js +13 -8
  142. package/dist/context/context/device-pixels.js.map +1 -1
  143. package/dist/context/debug/spector.d.ts +18 -0
  144. package/dist/context/debug/spector.d.ts.map +1 -0
  145. package/dist/context/debug/spector.js +76 -0
  146. package/dist/context/debug/spector.js.map +1 -0
  147. package/dist/context/debug/webgl-developer-tools.d.ts +19 -0
  148. package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -0
  149. package/dist/context/debug/webgl-developer-tools.js +121 -0
  150. package/dist/context/debug/webgl-developer-tools.js.map +1 -0
  151. package/dist/context/parameters/unified-parameter-api.d.ts +9 -7
  152. package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
  153. package/dist/context/parameters/unified-parameter-api.js +9 -8
  154. package/dist/context/parameters/unified-parameter-api.js.map +1 -1
  155. package/dist/context/parameters/webgl-parameter-tables.d.ts +40 -36
  156. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
  157. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
  158. package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
  159. package/dist/context/polyfill/polyfill-context.js +3 -3
  160. package/dist/context/polyfill/polyfill-context.js.map +1 -1
  161. package/dist/context/polyfill/polyfill-table.d.ts +1 -1
  162. package/dist/context/polyfill/polyfill-table.d.ts.map +1 -1
  163. package/dist/context/polyfill/polyfill-table.js +1 -1
  164. package/dist/context/polyfill/polyfill-table.js.map +1 -1
  165. package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
  166. package/dist/context/state-tracker/deep-array-equal.js.map +1 -1
  167. package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
  168. package/dist/context/state-tracker/track-context-state.js +26 -12
  169. package/dist/context/state-tracker/track-context-state.js.map +1 -1
  170. package/dist/context/state-tracker/with-parameters.d.ts +2 -1
  171. package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
  172. package/dist/context/state-tracker/with-parameters.js +6 -2
  173. package/dist/context/state-tracker/with-parameters.js.map +1 -1
  174. package/dist/es5/adapter/converters/{set-device-parameters.js → device-parameters.js} +53 -6
  175. package/dist/es5/adapter/converters/device-parameters.js.map +1 -0
  176. package/dist/es5/{classes → adapter/converters}/renderbuffer-formats.js +1 -1
  177. package/dist/es5/adapter/converters/renderbuffer-formats.js.map +1 -0
  178. package/dist/es5/adapter/converters/sampler-parameters.js +245 -0
  179. package/dist/es5/adapter/converters/sampler-parameters.js.map +1 -0
  180. package/dist/es5/adapter/converters/texture-formats.js +1031 -0
  181. package/dist/es5/adapter/converters/texture-formats.js.map +1 -0
  182. package/dist/es5/adapter/converters/vertex-formats.js +45 -0
  183. package/dist/es5/adapter/converters/vertex-formats.js.map +1 -0
  184. package/dist/es5/adapter/device-helpers/device-features.js +61 -58
  185. package/dist/es5/adapter/device-helpers/device-features.js.map +1 -1
  186. package/dist/es5/adapter/device-helpers/device-limits.js +1 -1
  187. package/dist/es5/adapter/device-helpers/device-limits.js.map +1 -1
  188. package/dist/es5/adapter/device-helpers/get-device-info.js +7 -7
  189. package/dist/es5/adapter/device-helpers/get-device-info.js.map +1 -1
  190. package/dist/es5/adapter/helpers/attribute-utils.js +91 -0
  191. package/dist/es5/adapter/helpers/attribute-utils.js.map +1 -0
  192. package/dist/es5/{helpers/get-program-bindings.js → adapter/helpers/get-shader-layout.js} +211 -94
  193. package/dist/es5/adapter/helpers/get-shader-layout.js.map +1 -0
  194. package/dist/es5/{webgl-utils → adapter/helpers}/parse-shader-compiler-log.js +0 -0
  195. package/dist/es5/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
  196. package/dist/es5/adapter/helpers/set-uniform.js +125 -0
  197. package/dist/es5/adapter/helpers/set-uniform.js.map +1 -0
  198. package/dist/es5/adapter/helpers/uniforms.js +112 -0
  199. package/dist/es5/adapter/helpers/uniforms.js.map +1 -0
  200. package/dist/es5/{webgl-utils → adapter/objects}/constants-to-keys.js +1 -0
  201. package/dist/es5/adapter/objects/constants-to-keys.js.map +1 -0
  202. package/dist/es5/{classes/renderbuffer.js → adapter/objects/webgl-renderbuffer.js} +48 -98
  203. package/dist/es5/adapter/objects/webgl-renderbuffer.js.map +1 -0
  204. package/dist/es5/{classes → adapter/objects}/webgl-resource.js +8 -3
  205. package/dist/es5/adapter/objects/webgl-resource.js.map +1 -0
  206. package/dist/es5/adapter/objects/webgl-vertex-array-object.js +137 -0
  207. package/dist/es5/adapter/objects/webgl-vertex-array-object.js.map +1 -0
  208. package/dist/es5/adapter/resources/webgl-buffer.js +243 -0
  209. package/dist/es5/adapter/resources/webgl-buffer.js.map +1 -0
  210. package/dist/es5/adapter/resources/webgl-command-buffer.js +96 -0
  211. package/dist/es5/adapter/resources/webgl-command-buffer.js.map +1 -0
  212. package/dist/es5/adapter/resources/webgl-command-encoder.js +98 -0
  213. package/dist/es5/adapter/resources/webgl-command-encoder.js.map +1 -0
  214. package/dist/es5/adapter/resources/webgl-external-texture.js +2 -0
  215. package/dist/{esm/helpers/program-bindings.js.map → es5/adapter/resources/webgl-external-texture.js.map} +1 -1
  216. package/dist/es5/adapter/resources/webgl-framebuffer.js +346 -0
  217. package/dist/es5/adapter/resources/webgl-framebuffer.js.map +1 -0
  218. package/dist/es5/{classes/texture-2d.js → adapter/resources/webgl-render-pass.js} +26 -45
  219. package/dist/es5/adapter/resources/webgl-render-pass.js.map +1 -0
  220. package/dist/es5/adapter/resources/webgl-render-pipeline.js +530 -0
  221. package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +1 -0
  222. package/dist/es5/adapter/resources/webgl-sampler.js +96 -0
  223. package/dist/es5/adapter/resources/webgl-sampler.js.map +1 -0
  224. package/dist/es5/adapter/{webgl-shader.js → resources/webgl-shader.js} +16 -21
  225. package/dist/es5/adapter/resources/webgl-shader.js.map +1 -0
  226. package/dist/es5/{classes/texture.js → adapter/resources/webgl-texture.js} +374 -298
  227. package/dist/es5/adapter/resources/webgl-texture.js.map +1 -0
  228. package/dist/es5/adapter/webgl-canvas-context.js +97 -0
  229. package/dist/es5/adapter/webgl-canvas-context.js.map +1 -0
  230. package/dist/es5/adapter/webgl-device.js +316 -132
  231. package/dist/es5/adapter/webgl-device.js.map +1 -1
  232. package/dist/es5/{classes → classic}/accessor.js +25 -1
  233. package/dist/es5/classic/accessor.js.map +1 -0
  234. package/dist/es5/{classes/webgl-buffer.js → classic/buffer.js} +88 -72
  235. package/dist/es5/classic/buffer.js.map +1 -0
  236. package/dist/es5/{webgl-utils → classic}/typed-array-utils.js +0 -0
  237. package/dist/es5/classic/typed-array-utils.js.map +1 -0
  238. package/dist/es5/context/context/context-state.js +1 -1
  239. package/dist/es5/context/context/context-state.js.map +1 -1
  240. package/dist/es5/context/context/{create-context.js → create-browser-context.js} +29 -3
  241. package/dist/es5/context/context/create-browser-context.js.map +1 -0
  242. package/dist/es5/context/context/create-headless-context.js +60 -0
  243. package/dist/es5/context/context/create-headless-context.js.map +1 -0
  244. package/dist/es5/context/context/device-pixels.js +14 -8
  245. package/dist/es5/context/context/device-pixels.js.map +1 -1
  246. package/dist/es5/context/debug/spector.js +133 -0
  247. package/dist/es5/context/debug/spector.js.map +1 -0
  248. package/dist/es5/context/debug/webgl-developer-tools.js +198 -0
  249. package/dist/es5/context/debug/webgl-developer-tools.js.map +1 -0
  250. package/dist/es5/context/parameters/unified-parameter-api.js +15 -9
  251. package/dist/es5/context/parameters/unified-parameter-api.js.map +1 -1
  252. package/dist/es5/context/parameters/webgl-parameter-tables.js.map +1 -1
  253. package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +1 -1
  254. package/dist/es5/context/polyfill/polyfill-context.js +3 -3
  255. package/dist/es5/context/polyfill/polyfill-context.js.map +1 -1
  256. package/dist/es5/context/polyfill/polyfill-table.js +1 -1
  257. package/dist/es5/context/polyfill/polyfill-table.js.map +1 -1
  258. package/dist/es5/context/state-tracker/deep-array-equal.js.map +1 -1
  259. package/dist/es5/context/state-tracker/track-context-state.js +39 -24
  260. package/dist/es5/context/state-tracker/track-context-state.js.map +1 -1
  261. package/dist/es5/context/state-tracker/with-parameters.js +8 -2
  262. package/dist/es5/context/state-tracker/with-parameters.js.map +1 -1
  263. package/dist/es5/index.js +72 -300
  264. package/dist/es5/index.js.map +1 -1
  265. package/dist/es5/init.js +1 -41
  266. package/dist/es5/init.js.map +1 -1
  267. package/dist/es5/{context/parameters/webgl-parameters.js → types/webgl.js} +1 -1
  268. package/dist/es5/types/webgl.js.map +1 -0
  269. package/dist/esm/adapter/converters/{set-device-parameters.js → device-parameters.js} +50 -6
  270. package/dist/esm/adapter/converters/device-parameters.js.map +1 -0
  271. package/dist/esm/{classes → adapter/converters}/renderbuffer-formats.js +1 -1
  272. package/dist/esm/adapter/converters/renderbuffer-formats.js.map +1 -0
  273. package/dist/esm/adapter/converters/sampler-parameters.js +227 -0
  274. package/dist/esm/adapter/converters/sampler-parameters.js.map +1 -0
  275. package/dist/esm/adapter/converters/texture-formats.js +954 -0
  276. package/dist/esm/adapter/converters/texture-formats.js.map +1 -0
  277. package/dist/esm/adapter/converters/vertex-formats.js +35 -0
  278. package/dist/esm/adapter/converters/vertex-formats.js.map +1 -0
  279. package/dist/esm/adapter/device-helpers/device-features.js +39 -50
  280. package/dist/esm/adapter/device-helpers/device-features.js.map +1 -1
  281. package/dist/esm/adapter/device-helpers/device-limits.js +1 -0
  282. package/dist/esm/adapter/device-helpers/device-limits.js.map +1 -1
  283. package/dist/esm/adapter/device-helpers/get-device-info.js +7 -7
  284. package/dist/esm/adapter/device-helpers/get-device-info.js.map +1 -1
  285. package/dist/esm/adapter/helpers/attribute-utils.js +81 -0
  286. package/dist/esm/adapter/helpers/attribute-utils.js.map +1 -0
  287. package/dist/esm/adapter/helpers/get-shader-layout.js +330 -0
  288. package/dist/esm/adapter/helpers/get-shader-layout.js.map +1 -0
  289. package/dist/{webgl-utils → esm/adapter/helpers}/parse-shader-compiler-log.js +0 -0
  290. package/dist/esm/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
  291. package/dist/esm/adapter/helpers/set-uniform.js +115 -0
  292. package/dist/esm/adapter/helpers/set-uniform.js.map +1 -0
  293. package/dist/esm/adapter/helpers/uniforms.js +99 -0
  294. package/dist/esm/adapter/helpers/uniforms.js.map +1 -0
  295. package/dist/{webgl-utils → esm/adapter/objects}/constants-to-keys.js +1 -0
  296. package/dist/esm/adapter/objects/constants-to-keys.js.map +1 -0
  297. package/dist/{classes/renderbuffer.js → esm/adapter/objects/webgl-renderbuffer.js} +38 -72
  298. package/dist/esm/adapter/objects/webgl-renderbuffer.js.map +1 -0
  299. package/dist/esm/{classes → adapter/objects}/webgl-resource.js +7 -3
  300. package/dist/esm/adapter/objects/webgl-resource.js.map +1 -0
  301. package/dist/esm/adapter/objects/webgl-vertex-array-object.js +84 -0
  302. package/dist/esm/adapter/objects/webgl-vertex-array-object.js.map +1 -0
  303. package/dist/esm/adapter/resources/webgl-buffer.js +164 -0
  304. package/dist/esm/adapter/resources/webgl-buffer.js.map +1 -0
  305. package/dist/esm/adapter/resources/webgl-command-buffer.js +65 -0
  306. package/dist/esm/adapter/resources/webgl-command-buffer.js.map +1 -0
  307. package/dist/esm/adapter/resources/webgl-command-encoder.js +53 -0
  308. package/dist/esm/adapter/resources/webgl-command-encoder.js.map +1 -0
  309. package/dist/esm/adapter/resources/webgl-external-texture.js +2 -0
  310. package/dist/{helpers/program-bindings.js.map → esm/adapter/resources/webgl-external-texture.js.map} +1 -1
  311. package/dist/esm/adapter/resources/webgl-framebuffer.js +267 -0
  312. package/dist/esm/adapter/resources/webgl-framebuffer.js.map +1 -0
  313. package/dist/esm/adapter/resources/webgl-render-pass.js +21 -0
  314. package/dist/esm/adapter/resources/webgl-render-pass.js.map +1 -0
  315. package/dist/esm/adapter/resources/webgl-render-pipeline.js +428 -0
  316. package/dist/esm/adapter/resources/webgl-render-pipeline.js.map +1 -0
  317. package/dist/esm/adapter/resources/webgl-sampler.js +50 -0
  318. package/dist/esm/adapter/resources/webgl-sampler.js.map +1 -0
  319. package/dist/{adapter → esm/adapter/resources}/webgl-shader.js +17 -23
  320. package/dist/esm/adapter/resources/webgl-shader.js.map +1 -0
  321. package/dist/esm/{classes/texture.js → adapter/resources/webgl-texture.js} +280 -232
  322. package/dist/esm/adapter/resources/webgl-texture.js.map +1 -0
  323. package/dist/esm/adapter/webgl-canvas-context.js +54 -0
  324. package/dist/esm/adapter/webgl-canvas-context.js.map +1 -0
  325. package/dist/esm/adapter/webgl-device.js +244 -115
  326. package/dist/esm/adapter/webgl-device.js.map +1 -1
  327. package/dist/esm/{classes → classic}/accessor.js +33 -1
  328. package/dist/esm/classic/accessor.js.map +1 -0
  329. package/dist/{classes/webgl-buffer.js → esm/classic/buffer.js} +67 -57
  330. package/dist/esm/classic/buffer.js.map +1 -0
  331. package/dist/{webgl-utils → esm/classic}/typed-array-utils.js +0 -0
  332. package/dist/esm/classic/typed-array-utils.js.map +1 -0
  333. package/dist/esm/context/context/context-state.js +1 -1
  334. package/dist/esm/context/context/context-state.js.map +1 -1
  335. package/dist/{context/context/create-context.js → esm/context/context/create-browser-context.js} +27 -3
  336. package/dist/esm/context/context/create-browser-context.js.map +1 -0
  337. package/dist/esm/context/context/create-headless-context.js +43 -0
  338. package/dist/esm/context/context/create-headless-context.js.map +1 -0
  339. package/dist/esm/context/context/device-pixels.js +13 -8
  340. package/dist/esm/context/context/device-pixels.js.map +1 -1
  341. package/dist/esm/context/debug/spector.js +76 -0
  342. package/dist/esm/context/debug/spector.js.map +1 -0
  343. package/dist/esm/context/debug/webgl-developer-tools.js +121 -0
  344. package/dist/esm/context/debug/webgl-developer-tools.js.map +1 -0
  345. package/dist/esm/context/parameters/unified-parameter-api.js +9 -8
  346. package/dist/esm/context/parameters/unified-parameter-api.js.map +1 -1
  347. package/dist/esm/context/parameters/webgl-parameter-tables.js.map +1 -1
  348. package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +1 -1
  349. package/dist/esm/context/polyfill/polyfill-context.js +3 -3
  350. package/dist/esm/context/polyfill/polyfill-context.js.map +1 -1
  351. package/dist/esm/context/polyfill/polyfill-table.js +1 -1
  352. package/dist/esm/context/polyfill/polyfill-table.js.map +1 -1
  353. package/dist/esm/context/state-tracker/deep-array-equal.js.map +1 -1
  354. package/dist/esm/context/state-tracker/track-context-state.js +26 -12
  355. package/dist/esm/context/state-tracker/track-context-state.js.map +1 -1
  356. package/dist/esm/context/state-tracker/with-parameters.js +6 -2
  357. package/dist/esm/context/state-tracker/with-parameters.js.map +1 -1
  358. package/dist/esm/index.js +20 -31
  359. package/dist/esm/index.js.map +1 -1
  360. package/dist/esm/init.js +2 -31
  361. package/dist/esm/init.js.map +1 -1
  362. package/dist/esm/types/webgl.js +2 -0
  363. package/dist/esm/types/webgl.js.map +1 -0
  364. package/dist/index.d.ts +25 -46
  365. package/dist/index.d.ts.map +1 -1
  366. package/dist/index.js +20 -31
  367. package/dist/index.js.map +1 -1
  368. package/dist/init.d.ts +1 -4
  369. package/dist/init.d.ts.map +1 -1
  370. package/dist/init.js +2 -31
  371. package/dist/init.js.map +1 -1
  372. package/dist/types/webgl.d.ts +145 -0
  373. package/dist/types/webgl.d.ts.map +1 -0
  374. package/dist/types/webgl.js +2 -0
  375. package/dist/types/webgl.js.map +1 -0
  376. package/package.json +5 -5
  377. package/src/adapter/converters/{set-device-parameters.ts → device-parameters.ts} +81 -12
  378. package/src/{classes → adapter/converters}/renderbuffer-formats.ts +1 -1
  379. package/src/adapter/converters/sampler-parameters.ts +184 -0
  380. package/src/adapter/converters/texture-formats.ts +633 -0
  381. package/src/adapter/converters/vertex-formats.ts +22 -0
  382. package/src/adapter/device-helpers/device-features.ts +55 -124
  383. package/src/adapter/device-helpers/device-limits.ts +6 -3
  384. package/src/adapter/device-helpers/get-device-info.ts +8 -8
  385. package/src/adapter/helpers/attribute-utils.ts +61 -0
  386. package/src/adapter/helpers/get-shader-layout.ts +407 -0
  387. package/src/{webgl-utils → adapter/helpers}/parse-shader-compiler-log.ts +0 -0
  388. package/src/adapter/helpers/set-uniform.ts +87 -0
  389. package/src/adapter/helpers/uniforms.ts +121 -0
  390. package/src/{webgl-utils → adapter/objects}/constants-to-keys.ts +6 -3
  391. package/src/adapter/objects/webgl-renderbuffer.ts +104 -0
  392. package/src/{classes → adapter/objects}/webgl-resource.ts +23 -17
  393. package/src/adapter/objects/webgl-vertex-array-object.ts +111 -0
  394. package/src/adapter/resources/webgl-buffer.ts +219 -0
  395. package/src/adapter/resources/webgl-command-buffer.ts +94 -0
  396. package/src/adapter/resources/webgl-command-encoder.ts +58 -0
  397. package/src/adapter/resources/webgl-external-texture.ts +92 -0
  398. package/src/adapter/resources/webgl-framebuffer.ts +282 -0
  399. package/src/adapter/resources/webgl-render-pass.ts +24 -0
  400. package/src/adapter/resources/webgl-render-pipeline.ts +425 -0
  401. package/src/adapter/resources/webgl-sampler.ts +56 -0
  402. package/src/adapter/{webgl-shader.ts → resources/webgl-shader.ts} +19 -24
  403. package/src/adapter/resources/webgl-texture.ts +1036 -0
  404. package/src/adapter/webgl-canvas-context.ts +74 -0
  405. package/src/adapter/webgl-device.ts +297 -289
  406. package/{dist/esm/classes/accessor.ts.disabled → src/classic/accessor.ts} +38 -37
  407. package/src/{classes/webgl-buffer.ts → classic/buffer.ts} +76 -84
  408. package/src/{webgl-utils → classic}/typed-array-utils.ts +5 -1
  409. package/src/context/context/context-state.ts +4 -2
  410. package/src/context/context/{create-context.ts → create-browser-context.ts} +41 -6
  411. package/src/context/context/create-headless-context.ts +48 -0
  412. package/src/context/context/device-pixels.ts +24 -13
  413. package/src/context/debug/spector.ts +92 -0
  414. package/src/context/debug/webgl-developer-tools.ts +162 -0
  415. package/src/context/parameters/unified-parameter-api.ts +21 -13
  416. package/src/context/parameters/webgl-parameter-tables.ts +38 -36
  417. package/src/context/polyfill/get-parameter-polyfill.ts +1 -1
  418. package/src/context/polyfill/polyfill-context.ts +4 -5
  419. package/src/context/polyfill/polyfill-table.ts +1 -1
  420. package/src/context/state-tracker/deep-array-equal.ts +1 -1
  421. package/src/context/state-tracker/track-context-state.ts +34 -26
  422. package/src/context/state-tracker/with-parameters.ts +7 -2
  423. package/src/index.ts +42 -102
  424. package/src/init.ts +2 -46
  425. package/src/types/webgl.ts +284 -0
  426. package/dist/_deprecated/context-api.d.ts +0 -85
  427. package/dist/_deprecated/context-api.d.ts.map +0 -1
  428. package/dist/_deprecated/context-api.js +0 -70
  429. package/dist/_deprecated/context-api.js.map +0 -1
  430. package/dist/_deprecated/features.d.ts +0 -27
  431. package/dist/_deprecated/features.d.ts.map +0 -1
  432. package/dist/_deprecated/features.js +0 -111
  433. package/dist/_deprecated/features.js.map +0 -1
  434. package/dist/adapter/converters/set-device-parameters.d.ts +0 -5
  435. package/dist/adapter/converters/set-device-parameters.d.ts.map +0 -1
  436. package/dist/adapter/converters/set-device-parameters.js.map +0 -1
  437. package/dist/adapter/converters/webgpu-texture-formats.d.ts +0 -281
  438. package/dist/adapter/converters/webgpu-texture-formats.d.ts.map +0 -1
  439. package/dist/adapter/converters/webgpu-texture-formats.js +0 -285
  440. package/dist/adapter/converters/webgpu-texture-formats.js.map +0 -1
  441. package/dist/adapter/webgl-shader.d.ts.map +0 -1
  442. package/dist/adapter/webgl-shader.js.map +0 -1
  443. package/dist/classes/accessor.d.ts +0 -28
  444. package/dist/classes/accessor.d.ts.map +0 -1
  445. package/dist/classes/accessor.js.map +0 -1
  446. package/dist/classes/accessor.ts.disabled +0 -159
  447. package/dist/classes/clear.d.ts +0 -17
  448. package/dist/classes/clear.d.ts.map +0 -1
  449. package/dist/classes/clear.js +0 -105
  450. package/dist/classes/clear.js.map +0 -1
  451. package/dist/classes/copy-and-blit.d.ts +0 -86
  452. package/dist/classes/copy-and-blit.d.ts.map +0 -1
  453. package/dist/classes/copy-and-blit.js +0 -338
  454. package/dist/classes/copy-and-blit.js.map +0 -1
  455. package/dist/classes/framebuffer.d.ts +0 -139
  456. package/dist/classes/framebuffer.d.ts.map +0 -1
  457. package/dist/classes/framebuffer.js +0 -656
  458. package/dist/classes/framebuffer.js.map +0 -1
  459. package/dist/classes/program-configuration.d.ts +0 -24
  460. package/dist/classes/program-configuration.d.ts.map +0 -1
  461. package/dist/classes/program-configuration.js +0 -73
  462. package/dist/classes/program-configuration.js.map +0 -1
  463. package/dist/classes/program.d.ts +0 -66
  464. package/dist/classes/program.d.ts.map +0 -1
  465. package/dist/classes/program.js +0 -379
  466. package/dist/classes/program.js.map +0 -1
  467. package/dist/classes/query.d.ts +0 -27
  468. package/dist/classes/query.d.ts.map +0 -1
  469. package/dist/classes/query.js +0 -145
  470. package/dist/classes/query.js.map +0 -1
  471. package/dist/classes/renderbuffer-formats.d.ts.map +0 -1
  472. package/dist/classes/renderbuffer-formats.js.map +0 -1
  473. package/dist/classes/renderbuffer.d.ts +0 -60
  474. package/dist/classes/renderbuffer.d.ts.map +0 -1
  475. package/dist/classes/renderbuffer.js.map +0 -1
  476. package/dist/classes/shader.d.ts +0 -42
  477. package/dist/classes/shader.d.ts.map +0 -1
  478. package/dist/classes/shader.js +0 -118
  479. package/dist/classes/shader.js.map +0 -1
  480. package/dist/classes/texture-2d.d.ts +0 -9
  481. package/dist/classes/texture-2d.d.ts.map +0 -1
  482. package/dist/classes/texture-2d.js +0 -36
  483. package/dist/classes/texture-2d.js.map +0 -1
  484. package/dist/classes/texture-3d.d.ts +0 -29
  485. package/dist/classes/texture-3d.d.ts.map +0 -1
  486. package/dist/classes/texture-3d.js +0 -76
  487. package/dist/classes/texture-3d.js.map +0 -1
  488. package/dist/classes/texture-cube.d.ts +0 -28
  489. package/dist/classes/texture-cube.d.ts.map +0 -1
  490. package/dist/classes/texture-cube.js +0 -130
  491. package/dist/classes/texture-cube.js.map +0 -1
  492. package/dist/classes/texture-formats.d.ts +0 -37
  493. package/dist/classes/texture-formats.d.ts.map +0 -1
  494. package/dist/classes/texture-formats.js +0 -98
  495. package/dist/classes/texture-formats.js.map +0 -1
  496. package/dist/classes/texture.d.ts +0 -123
  497. package/dist/classes/texture.d.ts.map +0 -1
  498. package/dist/classes/texture.js.map +0 -1
  499. package/dist/classes/transform-feedback.d.ts +0 -33
  500. package/dist/classes/transform-feedback.d.ts.map +0 -1
  501. package/dist/classes/transform-feedback.js +0 -198
  502. package/dist/classes/transform-feedback.js.map +0 -1
  503. package/dist/classes/uniform-buffer-layout.d.ts +0 -17
  504. package/dist/classes/uniform-buffer-layout.d.ts.map +0 -1
  505. package/dist/classes/uniform-buffer-layout.js +0 -104
  506. package/dist/classes/uniform-buffer-layout.js.map +0 -1
  507. package/dist/classes/uniforms.d.ts +0 -37
  508. package/dist/classes/uniforms.d.ts.map +0 -1
  509. package/dist/classes/uniforms.js +0 -250
  510. package/dist/classes/uniforms.js.map +0 -1
  511. package/dist/classes/vertex-array-object.d.ts +0 -76
  512. package/dist/classes/vertex-array-object.d.ts.map +0 -1
  513. package/dist/classes/vertex-array-object.js +0 -261
  514. package/dist/classes/vertex-array-object.js.map +0 -1
  515. package/dist/classes/vertex-array.d.ts +0 -75
  516. package/dist/classes/vertex-array.d.ts.map +0 -1
  517. package/dist/classes/vertex-array.js +0 -408
  518. package/dist/classes/vertex-array.js.map +0 -1
  519. package/dist/classes/webgl-buffer.d.ts.map +0 -1
  520. package/dist/classes/webgl-buffer.js.map +0 -1
  521. package/dist/classes/webgl-resource.d.ts.map +0 -1
  522. package/dist/classes/webgl-resource.js.map +0 -1
  523. package/dist/context/context/create-context.d.ts.map +0 -1
  524. package/dist/context/context/create-context.js.map +0 -1
  525. package/dist/context/context/get-canvas.d.ts +0 -13
  526. package/dist/context/context/get-canvas.d.ts.map +0 -1
  527. package/dist/context/context/get-canvas.js +0 -31
  528. package/dist/context/context/get-canvas.js.map +0 -1
  529. package/dist/context/context/resize-context.d.ts +0 -20
  530. package/dist/context/context/resize-context.d.ts.map +0 -1
  531. package/dist/context/context/resize-context.js +0 -15
  532. package/dist/context/context/resize-context.js.map +0 -1
  533. package/dist/context/parameters/webgl-parameters.d.ts +0 -144
  534. package/dist/context/parameters/webgl-parameters.d.ts.map +0 -1
  535. package/dist/context/parameters/webgl-parameters.js +0 -2
  536. package/dist/context/parameters/webgl-parameters.js.map +0 -1
  537. package/dist/debug/debug-program-configuration.d.ts +0 -2
  538. package/dist/debug/debug-program-configuration.d.ts.map +0 -1
  539. package/dist/debug/debug-program-configuration.js +0 -40
  540. package/dist/debug/debug-program-configuration.js.map +0 -1
  541. package/dist/debug/debug-uniforms.d.ts +0 -12
  542. package/dist/debug/debug-uniforms.d.ts.map +0 -1
  543. package/dist/debug/debug-uniforms.js +0 -108
  544. package/dist/debug/debug-uniforms.js.map +0 -1
  545. package/dist/debug/debug-vertex-array.d.ts +0 -5
  546. package/dist/debug/debug-vertex-array.d.ts.map +0 -1
  547. package/dist/debug/debug-vertex-array.js +0 -118
  548. package/dist/debug/debug-vertex-array.js.map +0 -1
  549. package/dist/es5/_deprecated/context-api.js +0 -110
  550. package/dist/es5/_deprecated/context-api.js.map +0 -1
  551. package/dist/es5/_deprecated/features.js +0 -118
  552. package/dist/es5/_deprecated/features.js.map +0 -1
  553. package/dist/es5/adapter/converters/set-device-parameters.js.map +0 -1
  554. package/dist/es5/adapter/converters/webgpu-texture-formats.js +0 -296
  555. package/dist/es5/adapter/converters/webgpu-texture-formats.js.map +0 -1
  556. package/dist/es5/adapter/webgl-shader.js.map +0 -1
  557. package/dist/es5/classes/accessor.d.ts +0 -28
  558. package/dist/es5/classes/accessor.js.map +0 -1
  559. package/dist/es5/classes/accessor.ts.disabled +0 -159
  560. package/dist/es5/classes/clear.js +0 -135
  561. package/dist/es5/classes/clear.js.map +0 -1
  562. package/dist/es5/classes/copy-and-blit.js +0 -382
  563. package/dist/es5/classes/copy-and-blit.js.map +0 -1
  564. package/dist/es5/classes/framebuffer.js +0 -807
  565. package/dist/es5/classes/framebuffer.js.map +0 -1
  566. package/dist/es5/classes/program-configuration.js +0 -119
  567. package/dist/es5/classes/program-configuration.js.map +0 -1
  568. package/dist/es5/classes/program.js +0 -471
  569. package/dist/es5/classes/program.js.map +0 -1
  570. package/dist/es5/classes/query.js +0 -222
  571. package/dist/es5/classes/query.js.map +0 -1
  572. package/dist/es5/classes/renderbuffer-formats.js.map +0 -1
  573. package/dist/es5/classes/renderbuffer.js.map +0 -1
  574. package/dist/es5/classes/shader.js +0 -195
  575. package/dist/es5/classes/shader.js.map +0 -1
  576. package/dist/es5/classes/texture-2d.js.map +0 -1
  577. package/dist/es5/classes/texture-3d.js +0 -142
  578. package/dist/es5/classes/texture-3d.js.map +0 -1
  579. package/dist/es5/classes/texture-cube.js +0 -202
  580. package/dist/es5/classes/texture-cube.js.map +0 -1
  581. package/dist/es5/classes/texture-formats.js +0 -87
  582. package/dist/es5/classes/texture-formats.js.map +0 -1
  583. package/dist/es5/classes/texture.js.map +0 -1
  584. package/dist/es5/classes/transform-feedback.js +0 -267
  585. package/dist/es5/classes/transform-feedback.js.map +0 -1
  586. package/dist/es5/classes/uniform-buffer-layout.js +0 -130
  587. package/dist/es5/classes/uniform-buffer-layout.js.map +0 -1
  588. package/dist/es5/classes/uniforms.js +0 -232
  589. package/dist/es5/classes/uniforms.js.map +0 -1
  590. package/dist/es5/classes/vertex-array-object.js +0 -337
  591. package/dist/es5/classes/vertex-array-object.js.map +0 -1
  592. package/dist/es5/classes/vertex-array.js +0 -465
  593. package/dist/es5/classes/vertex-array.js.map +0 -1
  594. package/dist/es5/classes/webgl-buffer.js.map +0 -1
  595. package/dist/es5/classes/webgl-resource.js.map +0 -1
  596. package/dist/es5/context/context/create-context.js.map +0 -1
  597. package/dist/es5/context/context/get-canvas.js +0 -40
  598. package/dist/es5/context/context/get-canvas.js.map +0 -1
  599. package/dist/es5/context/context/resize-context.js +0 -23
  600. package/dist/es5/context/context/resize-context.js.map +0 -1
  601. package/dist/es5/context/parameters/webgl-parameters.js.map +0 -1
  602. package/dist/es5/debug/debug-program-configuration.js +0 -76
  603. package/dist/es5/debug/debug-program-configuration.js.map +0 -1
  604. package/dist/es5/debug/debug-uniforms.js +0 -156
  605. package/dist/es5/debug/debug-uniforms.js.map +0 -1
  606. package/dist/es5/debug/debug-vertex-array.js +0 -126
  607. package/dist/es5/debug/debug-vertex-array.js.map +0 -1
  608. package/dist/es5/helpers/get-program-bindings.js.map +0 -1
  609. package/dist/es5/helpers/program-bindings.js +0 -2
  610. package/dist/es5/types/accessor.d.ts +0 -29
  611. package/dist/es5/webgl-utils/attribute-utils.js +0 -186
  612. package/dist/es5/webgl-utils/attribute-utils.js.map +0 -1
  613. package/dist/es5/webgl-utils/constants-to-keys.js.map +0 -1
  614. package/dist/es5/webgl-utils/format-utils.js +0 -58
  615. package/dist/es5/webgl-utils/format-utils.js.map +0 -1
  616. package/dist/es5/webgl-utils/get-error.js +0 -49
  617. package/dist/es5/webgl-utils/get-error.js.map +0 -1
  618. package/dist/es5/webgl-utils/index.js +0 -74
  619. package/dist/es5/webgl-utils/index.js.map +0 -1
  620. package/dist/es5/webgl-utils/parse-shader-compiler-log.js.map +0 -1
  621. package/dist/es5/webgl-utils/request-animation-frame.js +0 -16
  622. package/dist/es5/webgl-utils/request-animation-frame.js.map +0 -1
  623. package/dist/es5/webgl-utils/texture-utils.js +0 -61
  624. package/dist/es5/webgl-utils/texture-utils.js.map +0 -1
  625. package/dist/es5/webgl-utils/typed-array-utils.js.map +0 -1
  626. package/dist/esm/_deprecated/context-api.js +0 -70
  627. package/dist/esm/_deprecated/context-api.js.map +0 -1
  628. package/dist/esm/_deprecated/features.js +0 -111
  629. package/dist/esm/_deprecated/features.js.map +0 -1
  630. package/dist/esm/adapter/converters/set-device-parameters.js.map +0 -1
  631. package/dist/esm/adapter/converters/webgpu-texture-formats.js +0 -285
  632. package/dist/esm/adapter/converters/webgpu-texture-formats.js.map +0 -1
  633. package/dist/esm/adapter/webgl-shader.js.map +0 -1
  634. package/dist/esm/classes/accessor.d.ts +0 -28
  635. package/dist/esm/classes/accessor.js.map +0 -1
  636. package/dist/esm/classes/clear.js +0 -105
  637. package/dist/esm/classes/clear.js.map +0 -1
  638. package/dist/esm/classes/copy-and-blit.js +0 -338
  639. package/dist/esm/classes/copy-and-blit.js.map +0 -1
  640. package/dist/esm/classes/framebuffer.js +0 -656
  641. package/dist/esm/classes/framebuffer.js.map +0 -1
  642. package/dist/esm/classes/program-configuration.js +0 -73
  643. package/dist/esm/classes/program-configuration.js.map +0 -1
  644. package/dist/esm/classes/program.js +0 -379
  645. package/dist/esm/classes/program.js.map +0 -1
  646. package/dist/esm/classes/query.js +0 -145
  647. package/dist/esm/classes/query.js.map +0 -1
  648. package/dist/esm/classes/renderbuffer-formats.js.map +0 -1
  649. package/dist/esm/classes/renderbuffer.js.map +0 -1
  650. package/dist/esm/classes/shader.js +0 -118
  651. package/dist/esm/classes/shader.js.map +0 -1
  652. package/dist/esm/classes/texture-2d.js +0 -36
  653. package/dist/esm/classes/texture-2d.js.map +0 -1
  654. package/dist/esm/classes/texture-3d.js +0 -76
  655. package/dist/esm/classes/texture-3d.js.map +0 -1
  656. package/dist/esm/classes/texture-cube.js +0 -130
  657. package/dist/esm/classes/texture-cube.js.map +0 -1
  658. package/dist/esm/classes/texture-formats.js +0 -98
  659. package/dist/esm/classes/texture-formats.js.map +0 -1
  660. package/dist/esm/classes/texture.js.map +0 -1
  661. package/dist/esm/classes/transform-feedback.js +0 -198
  662. package/dist/esm/classes/transform-feedback.js.map +0 -1
  663. package/dist/esm/classes/uniform-buffer-layout.js +0 -104
  664. package/dist/esm/classes/uniform-buffer-layout.js.map +0 -1
  665. package/dist/esm/classes/uniforms.js +0 -250
  666. package/dist/esm/classes/uniforms.js.map +0 -1
  667. package/dist/esm/classes/vertex-array-object.js +0 -261
  668. package/dist/esm/classes/vertex-array-object.js.map +0 -1
  669. package/dist/esm/classes/vertex-array.js +0 -408
  670. package/dist/esm/classes/vertex-array.js.map +0 -1
  671. package/dist/esm/classes/webgl-buffer.js.map +0 -1
  672. package/dist/esm/classes/webgl-resource.js.map +0 -1
  673. package/dist/esm/context/context/create-context.js.map +0 -1
  674. package/dist/esm/context/context/get-canvas.js +0 -31
  675. package/dist/esm/context/context/get-canvas.js.map +0 -1
  676. package/dist/esm/context/context/resize-context.js +0 -15
  677. package/dist/esm/context/context/resize-context.js.map +0 -1
  678. package/dist/esm/context/parameters/webgl-parameters.js +0 -2
  679. package/dist/esm/context/parameters/webgl-parameters.js.map +0 -1
  680. package/dist/esm/debug/debug-program-configuration.js +0 -40
  681. package/dist/esm/debug/debug-program-configuration.js.map +0 -1
  682. package/dist/esm/debug/debug-uniforms.js +0 -108
  683. package/dist/esm/debug/debug-uniforms.js.map +0 -1
  684. package/dist/esm/debug/debug-vertex-array.js +0 -118
  685. package/dist/esm/debug/debug-vertex-array.js.map +0 -1
  686. package/dist/esm/helpers/get-program-bindings.js +0 -228
  687. package/dist/esm/helpers/get-program-bindings.js.map +0 -1
  688. package/dist/esm/helpers/program-bindings.js +0 -2
  689. package/dist/esm/types/accessor.d.ts +0 -29
  690. package/dist/esm/webgl-utils/attribute-utils.js +0 -182
  691. package/dist/esm/webgl-utils/attribute-utils.js.map +0 -1
  692. package/dist/esm/webgl-utils/constants-to-keys.js.map +0 -1
  693. package/dist/esm/webgl-utils/format-utils.js +0 -45
  694. package/dist/esm/webgl-utils/format-utils.js.map +0 -1
  695. package/dist/esm/webgl-utils/get-error.js +0 -41
  696. package/dist/esm/webgl-utils/get-error.js.map +0 -1
  697. package/dist/esm/webgl-utils/index.js +0 -5
  698. package/dist/esm/webgl-utils/index.js.map +0 -1
  699. package/dist/esm/webgl-utils/parse-shader-compiler-log.js.map +0 -1
  700. package/dist/esm/webgl-utils/request-animation-frame.js +0 -7
  701. package/dist/esm/webgl-utils/request-animation-frame.js.map +0 -1
  702. package/dist/esm/webgl-utils/texture-utils.js +0 -48
  703. package/dist/esm/webgl-utils/texture-utils.js.map +0 -1
  704. package/dist/esm/webgl-utils/typed-array-utils.js.map +0 -1
  705. package/dist/helpers/get-program-bindings.d.ts +0 -8
  706. package/dist/helpers/get-program-bindings.d.ts.map +0 -1
  707. package/dist/helpers/get-program-bindings.js +0 -228
  708. package/dist/helpers/get-program-bindings.js.map +0 -1
  709. package/dist/helpers/program-bindings.d.ts +0 -41
  710. package/dist/helpers/program-bindings.d.ts.map +0 -1
  711. package/dist/helpers/program-bindings.js +0 -2
  712. package/dist/types/accessor.d.ts +0 -29
  713. package/dist/webgl-utils/attribute-utils.d.ts +0 -18
  714. package/dist/webgl-utils/attribute-utils.d.ts.map +0 -1
  715. package/dist/webgl-utils/attribute-utils.js +0 -182
  716. package/dist/webgl-utils/attribute-utils.js.map +0 -1
  717. package/dist/webgl-utils/constants-to-keys.d.ts +0 -4
  718. package/dist/webgl-utils/constants-to-keys.d.ts.map +0 -1
  719. package/dist/webgl-utils/constants-to-keys.js.map +0 -1
  720. package/dist/webgl-utils/format-utils.d.ts +0 -3
  721. package/dist/webgl-utils/format-utils.d.ts.map +0 -1
  722. package/dist/webgl-utils/format-utils.js +0 -45
  723. package/dist/webgl-utils/format-utils.js.map +0 -1
  724. package/dist/webgl-utils/get-error.d.ts +0 -3
  725. package/dist/webgl-utils/get-error.d.ts.map +0 -1
  726. package/dist/webgl-utils/get-error.js +0 -41
  727. package/dist/webgl-utils/get-error.js.map +0 -1
  728. package/dist/webgl-utils/index.d.ts +0 -5
  729. package/dist/webgl-utils/index.d.ts.map +0 -1
  730. package/dist/webgl-utils/index.js +0 -5
  731. package/dist/webgl-utils/index.js.map +0 -1
  732. package/dist/webgl-utils/parse-shader-compiler-log.d.ts.map +0 -1
  733. package/dist/webgl-utils/parse-shader-compiler-log.js.map +0 -1
  734. package/dist/webgl-utils/request-animation-frame.d.ts +0 -4
  735. package/dist/webgl-utils/request-animation-frame.d.ts.map +0 -1
  736. package/dist/webgl-utils/request-animation-frame.js +0 -7
  737. package/dist/webgl-utils/request-animation-frame.js.map +0 -1
  738. package/dist/webgl-utils/texture-utils.d.ts +0 -15
  739. package/dist/webgl-utils/texture-utils.d.ts.map +0 -1
  740. package/dist/webgl-utils/texture-utils.js +0 -48
  741. package/dist/webgl-utils/texture-utils.js.map +0 -1
  742. package/dist/webgl-utils/typed-array-utils.d.ts.map +0 -1
  743. package/dist/webgl-utils/typed-array-utils.js.map +0 -1
  744. package/src/.DS_Store +0 -0
  745. package/src/_deprecated/context-api.ts +0 -140
  746. package/src/_deprecated/features.ts +0 -159
  747. package/src/adapter/converters/webgpu-texture-formats.ts +0 -167
  748. package/src/classes/accessor.d.ts +0 -28
  749. package/src/classes/accessor.js +0 -129
  750. package/src/classes/accessor.ts.disabled +0 -159
  751. package/src/classes/clear.ts +0 -108
  752. package/src/classes/copy-and-blit.ts +0 -460
  753. package/src/classes/framebuffer.ts +0 -763
  754. package/src/classes/program-configuration.ts +0 -77
  755. package/src/classes/program.ts +0 -431
  756. package/src/classes/query.ts +0 -171
  757. package/src/classes/renderbuffer.ts +0 -154
  758. package/src/classes/shader.ts +0 -129
  759. package/src/classes/texture-2d.ts +0 -35
  760. package/src/classes/texture-3d.ts +0 -123
  761. package/src/classes/texture-cube.ts +0 -162
  762. package/src/classes/texture-formats.ts +0 -171
  763. package/src/classes/texture.ts +0 -965
  764. package/src/classes/transform-feedback.ts +0 -191
  765. package/src/classes/uniform-buffer-layout.ts +0 -113
  766. package/src/classes/uniforms.ts +0 -394
  767. package/src/classes/vertex-array-object.ts +0 -339
  768. package/src/classes/vertex-array.ts +0 -484
  769. package/src/context/context/get-canvas.ts +0 -37
  770. package/src/context/context/resize-context.ts +0 -37
  771. package/src/context/parameters/webgl-parameters.ts +0 -197
  772. package/src/debug/debug-program-configuration.ts +0 -32
  773. package/src/debug/debug-uniforms.ts +0 -100
  774. package/src/debug/debug-vertex-array.ts +0 -123
  775. package/src/helpers/get-program-bindings.ts +0 -244
  776. package/src/helpers/program-bindings.ts +0 -46
  777. package/src/types/accessor.d.ts +0 -29
  778. package/src/webgl-utils/attribute-utils.ts +0 -171
  779. package/src/webgl-utils/format-utils.ts +0 -43
  780. package/src/webgl-utils/get-error.ts +0 -56
  781. package/src/webgl-utils/index.ts +0 -12
  782. package/src/webgl-utils/request-animation-frame.ts +0 -14
  783. package/src/webgl-utils/texture-utils.ts +0 -60
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/context/state-tracker/track-context-state.ts"],"names":["assert","GL_PARAMETER_DEFAULTS","GL_HOOKED_SETTERS","NON_CACHE_PARAMETERS","setParameters","getParameters","deepArrayEqual","GLState","constructor","gl","copyState","log","cache","Object","assign","_updateCache","bind","seal","push","values","stateStack","pop","length","oldValues","valueChanged","oldValue","key","undefined","value","cached","trackContextState","options","enable","state","global_","global","window","installProgramSpy","setter","installSetterSpy","installGetterOverride","pushContextState","popContextState","functionName","originalGetterFunc","get","pname","has","defineProperty","configurable","originalSetterFunc","set","params","originalUseProgram","useProgram","useProgramLuma","handle","program"],"mappings":";AAEA,SAAQA,MAAR,QAAqB,cAArB;AACA,SA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A+B;AAC7B,QAAM4C,kBAAkB,GAAG5C,EAAE,CAAC6C,UAAH,CAActC,IAAd,CAAmBP,EAAnB,CAA3B;;AAEAA,EAAAA,EAAE,CAAC6C,UAAH,GAAgB,SAASC,cAAT,CAAwBC,MAAxB,EAAgC;AAC9C,QAAI/C,EAAE,CAACwB,KAAH,CAASwB,OAAT,KAAqBD,MAAzB,EAAiC;AAC/BH,MAAAA,kBAAkB,CAACG,MAAD,CAAlB;AACA/C,MAAAA,EAAE,CAACwB,KAAH,CAASwB,OAAT,GAAmBD,MAAnB;AACD;AACF,GALD;AAMD","sourcesContent":["// Support for listening to context state changes and intercepting state queries\n// NOTE: this system does not handle buffer bindings\nimport {assert} from '@luma.gl/api';\nimport {GL_PARAMETER_DEFAULTS, GL_HOOKED_SETTERS, NON_CACHE_PARAMETERS} from '../parameters/webgl-parameter-tables';\nimport {setParameters, getParameters} from '../parameters/unified-parameter-api';\nimport {deepArrayEqual} from './deep-array-equal';\n\n// HELPER CLASS - GLState\n\n/* eslint-disable no-shadow */\nclass GLState {\n gl: WebGLRenderingContext;\n program = null;\n stateStack = [];\n enable = true;\n cache;\n log;\n\n constructor(\n gl,\n {\n copyState = false, // Copy cache from params (slow) or initialize from WebGL defaults (fast)\n log = () => {} // Logging function, called when gl parameter change calls are actually issued\n } = {}\n ) {\n this.gl = gl;\n this.cache = copyState ? getParameters(gl) : Object.assign({}, GL_PARAMETER_DEFAULTS);\n this.log = log;\n\n this._updateCache = this._updateCache.bind(this);\n Object.seal(this);\n }\n\n push(values = {}) {\n this.stateStack.push({});\n }\n\n pop() {\n assert(this.stateStack.length > 0);\n // Use the saved values in the state stack to restore parameters\n const oldValues = this.stateStack[this.stateStack.length - 1];\n setParameters(this.gl, oldValues);\n // Don't pop until we have reset parameters (to make sure other \"stack frames\" are not affected)\n this.stateStack.pop();\n }\n\n /**\n // interceptor for context set functions - update our cache and our stack\n // values (Object) - the key values for this setter\n * @param values\n * @returns\n */\n _updateCache(values) {\n let valueChanged = false;\n let oldValue; // = undefined\n\n const oldValues = this.stateStack.length > 0 && this.stateStack[this.stateStack.length - 1];\n\n for (const key in values) {\n assert(key !== undefined);\n const value = values[key];\n const cached = this.cache[key];\n // Check that value hasn't already been shadowed\n if (!deepArrayEqual(value, cached)) {\n valueChanged = true;\n oldValue = cached;\n\n // First, save current value being shadowed\n // If a state stack frame is active, save the current parameter values for pop\n // but first check that value hasn't already been shadowed and saved\n if (oldValues && !(key in oldValues)) {\n oldValues[key] = cached;\n }\n\n // Save current value being shadowed\n this.cache[key] = value;\n }\n }\n\n return {valueChanged, oldValue};\n }\n}\n\n// PUBLIC API\n\n/**\n * Initialize WebGL state caching on a context\n * can be called multiple times to enable/disable\n *\n * @note After calling this function, context state will be cached\n * gl.state.push() and gl.state.pop() will be available for saving,\n * temporarily modifying, and then restoring state.\n */\n export function trackContextState(\n gl: WebGLRenderingContext,\n options?: {\n enable?: boolean;\n copyState?: boolean;\n log?: any;\n }\n): WebGLRenderingContext {\n const {enable = true, copyState} = options;\n assert(copyState !== undefined);\n // @ts-expect-error\n if (!gl.state) {\n const global_ = typeof global !== 'undefined' ? global : window;\n // @ts-ignore\n // const {polyfillContext} = global_;\n // if (polyfillContext) {\n // polyfillContext(gl);\n // }\n\n // Create a state cache\n // @ts-expect-error\n gl.state = new GLState(gl, {copyState});\n\n installProgramSpy(gl);\n\n // intercept all setter functions in the table\n for (const key in GL_HOOKED_SETTERS) {\n const setter = GL_HOOKED_SETTERS[key];\n installSetterSpy(gl, key, setter);\n }\n\n // intercept all getter functions in the table\n installGetterOverride(gl, 'getParameter');\n installGetterOverride(gl, 'isEnabled');\n }\n\n // @ts-expect-error\n gl.state.enable = enable;\n\n return gl;\n}\n\n/**\n * Saves current WebGL context state onto an internal per-context stack\n */\n export function pushContextState(gl: WebGLRenderingContext): void {\n // @ts-expect-error\n if (!gl.state) {\n trackContextState(gl, {copyState: false});\n }\n // @ts-expect-error\n gl.state.push();\n}\n\n\n/**\n * Restores previously saved WebGL context state\n */\nexport function popContextState(gl: WebGLRenderingContext): void {\n // @ts-expect-error\n assert(gl.state);\n // @ts-expect-error\n gl.state.pop();\n}\n\n// HELPER FUNCTIONS - INSTALL GET/SET INTERCEPTORS (SPYS) ON THE CONTEXT\n\n/**\n// Overrides a WebGLRenderingContext state \"getter\" function\n// to return values directly from cache\n * @param gl\n * @param functionName\n */\nfunction installGetterOverride(gl, functionName) {\n // Get the original function from the WebGLRenderingContext\n const originalGetterFunc = gl[functionName].bind(gl);\n\n // Wrap it with a spy so that we can update our state cache when it gets called\n gl[functionName] = function get(pname) {\n if (pname === undefined || NON_CACHE_PARAMETERS.has(pname)) {\n // Invalid or blacklisted parameter, do not cache\n return originalGetterFunc(pname);\n }\n\n if (!(pname in gl.state.cache)) {\n // WebGL limits are not prepopulated in the cache, call the original getter when first queried.\n gl.state.cache[pname] = originalGetterFunc(pname);\n }\n\n // Optionally call the original function to do a \"hard\" query from the WebGLRenderingContext\n return gl.state.enable\n ? // Call the getter the params so that it can e.g. serve from a cache\n gl.state.cache[pname]\n : // Optionally call the original function to do a \"hard\" query from the WebGLRenderingContext\n originalGetterFunc(pname);\n };\n\n // Set the name of this anonymous function to help in debugging and profiling\n Object.defineProperty(gl[functionName], 'name', {\n value: `${functionName}-from-cache`,\n configurable: false\n });\n}\n\n/**\n// Overrides a WebGLRenderingContext state \"setter\" function\n// to call a setter spy before the actual setter. Allows us to keep a cache\n// updated with a copy of the WebGL context state.\n * @param gl\n * @param functionName\n * @param setter\n * @returns\n */\nfunction installSetterSpy(gl, functionName, setter) {\n // Get the original function from the WebGLRenderingContext\n if (!gl[functionName]) {\n // This could happen if we try to intercept WebGL2 method on a WebGL1 context\n return;\n }\n const originalSetterFunc = gl[functionName].bind(gl);\n\n // Wrap it with a spy so that we can update our state cache when it gets called\n gl[functionName] = function set(...params) {\n // Update the value\n // Call the setter with the state cache and the params so that it can store the parameters\n const {valueChanged, oldValue} = setter(gl.state._updateCache, ...params);\n\n // Call the original WebGLRenderingContext func to make sure the context actually gets updated\n if (valueChanged) {\n originalSetterFunc(...params);\n }\n\n // Note: if the original function fails to set the value, our state cache will be bad\n // No solution for this at the moment, but assuming that this is unlikely to be a real problem\n // We could call the setter after the originalSetterFunc. Concern is that this would\n // cause different behavior in debug mode, where originalSetterFunc can throw exceptions\n\n return oldValue;\n };\n\n // Set the name of this anonymous function to help in debugging and profiling\n Object.defineProperty(gl[functionName], 'name', {\n value: `${functionName}-to-cache`,\n configurable: false\n });\n}\n\nfunction installProgramSpy(gl) {\n const originalUseProgram = gl.useProgram.bind(gl);\n\n gl.useProgram = function useProgramLuma(handle) {\n if (gl.state.program !== handle) {\n originalUseProgram(handle);\n gl.state.program = handle;\n }\n };\n}\n"],"file":"track-context-state.js"}
1
+ {"version":3,"sources":["../../../../src/context/state-tracker/track-context-state.ts"],"names":["assert","GL_PARAMETER_DEFAULTS","GL_HOOKED_SETTERS","NON_CACHE_PARAMETERS","setParameters","getParameters","deepArrayEqual","GLState","constructor","gl","copyState","log","cache","Object","assign","_updateCache","bind","seal","push","values","stateStack","pop","length","oldValues","valueChanged","oldValue","key","undefined","value","cached","getContextState","state","trackContextState","options","enable","global_","global","window","installProgramSpy","setter","installSetterSpy","installGetterOverride","glState","pushContextState","popContextState","functionName","originalGetterFunc","get","pname","has","defineProperty","configurable","originalSetterFunc","set","params","originalUseProgram","useProgram","useProgramLuma","handle","program"],"mappings":";AAEA,SAAQA,MAAR,QAAqB,cAArB;AACA,SAAQC,qBAAR,EAA+BC,iBAA/B,EAAkDC,oBAAlD,QAA6E,sCAA7E;AACA,SAAQC,aAAR,EAAuBC,aAAvB,QAA2C,qCAA3C;AACA,SAAQC,cAAR,QAA6B,oBAA7B;;AAKA,MAAMC,OAAN,CAAc;AAQZC,EAAAA,WAAW,CACTC,EADS,EAET;AACEC,IAAAA,SAAS,GAAG,KADd;AAEEC,IAAAA,GAAG,GAAG,MAAM,CAAE;AAFhB,MAGI,EALK,EAMT;AAAA;;AAAA,qCAZiB,IA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AkB,GAAG9C,EAAE,CAAC+C,UAAH,CAAcxC,IAAd,CAAmBP,EAAnB,CAA3B;;AAEAA,EAAAA,EAAE,CAAC+C,UAAH,GAAgB,SAASC,cAAT,CAAwBC,MAAxB,EAAgC;AAC9C,UAAMhB,OAAO,GAAGZ,eAAe,CAACrB,EAAD,CAA/B;;AACA,QAAIiC,OAAO,CAACiB,OAAR,KAAoBD,MAAxB,EAAgC;AAC9BH,MAAAA,kBAAkB,CAACG,MAAD,CAAlB;AACAhB,MAAAA,OAAO,CAACiB,OAAR,GAAkBD,MAAlB;AACD;AACF,GAND;AAOD","sourcesContent":["// Support for listening to context state changes and intercepting state queries\n// NOTE: this system does not handle buffer bindings\nimport {assert} from '@luma.gl/api';\nimport {GL_PARAMETER_DEFAULTS, GL_HOOKED_SETTERS, NON_CACHE_PARAMETERS} from '../parameters/webgl-parameter-tables';\nimport {setParameters, getParameters} from '../parameters/unified-parameter-api';\nimport {deepArrayEqual} from './deep-array-equal';\n\n// HELPER CLASS - GLState\n\n/* eslint-disable no-shadow */\nclass GLState {\n gl: WebGLRenderingContext;\n program: unknown = null;\n stateStack: object[] = [];\n enable = true;\n cache: Record<string, any>;\n log;\n\n constructor(\n gl: WebGLRenderingContext,\n {\n copyState = false, // Copy cache from params (slow) or initialize from WebGL defaults (fast)\n log = () => {} // Logging function, called when gl parameter change calls are actually issued\n } = {}\n ) {\n this.gl = gl;\n this.cache = copyState ? getParameters(gl) : Object.assign({}, GL_PARAMETER_DEFAULTS);\n this.log = log;\n\n this._updateCache = this._updateCache.bind(this);\n Object.seal(this);\n }\n\n push(values = {}) {\n this.stateStack.push({});\n }\n\n pop() {\n assert(this.stateStack.length > 0);\n // Use the saved values in the state stack to restore parameters\n const oldValues = this.stateStack[this.stateStack.length - 1];\n setParameters(this.gl, oldValues);\n // Don't pop until we have reset parameters (to make sure other \"stack frames\" are not affected)\n this.stateStack.pop();\n }\n\n /**\n // interceptor for context set functions - update our cache and our stack\n // values (Object) - the key values for this setter\n * @param values\n * @returns\n */\n _updateCache(values: {[key: number | string]: any}) {\n let valueChanged = false;\n let oldValue; // = undefined\n\n const oldValues: {[key: number | string]: any} | null = this.stateStack.length > 0 ? this.stateStack[this.stateStack.length - 1] : null;\n\n for (const key in values) {\n assert(key !== undefined);\n const value = values[key];\n const cached = this.cache[key];\n // Check that value hasn't already been shadowed\n if (!deepArrayEqual(value, cached)) {\n valueChanged = true;\n oldValue = cached;\n\n // First, save current value being shadowed\n // If a state stack frame is active, save the current parameter values for pop\n // but first check that value hasn't already been shadowed and saved\n if (oldValues && !(key in oldValues)) {\n oldValues[key] = cached;\n }\n\n // Save current value being shadowed\n this.cache[key] = value;\n }\n }\n\n return {valueChanged, oldValue};\n }\n}\n\nfunction getContextState(gl: WebGLRenderingContext): GLState {\n // @ts-expect-error\n return gl.state as GLState;\n}\n\n// PUBLIC API\n\n/**\n * Initialize WebGL state caching on a context\n * can be called multiple times to enable/disable\n *\n * @note After calling this function, context state will be cached\n * gl.state.push() and gl.state.pop() will be available for saving,\n * temporarily modifying, and then restoring state.\n */\n export function trackContextState(\n gl: WebGLRenderingContext,\n options?: {\n enable?: boolean;\n copyState?: boolean;\n log?: any;\n }\n): WebGLRenderingContext {\n const {enable = true, copyState} = options;\n assert(copyState !== undefined);\n // @ts-expect-error\n if (!gl.state) {\n const global_ = typeof global !== 'undefined' ? global : window;\n // @ts-ignore\n // const {polyfillContext} = global_;\n // if (polyfillContext) {\n // polyfillContext(gl);\n // }\n\n // Create a state cache\n // @ts-expect-error\n gl.state = new GLState(gl, {copyState});\n\n installProgramSpy(gl);\n\n // intercept all setter functions in the table\n for (const key in GL_HOOKED_SETTERS) {\n const setter = GL_HOOKED_SETTERS[key];\n installSetterSpy(gl, key, setter);\n }\n\n // intercept all getter functions in the table\n installGetterOverride(gl, 'getParameter');\n installGetterOverride(gl, 'isEnabled');\n }\n\n const glState = getContextState(gl);\n glState.enable = enable;\n\n return gl;\n}\n\n/**\n * Saves current WebGL context state onto an internal per-context stack\n */\n export function pushContextState(gl: WebGLRenderingContext): void {\n let glState = getContextState(gl);\n if (!glState) {\n trackContextState(gl, {copyState: false});\n glState = getContextState(gl);\n }\n glState.push();\n}\n\n\n/**\n * Restores previously saved WebGL context state\n */\nexport function popContextState(gl: WebGLRenderingContext): void {\n const glState = getContextState(gl);\n assert(glState);\n glState.pop();\n}\n\n// HELPER FUNCTIONS - INSTALL GET/SET INTERCEPTORS (SPYS) ON THE CONTEXT\n\n/**\n// Overrides a WebGLRenderingContext state \"getter\" function\n// to return values directly from cache\n * @param gl\n * @param functionName\n */\nfunction installGetterOverride(gl: WebGLRenderingContext, functionName: string) {\n // Get the original function from the WebGLRenderingContext\n const originalGetterFunc = gl[functionName].bind(gl);\n\n // Wrap it with a spy so that we can update our state cache when it gets called\n gl[functionName] = function get(pname) {\n if (pname === undefined || NON_CACHE_PARAMETERS.has(pname)) {\n // Invalid or blacklisted parameter, do not cache\n return originalGetterFunc(pname);\n }\n\n const glState = getContextState(gl);\n if (!(pname in glState.cache)) {\n // WebGL limits are not prepopulated in the cache, call the original getter when first queried.\n glState.cache[pname] = originalGetterFunc(pname);\n }\n\n // Optionally call the original function to do a \"hard\" query from the WebGLRenderingContext\n return glState.enable\n ? // Call the getter the params so that it can e.g. serve from a cache\n glState.cache[pname]\n : // Optionally call the original function to do a \"hard\" query from the WebGLRenderingContext\n originalGetterFunc(pname);\n };\n\n // Set the name of this anonymous function to help in debugging and profiling\n Object.defineProperty(gl[functionName], 'name', {\n value: `${functionName}-from-cache`,\n configurable: false\n });\n}\n\n/**\n// Overrides a WebGLRenderingContext state \"setter\" function\n// to call a setter spy before the actual setter. Allows us to keep a cache\n// updated with a copy of the WebGL context state.\n * @param gl\n * @param functionName\n * @param setter\n * @returns\n */\nfunction installSetterSpy(gl: WebGLRenderingContext, functionName: string, setter) {\n // Get the original function from the WebGLRenderingContext\n if (!gl[functionName]) {\n // This could happen if we try to intercept WebGL2 method on a WebGL1 context\n return;\n }\n\n const originalSetterFunc = gl[functionName].bind(gl);\n\n // Wrap it with a spy so that we can update our state cache when it gets called\n gl[functionName] = function set(...params) {\n // Update the value\n // Call the setter with the state cache and the params so that it can store the parameters\n const glState = getContextState(gl);\n const {valueChanged, oldValue} = setter(glState._updateCache, ...params);\n\n // Call the original WebGLRenderingContext func to make sure the context actually gets updated\n if (valueChanged) {\n originalSetterFunc(...params);\n }\n\n // Note: if the original function fails to set the value, our state cache will be bad\n // No solution for this at the moment, but assuming that this is unlikely to be a real problem\n // We could call the setter after the originalSetterFunc. Concern is that this would\n // cause different behavior in debug mode, where originalSetterFunc can throw exceptions\n\n return oldValue;\n };\n\n // Set the name of this anonymous function to help in debugging and profiling\n Object.defineProperty(gl[functionName], 'name', {\n value: `${functionName}-to-cache`,\n configurable: false\n });\n}\n\nfunction installProgramSpy(gl: WebGLRenderingContext): void {\n const originalUseProgram = gl.useProgram.bind(gl);\n\n gl.useProgram = function useProgramLuma(handle) {\n const glState = getContextState(gl);\n if (glState.program !== handle) {\n originalUseProgram(handle);\n glState.program = handle;\n }\n };\n}\n"],"file":"track-context-state.js"}
@@ -1,8 +1,12 @@
1
+ import { WebGLDevice } from '../..';
1
2
  import { setParameters } from '../parameters/unified-parameter-api';
2
3
  import { pushContextState, popContextState } from './track-context-state';
3
- export function withParameters(gl, parameters, func) {
4
+ export function withParameters(device, parameters, func) {
5
+ const webglDevice = WebGLDevice.attach(device);
6
+ const gl = webglDevice.gl;
7
+
4
8
  if (isObjectEmpty(parameters)) {
5
- return func(gl);
9
+ return func(device);
6
10
  }
7
11
 
8
12
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/context/state-tracker/with-parameters.ts"],"names":["setParameters","pushContextState","popContextState","withParameters","gl","parameters","func","isObjectEmpty","nocatch","value","object","key"],"mappings":"AAAA,SAAsBA,aAAtB,QAA0C,qCAA1C;AACA,SAAQC,gBAAR,EAA0BC,eAA1B,QAAgD,uBAAhD;AAUC,OAAO,SAASC,cAAT,CAAwBC,EAAxB,EAAmDC,UAAnD,EAAmGC,IAAnG,EAAmH;AACzH,MAAIC,aAAa,CAACF,UAAD,CAAjB,EAA+B;AAE7B,WAAOC,IAAI,CAACF,EAAD,CAAX;AACD;;AAED,QAAM;AAACI,IAAAA,OAAO,GAAG;AAAX,MAAmBH,UAAzB;AAEAJ,EAAAA,gBAAgB,CAACG,EAAD,CAAhB;AACAJ,EAAAA,aAAa,CAACI,EAAD,EAAKC,UAAL,CAAb;AAGA,MAAII,KAAJ;;AAEA,MAAID,OAAJ,EAAa;AAEXC,IAAAA,KAAK,GAAGH,IAAI,CAACF,EAAD,CAAZ;AACAF,IAAAA,eAAe,CAACE,EAAD,CAAf;AACD,GAJD,MAIO;AAEL,QAAI;AACFK,MAAAA,KAAK,GAAGH,IAAI,CAACF,EAAD,CAAZ;AACD,KAFD,SAEU;AACRF,MAAAA,eAAe,CAACE,EAAD,CAAf;AACD;AACF;;AAED,SAAOK,KAAP;AACD;;AAKD,SAASF,aAAT,CAAuBG,MAAvB,EAA+B;AAC7B,OAAK,MAAMC,GAAX,IAAkBD,MAAlB,EAA0B;AACxB,WAAO,KAAP;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["import {GLParameters, setParameters} from '../parameters/unified-parameter-api';\nimport {pushContextState, popContextState} from './track-context-state';\n\n/**\n * Execute a function with a set of temporary WebGL parameter overrides\n * - Saves current \"global\" WebGL context settings\n * - Sets the supplies WebGL context parameters,\n * - Executes supplied function\n * - Restores parameters\n * - Returns the return value of the supplied function\n */\n export function withParameters(gl: WebGLRenderingContext, parameters: GLParameters & {nocatch?: boolean}, func: any): any {\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(gl);\n }\n\n const {nocatch = true} = parameters;\n\n pushContextState(gl);\n setParameters(gl, parameters);\n\n // Setup is done, call the function\n let value;\n\n if (nocatch) {\n // Avoid try catch to minimize stack size impact for safe execution paths\n value = func(gl);\n popContextState(gl);\n } else {\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n try {\n value = func(gl);\n } finally {\n popContextState(gl);\n }\n }\n\n return value;\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"file":"with-parameters.js"}
1
+ {"version":3,"sources":["../../../../src/context/state-tracker/with-parameters.ts"],"names":["WebGLDevice","setParameters","pushContextState","popContextState","withParameters","device","parameters","func","webglDevice","attach","gl","isObjectEmpty","nocatch","value","object","key"],"mappings":"AACA,SAAQA,WAAR,QAA0B,OAA1B;AACA,SAAsBC,aAAtB,QAA0C,qCAA1C;AACA,SAAQC,gBAAR,EAA0BC,eAA1B,QAAgD,uBAAhD;AAUC,OAAO,SAASC,cAAT,CAAwBC,MAAxB,EAAgEC,UAAhE,EAAgHC,IAAhH,EAAgI;AACtI,QAAMC,WAAW,GAAGR,WAAW,CAACS,MAAZ,CAAmBJ,MAAnB,CAApB;AACA,QAAMK,EAAE,GAAGF,WAAW,CAACE,EAAvB;;AAEA,MAAIC,aAAa,CAACL,UAAD,CAAjB,EAA+B;AAE7B,WAAOC,IAAI,CAACF,MAAD,CAAX;AACD;;AAED,QAAM;AAACO,IAAAA,OAAO,GAAG;AAAX,MAAmBN,UAAzB;AAEAJ,EAAAA,gBAAgB,CAACQ,EAAD,CAAhB;AACAT,EAAAA,aAAa,CAACS,EAAD,EAAKJ,UAAL,CAAb;AAGA,MAAIO,KAAJ;;AAEA,MAAID,OAAJ,EAAa;AAEXC,IAAAA,KAAK,GAAGN,IAAI,CAACG,EAAD,CAAZ;AACAP,IAAAA,eAAe,CAACO,EAAD,CAAf;AACD,GAJD,MAIO;AAEL,QAAI;AACFG,MAAAA,KAAK,GAAGN,IAAI,CAACG,EAAD,CAAZ;AACD,KAFD,SAEU;AACRP,MAAAA,eAAe,CAACO,EAAD,CAAf;AACD;AACF;;AAED,SAAOG,KAAP;AACD;;AAKD,SAASF,aAAT,CAAuBG,MAAvB,EAA+B;AAC7B,OAAK,MAAMC,GAAX,IAAkBD,MAAlB,EAA0B;AACxB,WAAO,KAAP;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["import type {Device} from '@luma.gl/api';\nimport {WebGLDevice} from '../..';\nimport {GLParameters, setParameters} from '../parameters/unified-parameter-api';\nimport {pushContextState, popContextState} from './track-context-state';\n\n/**\n * Execute a function with a set of temporary WebGL parameter overrides\n * - Saves current \"global\" WebGL context settings\n * - Sets the supplies WebGL context parameters,\n * - Executes supplied function\n * - Restores parameters\n * - Returns the return value of the supplied function\n */\n export function withParameters(device: Device | WebGLRenderingContext, parameters: GLParameters & {nocatch?: boolean}, func: any): any {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(device);\n }\n\n const {nocatch = true} = parameters;\n\n pushContextState(gl);\n setParameters(gl, parameters);\n\n // Setup is done, call the function\n let value;\n\n if (nocatch) {\n // Avoid try catch to minimize stack size impact for safe execution paths\n value = func(gl);\n popContextState(gl);\n } else {\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n try {\n value = func(gl);\n } finally {\n popContextState(gl);\n }\n }\n\n return value;\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"file":"with-parameters.js"}
package/dist/esm/index.js CHANGED
@@ -1,39 +1,28 @@
1
+ import '@luma.gl/api';
1
2
  import './init';
2
- export { default as WebGLDevice, getWebGLDevice } from './adapter/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 { default as Program } from './classes/program';
11
- export { default as Framebuffer } from './classes/framebuffer';
12
- export { default as Renderbuffer } from './classes/renderbuffer';
13
- export { Shader, VertexShader, FragmentShader } from './classes/shader';
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 { setDeviceParameters } from './adapter/converters/set-device-parameters';
3
+ export { registerHeadlessGL } from './context/context/create-headless-context';
4
+ export { default as WebGLDevice } from './adapter/webgl-device';
5
+ export { default as WebGLCanvasContext } from './adapter/webgl-canvas-context';
6
+ export { default as WEBGLResource, default as WebGLResource } from './adapter/objects/webgl-resource';
7
+ export { default as WEBGLBuffer } from './adapter/resources/webgl-buffer';
8
+ export { default as WEBGLTexture } from './adapter/resources/webgl-texture';
9
+ export { default as WEBGLShader } from './adapter/resources/webgl-shader';
10
+ export { default as WEBGLSampler } from './adapter/resources/webgl-sampler';
11
+ export { default as WEBGLFramebuffer } from './adapter/resources/webgl-framebuffer';
12
+ export { default as WEBGLRenderPipeline } from './adapter/resources/webgl-render-pipeline';
13
+ export { default as WEBGLCommandEncoder } from './adapter/resources/webgl-command-encoder';
14
+ export { default as WEBGLRenderPass } from './adapter/resources/webgl-render-pass';
15
+ export { default as WEBGLRenderbuffer } from './adapter/objects/webgl-renderbuffer';
16
+ export { default as WEBGLVertexArrayObject } from './adapter/objects/webgl-vertex-array-object';
17
+ export { default as Accessor } from './classic/accessor';
18
+ export { default as ClassicBuffer, default as Buffer } from './classic/buffer';
23
19
  export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from './context/context/webgl-checks';
24
20
  export { cssToDeviceRatio, cssToDevicePixels } from './context/context/device-pixels';
21
+ export { setDeviceParameters, withDeviceParameters } from './adapter/converters/device-parameters';
25
22
  export { getParameters, setParameters, resetParameters } from './context/parameters/unified-parameter-api';
26
23
  export { withParameters } from './context/state-tracker/with-parameters';
27
24
  export { trackContextState, pushContextState, popContextState } from './context/state-tracker/track-context-state';
28
25
  export { polyfillContext } from './context/polyfill/polyfill-context';
29
- export { parseUniformName, getUniformSetter } from './classes/uniforms';
30
- export { getDebugTableForUniforms } from './debug/debug-uniforms';
31
- export { getDebugTableForVertexArray } from './debug/debug-vertex-array';
32
- export { getDebugTableForProgramConfiguration } from './debug/debug-program-configuration';
33
- export { getProgramBindings } from './helpers/get-program-bindings';
34
- export { lumaStats } from './init';
35
- export { log, assert, uid, isObjectEmpty } from '@luma.gl/api';
36
- export { setPathPrefix, loadFile, loadImage } from '@luma.gl/api';
37
- export { createGLContext, instrumentGLContext, resizeGLContext, hasFeature, hasFeatures, getFeatures, getContextInfo, getGLContextInfo, getContextLimits, getContextDebugInfo } from './_deprecated/context-api';
38
- export { FEATURES } from './_deprecated/features';
26
+ export { getShaderLayout, getProgramBindings } from './adapter/helpers/get-shader-layout';
27
+ export { _checkFloat32ColorAttachment } from './adapter/converters/texture-formats';
39
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":["default","WebGLDevice","getWebGLDevice","requestAnimationFrame","cancelAnimationFrame","cloneTextureFrom","getKeyValue","getKey","Accessor","Buffer","Texture2D","TextureCube","Program","Framebuffer","Renderbuffer","Shader","VertexShader","FragmentShader","clear","clearBuffer","readPixelsToArray","readPixelsToBuffer","copyToDataUrl","copyToImage","copyToTexture","blit","Query","Texture3D","TransformFeedback","VertexArrayObject","VertexArray","UniformBufferLayout","setDeviceParameters","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","cssToDeviceRatio","cssToDevicePixels","getParameters","setParameters","resetParameters","withParameters","trackContextState","pushContextState","popContextState","polyfillContext","parseUniformName","getUniformSetter","getDebugTableForUniforms","getDebugTableForVertexArray","getDebugTableForProgramConfiguration","getProgramBindings","lumaStats","log","assert","uid","isObjectEmpty","setPathPrefix","loadFile","loadImage","createGLContext","instrumentGLContext","resizeGLContext","hasFeature","hasFeatures","getFeatures","getContextInfo","getGLContextInfo","getContextLimits","getContextDebugInfo","FEATURES"],"mappings":"AAOA,OAAO,QAAP;AAIA,SAAQA,OAAO,IAAIC,WAAnB,EAAgCC,cAAhC,QAAqD,wBAArD;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,SAAQX,OAAO,IAAIY,OAAnB,QAAiC,mBAAjC;AAEA,SAAQZ,OAAO,IAAIa,WAAnB,QAAqC,uBAArC;AAEA,SAAQb,OAAO,IAAIc,YAAnB,QAAsC,wBAAtC;AAIA,SAAQC,MAAR,EAAgBC,YAAhB,EAA8BC,cAA9B,QAAmD,kBAAnD;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;AAEA,SAAQC,mBAAR,QAAkC,4CAAlC;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;AAGA,SAAQC,kBAAR,QAAiC,gCAAjC;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;AAIA,SACEC,eADF,EAEEC,mBAFF,EAGEC,eAHF,EAIEC,UAJF,EAKEC,WALF,EAMEC,WANF,EAOEC,cAPF,EAQEC,gBARF,EASEC,gBATF,EAUEC,mBAVF,QAWO,2BAXP;AAcA,SAAQC,QAAR,QAAuB,wBAAvB","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 './adapter/webgl-device';\nexport {default as WebGLDevice, getWebGLDevice} from './adapter/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 {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\n// Classic luma.gl classes (For backwards compatibility)\nexport type {ShaderProps} from './classes/shader';\nexport {Shader, VertexShader, FragmentShader} from './classes/shader';\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\nexport {setDeviceParameters} from './adapter/converters/set-device-parameters';\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// HELPERS - EXPERIMENTAL\nexport {getProgramBindings} from './helpers/get-program-bindings';\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// GLTOOLS\nexport type {GLContextOptions} from './_deprecated/context-api';\nexport {\n createGLContext,\n instrumentGLContext,\n resizeGLContext,\n hasFeature,\n hasFeatures,\n getFeatures,\n getContextInfo,\n getGLContextInfo,\n getContextLimits,\n getContextDebugInfo\n} from './_deprecated/context-api';\n\n// Features\nexport {FEATURES} from './_deprecated/features';\n\n// REMOVED in v8.7\n// getShaderInfo,\n// getShaderName\n// getShaderVersion\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":["registerHeadlessGL","default","WebGLDevice","WebGLCanvasContext","WEBGLResource","WebGLResource","WEBGLBuffer","WEBGLTexture","WEBGLShader","WEBGLSampler","WEBGLFramebuffer","WEBGLRenderPipeline","WEBGLCommandEncoder","WEBGLRenderPass","WEBGLRenderbuffer","WEBGLVertexArrayObject","Accessor","ClassicBuffer","Buffer","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","cssToDeviceRatio","cssToDevicePixels","setDeviceParameters","withDeviceParameters","getParameters","setParameters","resetParameters","withParameters","trackContextState","pushContextState","popContextState","polyfillContext","getShaderLayout","getProgramBindings","_checkFloat32ColorAttachment"],"mappings":"AAOA,OAAO,cAAP;AACA,OAAO,QAAP;AAKA,SAAQA,kBAAR,QAAiC,2CAAjC;AAGA,SAAQC,OAAO,IAAIC,WAAnB,QAAqC,wBAArC;AACA,SAAQD,OAAO,IAAIE,kBAAnB,QAA4C,gCAA5C;AAGA,SAAQF,OAAO,IAAIG,aAAnB,EAAkCH,OAAO,IAAII,aAA7C,QAAiE,kCAAjE;AACA,SAAQJ,OAAO,IAAIK,WAAnB,QAAqC,kCAArC;AACA,SAAQL,OAAO,IAAIM,YAAnB,QAAsC,mCAAtC;AAEA,SAAQN,OAAO,IAAIO,WAAnB,QAAqC,kCAArC;AACA,SAAQP,OAAO,IAAIQ,YAAnB,QAAsC,mCAAtC;AACA,SAAQR,OAAO,IAAIS,gBAAnB,QAA0C,uCAA1C;AAEA,SAAQT,OAAO,IAAIU,mBAAnB,QAA6C,2CAA7C;AAEA,SAAQV,OAAO,IAAIW,mBAAnB,QAA6C,2CAA7C;AACA,SAAQX,OAAO,IAAIY,eAAnB,QAAyC,uCAAzC;AAKA,SAAQZ,OAAO,IAAIa,iBAAnB,QAA2C,sCAA3C;AACA,SAAQb,OAAO,IAAIc,sBAAnB,QAAgD,6CAAhD;AAGA,SAAQd,OAAO,IAAIe,QAAnB,QAAkC,oBAAlC;AAGA,SAAQf,OAAO,IAAIgB,aAAnB,EAAkChB,OAAO,IAAIiB,MAA7C,QAA0D,kBAA1D;AAEA,SACEC,OADF,EAEEC,QAFF,EAGEC,gBAHF,EAIEC,kBAJF,EAKEC,mBALF,QAMO,gCANP;AASA,SAAQC,gBAAR,EAA0BC,iBAA1B,QAAkD,iCAAlD;AAIA,SAAQC,mBAAR,EAA6BC,oBAA7B,QAAwD,wCAAxD;AAGA,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,eAAR,EAAyBC,kBAAzB,QAAkD,qCAAlD;AACA,SAAQC,4BAAR,QAA2C,sCAA3C","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 '@luma.gl/api';\nimport './init'\n\n// Types\nexport type {WebGLLimits} from './adapter/device-helpers/device-limits';\n\nexport {registerHeadlessGL} from './context/context/create-headless-context';\n\n// WebGL adapter classes\nexport {default as WebGLDevice} from './adapter/webgl-device';\nexport {default as WebGLCanvasContext} from './adapter/webgl-canvas-context';\n\n// WebGL Resource classes\nexport {default as WEBGLResource, default as WebGLResource} from './adapter/objects/webgl-resource';\nexport {default as WEBGLBuffer} from './adapter/resources/webgl-buffer';\nexport {default as WEBGLTexture} from './adapter/resources/webgl-texture';\n// export {default as WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';\nexport {default as WEBGLShader} from './adapter/resources/webgl-shader';\nexport {default as WEBGLSampler} from './adapter/resources/webgl-sampler';\nexport {default as WEBGLFramebuffer} from './adapter/resources/webgl-framebuffer';\n\nexport {default as WEBGLRenderPipeline} from './adapter/resources/webgl-render-pipeline';\n// export {default as WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';\nexport {default as WEBGLCommandEncoder} from './adapter/resources/webgl-command-encoder';\nexport {default as WEBGLRenderPass} from './adapter/resources/webgl-render-pass';\n//export {default as WEBGLComputePass} from './adapter/resources/webgl-compute-pass';\n\n// non-api resources\nexport type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';\nexport {default as WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';\nexport {default as WEBGLVertexArrayObject} from './adapter/objects/webgl-vertex-array-object';\n\n// WebGL adapter classes (Legacy, will be moved to gltools)\nexport {default as Accessor} from './classic/accessor';\nexport type {AccessorObject} from './types';\nexport type {ClassicBufferProps, ClassicBufferProps as BufferProps} from './classic/buffer';\nexport {default as ClassicBuffer, default as Buffer} from './classic/buffer';\n\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 {setDeviceParameters, withDeviceParameters} from './adapter/converters/device-parameters';\n\nexport type {GLParameters} from './types/webgl';\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// HELPERS - EXPERIMENTAL\nexport {getShaderLayout, getProgramBindings} from './adapter/helpers/get-shader-layout';\nexport {_checkFloat32ColorAttachment} from './adapter/converters/texture-formats';\n"],"file":"index.js"}
package/dist/esm/init.js CHANGED
@@ -1,33 +1,4 @@
1
- import { log } from '@luma.gl/api';
2
- import { isBrowser } from '@probe.gl/env';
3
- import { luma, lumaStats } from '@luma.gl/api';
1
+ import { luma } from '@luma.gl/api';
4
2
  import WebGLDevice from './adapter/webgl-device';
5
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'untranspiled source';
6
- const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
7
-
8
- if (globalThis.luma && globalThis.luma.VERSION !== VERSION) {
9
- throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION, " vs ").concat(VERSION));
10
- }
11
-
12
- if (!globalThis.luma) {
13
- luma.registerDevices([WebGLDevice]);
14
-
15
- if (isBrowser()) {
16
- log.log(1, "luma.gl ".concat(VERSION, " - ").concat(STARTUP_MESSAGE))();
17
- }
18
-
19
- globalThis.luma = globalThis.luma || {
20
- VERSION,
21
- version: VERSION,
22
- log,
23
- stats: lumaStats,
24
- globals: {
25
- modules: {},
26
- nodeIO: {}
27
- }
28
- };
29
- }
30
-
31
- export { lumaStats };
32
- export default globalThis.luma;
3
+ luma.registerDevices([WebGLDevice]);
33
4
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/init.ts"],"names":["log","isBrowser","luma","lumaStats","WebGLDevice","VERSION","__VERSION__","STARTUP_MESSAGE","globalThis","Error","registerDevices","version","stats","globals","modules","nodeIO"],"mappings":"AAAA,SAAQA,GAAR,QAAkB,cAAlB;AACA,SAAQC,SAAR,QAAwB,eAAxB;AACA,SAAQC,IAAR,EAAcC,SAAd,QAA8B,cAA9B;AACA,OAAOC,WAAP,MAAwB,wBAAxB;AAIA,MAAMC,OAAO,GAAG,OAAOC,WAAP,KAAuB,WAAvB,GAAqCA,WAArC,GAAmD,qBAAnE;AAEA,MAAMC,eAAe,GAAG,qDAAxB;;AAKA,IAAIC,UAAU,CAACN,IAAX,IAAmBM,UAAU,CAACN,IAAX,CAAgBG,OAAhB,KAA4BA,OAAnD,EAA4D;AAC1D,QAAM,IAAII,KAAJ,iDAAmDD,UAAU,CAACN,IAAX,CAAgBG,OAAnE,iBAAiFA,OAAjF,EAAN;AACD;;AAED,IAAI,CAACG,UAAU,CAACN,IAAhB,EAAsB;AACpBA,EAAAA,IAAI,CAACQ,eAAL,CAAqB,CAACN,WAAD,CAArB;;AAEA,MAAIH,SAAS,EAAb,EAAiB;AACfD,IAAAA,GAAG,CAACA,GAAJ,CAAQ,CAAR,oBAAsBK,OAAtB,gBAAmCE,eAAnC;AACD;;AAEDC,EAAAA,UAAU,CAACN,IAAX,GAAkBM,UAAU,CAACN,IAAX,IAAmB;AACnCG,IAAAA,OADmC;AAEnCM,IAAAA,OAAO,EAAEN,OAF0B;AAGnCL,IAAAA,GAHmC;AAOnCY,IAAAA,KAAK,EAAET,SAP4B;AAcnCU,IAAAA,OAAO,EAAE;AACPC,MAAAA,OAAO,EAAE,EADF;AAEPC,MAAAA,MAAM,EAAE;AAFD;AAd0B,GAArC;AAmBD;;AAED,SAAQZ,SAAR;AACA,eAAeK,UAAU,CAACN,IAA1B","sourcesContent":["import {log} from '@luma.gl/api';\nimport {isBrowser} from '@probe.gl/env';\nimport {luma, lumaStats} from '@luma.gl/api';\nimport WebGLDevice from './adapter/webgl-device';\n\n// Version detection using babel plugin\n// @ts-expect-error\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'untranspiled source';\n\nconst STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';\n// Assign luma.log.level in console to control logging: \\\n// 0: none, 1: minimal, 2: verbose, 3: attribute/uniforms, 4: gl logs\n// luma.log.break[], set to gl funcs, luma.log.profile[] set to model names`;\n\nif (globalThis.luma && globalThis.luma.VERSION !== VERSION) {\n throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${VERSION}`);\n}\n\nif (!globalThis.luma) {\n luma.registerDevices([WebGLDevice]);\n\n if (isBrowser()) {\n log.log(1, `luma.gl ${VERSION} - ${STARTUP_MESSAGE}`)();\n }\n\n globalThis.luma = globalThis.luma || {\n VERSION,\n version: VERSION,\n log,\n\n // A global stats object that various components can add information to\n // E.g. see webgl/resource.js\n stats: lumaStats,\n\n // Keep some luma globals in a sub-object\n // This allows us to dynamically detect if certain modules have been\n // included (such as IO and headless) and enable related functionality,\n // without unconditionally requiring and thus bundling big dependencies\n // into the app.\n globals: {\n modules: {},\n nodeIO: {}\n }\n };\n}\n\nexport {lumaStats};\nexport default globalThis.luma;\n"],"file":"init.js"}
1
+ {"version":3,"sources":["../../src/init.ts"],"names":["luma","WebGLDevice","registerDevices"],"mappings":"AAAA,SAAQA,IAAR,QAAmB,cAAnB;AACA,OAAOC,WAAP,MAAwB,wBAAxB;AAEAD,IAAI,CAACE,eAAL,CAAqB,CAACD,WAAD,CAArB","sourcesContent":["import {luma} from '@luma.gl/api';\nimport WebGLDevice from './adapter/webgl-device';\n\nluma.registerDevices([WebGLDevice]);\n"],"file":"init.js"}
@@ -0,0 +1,2 @@
1
+ import GL from '@luma.gl/constants';
2
+ //# sourceMappingURL=webgl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/types/webgl.ts"],"names":["GL"],"mappings":"AACA,OAAOA,EAAP,MAAe,oBAAf","sourcesContent":["import type {NumberArray} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\n\ntype Framebuffer = any;\n\nexport type GLDrawMode =\n | GL.POINTS\n | GL.LINES\n | GL.LINE_STRIP\n | GL.LINE_LOOP\n | GL.TRIANGLES\n | GL.TRIANGLE_STRIP\n | GL.TRIANGLE_FAN;\n\nexport type GLPrimitive = GL.POINTS | GL.LINES | GL.TRIANGLES;\n\nexport type GLType =\n | GL.FLOAT\n | GL.UNSIGNED_SHORT\n | GL.UNSIGNED_INT\n | GL.UNSIGNED_BYTE\n | GL.BYTE\n | GL.SHORT\n | GL.INT;\n\nexport type GLPackedType =\n | GL.UNSIGNED_SHORT_5_6_5\n | GL.UNSIGNED_SHORT_4_4_4_4\n | GL.UNSIGNED_SHORT_5_5_5_1;\n\nexport type GLUniformType = GLSamplerType | GLCompositeType;\n\nexport type GLSamplerType =\n | GL.SAMPLER_2D\n | GL.SAMPLER_CUBE\n | GL.SAMPLER_3D\n | GL.SAMPLER_2D_SHADOW\n | GL.SAMPLER_2D_ARRAY\n | GL.SAMPLER_2D_ARRAY_SHADOW\n | GL.SAMPLER_CUBE_SHADOW\n | GL.INT_SAMPLER_2D\n | GL.INT_SAMPLER_3D\n | GL.INT_SAMPLER_CUBE\n | GL.INT_SAMPLER_2D_ARRAY\n | GL.UNSIGNED_INT_SAMPLER_2D\n | GL.UNSIGNED_INT_SAMPLER_3D\n | GL.UNSIGNED_INT_SAMPLER_CUBE\n | GL.UNSIGNED_INT_SAMPLER_2D_ARRAY;\n\n// Composite types table\nexport type GLCompositeType =\n | GL.FLOAT\n | GL.FLOAT_VEC2\n | GL.FLOAT_VEC3\n | GL.FLOAT_VEC4\n | GL.INT\n | GL.INT_VEC2\n | GL.INT_VEC3\n | GL.INT_VEC4\n | GL.UNSIGNED_INT\n | GL.UNSIGNED_INT_VEC2\n | GL.UNSIGNED_INT_VEC3\n | GL.UNSIGNED_INT_VEC4\n | GL.BOOL\n | GL.BOOL_VEC2\n | GL.BOOL_VEC3\n | GL.BOOL_VEC4\n | GL.FLOAT_MAT2\n | GL.FLOAT_MAT2x3\n | GL.FLOAT_MAT2x4\n | GL.FLOAT_MAT3x2\n | GL.FLOAT_MAT3\n | GL.FLOAT_MAT3x4\n | GL.FLOAT_MAT4x2\n | GL.FLOAT_MAT4x3\n | GL.FLOAT_MAT4;\n\nexport type GLFunction =\n | GL.NEVER\n | GL.LESS\n | GL.EQUAL\n | GL.LEQUAL\n | GL.GREATER\n | GL.NOTEQUAL\n | GL.GEQUAL\n | GL.ALWAYS;\n\nexport type GLBlendEquation =\n | GL.FUNC_ADD\n | GL.FUNC_SUBTRACT\n | GL.FUNC_REVERSE_SUBTRACT\n | GL.MIN_EXT\n | GL.MAX_EXT;\n\nexport type GLBlendFunction =\n | GL.ZERO\n | GL.ONE\n | GL.SRC_COLOR\n | GL.ONE_MINUS_SRC_COLOR\n | GL.DST_COLOR\n | GL.ONE_MINUS_DST_COLOR\n | GL.SRC_ALPHA\n | GL.ONE_MINUS_SRC_ALPHA\n | GL.DST_ALPHA\n | GL.ONE_MINUS_DST_ALPHA\n | GL.CONSTANT_COLOR\n | GL.ONE_MINUS_CONSTANT_COLOR\n | GL.CONSTANT_ALPHA\n | GL.ONE_MINUS_CONSTANT_ALPHA\n | GL.SRC_ALPHA_SATURATE;\n\nexport type GLStencilOp =\n | GL.KEEP\n | GL.ZERO\n | GL.REPLACE\n | GL.INCR\n | GL.INCR_WRAP\n | GL.DECR\n | GL.DECR_WRAP\n | GL.INVERT;\n\n/** Parameters for textures and samplers */\nexport type GLSamplerParameters = {\n [GL.TEXTURE_WRAP_S]?: GL.CLAMP_TO_EDGE | GL.REPEAT | GL.MIRRORED_REPEAT;\n [GL.TEXTURE_WRAP_T]?: GL.CLAMP_TO_EDGE | GL.REPEAT | GL.MIRRORED_REPEAT;\n [GL.TEXTURE_WRAP_R]?: GL.CLAMP_TO_EDGE | GL.REPEAT | GL.MIRRORED_REPEAT;\n [GL.TEXTURE_MAG_FILTER]?: GL.NEAREST | GL.LINEAR;\n [GL.TEXTURE_MIN_FILTER]?:\n | GL.NEAREST\n | GL.LINEAR\n | GL.NEAREST_MIPMAP_NEAREST\n | GL.NEAREST_MIPMAP_LINEAR\n | GL.LINEAR_MIPMAP_NEAREST\n | GL.LINEAR_MIPMAP_LINEAR;\n [GL.TEXTURE_MIN_LOD]?: number;\n [GL.TEXTURE_MAX_LOD]?: number;\n [GL.TEXTURE_COMPARE_FUNC]?: number; // COMPARE_FUNC);\n [GL.TEXTURE_COMPARE_MODE]?: GL.COMPARE_REF_TO_TEXTURE;\n [GL.TEXTURE_MAX_ANISOTROPY_EXT]?: number; //\n};\n\n/**\n * All global WebGL values set by a variety of setter gl.enable ...\n */\nexport type GLValueParameters = {\n [GL.BLEND]?: boolean;\n [GL.BLEND_COLOR]?: [number, number, number, number] | NumberArray;\n [GL.BLEND_EQUATION_RGB]?: GLBlendEquation;\n [GL.BLEND_EQUATION_ALPHA]?: GLBlendEquation;\n [GL.BLEND_SRC_RGB]?: GLBlendFunction;\n [GL.BLEND_DST_RGB]?: GLBlendFunction;\n [GL.BLEND_SRC_ALPHA]?: GLBlendFunction;\n [GL.BLEND_DST_ALPHA]?: GLBlendFunction;\n [GL.COLOR_CLEAR_VALUE]?: [number, number, number, number] | NumberArray;\n [GL.COLOR_WRITEMASK]?: [boolean, boolean, boolean, boolean] | boolean[];\n [GL.CULL_FACE]?: boolean;\n [GL.CULL_FACE_MODE]?: GL.FRONT | GL.BACK | GL.FRONT_AND_BACK;\n [GL.DEPTH_TEST]?: boolean;\n [GL.DEPTH_CLEAR_VALUE]?: number;\n [GL.DEPTH_FUNC]?: GLFunction;\n [GL.DEPTH_RANGE]?: [number, number] | NumberArray;\n [GL.DEPTH_WRITEMASK]?: boolean;\n [GL.DITHER]?: boolean;\n [GL.FRAGMENT_SHADER_DERIVATIVE_HINT]?: GL.FASTEST | GL.NICEST | GL.DONT_CARE;\n [GL.CURRENT_PROGRAM]?: WebGLProgram | null;\n [GL.FRAMEBUFFER_BINDING]?: WebGLFramebuffer | null;\n [GL.RENDERBUFFER_BINDING]?: WebGLRenderbuffer | null;\n [GL.TRANSFORM_FEEDBACK_BINDING]?: WebGLTransformFeedback | null;\n [GL.VERTEX_ARRAY_BINDING]?: WebGLVertexArrayObject | null;\n [GL.ARRAY_BUFFER_BINDING]?: WebGLBuffer | null;\n [GL.COPY_READ_BUFFER_BINDING]?: WebGLBuffer | null;\n [GL.COPY_WRITE_BUFFER_BINDING]?: WebGLBuffer | null;\n [GL.PIXEL_PACK_BUFFER_BINDING]?: WebGLBuffer | null;\n [GL.PIXEL_UNPACK_BUFFER_BINDING]?: WebGLBuffer | null;\n [GL.TEXTURE_BINDING_2D]?: WebGLTexture | null;\n [GL.TEXTURE_BINDING_2D_ARRAY]?: WebGLTexture | null;\n [GL.TEXTURE_BINDING_3D]?: WebGLTexture | null;\n [GL.TEXTURE_BINDING_CUBE_MAP]?: WebGLTexture | null;\n [GL.FRONT_FACE]?: GL.CW | GL.CCW;\n [GL.GENERATE_MIPMAP_HINT]?: GL.FASTEST | GL.NICEST | GL.DONT_CARE;\n [GL.LINE_WIDTH]?: number;\n [GL.POLYGON_OFFSET_FILL]?: boolean;\n [GL.POLYGON_OFFSET_FACTOR]?: number;\n [GL.POLYGON_OFFSET_UNITS]?: number;\n [GL.SAMPLE_ALPHA_TO_COVERAGE]?: boolean;\n [GL.SAMPLE_COVERAGE]?: boolean;\n [GL.RASTERIZER_DISCARD]?: boolean;\n [GL.SAMPLE_COVERAGE_VALUE]?: number;\n [GL.SAMPLE_COVERAGE_INVERT]?: boolean;\n [GL.SCISSOR_TEST]?: boolean;\n [GL.SCISSOR_BOX]?: [number, number, number, number] | NumberArray;\n [GL.STENCIL_TEST]?: boolean;\n [GL.STENCIL_CLEAR_VALUE]?: number;\n [GL.STENCIL_WRITEMASK]?: number;\n [GL.STENCIL_BACK_WRITEMASK]?: number;\n [GL.STENCIL_FUNC]?: GLFunction;\n [GL.STENCIL_REF]?: GLFunction;\n [GL.STENCIL_VALUE_MASK]?: GLFunction;\n [GL.STENCIL_BACK_FUNC]?: GLFunction;\n [GL.STENCIL_BACK_REF]?: GLFunction;\n [GL.STENCIL_BACK_VALUE_MASK]?: GLFunction;\n [GL.STENCIL_FAIL]?: GLStencilOp;\n [GL.STENCIL_PASS_DEPTH_FAIL]?: GLStencilOp;\n [GL.STENCIL_PASS_DEPTH_PASS]?: GLStencilOp;\n [GL.STENCIL_BACK_FAIL]?: GLStencilOp;\n [GL.STENCIL_BACK_PASS_DEPTH_FAIL]?: GLStencilOp;\n [GL.STENCIL_BACK_PASS_DEPTH_PASS]?: GLStencilOp;\n [GL.VIEWPORT]?: [number, number, number, number] | NumberArray;\n\n // WEBGL1 PIXEL PACK/UNPACK MODES\n [GL.PACK_ALIGNMENT]?: number;\n [GL.UNPACK_ALIGNMENT]?: number;\n [GL.UNPACK_FLIP_Y_WEBGL]?: boolean;\n [GL.UNPACK_PREMULTIPLY_ALPHA_WEBGL]?: boolean;\n [GL.UNPACK_COLORSPACE_CONVERSION_WEBGL]?: GL.NONE | GL.BROWSER_DEFAULT_WEBGL;\n\n // WEBGL2 PIXEL PACK/UNPACK MODES\n // RASTERIZER_DISCARD ...\n [GL.PACK_ROW_LENGTH]?: number;\n [GL.PACK_SKIP_PIXELS]?: number;\n [GL.PACK_SKIP_ROWS]?: number;\n [GL.READ_FRAMEBUFFER_BINDING]?: Framebuffer | null;\n [GL.UNPACK_ROW_LENGTH]?: number;\n [GL.UNPACK_IMAGE_HEIGHT]?: number;\n [GL.UNPACK_SKIP_PIXELS]?: number;\n [GL.UNPACK_SKIP_ROWS]?: number;\n [GL.UNPACK_SKIP_IMAGES]?: number;\n};\n\nexport type GLFunctionParameters = {\n // Function-style setters\n framebuffer?: Framebuffer | null;\n blend?: boolean;\n blendColor?: [number, number, number, number] | NumberArray;\n blendEquation?: GLBlendEquation | [GLBlendEquation, GLBlendEquation];\n blendFunc?:\n | [GLBlendFunction, GLBlendFunction]\n | [GLBlendFunction, GLBlendFunction, GLBlendFunction, GLBlendFunction];\n\n clearColor?: [number, number, number, number] | NumberArray;\n clearDepth?: number;\n clearStencil?: number;\n\n colorMask?: [boolean, boolean, boolean, boolean] | boolean[];\n\n cull?: boolean;\n cullFace?: GL.FRONT | GL.BACK | GL.FRONT_AND_BACK;\n\n depthTest?: boolean;\n depthFunc?: GLFunction;\n depthMask?: boolean;\n depthRange?: [number, number] | NumberArray;\n\n dither?: boolean;\n\n derivativeHint?: GL.FASTEST | GL.NICEST | GL.DONT_CARE;\n\n frontFace?: GL.CW | GL.CCW;\n\n mipmapHint?: GL.FASTEST | GL.NICEST | GL.DONT_CARE;\n\n lineWidth?: number;\n\n polygonOffsetFill?: boolean;\n polygonOffset?: [number, number];\n\n sampleCoverage?: [number, boolean];\n\n scissorTest?: boolean;\n scissor?: [number, number, number, number] | NumberArray;\n\n stencilTest?: boolean;\n stencilMask?: number | [number, number];\n stencilFunc?:\n | [GLFunction, number, number]\n | [GLFunction, number, number, GLFunction, number, number];\n stencilOp?:\n | [GLStencilOp, GLStencilOp, GLStencilOp]\n | [GLStencilOp, GLStencilOp, GLStencilOp, GLStencilOp, GLStencilOp, GLStencilOp];\n viewport?: [number, number, number, number] | NumberArray;\n};\n\n/** WebGL style parameters object (with both GL constants and function style fields) */\nexport type GLParameters = GLValueParameters & GLFunctionParameters;\n"],"file":"webgl.js"}
package/dist/index.d.ts CHANGED
@@ -1,54 +1,33 @@
1
+ import '@luma.gl/api';
1
2
  import './init';
2
- export type { WebGLDeviceProps } from './adapter/webgl-device';
3
- export { default as WebGLDevice, getWebGLDevice } from './adapter/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 { ProgramProps } from './classes/program';
15
- export { default as Program } from './classes/program';
16
- export type { FramebufferProps } from './classes/framebuffer';
17
- export { default as Framebuffer } from './classes/framebuffer';
18
- export type { RenderbufferProps } from './classes/renderbuffer';
19
- export { default as Renderbuffer } from './classes/renderbuffer';
20
- export type { ShaderProps } from './classes/shader';
21
- export { Shader, VertexShader, FragmentShader } from './classes/shader';
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 { setDeviceParameters } from './adapter/converters/set-device-parameters';
3
+ export type { WebGLLimits } from './adapter/device-helpers/device-limits';
4
+ export { registerHeadlessGL } from './context/context/create-headless-context';
5
+ export { default as WebGLDevice } from './adapter/webgl-device';
6
+ export { default as WebGLCanvasContext } from './adapter/webgl-canvas-context';
7
+ export { default as WEBGLResource, default as WebGLResource } from './adapter/objects/webgl-resource';
8
+ export { default as WEBGLBuffer } from './adapter/resources/webgl-buffer';
9
+ export { default as WEBGLTexture } from './adapter/resources/webgl-texture';
10
+ export { default as WEBGLShader } from './adapter/resources/webgl-shader';
11
+ export { default as WEBGLSampler } from './adapter/resources/webgl-sampler';
12
+ export { default as WEBGLFramebuffer } from './adapter/resources/webgl-framebuffer';
13
+ export { default as WEBGLRenderPipeline } from './adapter/resources/webgl-render-pipeline';
14
+ export { default as WEBGLCommandEncoder } from './adapter/resources/webgl-command-encoder';
15
+ export { default as WEBGLRenderPass } from './adapter/resources/webgl-render-pass';
16
+ export type { RenderbufferProps } from './adapter/objects/webgl-renderbuffer';
17
+ export { default as WEBGLRenderbuffer } from './adapter/objects/webgl-renderbuffer';
18
+ export { default as WEBGLVertexArrayObject } from './adapter/objects/webgl-vertex-array-object';
19
+ export { default as Accessor } from './classic/accessor';
20
+ export type { AccessorObject } from './types';
21
+ export type { ClassicBufferProps, ClassicBufferProps as BufferProps } from './classic/buffer';
22
+ export { default as ClassicBuffer, default as Buffer } from './classic/buffer';
36
23
  export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from './context/context/webgl-checks';
37
24
  export { cssToDeviceRatio, cssToDevicePixels } from './context/context/device-pixels';
38
- export type { GLParameters } from './context/parameters/webgl-parameters';
25
+ export { setDeviceParameters, withDeviceParameters } from './adapter/converters/device-parameters';
26
+ export type { GLParameters } from './types/webgl';
39
27
  export { getParameters, setParameters, resetParameters } from './context/parameters/unified-parameter-api';
40
28
  export { withParameters } from './context/state-tracker/with-parameters';
41
29
  export { trackContextState, pushContextState, popContextState } from './context/state-tracker/track-context-state';
42
30
  export { polyfillContext } from './context/polyfill/polyfill-context';
43
- export { parseUniformName, getUniformSetter } from './classes/uniforms';
44
- export { getDebugTableForUniforms } from './debug/debug-uniforms';
45
- export { getDebugTableForVertexArray } from './debug/debug-vertex-array';
46
- export { getDebugTableForProgramConfiguration } from './debug/debug-program-configuration';
47
- export { getProgramBindings } from './helpers/get-program-bindings';
48
- export { lumaStats } from './init';
49
- export { log, assert, uid, isObjectEmpty } from '@luma.gl/api';
50
- export { setPathPrefix, loadFile, loadImage } from '@luma.gl/api';
51
- export type { GLContextOptions } from './_deprecated/context-api';
52
- export { createGLContext, instrumentGLContext, resizeGLContext, hasFeature, hasFeatures, getFeatures, getContextInfo, getGLContextInfo, getContextLimits, getContextDebugInfo } from './_deprecated/context-api';
53
- export { FEATURES } from './_deprecated/features';
31
+ export { getShaderLayout, getProgramBindings } from './adapter/helpers/get-shader-layout';
32
+ export { _checkFloat32ColorAttachment } from './adapter/converters/texture-formats';
54
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,wBAAwB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,WAAW,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAG9E,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAC,MAAM,uCAAuC,CAAC;AAGlG,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAE,M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C,CAAC;AAGrD,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAGpE,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAC,4BAA4B,EAAC,MAAM,sCAAsC,CAAC"}
package/dist/index.js CHANGED
@@ -1,39 +1,28 @@
1
+ import '@luma.gl/api';
1
2
  import './init';
2
- export { default as WebGLDevice, getWebGLDevice } from './adapter/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 { default as Program } from './classes/program';
11
- export { default as Framebuffer } from './classes/framebuffer';
12
- export { default as Renderbuffer } from './classes/renderbuffer';
13
- export { Shader, VertexShader, FragmentShader } from './classes/shader';
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 { setDeviceParameters } from './adapter/converters/set-device-parameters';
3
+ export { registerHeadlessGL } from './context/context/create-headless-context';
4
+ export { default as WebGLDevice } from './adapter/webgl-device';
5
+ export { default as WebGLCanvasContext } from './adapter/webgl-canvas-context';
6
+ export { default as WEBGLResource, default as WebGLResource } from './adapter/objects/webgl-resource';
7
+ export { default as WEBGLBuffer } from './adapter/resources/webgl-buffer';
8
+ export { default as WEBGLTexture } from './adapter/resources/webgl-texture';
9
+ export { default as WEBGLShader } from './adapter/resources/webgl-shader';
10
+ export { default as WEBGLSampler } from './adapter/resources/webgl-sampler';
11
+ export { default as WEBGLFramebuffer } from './adapter/resources/webgl-framebuffer';
12
+ export { default as WEBGLRenderPipeline } from './adapter/resources/webgl-render-pipeline';
13
+ export { default as WEBGLCommandEncoder } from './adapter/resources/webgl-command-encoder';
14
+ export { default as WEBGLRenderPass } from './adapter/resources/webgl-render-pass';
15
+ export { default as WEBGLRenderbuffer } from './adapter/objects/webgl-renderbuffer';
16
+ export { default as WEBGLVertexArrayObject } from './adapter/objects/webgl-vertex-array-object';
17
+ export { default as Accessor } from './classic/accessor';
18
+ export { default as ClassicBuffer, default as Buffer } from './classic/buffer';
23
19
  export { isWebGL, isWebGL2, getWebGL2Context, assertWebGLContext, assertWebGL2Context } from './context/context/webgl-checks';
24
20
  export { cssToDeviceRatio, cssToDevicePixels } from './context/context/device-pixels';
21
+ export { setDeviceParameters, withDeviceParameters } from './adapter/converters/device-parameters';
25
22
  export { getParameters, setParameters, resetParameters } from './context/parameters/unified-parameter-api';
26
23
  export { withParameters } from './context/state-tracker/with-parameters';
27
24
  export { trackContextState, pushContextState, popContextState } from './context/state-tracker/track-context-state';
28
25
  export { polyfillContext } from './context/polyfill/polyfill-context';
29
- export { parseUniformName, getUniformSetter } from './classes/uniforms';
30
- export { getDebugTableForUniforms } from './debug/debug-uniforms';
31
- export { getDebugTableForVertexArray } from './debug/debug-vertex-array';
32
- export { getDebugTableForProgramConfiguration } from './debug/debug-program-configuration';
33
- export { getProgramBindings } from './helpers/get-program-bindings';
34
- export { lumaStats } from './init';
35
- export { log, assert, uid, isObjectEmpty } from '@luma.gl/api';
36
- export { setPathPrefix, loadFile, loadImage } from '@luma.gl/api';
37
- export { createGLContext, instrumentGLContext, resizeGLContext, hasFeature, hasFeatures, getFeatures, getContextInfo, getGLContextInfo, getContextLimits, getContextDebugInfo } from './_deprecated/context-api';
38
- export { FEATURES } from './_deprecated/features';
26
+ export { getShaderLayout, getProgramBindings } from './adapter/helpers/get-shader-layout';
27
+ export { _checkFloat32ColorAttachment } from './adapter/converters/texture-formats';
39
28
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["default","WebGLDevice","getWebGLDevice","requestAnimationFrame","cancelAnimationFrame","cloneTextureFrom","getKeyValue","getKey","Accessor","Buffer","Texture2D","TextureCube","Program","Framebuffer","Renderbuffer","Shader","VertexShader","FragmentShader","clear","clearBuffer","readPixelsToArray","readPixelsToBuffer","copyToDataUrl","copyToImage","copyToTexture","blit","Query","Texture3D","TransformFeedback","VertexArrayObject","VertexArray","UniformBufferLayout","setDeviceParameters","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","cssToDeviceRatio","cssToDevicePixels","getParameters","setParameters","resetParameters","withParameters","trackContextState","pushContextState","popContextState","polyfillContext","parseUniformName","getUniformSetter","getDebugTableForUniforms","getDebugTableForVertexArray","getDebugTableForProgramConfiguration","getProgramBindings","lumaStats","log","assert","uid","isObjectEmpty","setPathPrefix","loadFile","loadImage","createGLContext","instrumentGLContext","resizeGLContext","hasFeature","hasFeatures","getFeatures","getContextInfo","getGLContextInfo","getContextLimits","getContextDebugInfo","FEATURES"],"mappings":"AAOA,OAAO,QAAP;AAIA,SAAQA,OAAO,IAAIC,WAAnB,EAAgCC,cAAhC,QAAqD,wBAArD;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,QA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C;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;AAIA,SACEC,eADF,EAEEC,mBAFF,EAGEC,eAHF,EAIEC,UAJF,EAKEC,WALF,EAMEC,WANF,EAOEC,cAPF,EAQEC,gBARF,EASEC,gBATF,EAUEC,mBAVF,QAWO,2BAXP;AAcA,SAAQC,QAAR,QAAuB,wBAAvB","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 './adapter/webgl-device';\nexport {default as WebGLDevice, getWebGLDevice} from './adapter/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 {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\n// Classic luma.gl classes (For backwards compatibility)\nexport type {ShaderProps} from './classes/shader';\nexport {Shader, VertexShader, FragmentShader} from './classes/shader';\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\nexport {setDeviceParameters} from './adapter/converters/set-device-parameters';\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// HELPERS - EXPERIMENTAL\nexport {getProgramBindings} from './helpers/get-program-bindings';\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// GLTOOLS\nexport type {GLContextOptions} from './_deprecated/context-api';\nexport {\n createGLContext,\n instrumentGLContext,\n resizeGLContext,\n hasFeature,\n hasFeatures,\n getFeatures,\n getContextInfo,\n getGLContextInfo,\n getContextLimits,\n getContextDebugInfo\n} from './_deprecated/context-api';\n\n// Features\nexport {FEATURES} from './_deprecated/features';\n\n// REMOVED in v8.7\n// getShaderInfo,\n// getShaderName\n// getShaderVersion\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["registerHeadlessGL","default","WebGLDevice","WebGLCanvasContext","WEBGLResource","WebGLResource","WEBGLBuffer","WEBGLTexture","WEBGLShader","WEBGLSampler","WEBGLFramebuffer","WEBGLRenderPipeline","WEBGLCommandEncoder","WEBGLRenderPass","WEBGLRenderbuffer","WEBGLVertexArrayObject","Accessor","ClassicBuffer","Buffer","isWebGL","isWebGL2","getWebGL2Context","assertWebGLContext","assertWebGL2Context","cssToDeviceRatio","cssToDevicePixels","setDeviceParameters","withDeviceParameters","getParameters","setParameters","resetParameters","withParameters","trackContextState","pushContextState","popContextState","polyfillContext","getShaderLayout","getProgramBindings","_checkFloat32ColorAttachment"],"mappings":"AAOA,OAAO,cAAP;AACA,OAAO,QAAP;AAKA,SAAQA,kBAAR,QAAiC,2CAAjC;AAGA,SAAQC,OAAO,IAAIC,WAAnB,QAAqC,wBAArC;AACA,SAAQD,OAAO,IAAIE,kBAAnB,QAA4C,gCAA5C;AAGA,SAAQF,OAAO,IAAIG,aAAnB,EAAkCH,OAAO,IAAII,aAA7C,QAAiE,kCAAjE;AACA,SAAQJ,OAAO,IAAIK,WAAnB,QAAqC,kCAArC;AACA,SAAQL,OAAO,IAAIM,YAAnB,QAAsC,mCAAtC;AAEA,SAAQN,OAAO,IAAIO,WAAnB,QAAqC,kCAArC;AACA,SAAQP,OAAO,IAAIQ,YAAnB,QAAsC,mCAAtC;AACA,SAAQR,OAAO,IAAIS,gBAAnB,QAA0C,uCAA1C;AAEA,SAAQT,OAAO,IAAIU,mBAAnB,QAA6C,2CAA7C;AAEA,SAAQV,OAAO,IAAIW,mBAAnB,QAA6C,2CAA7C;AACA,SAAQX,OAAO,IAAIY,eAAnB,QAAyC,uCAAzC;AAKA,SAAQZ,OAAO,IAAIa,iBAAnB,QAA2C,sCAA3C;AACA,SAAQb,OAAO,IAAIc,sBAAnB,QAAgD,6CAAhD;AAGA,SAAQd,OAAO,IAAIe,QAAnB,QAAkC,oBAAlC;AAGA,SAAQf,OAAO,IAAIgB,aAAnB,EAAkChB,OAAO,IAAIiB,MAA7C,QAA0D,kBAA1D;AAEA,SACEC,OADF,EAEEC,QAFF,EAGEC,gBAHF,EAIEC,kBAJF,EAKEC,mBALF,QAMO,gCANP;AASA,SAAQC,gBAAR,EAA0BC,iBAA1B,QAAkD,iCAAlD;AAIA,SAAQC,mBAAR,EAA6BC,oBAA7B,QAAwD,wCAAxD;AAGA,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,eAAR,EAAyBC,kBAAzB,QAAkD,qCAAlD;AACA,SAAQC,4BAAR,QAA2C,sCAA3C","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 '@luma.gl/api';\nimport './init'\n\n// Types\nexport type {WebGLLimits} from './adapter/device-helpers/device-limits';\n\nexport {registerHeadlessGL} from './context/context/create-headless-context';\n\n// WebGL adapter classes\nexport {default as WebGLDevice} from './adapter/webgl-device';\nexport {default as WebGLCanvasContext} from './adapter/webgl-canvas-context';\n\n// WebGL Resource classes\nexport {default as WEBGLResource, default as WebGLResource} from './adapter/objects/webgl-resource';\nexport {default as WEBGLBuffer} from './adapter/resources/webgl-buffer';\nexport {default as WEBGLTexture} from './adapter/resources/webgl-texture';\n// export {default as WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';\nexport {default as WEBGLShader} from './adapter/resources/webgl-shader';\nexport {default as WEBGLSampler} from './adapter/resources/webgl-sampler';\nexport {default as WEBGLFramebuffer} from './adapter/resources/webgl-framebuffer';\n\nexport {default as WEBGLRenderPipeline} from './adapter/resources/webgl-render-pipeline';\n// export {default as WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';\nexport {default as WEBGLCommandEncoder} from './adapter/resources/webgl-command-encoder';\nexport {default as WEBGLRenderPass} from './adapter/resources/webgl-render-pass';\n//export {default as WEBGLComputePass} from './adapter/resources/webgl-compute-pass';\n\n// non-api resources\nexport type {RenderbufferProps} from './adapter/objects/webgl-renderbuffer';\nexport {default as WEBGLRenderbuffer} from './adapter/objects/webgl-renderbuffer';\nexport {default as WEBGLVertexArrayObject} from './adapter/objects/webgl-vertex-array-object';\n\n// WebGL adapter classes (Legacy, will be moved to gltools)\nexport {default as Accessor} from './classic/accessor';\nexport type {AccessorObject} from './types';\nexport type {ClassicBufferProps, ClassicBufferProps as BufferProps} from './classic/buffer';\nexport {default as ClassicBuffer, default as Buffer} from './classic/buffer';\n\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 {setDeviceParameters, withDeviceParameters} from './adapter/converters/device-parameters';\n\nexport type {GLParameters} from './types/webgl';\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// HELPERS - EXPERIMENTAL\nexport {getShaderLayout, getProgramBindings} from './adapter/helpers/get-shader-layout';\nexport {_checkFloat32ColorAttachment} from './adapter/converters/texture-formats';\n"],"file":"index.js"}
package/dist/init.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- import { lumaStats } from '@luma.gl/api';
2
- export { lumaStats };
3
- declare const _default: any;
4
- export default _default;
1
+ export {};
5
2
  //# sourceMappingURL=init.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":""}
package/dist/init.js CHANGED
@@ -1,33 +1,4 @@
1
- import { log } from '@luma.gl/api';
2
- import { isBrowser } from '@probe.gl/env';
3
- import { luma, lumaStats } from '@luma.gl/api';
1
+ import { luma } from '@luma.gl/api';
4
2
  import WebGLDevice from './adapter/webgl-device';
5
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'untranspiled source';
6
- const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
7
-
8
- if (globalThis.luma && globalThis.luma.VERSION !== VERSION) {
9
- throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION, " vs ").concat(VERSION));
10
- }
11
-
12
- if (!globalThis.luma) {
13
- luma.registerDevices([WebGLDevice]);
14
-
15
- if (isBrowser()) {
16
- log.log(1, "luma.gl ".concat(VERSION, " - ").concat(STARTUP_MESSAGE))();
17
- }
18
-
19
- globalThis.luma = globalThis.luma || {
20
- VERSION,
21
- version: VERSION,
22
- log,
23
- stats: lumaStats,
24
- globals: {
25
- modules: {},
26
- nodeIO: {}
27
- }
28
- };
29
- }
30
-
31
- export { lumaStats };
32
- export default globalThis.luma;
3
+ luma.registerDevices([WebGLDevice]);
33
4
  //# sourceMappingURL=init.js.map
package/dist/init.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/init.ts"],"names":["log","isBrowser","luma","lumaStats","WebGLDevice","VERSION","__VERSION__","STARTUP_MESSAGE","globalThis","Error","registerDevices","version","stats","globals","modules","nodeIO"],"mappings":"AAAA,SAAQA,GAAR,QAAkB,cAAlB;AACA,SAAQC,SAAR,QAAwB,eAAxB;AACA,SAAQC,IAAR,EAAcC,SAAd,QAA8B,cAA9B;AACA,OAAOC,WAAP,MAAwB,wBAAxB;AAIA,MAAMC,OAAO,GAAG,OAAOC,WAAP,KAAuB,WAAvB,GAAqCA,WAArC,GAAmD,qBAAnE;AAEA,MAAMC,eAAe,GAAG,qDAAxB;;AAKA,IAAIC,UAAU,CAACN,IAAX,IAAmBM,UAAU,CAACN,IAAX,CAAgBG,OAAhB,KAA4BA,OAAnD,EAA4D;AAC1D,QAAM,IAAII,KAAJ,iDAAmDD,UAAU,CAACN,IAAX,CAAgBG,OAAnE,iBAAiFA,OAAjF,EAAN;AACD;;AAED,IAAI,CAACG,UAAU,CAACN,IAAhB,EAAsB;AACpBA,EAAAA,IAAI,CAACQ,eAAL,CAAqB,CAACN,WAAD,CAArB;;AAEA,MAAIH,SAAS,EAAb,EAAiB;AACfD,IAAAA,GAAG,CAACA,GAAJ,CAAQ,CAAR,oBAAsBK,OAAtB,gBAAmCE,eAAnC;AACD;;AAEDC,EAAAA,UAAU,CAACN,IAAX,GAAkBM,UAAU,CAACN,IAAX,IAAmB;AACnCG,IAAAA,OADmC;AAEnCM,IAAAA,OAAO,EAAEN,OAF0B;AAGnCL,IAAAA,GAHmC;AAOnCY,IAAAA,KAAK,EAAET,SAP4B;AAcnCU,IAAAA,OAAO,EAAE;AACPC,MAAAA,OAAO,EAAE,EADF;AAEPC,MAAAA,MAAM,EAAE;AAFD;AAd0B,GAArC;AAmBD;;AAED,SAAQZ,SAAR;AACA,eAAeK,UAAU,CAACN,IAA1B","sourcesContent":["import {log} from '@luma.gl/api';\nimport {isBrowser} from '@probe.gl/env';\nimport {luma, lumaStats} from '@luma.gl/api';\nimport WebGLDevice from './adapter/webgl-device';\n\n// Version detection using babel plugin\n// @ts-expect-error\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'untranspiled source';\n\nconst STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';\n// Assign luma.log.level in console to control logging: \\\n// 0: none, 1: minimal, 2: verbose, 3: attribute/uniforms, 4: gl logs\n// luma.log.break[], set to gl funcs, luma.log.profile[] set to model names`;\n\nif (globalThis.luma && globalThis.luma.VERSION !== VERSION) {\n throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${VERSION}`);\n}\n\nif (!globalThis.luma) {\n luma.registerDevices([WebGLDevice]);\n\n if (isBrowser()) {\n log.log(1, `luma.gl ${VERSION} - ${STARTUP_MESSAGE}`)();\n }\n\n globalThis.luma = globalThis.luma || {\n VERSION,\n version: VERSION,\n log,\n\n // A global stats object that various components can add information to\n // E.g. see webgl/resource.js\n stats: lumaStats,\n\n // Keep some luma globals in a sub-object\n // This allows us to dynamically detect if certain modules have been\n // included (such as IO and headless) and enable related functionality,\n // without unconditionally requiring and thus bundling big dependencies\n // into the app.\n globals: {\n modules: {},\n nodeIO: {}\n }\n };\n}\n\nexport {lumaStats};\nexport default globalThis.luma;\n"],"file":"init.js"}
1
+ {"version":3,"sources":["../src/init.ts"],"names":["luma","WebGLDevice","registerDevices"],"mappings":"AAAA,SAAQA,IAAR,QAAmB,cAAnB;AACA,OAAOC,WAAP,MAAwB,wBAAxB;AAEAD,IAAI,CAACE,eAAL,CAAqB,CAACD,WAAD,CAArB","sourcesContent":["import {luma} from '@luma.gl/api';\nimport WebGLDevice from './adapter/webgl-device';\n\nluma.registerDevices([WebGLDevice]);\n"],"file":"init.js"}