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

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 (749) hide show
  1. package/README.md +3 -67
  2. package/dist/adapter/converters/device-parameters.d.ts +17 -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} +36 -5
  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 +208 -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 +27 -48
  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 +306 -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 +40 -0
  85. package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -0
  86. package/dist/adapter/resources/webgl-framebuffer.js +265 -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 +19 -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 +400 -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 +13 -20
  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} +274 -229
  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 +58 -77
  113. package/dist/adapter/webgl-device.d.ts.map +1 -1
  114. package/dist/adapter/webgl-device.js +185 -113
  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/{classes/webgl-buffer.js → classic/buffer.js} +53 -51
  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 +1 -0
  132. package/dist/context/context/create-context.d.ts.map +1 -1
  133. package/dist/context/context/create-context.js +12 -0
  134. package/dist/context/context/create-context.js.map +1 -1
  135. package/dist/context/context/device-pixels.d.ts +1 -1
  136. package/dist/context/context/device-pixels.d.ts.map +1 -1
  137. package/dist/context/context/device-pixels.js.map +1 -1
  138. package/dist/context/debug/spector.d.ts +18 -0
  139. package/dist/context/debug/spector.d.ts.map +1 -0
  140. package/dist/context/debug/spector.js +76 -0
  141. package/dist/context/debug/spector.js.map +1 -0
  142. package/dist/context/debug/webgl-developer-tools.d.ts +19 -0
  143. package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -0
  144. package/dist/context/debug/webgl-developer-tools.js +121 -0
  145. package/dist/context/debug/webgl-developer-tools.js.map +1 -0
  146. package/dist/context/parameters/unified-parameter-api.d.ts +3 -2
  147. package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
  148. package/dist/context/parameters/unified-parameter-api.js +4 -4
  149. package/dist/context/parameters/unified-parameter-api.js.map +1 -1
  150. package/dist/context/parameters/webgl-parameter-tables.d.ts +40 -36
  151. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
  152. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
  153. package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
  154. package/dist/context/polyfill/polyfill-context.js +4 -3
  155. package/dist/context/polyfill/polyfill-context.js.map +1 -1
  156. package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
  157. package/dist/context/state-tracker/deep-array-equal.js.map +1 -1
  158. package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
  159. package/dist/context/state-tracker/track-context-state.js +25 -11
  160. package/dist/context/state-tracker/track-context-state.js.map +1 -1
  161. package/dist/es5/adapter/converters/{set-device-parameters.js → device-parameters.js} +37 -5
  162. package/dist/es5/adapter/converters/device-parameters.js.map +1 -0
  163. package/dist/es5/{classes → adapter/converters}/renderbuffer-formats.js +1 -1
  164. package/dist/es5/adapter/converters/renderbuffer-formats.js.map +1 -0
  165. package/dist/es5/adapter/converters/sampler-parameters.js +226 -0
  166. package/dist/es5/adapter/converters/sampler-parameters.js.map +1 -0
  167. package/dist/es5/adapter/converters/texture-formats.js +1031 -0
  168. package/dist/es5/adapter/converters/texture-formats.js.map +1 -0
  169. package/dist/es5/adapter/converters/vertex-formats.js +45 -0
  170. package/dist/es5/adapter/converters/vertex-formats.js.map +1 -0
  171. package/dist/es5/adapter/device-helpers/device-features.js +46 -54
  172. package/dist/es5/adapter/device-helpers/device-features.js.map +1 -1
  173. package/dist/es5/adapter/device-helpers/device-limits.js +1 -1
  174. package/dist/es5/adapter/device-helpers/device-limits.js.map +1 -1
  175. package/dist/es5/adapter/device-helpers/get-device-info.js +7 -7
  176. package/dist/es5/adapter/device-helpers/get-device-info.js.map +1 -1
  177. package/dist/es5/adapter/helpers/attribute-utils.js +91 -0
  178. package/dist/es5/adapter/helpers/attribute-utils.js.map +1 -0
  179. package/dist/es5/{helpers/get-program-bindings.js → adapter/helpers/get-shader-layout.js} +184 -87
  180. package/dist/es5/adapter/helpers/get-shader-layout.js.map +1 -0
  181. package/dist/es5/{webgl-utils → adapter/helpers}/parse-shader-compiler-log.js +0 -0
  182. package/dist/es5/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
  183. package/dist/es5/adapter/helpers/set-uniform.js +125 -0
  184. package/dist/es5/adapter/helpers/set-uniform.js.map +1 -0
  185. package/dist/es5/adapter/helpers/uniforms.js +112 -0
  186. package/dist/es5/adapter/helpers/uniforms.js.map +1 -0
  187. package/dist/es5/{webgl-utils → adapter/objects}/constants-to-keys.js +1 -0
  188. package/dist/es5/adapter/objects/constants-to-keys.js.map +1 -0
  189. package/dist/es5/{classes/renderbuffer.js → adapter/objects/webgl-renderbuffer.js} +48 -98
  190. package/dist/es5/adapter/objects/webgl-renderbuffer.js.map +1 -0
  191. package/dist/es5/{classes → adapter/objects}/webgl-resource.js +8 -3
  192. package/dist/es5/adapter/objects/webgl-resource.js.map +1 -0
  193. package/dist/es5/adapter/objects/webgl-vertex-array-object.js +137 -0
  194. package/dist/es5/adapter/objects/webgl-vertex-array-object.js.map +1 -0
  195. package/dist/es5/adapter/resources/webgl-buffer.js +243 -0
  196. package/dist/es5/adapter/resources/webgl-buffer.js.map +1 -0
  197. package/dist/es5/adapter/resources/webgl-command-buffer.js +96 -0
  198. package/dist/es5/adapter/resources/webgl-command-buffer.js.map +1 -0
  199. package/dist/es5/adapter/resources/webgl-command-encoder.js +98 -0
  200. package/dist/es5/adapter/resources/webgl-command-encoder.js.map +1 -0
  201. package/dist/es5/adapter/resources/webgl-external-texture.js +2 -0
  202. package/dist/{esm/helpers/program-bindings.js.map → es5/adapter/resources/webgl-external-texture.js.map} +1 -1
  203. package/dist/es5/adapter/resources/webgl-framebuffer.js +345 -0
  204. package/dist/es5/adapter/resources/webgl-framebuffer.js.map +1 -0
  205. package/dist/es5/{classes/texture-2d.js → adapter/resources/webgl-render-pass.js} +25 -45
  206. package/dist/es5/adapter/resources/webgl-render-pass.js.map +1 -0
  207. package/dist/es5/adapter/resources/webgl-render-pipeline.js +505 -0
  208. package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +1 -0
  209. package/dist/es5/adapter/resources/webgl-sampler.js +96 -0
  210. package/dist/es5/adapter/resources/webgl-sampler.js.map +1 -0
  211. package/dist/es5/adapter/{webgl-shader.js → resources/webgl-shader.js} +12 -18
  212. package/dist/es5/adapter/resources/webgl-shader.js.map +1 -0
  213. package/dist/es5/{classes/texture.js → adapter/resources/webgl-texture.js} +336 -260
  214. package/dist/es5/adapter/resources/webgl-texture.js.map +1 -0
  215. package/dist/es5/adapter/webgl-canvas-context.js +97 -0
  216. package/dist/es5/adapter/webgl-canvas-context.js.map +1 -0
  217. package/dist/es5/adapter/webgl-device.js +255 -135
  218. package/dist/es5/adapter/webgl-device.js.map +1 -1
  219. package/dist/es5/{classes → classic}/accessor.js +25 -1
  220. package/dist/es5/classic/accessor.js.map +1 -0
  221. package/dist/es5/{classes/webgl-buffer.js → classic/buffer.js} +74 -66
  222. package/dist/es5/classic/buffer.js.map +1 -0
  223. package/dist/es5/{webgl-utils → classic}/typed-array-utils.js +0 -0
  224. package/dist/es5/classic/typed-array-utils.js.map +1 -0
  225. package/dist/es5/context/context/context-state.js +1 -1
  226. package/dist/es5/context/context/context-state.js.map +1 -1
  227. package/dist/es5/context/context/create-context.js +12 -0
  228. package/dist/es5/context/context/create-context.js.map +1 -1
  229. package/dist/es5/context/context/device-pixels.js.map +1 -1
  230. package/dist/es5/context/debug/spector.js +133 -0
  231. package/dist/es5/context/debug/spector.js.map +1 -0
  232. package/dist/es5/context/debug/webgl-developer-tools.js +198 -0
  233. package/dist/es5/context/debug/webgl-developer-tools.js.map +1 -0
  234. package/dist/es5/context/parameters/unified-parameter-api.js +7 -5
  235. package/dist/es5/context/parameters/unified-parameter-api.js.map +1 -1
  236. package/dist/es5/context/parameters/webgl-parameter-tables.js.map +1 -1
  237. package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +1 -1
  238. package/dist/es5/context/polyfill/polyfill-context.js +4 -3
  239. package/dist/es5/context/polyfill/polyfill-context.js.map +1 -1
  240. package/dist/es5/context/state-tracker/deep-array-equal.js.map +1 -1
  241. package/dist/es5/context/state-tracker/track-context-state.js +26 -11
  242. package/dist/es5/context/state-tracker/track-context-state.js.map +1 -1
  243. package/dist/es5/index.js +65 -307
  244. package/dist/es5/index.js.map +1 -1
  245. package/dist/es5/init.js +1 -41
  246. package/dist/es5/init.js.map +1 -1
  247. package/dist/es5/{context/parameters/webgl-parameters.js → types/webgl.js} +1 -1
  248. package/dist/es5/types/webgl.js.map +1 -0
  249. package/dist/esm/adapter/converters/{set-device-parameters.js → device-parameters.js} +36 -5
  250. package/dist/esm/adapter/converters/device-parameters.js.map +1 -0
  251. package/dist/esm/{classes → adapter/converters}/renderbuffer-formats.js +1 -1
  252. package/dist/esm/adapter/converters/renderbuffer-formats.js.map +1 -0
  253. package/dist/esm/adapter/converters/sampler-parameters.js +208 -0
  254. package/dist/esm/adapter/converters/sampler-parameters.js.map +1 -0
  255. package/dist/esm/adapter/converters/texture-formats.js +954 -0
  256. package/dist/esm/adapter/converters/texture-formats.js.map +1 -0
  257. package/dist/esm/adapter/converters/vertex-formats.js +35 -0
  258. package/dist/esm/adapter/converters/vertex-formats.js.map +1 -0
  259. package/dist/esm/adapter/device-helpers/device-features.js +27 -48
  260. package/dist/esm/adapter/device-helpers/device-features.js.map +1 -1
  261. package/dist/esm/adapter/device-helpers/device-limits.js +1 -0
  262. package/dist/esm/adapter/device-helpers/device-limits.js.map +1 -1
  263. package/dist/esm/adapter/device-helpers/get-device-info.js +7 -7
  264. package/dist/esm/adapter/device-helpers/get-device-info.js.map +1 -1
  265. package/dist/esm/adapter/helpers/attribute-utils.js +81 -0
  266. package/dist/esm/adapter/helpers/attribute-utils.js.map +1 -0
  267. package/dist/esm/adapter/helpers/get-shader-layout.js +306 -0
  268. package/dist/esm/adapter/helpers/get-shader-layout.js.map +1 -0
  269. package/dist/{webgl-utils → esm/adapter/helpers}/parse-shader-compiler-log.js +0 -0
  270. package/dist/esm/adapter/helpers/parse-shader-compiler-log.js.map +1 -0
  271. package/dist/esm/adapter/helpers/set-uniform.js +115 -0
  272. package/dist/esm/adapter/helpers/set-uniform.js.map +1 -0
  273. package/dist/esm/adapter/helpers/uniforms.js +99 -0
  274. package/dist/esm/adapter/helpers/uniforms.js.map +1 -0
  275. package/dist/{webgl-utils → esm/adapter/objects}/constants-to-keys.js +1 -0
  276. package/dist/esm/adapter/objects/constants-to-keys.js.map +1 -0
  277. package/dist/{classes/renderbuffer.js → esm/adapter/objects/webgl-renderbuffer.js} +38 -72
  278. package/dist/esm/adapter/objects/webgl-renderbuffer.js.map +1 -0
  279. package/dist/esm/{classes → adapter/objects}/webgl-resource.js +7 -3
  280. package/dist/esm/adapter/objects/webgl-resource.js.map +1 -0
  281. package/dist/esm/adapter/objects/webgl-vertex-array-object.js +84 -0
  282. package/dist/esm/adapter/objects/webgl-vertex-array-object.js.map +1 -0
  283. package/dist/esm/adapter/resources/webgl-buffer.js +164 -0
  284. package/dist/esm/adapter/resources/webgl-buffer.js.map +1 -0
  285. package/dist/esm/adapter/resources/webgl-command-buffer.js +65 -0
  286. package/dist/esm/adapter/resources/webgl-command-buffer.js.map +1 -0
  287. package/dist/esm/adapter/resources/webgl-command-encoder.js +53 -0
  288. package/dist/esm/adapter/resources/webgl-command-encoder.js.map +1 -0
  289. package/dist/esm/adapter/resources/webgl-external-texture.js +2 -0
  290. package/dist/{helpers/program-bindings.js.map → esm/adapter/resources/webgl-external-texture.js.map} +1 -1
  291. package/dist/esm/adapter/resources/webgl-framebuffer.js +265 -0
  292. package/dist/esm/adapter/resources/webgl-framebuffer.js.map +1 -0
  293. package/dist/esm/adapter/resources/webgl-render-pass.js +19 -0
  294. package/dist/esm/adapter/resources/webgl-render-pass.js.map +1 -0
  295. package/dist/esm/adapter/resources/webgl-render-pipeline.js +400 -0
  296. package/dist/esm/adapter/resources/webgl-render-pipeline.js.map +1 -0
  297. package/dist/esm/adapter/resources/webgl-sampler.js +50 -0
  298. package/dist/esm/adapter/resources/webgl-sampler.js.map +1 -0
  299. package/dist/{adapter → esm/adapter/resources}/webgl-shader.js +13 -20
  300. package/dist/esm/adapter/resources/webgl-shader.js.map +1 -0
  301. package/dist/esm/{classes/texture.js → adapter/resources/webgl-texture.js} +274 -229
  302. package/dist/esm/adapter/resources/webgl-texture.js.map +1 -0
  303. package/dist/esm/adapter/webgl-canvas-context.js +54 -0
  304. package/dist/esm/adapter/webgl-canvas-context.js.map +1 -0
  305. package/dist/esm/adapter/webgl-device.js +185 -113
  306. package/dist/esm/adapter/webgl-device.js.map +1 -1
  307. package/dist/esm/{classes → classic}/accessor.js +33 -1
  308. package/dist/esm/classic/accessor.js.map +1 -0
  309. package/dist/esm/{classes/webgl-buffer.js → classic/buffer.js} +53 -51
  310. package/dist/esm/classic/buffer.js.map +1 -0
  311. package/dist/{webgl-utils → esm/classic}/typed-array-utils.js +0 -0
  312. package/dist/esm/classic/typed-array-utils.js.map +1 -0
  313. package/dist/esm/context/context/context-state.js +1 -1
  314. package/dist/esm/context/context/context-state.js.map +1 -1
  315. package/dist/esm/context/context/create-context.js +12 -0
  316. package/dist/esm/context/context/create-context.js.map +1 -1
  317. package/dist/esm/context/context/device-pixels.js.map +1 -1
  318. package/dist/esm/context/debug/spector.js +76 -0
  319. package/dist/esm/context/debug/spector.js.map +1 -0
  320. package/dist/esm/context/debug/webgl-developer-tools.js +121 -0
  321. package/dist/esm/context/debug/webgl-developer-tools.js.map +1 -0
  322. package/dist/esm/context/parameters/unified-parameter-api.js +4 -4
  323. package/dist/esm/context/parameters/unified-parameter-api.js.map +1 -1
  324. package/dist/esm/context/parameters/webgl-parameter-tables.js.map +1 -1
  325. package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +1 -1
  326. package/dist/esm/context/polyfill/polyfill-context.js +4 -3
  327. package/dist/esm/context/polyfill/polyfill-context.js.map +1 -1
  328. package/dist/esm/context/state-tracker/deep-array-equal.js.map +1 -1
  329. package/dist/esm/context/state-tracker/track-context-state.js +25 -11
  330. package/dist/esm/context/state-tracker/track-context-state.js.map +1 -1
  331. package/dist/esm/index.js +19 -31
  332. package/dist/esm/index.js.map +1 -1
  333. package/dist/esm/init.js +2 -31
  334. package/dist/esm/init.js.map +1 -1
  335. package/dist/esm/types/webgl.js +2 -0
  336. package/dist/esm/types/webgl.js.map +1 -0
  337. package/dist/index.d.ts +22 -46
  338. package/dist/index.d.ts.map +1 -1
  339. package/dist/index.js +19 -31
  340. package/dist/index.js.map +1 -1
  341. package/dist/init.d.ts +1 -4
  342. package/dist/init.d.ts.map +1 -1
  343. package/dist/init.js +2 -31
  344. package/dist/init.js.map +1 -1
  345. package/dist/types/webgl.d.ts +144 -0
  346. package/dist/types/webgl.d.ts.map +1 -0
  347. package/dist/types/webgl.js +2 -0
  348. package/dist/types/webgl.js.map +1 -0
  349. package/package.json +5 -5
  350. package/src/adapter/converters/{set-device-parameters.ts → device-parameters.ts} +52 -9
  351. package/src/{classes → adapter/converters}/renderbuffer-formats.ts +1 -1
  352. package/src/adapter/converters/sampler-parameters.ts +175 -0
  353. package/src/adapter/converters/texture-formats.ts +633 -0
  354. package/src/adapter/converters/vertex-formats.ts +22 -0
  355. package/src/adapter/device-helpers/device-features.ts +46 -123
  356. package/src/adapter/device-helpers/device-limits.ts +5 -2
  357. package/src/adapter/device-helpers/get-device-info.ts +8 -8
  358. package/src/adapter/helpers/attribute-utils.ts +61 -0
  359. package/src/adapter/helpers/get-shader-layout.ts +388 -0
  360. package/src/{webgl-utils → adapter/helpers}/parse-shader-compiler-log.ts +0 -0
  361. package/src/adapter/helpers/set-uniform.ts +87 -0
  362. package/src/adapter/helpers/uniforms.ts +110 -0
  363. package/src/{webgl-utils → adapter/objects}/constants-to-keys.ts +6 -3
  364. package/src/adapter/objects/webgl-renderbuffer.ts +104 -0
  365. package/src/{classes → adapter/objects}/webgl-resource.ts +23 -17
  366. package/src/adapter/objects/webgl-vertex-array-object.ts +111 -0
  367. package/src/adapter/resources/webgl-buffer.ts +219 -0
  368. package/src/adapter/resources/webgl-command-buffer.ts +94 -0
  369. package/src/adapter/resources/webgl-command-encoder.ts +58 -0
  370. package/src/adapter/resources/webgl-external-texture.ts +92 -0
  371. package/src/adapter/resources/webgl-framebuffer.ts +279 -0
  372. package/src/adapter/resources/webgl-render-pass.ts +23 -0
  373. package/src/adapter/resources/webgl-render-pipeline.ts +413 -0
  374. package/src/adapter/resources/webgl-sampler.ts +54 -0
  375. package/src/adapter/{webgl-shader.ts → resources/webgl-shader.ts} +14 -20
  376. package/src/adapter/resources/webgl-texture.ts +1023 -0
  377. package/src/adapter/webgl-canvas-context.ts +74 -0
  378. package/src/adapter/webgl-device.ts +229 -285
  379. package/{dist/esm/classes/accessor.ts.disabled → src/classic/accessor.ts} +50 -36
  380. package/src/{classes/webgl-buffer.ts → classic/buffer.ts} +69 -77
  381. package/src/{webgl-utils → classic}/typed-array-utils.ts +3 -1
  382. package/src/context/context/context-state.ts +4 -2
  383. package/src/context/context/create-context.ts +28 -1
  384. package/src/context/context/device-pixels.ts +9 -4
  385. package/src/context/debug/spector.ts +92 -0
  386. package/src/context/debug/webgl-developer-tools.ts +162 -0
  387. package/src/context/parameters/unified-parameter-api.ts +6 -4
  388. package/src/context/parameters/webgl-parameter-tables.ts +38 -36
  389. package/src/context/polyfill/get-parameter-polyfill.ts +1 -1
  390. package/src/context/polyfill/polyfill-context.ts +4 -3
  391. package/src/context/state-tracker/deep-array-equal.ts +1 -1
  392. package/src/context/state-tracker/track-context-state.ts +27 -20
  393. package/src/index.ts +33 -102
  394. package/src/init.ts +2 -46
  395. package/src/types/webgl.ts +283 -0
  396. package/dist/_deprecated/context-api.d.ts +0 -85
  397. package/dist/_deprecated/context-api.d.ts.map +0 -1
  398. package/dist/_deprecated/context-api.js +0 -70
  399. package/dist/_deprecated/context-api.js.map +0 -1
  400. package/dist/_deprecated/features.d.ts +0 -27
  401. package/dist/_deprecated/features.d.ts.map +0 -1
  402. package/dist/_deprecated/features.js +0 -111
  403. package/dist/_deprecated/features.js.map +0 -1
  404. package/dist/adapter/converters/set-device-parameters.d.ts +0 -5
  405. package/dist/adapter/converters/set-device-parameters.d.ts.map +0 -1
  406. package/dist/adapter/converters/set-device-parameters.js.map +0 -1
  407. package/dist/adapter/converters/webgpu-texture-formats.d.ts +0 -281
  408. package/dist/adapter/converters/webgpu-texture-formats.d.ts.map +0 -1
  409. package/dist/adapter/converters/webgpu-texture-formats.js +0 -285
  410. package/dist/adapter/converters/webgpu-texture-formats.js.map +0 -1
  411. package/dist/adapter/webgl-shader.d.ts.map +0 -1
  412. package/dist/adapter/webgl-shader.js.map +0 -1
  413. package/dist/classes/accessor.d.ts +0 -28
  414. package/dist/classes/accessor.d.ts.map +0 -1
  415. package/dist/classes/accessor.js.map +0 -1
  416. package/dist/classes/accessor.ts.disabled +0 -159
  417. package/dist/classes/clear.d.ts +0 -17
  418. package/dist/classes/clear.d.ts.map +0 -1
  419. package/dist/classes/clear.js +0 -105
  420. package/dist/classes/clear.js.map +0 -1
  421. package/dist/classes/copy-and-blit.d.ts +0 -86
  422. package/dist/classes/copy-and-blit.d.ts.map +0 -1
  423. package/dist/classes/copy-and-blit.js +0 -338
  424. package/dist/classes/copy-and-blit.js.map +0 -1
  425. package/dist/classes/framebuffer.d.ts +0 -139
  426. package/dist/classes/framebuffer.d.ts.map +0 -1
  427. package/dist/classes/framebuffer.js +0 -656
  428. package/dist/classes/framebuffer.js.map +0 -1
  429. package/dist/classes/program-configuration.d.ts +0 -24
  430. package/dist/classes/program-configuration.d.ts.map +0 -1
  431. package/dist/classes/program-configuration.js +0 -73
  432. package/dist/classes/program-configuration.js.map +0 -1
  433. package/dist/classes/program.d.ts +0 -66
  434. package/dist/classes/program.d.ts.map +0 -1
  435. package/dist/classes/program.js +0 -379
  436. package/dist/classes/program.js.map +0 -1
  437. package/dist/classes/query.d.ts +0 -27
  438. package/dist/classes/query.d.ts.map +0 -1
  439. package/dist/classes/query.js +0 -145
  440. package/dist/classes/query.js.map +0 -1
  441. package/dist/classes/renderbuffer-formats.d.ts.map +0 -1
  442. package/dist/classes/renderbuffer-formats.js.map +0 -1
  443. package/dist/classes/renderbuffer.d.ts +0 -60
  444. package/dist/classes/renderbuffer.d.ts.map +0 -1
  445. package/dist/classes/renderbuffer.js.map +0 -1
  446. package/dist/classes/shader.d.ts +0 -42
  447. package/dist/classes/shader.d.ts.map +0 -1
  448. package/dist/classes/shader.js +0 -118
  449. package/dist/classes/shader.js.map +0 -1
  450. package/dist/classes/texture-2d.d.ts +0 -9
  451. package/dist/classes/texture-2d.d.ts.map +0 -1
  452. package/dist/classes/texture-2d.js +0 -36
  453. package/dist/classes/texture-2d.js.map +0 -1
  454. package/dist/classes/texture-3d.d.ts +0 -29
  455. package/dist/classes/texture-3d.d.ts.map +0 -1
  456. package/dist/classes/texture-3d.js +0 -76
  457. package/dist/classes/texture-3d.js.map +0 -1
  458. package/dist/classes/texture-cube.d.ts +0 -28
  459. package/dist/classes/texture-cube.d.ts.map +0 -1
  460. package/dist/classes/texture-cube.js +0 -130
  461. package/dist/classes/texture-cube.js.map +0 -1
  462. package/dist/classes/texture-formats.d.ts +0 -37
  463. package/dist/classes/texture-formats.d.ts.map +0 -1
  464. package/dist/classes/texture-formats.js +0 -98
  465. package/dist/classes/texture-formats.js.map +0 -1
  466. package/dist/classes/texture.d.ts +0 -123
  467. package/dist/classes/texture.d.ts.map +0 -1
  468. package/dist/classes/texture.js.map +0 -1
  469. package/dist/classes/transform-feedback.d.ts +0 -33
  470. package/dist/classes/transform-feedback.d.ts.map +0 -1
  471. package/dist/classes/transform-feedback.js +0 -198
  472. package/dist/classes/transform-feedback.js.map +0 -1
  473. package/dist/classes/uniform-buffer-layout.d.ts +0 -17
  474. package/dist/classes/uniform-buffer-layout.d.ts.map +0 -1
  475. package/dist/classes/uniform-buffer-layout.js +0 -104
  476. package/dist/classes/uniform-buffer-layout.js.map +0 -1
  477. package/dist/classes/uniforms.d.ts +0 -37
  478. package/dist/classes/uniforms.d.ts.map +0 -1
  479. package/dist/classes/uniforms.js +0 -250
  480. package/dist/classes/uniforms.js.map +0 -1
  481. package/dist/classes/vertex-array-object.d.ts +0 -76
  482. package/dist/classes/vertex-array-object.d.ts.map +0 -1
  483. package/dist/classes/vertex-array-object.js +0 -261
  484. package/dist/classes/vertex-array-object.js.map +0 -1
  485. package/dist/classes/vertex-array.d.ts +0 -75
  486. package/dist/classes/vertex-array.d.ts.map +0 -1
  487. package/dist/classes/vertex-array.js +0 -408
  488. package/dist/classes/vertex-array.js.map +0 -1
  489. package/dist/classes/webgl-buffer.d.ts.map +0 -1
  490. package/dist/classes/webgl-buffer.js.map +0 -1
  491. package/dist/classes/webgl-resource.d.ts.map +0 -1
  492. package/dist/classes/webgl-resource.js.map +0 -1
  493. package/dist/context/context/get-canvas.d.ts +0 -13
  494. package/dist/context/context/get-canvas.d.ts.map +0 -1
  495. package/dist/context/context/get-canvas.js +0 -31
  496. package/dist/context/context/get-canvas.js.map +0 -1
  497. package/dist/context/context/resize-context.d.ts +0 -20
  498. package/dist/context/context/resize-context.d.ts.map +0 -1
  499. package/dist/context/context/resize-context.js +0 -15
  500. package/dist/context/context/resize-context.js.map +0 -1
  501. package/dist/context/parameters/webgl-parameters.d.ts +0 -144
  502. package/dist/context/parameters/webgl-parameters.d.ts.map +0 -1
  503. package/dist/context/parameters/webgl-parameters.js +0 -2
  504. package/dist/context/parameters/webgl-parameters.js.map +0 -1
  505. package/dist/debug/debug-program-configuration.d.ts +0 -2
  506. package/dist/debug/debug-program-configuration.d.ts.map +0 -1
  507. package/dist/debug/debug-program-configuration.js +0 -40
  508. package/dist/debug/debug-program-configuration.js.map +0 -1
  509. package/dist/debug/debug-uniforms.d.ts +0 -12
  510. package/dist/debug/debug-uniforms.d.ts.map +0 -1
  511. package/dist/debug/debug-uniforms.js +0 -108
  512. package/dist/debug/debug-uniforms.js.map +0 -1
  513. package/dist/debug/debug-vertex-array.d.ts +0 -5
  514. package/dist/debug/debug-vertex-array.d.ts.map +0 -1
  515. package/dist/debug/debug-vertex-array.js +0 -118
  516. package/dist/debug/debug-vertex-array.js.map +0 -1
  517. package/dist/es5/_deprecated/context-api.js +0 -110
  518. package/dist/es5/_deprecated/context-api.js.map +0 -1
  519. package/dist/es5/_deprecated/features.js +0 -118
  520. package/dist/es5/_deprecated/features.js.map +0 -1
  521. package/dist/es5/adapter/converters/set-device-parameters.js.map +0 -1
  522. package/dist/es5/adapter/converters/webgpu-texture-formats.js +0 -296
  523. package/dist/es5/adapter/converters/webgpu-texture-formats.js.map +0 -1
  524. package/dist/es5/adapter/webgl-shader.js.map +0 -1
  525. package/dist/es5/classes/accessor.d.ts +0 -28
  526. package/dist/es5/classes/accessor.js.map +0 -1
  527. package/dist/es5/classes/accessor.ts.disabled +0 -159
  528. package/dist/es5/classes/clear.js +0 -135
  529. package/dist/es5/classes/clear.js.map +0 -1
  530. package/dist/es5/classes/copy-and-blit.js +0 -382
  531. package/dist/es5/classes/copy-and-blit.js.map +0 -1
  532. package/dist/es5/classes/framebuffer.js +0 -807
  533. package/dist/es5/classes/framebuffer.js.map +0 -1
  534. package/dist/es5/classes/program-configuration.js +0 -119
  535. package/dist/es5/classes/program-configuration.js.map +0 -1
  536. package/dist/es5/classes/program.js +0 -471
  537. package/dist/es5/classes/program.js.map +0 -1
  538. package/dist/es5/classes/query.js +0 -222
  539. package/dist/es5/classes/query.js.map +0 -1
  540. package/dist/es5/classes/renderbuffer-formats.js.map +0 -1
  541. package/dist/es5/classes/renderbuffer.js.map +0 -1
  542. package/dist/es5/classes/shader.js +0 -195
  543. package/dist/es5/classes/shader.js.map +0 -1
  544. package/dist/es5/classes/texture-2d.js.map +0 -1
  545. package/dist/es5/classes/texture-3d.js +0 -142
  546. package/dist/es5/classes/texture-3d.js.map +0 -1
  547. package/dist/es5/classes/texture-cube.js +0 -202
  548. package/dist/es5/classes/texture-cube.js.map +0 -1
  549. package/dist/es5/classes/texture-formats.js +0 -87
  550. package/dist/es5/classes/texture-formats.js.map +0 -1
  551. package/dist/es5/classes/texture.js.map +0 -1
  552. package/dist/es5/classes/transform-feedback.js +0 -267
  553. package/dist/es5/classes/transform-feedback.js.map +0 -1
  554. package/dist/es5/classes/uniform-buffer-layout.js +0 -130
  555. package/dist/es5/classes/uniform-buffer-layout.js.map +0 -1
  556. package/dist/es5/classes/uniforms.js +0 -232
  557. package/dist/es5/classes/uniforms.js.map +0 -1
  558. package/dist/es5/classes/vertex-array-object.js +0 -337
  559. package/dist/es5/classes/vertex-array-object.js.map +0 -1
  560. package/dist/es5/classes/vertex-array.js +0 -465
  561. package/dist/es5/classes/vertex-array.js.map +0 -1
  562. package/dist/es5/classes/webgl-buffer.js.map +0 -1
  563. package/dist/es5/classes/webgl-resource.js.map +0 -1
  564. package/dist/es5/context/context/get-canvas.js +0 -40
  565. package/dist/es5/context/context/get-canvas.js.map +0 -1
  566. package/dist/es5/context/context/resize-context.js +0 -23
  567. package/dist/es5/context/context/resize-context.js.map +0 -1
  568. package/dist/es5/context/parameters/webgl-parameters.js.map +0 -1
  569. package/dist/es5/debug/debug-program-configuration.js +0 -76
  570. package/dist/es5/debug/debug-program-configuration.js.map +0 -1
  571. package/dist/es5/debug/debug-uniforms.js +0 -156
  572. package/dist/es5/debug/debug-uniforms.js.map +0 -1
  573. package/dist/es5/debug/debug-vertex-array.js +0 -126
  574. package/dist/es5/debug/debug-vertex-array.js.map +0 -1
  575. package/dist/es5/helpers/get-program-bindings.js.map +0 -1
  576. package/dist/es5/helpers/program-bindings.js +0 -2
  577. package/dist/es5/types/accessor.d.ts +0 -29
  578. package/dist/es5/webgl-utils/attribute-utils.js +0 -186
  579. package/dist/es5/webgl-utils/attribute-utils.js.map +0 -1
  580. package/dist/es5/webgl-utils/constants-to-keys.js.map +0 -1
  581. package/dist/es5/webgl-utils/format-utils.js +0 -58
  582. package/dist/es5/webgl-utils/format-utils.js.map +0 -1
  583. package/dist/es5/webgl-utils/get-error.js +0 -49
  584. package/dist/es5/webgl-utils/get-error.js.map +0 -1
  585. package/dist/es5/webgl-utils/index.js +0 -74
  586. package/dist/es5/webgl-utils/index.js.map +0 -1
  587. package/dist/es5/webgl-utils/parse-shader-compiler-log.js.map +0 -1
  588. package/dist/es5/webgl-utils/request-animation-frame.js +0 -16
  589. package/dist/es5/webgl-utils/request-animation-frame.js.map +0 -1
  590. package/dist/es5/webgl-utils/texture-utils.js +0 -61
  591. package/dist/es5/webgl-utils/texture-utils.js.map +0 -1
  592. package/dist/es5/webgl-utils/typed-array-utils.js.map +0 -1
  593. package/dist/esm/_deprecated/context-api.js +0 -70
  594. package/dist/esm/_deprecated/context-api.js.map +0 -1
  595. package/dist/esm/_deprecated/features.js +0 -111
  596. package/dist/esm/_deprecated/features.js.map +0 -1
  597. package/dist/esm/adapter/converters/set-device-parameters.js.map +0 -1
  598. package/dist/esm/adapter/converters/webgpu-texture-formats.js +0 -285
  599. package/dist/esm/adapter/converters/webgpu-texture-formats.js.map +0 -1
  600. package/dist/esm/adapter/webgl-shader.js.map +0 -1
  601. package/dist/esm/classes/accessor.d.ts +0 -28
  602. package/dist/esm/classes/accessor.js.map +0 -1
  603. package/dist/esm/classes/clear.js +0 -105
  604. package/dist/esm/classes/clear.js.map +0 -1
  605. package/dist/esm/classes/copy-and-blit.js +0 -338
  606. package/dist/esm/classes/copy-and-blit.js.map +0 -1
  607. package/dist/esm/classes/framebuffer.js +0 -656
  608. package/dist/esm/classes/framebuffer.js.map +0 -1
  609. package/dist/esm/classes/program-configuration.js +0 -73
  610. package/dist/esm/classes/program-configuration.js.map +0 -1
  611. package/dist/esm/classes/program.js +0 -379
  612. package/dist/esm/classes/program.js.map +0 -1
  613. package/dist/esm/classes/query.js +0 -145
  614. package/dist/esm/classes/query.js.map +0 -1
  615. package/dist/esm/classes/renderbuffer-formats.js.map +0 -1
  616. package/dist/esm/classes/renderbuffer.js.map +0 -1
  617. package/dist/esm/classes/shader.js +0 -118
  618. package/dist/esm/classes/shader.js.map +0 -1
  619. package/dist/esm/classes/texture-2d.js +0 -36
  620. package/dist/esm/classes/texture-2d.js.map +0 -1
  621. package/dist/esm/classes/texture-3d.js +0 -76
  622. package/dist/esm/classes/texture-3d.js.map +0 -1
  623. package/dist/esm/classes/texture-cube.js +0 -130
  624. package/dist/esm/classes/texture-cube.js.map +0 -1
  625. package/dist/esm/classes/texture-formats.js +0 -98
  626. package/dist/esm/classes/texture-formats.js.map +0 -1
  627. package/dist/esm/classes/texture.js.map +0 -1
  628. package/dist/esm/classes/transform-feedback.js +0 -198
  629. package/dist/esm/classes/transform-feedback.js.map +0 -1
  630. package/dist/esm/classes/uniform-buffer-layout.js +0 -104
  631. package/dist/esm/classes/uniform-buffer-layout.js.map +0 -1
  632. package/dist/esm/classes/uniforms.js +0 -250
  633. package/dist/esm/classes/uniforms.js.map +0 -1
  634. package/dist/esm/classes/vertex-array-object.js +0 -261
  635. package/dist/esm/classes/vertex-array-object.js.map +0 -1
  636. package/dist/esm/classes/vertex-array.js +0 -408
  637. package/dist/esm/classes/vertex-array.js.map +0 -1
  638. package/dist/esm/classes/webgl-buffer.js.map +0 -1
  639. package/dist/esm/classes/webgl-resource.js.map +0 -1
  640. package/dist/esm/context/context/get-canvas.js +0 -31
  641. package/dist/esm/context/context/get-canvas.js.map +0 -1
  642. package/dist/esm/context/context/resize-context.js +0 -15
  643. package/dist/esm/context/context/resize-context.js.map +0 -1
  644. package/dist/esm/context/parameters/webgl-parameters.js +0 -2
  645. package/dist/esm/context/parameters/webgl-parameters.js.map +0 -1
  646. package/dist/esm/debug/debug-program-configuration.js +0 -40
  647. package/dist/esm/debug/debug-program-configuration.js.map +0 -1
  648. package/dist/esm/debug/debug-uniforms.js +0 -108
  649. package/dist/esm/debug/debug-uniforms.js.map +0 -1
  650. package/dist/esm/debug/debug-vertex-array.js +0 -118
  651. package/dist/esm/debug/debug-vertex-array.js.map +0 -1
  652. package/dist/esm/helpers/get-program-bindings.js +0 -228
  653. package/dist/esm/helpers/get-program-bindings.js.map +0 -1
  654. package/dist/esm/helpers/program-bindings.js +0 -2
  655. package/dist/esm/types/accessor.d.ts +0 -29
  656. package/dist/esm/webgl-utils/attribute-utils.js +0 -182
  657. package/dist/esm/webgl-utils/attribute-utils.js.map +0 -1
  658. package/dist/esm/webgl-utils/constants-to-keys.js.map +0 -1
  659. package/dist/esm/webgl-utils/format-utils.js +0 -45
  660. package/dist/esm/webgl-utils/format-utils.js.map +0 -1
  661. package/dist/esm/webgl-utils/get-error.js +0 -41
  662. package/dist/esm/webgl-utils/get-error.js.map +0 -1
  663. package/dist/esm/webgl-utils/index.js +0 -5
  664. package/dist/esm/webgl-utils/index.js.map +0 -1
  665. package/dist/esm/webgl-utils/parse-shader-compiler-log.js.map +0 -1
  666. package/dist/esm/webgl-utils/request-animation-frame.js +0 -7
  667. package/dist/esm/webgl-utils/request-animation-frame.js.map +0 -1
  668. package/dist/esm/webgl-utils/texture-utils.js +0 -48
  669. package/dist/esm/webgl-utils/texture-utils.js.map +0 -1
  670. package/dist/esm/webgl-utils/typed-array-utils.js.map +0 -1
  671. package/dist/helpers/get-program-bindings.d.ts +0 -8
  672. package/dist/helpers/get-program-bindings.d.ts.map +0 -1
  673. package/dist/helpers/get-program-bindings.js +0 -228
  674. package/dist/helpers/get-program-bindings.js.map +0 -1
  675. package/dist/helpers/program-bindings.d.ts +0 -41
  676. package/dist/helpers/program-bindings.d.ts.map +0 -1
  677. package/dist/helpers/program-bindings.js +0 -2
  678. package/dist/types/accessor.d.ts +0 -29
  679. package/dist/webgl-utils/attribute-utils.d.ts +0 -18
  680. package/dist/webgl-utils/attribute-utils.d.ts.map +0 -1
  681. package/dist/webgl-utils/attribute-utils.js +0 -182
  682. package/dist/webgl-utils/attribute-utils.js.map +0 -1
  683. package/dist/webgl-utils/constants-to-keys.d.ts +0 -4
  684. package/dist/webgl-utils/constants-to-keys.d.ts.map +0 -1
  685. package/dist/webgl-utils/constants-to-keys.js.map +0 -1
  686. package/dist/webgl-utils/format-utils.d.ts +0 -3
  687. package/dist/webgl-utils/format-utils.d.ts.map +0 -1
  688. package/dist/webgl-utils/format-utils.js +0 -45
  689. package/dist/webgl-utils/format-utils.js.map +0 -1
  690. package/dist/webgl-utils/get-error.d.ts +0 -3
  691. package/dist/webgl-utils/get-error.d.ts.map +0 -1
  692. package/dist/webgl-utils/get-error.js +0 -41
  693. package/dist/webgl-utils/get-error.js.map +0 -1
  694. package/dist/webgl-utils/index.d.ts +0 -5
  695. package/dist/webgl-utils/index.d.ts.map +0 -1
  696. package/dist/webgl-utils/index.js +0 -5
  697. package/dist/webgl-utils/index.js.map +0 -1
  698. package/dist/webgl-utils/parse-shader-compiler-log.d.ts.map +0 -1
  699. package/dist/webgl-utils/parse-shader-compiler-log.js.map +0 -1
  700. package/dist/webgl-utils/request-animation-frame.d.ts +0 -4
  701. package/dist/webgl-utils/request-animation-frame.d.ts.map +0 -1
  702. package/dist/webgl-utils/request-animation-frame.js +0 -7
  703. package/dist/webgl-utils/request-animation-frame.js.map +0 -1
  704. package/dist/webgl-utils/texture-utils.d.ts +0 -15
  705. package/dist/webgl-utils/texture-utils.d.ts.map +0 -1
  706. package/dist/webgl-utils/texture-utils.js +0 -48
  707. package/dist/webgl-utils/texture-utils.js.map +0 -1
  708. package/dist/webgl-utils/typed-array-utils.d.ts.map +0 -1
  709. package/dist/webgl-utils/typed-array-utils.js.map +0 -1
  710. package/src/.DS_Store +0 -0
  711. package/src/_deprecated/context-api.ts +0 -140
  712. package/src/_deprecated/features.ts +0 -159
  713. package/src/adapter/converters/webgpu-texture-formats.ts +0 -167
  714. package/src/classes/accessor.d.ts +0 -28
  715. package/src/classes/accessor.js +0 -129
  716. package/src/classes/accessor.ts.disabled +0 -159
  717. package/src/classes/clear.ts +0 -108
  718. package/src/classes/copy-and-blit.ts +0 -460
  719. package/src/classes/framebuffer.ts +0 -763
  720. package/src/classes/program-configuration.ts +0 -77
  721. package/src/classes/program.ts +0 -431
  722. package/src/classes/query.ts +0 -171
  723. package/src/classes/renderbuffer.ts +0 -154
  724. package/src/classes/shader.ts +0 -129
  725. package/src/classes/texture-2d.ts +0 -35
  726. package/src/classes/texture-3d.ts +0 -123
  727. package/src/classes/texture-cube.ts +0 -162
  728. package/src/classes/texture-formats.ts +0 -171
  729. package/src/classes/texture.ts +0 -965
  730. package/src/classes/transform-feedback.ts +0 -191
  731. package/src/classes/uniform-buffer-layout.ts +0 -113
  732. package/src/classes/uniforms.ts +0 -394
  733. package/src/classes/vertex-array-object.ts +0 -339
  734. package/src/classes/vertex-array.ts +0 -484
  735. package/src/context/context/get-canvas.ts +0 -37
  736. package/src/context/context/resize-context.ts +0 -37
  737. package/src/context/parameters/webgl-parameters.ts +0 -197
  738. package/src/debug/debug-program-configuration.ts +0 -32
  739. package/src/debug/debug-uniforms.ts +0 -100
  740. package/src/debug/debug-vertex-array.ts +0 -123
  741. package/src/helpers/get-program-bindings.ts +0 -244
  742. package/src/helpers/program-bindings.ts +0 -46
  743. package/src/types/accessor.d.ts +0 -29
  744. package/src/webgl-utils/attribute-utils.ts +0 -171
  745. package/src/webgl-utils/format-utils.ts +0 -43
  746. package/src/webgl-utils/get-error.ts +0 -56
  747. package/src/webgl-utils/index.ts +0 -12
  748. package/src/webgl-utils/request-animation-frame.ts +0 -14
  749. package/src/webgl-utils/texture-utils.ts +0 -60
@@ -1,14 +1,13 @@
1
- import { Buffer, BufferProps } from '@luma.gl/api';
1
+ import type { Device, BufferProps, TypedArray } from '@luma.gl/api';
2
+ import GL from '@luma.gl/constants';
2
3
  import { AccessorObject } from '../types';
3
4
  import Accessor from './accessor';
4
- import WebGLDevice from '../adapter/webgl-device';
5
+ import WEBGLBuffer from '../adapter/resources/webgl-buffer';
5
6
  /** WebGL Buffer interface */
6
- export declare type WebGLBufferProps = BufferProps & {
7
+ export declare type ClassicBufferProps = BufferProps & {
7
8
  handle?: WebGLBuffer;
8
- data?: any;
9
- byteLength?: number;
10
9
  target?: number;
11
- usage?: number;
10
+ webglUsage?: number;
12
11
  accessor?: AccessorObject;
13
12
  /** @deprecated */
14
13
  index?: number;
@@ -20,29 +19,28 @@ export declare type WebGLBufferProps = BufferProps & {
20
19
  type?: number;
21
20
  };
22
21
  /** WebGL Buffer interface */
23
- export default class WEBGLBuffer extends Buffer {
24
- readonly device: WebGLDevice;
25
- readonly gl: WebGLRenderingContext;
26
- readonly gl2: WebGL2RenderingContext | null;
27
- readonly handle: WebGLBuffer;
28
- target: number;
22
+ export default class ClassicBuffer extends WEBGLBuffer {
29
23
  usage: number;
30
- byteLength: number;
31
- bytesUsed: number;
32
24
  accessor: Accessor;
33
- debugData: any;
34
- constructor(gl: WebGLRenderingContext, props?: BufferProps);
35
- constructor(gl: WebGLRenderingContext, data: ArrayBufferView | number[]);
36
- constructor(gl: WebGLRenderingContext, byteLength: number);
25
+ constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);
26
+ constructor(device: Device | WebGLRenderingContext, data: ArrayBufferView | number[]);
27
+ constructor(device: Device | WebGLRenderingContext, byteLength: number);
37
28
  destroy(): void;
38
- getElementCount(accessor?: Accessor): number;
39
- getVertexCount(accessor?: Accessor): number;
40
- initialize(props?: BufferProps): this;
41
- setProps(props: BufferProps): this;
42
- setAccessor(accessor: any): this;
43
- reallocate(byteLength: any): boolean;
44
- setData(props: any): this;
45
- subData(props: any): this;
29
+ write(data: TypedArray, byteOffset?: number): void;
30
+ getElementCount(accessor?: AccessorObject): number;
31
+ getVertexCount(accessor?: AccessorObject): number;
32
+ initialize(props?: ClassicBufferProps): this;
33
+ setProps(props: ClassicBufferProps): this;
34
+ setAccessor(accessor: AccessorObject | Accessor): this;
35
+ reallocate(byteLength: number): boolean;
36
+ setData(props: ClassicBufferProps): this;
37
+ subData(options: TypedArray | {
38
+ data: TypedArray;
39
+ offset?: number;
40
+ srcOffset?: number;
41
+ byteLength?: number;
42
+ length?: number;
43
+ }): this;
46
44
  /**
47
45
  * Copies part of the data of another buffer into this buffer
48
46
  * @note WEBGL2 ONLY
@@ -86,15 +84,12 @@ export default class WEBGLBuffer extends Buffer {
86
84
  };
87
85
  invalidateDebugData(): void;
88
86
  _setData(data: any, offset?: number, byteLength?: number): this;
89
- _setByteLength(byteLength: number, usage?: number): this;
87
+ _setByteLength(byteLength: number, webglUsage?: number): this;
90
88
  _getTarget(): number;
91
- _getAvailableElementCount(srcByteOffset: any): number;
89
+ _getAvailableElementCount(srcByteOffset: number): number;
92
90
  _inferType(data: any): void;
93
- getParameter(pname: any): any;
91
+ getParameter(pname: GL): any;
94
92
  /** @deprecated Use Buffer.accessor.type */
95
93
  get type(): number;
96
- get bytes(): number;
97
- setByteLength(byteLength: any): boolean;
98
- updateAccessor(opts: any): this;
99
94
  }
100
- //# sourceMappingURL=webgl-buffer.d.ts.map
95
+ //# sourceMappingURL=buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/classic/buffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEpC,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAIlC,OAAO,WAAW,MAAM,mCAAmC,CAAC;AAoD5D,6BAA6B;AAC7B,oBAAY,kBAAkB,GAAG,WAAW,GAAG;IAC7C,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,6BAA6B;AAC7B,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAA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B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,GAAG;IAsCP;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAC,GAAG,IAAI;IAwBhF,MAAM,CAAC,OAAO,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAA;KAAC,GAAG,IAAI;IAcnD,YAAY,IAAI;QACd,IAAI,EAAE,GAAG,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;KAClB;IAQD,mBAAmB;IAOnB,QAAQ,CAAC,IAAI,KAAA,EAAE,MAAM,GAAE,MAAU,EAAE,UAAU,GAAE,MAAiC,GAAG,IAAI;IAwBvF,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,SAAkB,GAAG,IAAI;IA8BtE,UAAU;IAKV,yBAAyB,CAAC,aAAa,EAAE,MAAM;IAQ/C,UAAU,CAAC,IAAI,KAAA;IAQf,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,GAAG;IAQ5B,2CAA2C;IAC3C,IAAI,IAAI,WAEP;CACF"}
@@ -1,11 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import { log, assert, checkProps } from '@luma.gl/api';
3
- import { Buffer } from '@luma.gl/api';
2
+ import { assert, checkProps } from '@luma.gl/api';
4
3
  import GL from '@luma.gl/constants';
5
- import { getWebGL2Context, assertWebGL2Context } from '../context/context/webgl-checks';
4
+ import { assertWebGL2Context } from '../context/context/webgl-checks';
6
5
  import Accessor from './accessor';
7
- import { getGLTypeFromTypedArray, getTypedArrayFromGLType } from '../webgl-utils/typed-array-utils';
6
+ import { getGLTypeFromTypedArray, getTypedArrayFromGLType } from './typed-array-utils';
8
7
  import WebGLDevice from '../adapter/webgl-device';
8
+ import WEBGLBuffer from '../adapter/resources/webgl-buffer';
9
9
  const DEBUG_DATA_LENGTH = 10;
10
10
  const DEPRECATED_PROPS = {
11
11
  offset: 'accessor.offset',
@@ -28,36 +28,47 @@ const PROP_CHECKS_INITIALIZE = {
28
28
  const PROP_CHECKS_SET_PROPS = {
29
29
  removedProps: DEPRECATED_PROPS
30
30
  };
31
- export default class WEBGLBuffer extends Buffer {
32
- constructor(gl, props = {}) {
33
- super(WebGLDevice.attach(gl), props);
34
31
 
35
- _defineProperty(this, "device", void 0);
32
+ function getWEBGLBufferProps(props) {
33
+ if (ArrayBuffer.isView(props)) {
34
+ return {
35
+ data: props
36
+ };
37
+ } else if (typeof props === 'number') {
38
+ return {
39
+ byteLength: props
40
+ };
41
+ }
36
42
 
37
- _defineProperty(this, "gl", void 0);
43
+ props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);
44
+ const bufferProps = { ...props
45
+ };
38
46
 
39
- _defineProperty(this, "gl2", void 0);
47
+ if (bufferProps.offset) {
48
+ bufferProps.byteOffset = bufferProps.offset;
49
+ }
40
50
 
41
- _defineProperty(this, "handle", void 0);
51
+ return bufferProps;
52
+ }
42
53
 
43
- _defineProperty(this, "target", void 0);
54
+ export default class ClassicBuffer extends WEBGLBuffer {
55
+ constructor(device, props = {}) {
56
+ super(WebGLDevice.attach(device), getWEBGLBufferProps(props));
44
57
 
45
58
  _defineProperty(this, "usage", void 0);
46
59
 
47
- _defineProperty(this, "byteLength", void 0);
48
-
49
- _defineProperty(this, "bytesUsed", void 0);
50
-
51
60
  _defineProperty(this, "accessor", void 0);
52
61
 
53
- _defineProperty(this, "debugData", void 0);
62
+ this.setAccessor(Object.assign({}, props, props.accessor));
63
+
64
+ if (this.props.data) {
65
+ const type = getGLTypeFromTypedArray(this.props.data);
66
+ assert(type);
67
+ this.setAccessor(new Accessor(this.accessor, {
68
+ type
69
+ }));
70
+ }
54
71
 
55
- this.gl = gl;
56
- this.gl2 = getWebGL2Context(gl);
57
- const handle = typeof props === 'object' ? props.handle : undefined;
58
- this.handle = handle || this.gl.createBuffer();
59
- this.target = props.target || (this.gl.webgl2 ? GL.COPY_READ_BUFFER : GL.ARRAY_BUFFER);
60
- this.initialize(props);
61
72
  Object.seal(this);
62
73
  }
63
74
 
@@ -70,6 +81,13 @@ export default class WEBGLBuffer extends Buffer {
70
81
  }
71
82
  }
72
83
 
84
+ write(data, byteOffset) {
85
+ this.subData({
86
+ data,
87
+ offset: byteOffset
88
+ });
89
+ }
90
+
73
91
  getElementCount(accessor = this.accessor) {
74
92
  return Math.round(this.byteLength / Accessor.getBytesPerElement(accessor));
75
93
  }
@@ -92,7 +110,7 @@ export default class WEBGLBuffer extends Buffer {
92
110
  }
93
111
 
94
112
  props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);
95
- this.usage = props.usage || GL.STATIC_DRAW;
113
+ this.webglUsage = props.webglUsage || GL.STATIC_DRAW;
96
114
  this.debugData = null;
97
115
  this.setAccessor(Object.assign({}, props, props.accessor));
98
116
 
@@ -137,10 +155,10 @@ export default class WEBGLBuffer extends Buffer {
137
155
  return this.initialize(props);
138
156
  }
139
157
 
140
- subData(props) {
141
- if (ArrayBuffer.isView(props)) {
142
- props = {
143
- data: props
158
+ subData(options) {
159
+ if (ArrayBuffer.isView(options)) {
160
+ options = {
161
+ data: options
144
162
  };
145
163
  }
146
164
 
@@ -148,8 +166,8 @@ export default class WEBGLBuffer extends Buffer {
148
166
  data,
149
167
  offset = 0,
150
168
  srcOffset = 0
151
- } = props;
152
- const byteLength = props.byteLength || props.length;
169
+ } = options;
170
+ const byteLength = options.byteLength || options.length;
153
171
  assert(data);
154
172
  const target = this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;
155
173
  this.gl.bindBuffer(target, this.handle);
@@ -294,7 +312,7 @@ export default class WEBGLBuffer extends Buffer {
294
312
  const target = this._getTarget();
295
313
 
296
314
  this.gl.bindBuffer(target, this.handle);
297
- this.gl.bufferData(target, byteLength, this.usage);
315
+ this.gl.bufferData(target, byteLength, this.webglUsage);
298
316
  this.gl.bufferSubData(target, offset, data);
299
317
  this.gl.bindBuffer(target, null);
300
318
  this.debugData = data.slice(0, DEBUG_DATA_LENGTH);
@@ -309,7 +327,7 @@ export default class WEBGLBuffer extends Buffer {
309
327
  return this;
310
328
  }
311
329
 
312
- _setByteLength(byteLength, usage = this.usage) {
330
+ _setByteLength(byteLength, webglUsage = this.webglUsage) {
313
331
  assert(byteLength >= 0);
314
332
  this.trackDeallocatedMemory();
315
333
  let data = byteLength;
@@ -321,9 +339,9 @@ export default class WEBGLBuffer extends Buffer {
321
339
  const target = this._getTarget();
322
340
 
323
341
  this.gl.bindBuffer(target, this.handle);
324
- this.gl.bufferData(target, data, usage);
342
+ this.gl.bufferData(target, data, webglUsage);
325
343
  this.gl.bindBuffer(target, null);
326
- this.usage = usage;
344
+ this.webglUsage = webglUsage;
327
345
  this.debugData = null;
328
346
  this.bytesUsed = byteLength;
329
347
  this.byteLength = byteLength;
@@ -362,21 +380,5 @@ export default class WEBGLBuffer extends Buffer {
362
380
  return this.accessor.type;
363
381
  }
364
382
 
365
- get bytes() {
366
- log.deprecated('Buffer.bytes', 'Buffer.byteLength')();
367
- return this.byteLength;
368
- }
369
-
370
- setByteLength(byteLength) {
371
- log.deprecated('setByteLength', 'reallocate')();
372
- return this.reallocate(byteLength);
373
- }
374
-
375
- updateAccessor(opts) {
376
- log.deprecated('updateAccessor(...)', 'setAccessor(new Accessor(buffer.accessor, ...)')();
377
- this.accessor = new Accessor(this.accessor, opts);
378
- return this;
379
- }
380
-
381
383
  }
382
- //# sourceMappingURL=webgl-buffer.js.map
384
+ //# sourceMappingURL=buffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/classic/buffer.ts"],"names":["assert","checkProps","GL","assertWebGL2Context","Accessor","getGLTypeFromTypedArray","getTypedArrayFromGLType","WebGLDevice","WEBGLBuffer","DEBUG_DATA_LENGTH","DEPRECATED_PROPS","offset","stride","type","size","divisor","normalized","integer","instanced","isInstanced","PROP_CHECKS_INITIALIZE","removedProps","replacedProps","bytes","deprecatedProps","PROP_CHECKS_SET_PROPS","getWEBGLBufferProps","props","ArrayBuffer","isView","data","byteLength","bufferProps","byteOffset","ClassicBuffer","constructor","device","attach","setAccessor","Object","assign","accessor","seal","destroy","handle","removeStats","trackDeallocatedMemory","gl","deleteBuffer","write","subData","getElementCount","Math","round","getBytesPerElement","getVertexCount","getBytesPerVertex","initialize","Number","isFinite","webglUsage","STATIC_DRAW","debugData","_setData","_setByteLength","setProps","buffer","reallocate","bytesUsed","setData","options","srcOffset","length","target","webgl2","COPY_WRITE_BUFFER","bindBuffer","undefined","bufferSubData","_inferType","copyData","sourceBuffer","readOffset","writeOffset","gl2","COPY_READ_BUFFER","copyBufferSubData","getData","dstData","srcByteOffset","dstOffset","ArrayType","FLOAT","clamped","sourceAvailableElementCount","_getAvailableElementCount","dstElementOffset","dstAvailableElementCount","dstElementCount","min","copyElementCount","getBufferSubData","bind","index","UNIFORM_BUFFER","TRANSFORM_FEEDBACK_BUFFER","bindBufferRange","bindBufferBase","unbind","isIndexedBuffer","getDebugData","changed","invalidateDebugData","_getTarget","bufferData","slice","trackAllocatedMemory","Float32Array","sourceElementOffset","BYTES_PER_ELEMENT","getParameter","pname","value","getBufferParameter"],"mappings":";AACA,SAAqBA,MAArB,EAA6BC,UAA7B,QAA8C,cAA9C;AACA,OAAOC,EAAP,MAAe,oBAAf;AACA,SAAQC,mBAAR,QAAkC,iCAAlC;AAEA,OAAOC,QAAP,MAAqB,YAArB;AACA,SAAQC,uBAAR,EAAiCC,uBAAjC,QAA+D,qBAA/D;AAEA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,WAAP,MAAwB,mCAAxB;AAEA,MAAMC,iBAAiB,GAAG,EAA1B;AAGA,MAAMC,gBAAgB,GAAG;AACvBC,EAAAA,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AEA,SAAKqF,oBAAL,CAA0BrF,UAA1B;AAEA,WAAO,IAAP;AACD;;AAIDkF,EAAAA,UAAU,GAAG;AAEX,WAAO,KAAKlE,EAAL,CAAQ2B,MAAR,GAAiBxE,EAAE,CAACyE,iBAApB,GAAwC,KAAKF,MAApD;AACD;;AAEDsB,EAAAA,yBAAyB,CAACN,aAAD,EAAwB;AAC/C,UAAME,SAAS,GAAGrF,uBAAuB,CAAC,KAAKmC,QAAL,CAAc5B,IAAd,IAAsBX,EAAE,CAAC0F,KAA1B,EAAiC;AAACC,MAAAA,OAAO,EAAE;AAAV,KAAjC,CAAzC;AACA,UAAMyB,mBAAmB,GAAG7B,aAAa,GAAGE,SAAS,CAAC4B,iBAAtD;AACA,WAAO,KAAKpE,eAAL,KAAyBmE,mBAAhC;AACD;;AAIDvC,EAAAA,UAAU,CAACjD,IAAD,EAAO;AACf,QAAI,CAAC,KAAKW,QAAL,CAAc5B,IAAnB,EAAyB;AACvB,WAAKyB,WAAL,CAAiB,IAAIlC,QAAJ,CAAa,KAAKqC,QAAlB,EAA4B;AAAC5B,QAAAA,IAAI,EAAER,uBAAuB,CAACyB,IAAD;AAA9B,OAA5B,CAAjB;AACD;AACF;;AAID0F,EAAAA,YAAY,CAACC,KAAD,EAAiB;AAC3B,SAAK1E,EAAL,CAAQ6B,UAAR,CAAmB,KAAKH,MAAxB,EAAgC,KAAK7B,MAArC;AACA,UAAM8E,KAAK,GAAG,KAAK3E,EAAL,CAAQ4E,kBAAR,CAA2B,KAAKlD,MAAhC,EAAwCgD,KAAxC,CAAd;AACA,SAAK1E,EAAL,CAAQ6B,UAAR,CAAmB,KAAKH,MAAxB,EAAgC,IAAhC;AACA,WAAOiD,KAAP;AACD;;AAIO,MAAJ7G,IAAI,GAAG;AACT,WAAO,KAAK4B,QAAL,CAAc5B,IAArB;AACD;;AAvYoD","sourcesContent":["import type {Device, BufferProps, TypedArray} from '@luma.gl/api';\nimport {Buffer, log, assert, checkProps} from '@luma.gl/api';\nimport GL from '@luma.gl/constants';\nimport {assertWebGL2Context} from '../context/context/webgl-checks';\nimport {AccessorObject} from '../types';\nimport Accessor from './accessor';\nimport {getGLTypeFromTypedArray, getTypedArrayFromGLType} from './typed-array-utils';\n\nimport WebGLDevice from '../adapter/webgl-device';\nimport WEBGLBuffer from '../adapter/resources/webgl-buffer';\n\nconst DEBUG_DATA_LENGTH = 10;\n\n// Shared prop checks for constructor and setProps\nconst DEPRECATED_PROPS = {\n offset: 'accessor.offset',\n stride: 'accessor.stride',\n type: 'accessor.type',\n size: 'accessor.size',\n divisor: 'accessor.divisor',\n normalized: 'accessor.normalized',\n integer: 'accessor.integer',\n instanced: 'accessor.divisor',\n isInstanced: 'accessor.divisor'\n};\n\n// Prop checks for constructor\nconst PROP_CHECKS_INITIALIZE = {\n removedProps: {},\n replacedProps: {\n bytes: 'byteLength'\n },\n // new Buffer() with individual accessor props is still used in apps, emit warnings\n deprecatedProps: DEPRECATED_PROPS\n};\n\n// Prop checks for setProps\nconst PROP_CHECKS_SET_PROPS = {\n // Buffer.setProps() with individual accessor props is rare => emit errors\n removedProps: DEPRECATED_PROPS\n};\n\nfunction getWEBGLBufferProps(props: ClassicBufferProps | ArrayBufferView | number): BufferProps {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n return {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n else if (typeof props === 'number') {\n return {byteLength: props as number};\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n const bufferProps = {...props as ClassicBufferProps};\n if (bufferProps.offset) {\n bufferProps.byteOffset = bufferProps.offset;\n }\n return bufferProps;\n}\n\n/** WebGL Buffer interface */\nexport type ClassicBufferProps = BufferProps & {\n handle?: WebGLBuffer;\n\n target?: number;\n webglUsage?: number;\n\n accessor?: AccessorObject;\n\n /** @deprecated */\n index?: number;\n /** @deprecated */\n offset?: number;\n /** @deprecated */\n size?: number;\n /** @deprecated */\n type?: number\n}\n\n/** WebGL Buffer interface */\nexport default class ClassicBuffer extends WEBGLBuffer {\n usage: number;\n accessor: Accessor;\n\n constructor(device: Device | WebGLRenderingContext, props?: ClassicBufferProps);\n constructor(device: Device | WebGLRenderingContext, data: ArrayBufferView | number[]);\n constructor(device: Device | WebGLRenderingContext, byteLength: number);\n\n constructor(device: Device | WebGLRenderingContext, props = {}) {\n super(WebGLDevice.attach(device), getWEBGLBufferProps(props));\n\n // Base class initializes\n // this.initialize(props);\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, (props as ClassicBufferProps).accessor));\n\n // infer GL type from supplied typed array\n if (this.props.data) {\n const type = getGLTypeFromTypedArray(this.props.data as TypedArray);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n }\n\n Object.seal(this);\n }\n\n destroy(): void {\n if (this.handle) {\n this.removeStats();\n this.trackDeallocatedMemory();\n this.gl.deleteBuffer(this.handle);\n // @ts-expect-error\n this.handle = null;\n }\n }\n\n write(data: TypedArray, byteOffset?: number): void {\n this.subData({data, offset: byteOffset});\n }\n // returns number of elements in the buffer (assuming that the full buffer is used)\n getElementCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerElement(accessor));\n }\n\n // returns number of vertices in the buffer (assuming that the full buffer is used)\n getVertexCount(accessor: AccessorObject = this.accessor): number {\n return Math.round(this.byteLength / Accessor.getBytesPerVertex(accessor));\n }\n\n // Creates and initializes the buffer object's data store.\n // Signature: `new Buffer(gl, {data: new Float32Array(...)})`\n // Signature: `new Buffer(gl, new Float32Array(...))`\n // Signature: `new Buffer(gl, 100)`\n initialize(props: ClassicBufferProps = {}): this {\n // Signature `new Buffer(gl, new Float32Array(...)`\n if (ArrayBuffer.isView(props)) {\n props = {data: props};\n }\n\n // Signature: `new Buffer(gl, 100)`\n if (Number.isFinite(props)) {\n // @ts-expect-error\n props = {byteLength: props};\n }\n\n props = checkProps('Buffer', props, PROP_CHECKS_INITIALIZE);\n\n // Initialize member fields\n this.webglUsage = props.webglUsage || GL.STATIC_DRAW;\n this.debugData = null;\n\n // Deprecated: Merge main props and accessor\n this.setAccessor(Object.assign({}, props, props.accessor));\n\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._setData(props.data, props.offset, props.byteLength);\n } else {\n this._setByteLength(props.byteLength || 0);\n }\n\n return this;\n }\n\n setProps(props: ClassicBufferProps): this {\n props = checkProps('Buffer', props, PROP_CHECKS_SET_PROPS);\n\n if ('accessor' in props) {\n this.setAccessor(props.accessor);\n }\n\n return this;\n }\n\n // Optionally stores an accessor with the buffer, makes it easier to use it as an attribute later\n // {type, size = 1, offset = 0, stride = 0, normalized = false, integer = false, divisor = 0}\n setAccessor(accessor: AccessorObject | Accessor): this {\n // NOTE: From luma.gl v7.0, Accessors have an optional `buffer `field\n // (mainly to support \"interleaving\")\n // To avoid confusion, ensure `buffer.accessor` does not have a `buffer.accessor.buffer` field:\n accessor = Object.assign({}, accessor);\n // @ts-expect-error\n delete accessor.buffer;\n\n // This new statement ensures that an \"accessor object\" is re-packaged as an Accessor instance\n this.accessor = new Accessor(accessor);\n return this;\n }\n\n // Allocate a bigger GPU buffer (if the current buffer is not big enough).\n // If a reallocation is triggered it clears the buffer\n // Returns:\n // `true`: buffer was reallocated, data was cleared\n // `false`: buffer was big enough, data is intact\n reallocate(byteLength: number): boolean {\n if (byteLength > this.byteLength) {\n this._setByteLength(byteLength);\n return true;\n }\n this.bytesUsed = byteLength;\n return false;\n }\n\n // Update with new data. Reinitializes the buffer\n setData(props: ClassicBufferProps) {\n return this.initialize(props);\n }\n\n // Updates a subset of a buffer object's data store.\n // Data (Typed Array or ArrayBuffer), length is inferred unless provided\n // Offset into buffer\n // WebGL2 only: Offset into srcData\n // WebGL2 only: Number of bytes to be copied\n subData(options: TypedArray | {data: TypedArray, offset?: number; srcOffset?: number; byteLength?: number, length?: number}) {\n // Signature: buffer.subData(new Float32Array([...]))\n if (ArrayBuffer.isView(options)) {\n options = {data: options};\n }\n\n const {data, offset = 0, srcOffset = 0} = options;\n const byteLength = options.byteLength || options.length;\n\n assert(data);\n\n // Create the buffer - binding it here for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n // @ts-expect-error\n const target = this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n this.gl.bindBuffer(target, this.handle);\n // WebGL2: subData supports additional srcOffset and length parameters\n if (srcOffset !== 0 || byteLength !== undefined) {\n assertWebGL2Context(this.gl);\n // @ts-expect-error\n this.gl.bufferSubData(this.target, offset, data, srcOffset, byteLength);\n } else {\n this.gl.bufferSubData(target, offset, data);\n }\n this.gl.bindBuffer(target, null);\n\n // TODO - update local `data` if offsets are right\n this.debugData = null;\n\n this._inferType(data);\n\n return this;\n }\n\n /**\n * Copies part of the data of another buffer into this buffer\n * @note WEBGL2 ONLY\n */\n copyData(options: {\n sourceBuffer: any;\n readOffset?: number;\n writeOffset?: number;\n size: any;\n }): this {\n const {sourceBuffer, readOffset = 0, writeOffset = 0, size} = options;\n const {gl, gl2} = this;\n assertWebGL2Context(gl);\n\n // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type\n gl.bindBuffer(GL.COPY_READ_BUFFER, sourceBuffer.handle);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, this.handle);\n gl2.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, readOffset, writeOffset, size);\n gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n this.debugData = null;\n\n return this;\n }\n\n /**\n * Reads data from buffer into an ArrayBufferView or SharedArrayBuffer.\n * @note WEBGL2 ONLY\n */\n getData(options?: {\n dstData?: any;\n srcByteOffset?: number;\n dstOffset?: number;\n length?: number;\n }): any {\n let {dstData = null, length = 0} = options || {};\n const {srcByteOffset = 0, dstOffset = 0} = options || {};\n assertWebGL2Context(this.gl);\n\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceAvailableElementCount = this._getAvailableElementCount(srcByteOffset);\n\n const dstElementOffset = dstOffset;\n\n let dstAvailableElementCount;\n let dstElementCount;\n if (dstData) {\n dstElementCount = dstData.length;\n dstAvailableElementCount = dstElementCount - dstElementOffset;\n } else {\n // Allocate ArrayBufferView with enough size to copy all eligible data.\n dstAvailableElementCount = Math.min(\n sourceAvailableElementCount,\n length || sourceAvailableElementCount\n );\n dstElementCount = dstElementOffset + dstAvailableElementCount;\n }\n\n const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);\n length = length || copyElementCount;\n assert(length <= copyElementCount);\n dstData = dstData || new ArrayType(dstElementCount);\n\n // Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);\n this.gl2.getBufferSubData(GL.COPY_READ_BUFFER, srcByteOffset, dstData, dstOffset, length);\n this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);\n\n // TODO - update local `data` if offsets are 0\n return dstData;\n }\n\n /**\n * Binds a buffer to a given binding point (target).\n * GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER take an index, and optionally a range.\n * - GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER need an index to affect state\n * - GL.UNIFORM_BUFFER: `offset` must be aligned to GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT.\n * - GL.UNIFORM_BUFFER: `size` must be a minimum of GL.UNIFORM_BLOCK_SIZE_DATA.\n */\n bind(options?: {target?: number; index?: any; offset?: number; size: any}): this {\n const {\n target = this.target, // target for the bind operation\n index = this.accessor && this.accessor.index, // index = index of target (indexed bind point)\n offset = 0,\n size\n } = options || {};\n // NOTE: While GL.TRANSFORM_FEEDBACK_BUFFER and GL.UNIFORM_BUFFER could\n // be used as direct binding points, they will not affect transform feedback or\n // uniform buffer state. Instead indexed bindings need to be made.\n if (target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER) {\n if (size !== undefined) {\n this.gl2.bindBufferRange(target, index, this.handle, offset, size);\n } else {\n assert(offset === 0); // Make sure offset wasn't supplied\n this.gl2.bindBufferBase(target, index, this.handle);\n }\n } else {\n this.gl.bindBuffer(target, this.handle);\n }\n\n return this;\n }\n\n unbind(options?: {target?: any; index?: any}): this {\n const {target = this.target, index = this.accessor && this.accessor.index} = options || {};\n const isIndexedBuffer = target === GL.UNIFORM_BUFFER || target === GL.TRANSFORM_FEEDBACK_BUFFER;\n if (isIndexedBuffer) {\n this.gl2.bindBufferBase(target, index, null);\n } else {\n this.gl.bindBuffer(target, null);\n }\n return this;\n }\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n // Returns a short initial data array\n getDebugData(): {\n data: any;\n changed: boolean;\n } {\n if (!this.debugData) {\n this.debugData = this.getData({length: Math.min(DEBUG_DATA_LENGTH, this.byteLength)});\n return {data: this.debugData, changed: true};\n }\n return {data: this.debugData, changed: false};\n }\n\n invalidateDebugData() {\n this.debugData = null;\n }\n\n // PRIVATE METHODS\n\n // Allocate a new buffer and initialize to contents of typed array\n _setData(data, offset: number = 0, byteLength: number = data.byteLength + offset): this {\n assert(ArrayBuffer.isView(data));\n\n this.trackDeallocatedMemory();\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, byteLength, this.webglUsage);\n this.gl.bufferSubData(target, offset, data);\n this.gl.bindBuffer(target, null);\n\n this.debugData = data.slice(0, DEBUG_DATA_LENGTH);\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n this.trackAllocatedMemory(byteLength);\n\n // infer GL type from supplied typed array\n const type = getGLTypeFromTypedArray(data);\n assert(type);\n this.setAccessor(new Accessor(this.accessor, {type}));\n return this;\n }\n\n // Allocate a GPU buffer of specified size.\n _setByteLength(byteLength: number, webglUsage = this.webglUsage): this {\n assert(byteLength >= 0);\n\n this.trackDeallocatedMemory();\n\n // Workaround needed for Safari (#291):\n // gl.bufferData with size equal to 0 crashes. Instead create zero sized array.\n let data = byteLength;\n if (byteLength === 0) {\n // @ts-expect-error\n data = new Float32Array(0);\n }\n\n const target = this._getTarget();\n this.gl.bindBuffer(target, this.handle);\n this.gl.bufferData(target, data, webglUsage);\n this.gl.bindBuffer(target, null);\n\n this.webglUsage = webglUsage;\n this.debugData = null;\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n\n this.trackAllocatedMemory(byteLength);\n\n return this;\n }\n\n // Binding a buffer for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n _getTarget() {\n // @ts-expect-error\n return this.gl.webgl2 ? GL.COPY_WRITE_BUFFER : this.target;\n }\n\n _getAvailableElementCount(srcByteOffset: number) {\n const ArrayType = getTypedArrayFromGLType(this.accessor.type || GL.FLOAT, {clamped: false});\n const sourceElementOffset = srcByteOffset / ArrayType.BYTES_PER_ELEMENT;\n return this.getElementCount() - sourceElementOffset;\n }\n\n // Automatically infers type from typed array passed to setData\n // Note: No longer that useful, since type is now autodeduced from the compiled shaders\n _inferType(data) {\n if (!this.accessor.type) {\n this.setAccessor(new Accessor(this.accessor, {type: getGLTypeFromTypedArray(data)}));\n }\n }\n\n // RESOURCE METHODS\n\n getParameter(pname: GL): any {\n this.gl.bindBuffer(this.target, this.handle);\n const value = this.gl.getBufferParameter(this.target, pname);\n this.gl.bindBuffer(this.target, null);\n return value;\n }\n\n // DEPRECATIONS - v7.0\n /** @deprecated Use Buffer.accessor.type */\n get type() {\n return this.accessor.type;\n }\n}\n"],"file":"buffer.js"}
@@ -1,4 +1,5 @@
1
- import GL from '@luma.gl/constants';
1
+ import { TypedArray } from '@luma.gl/api/types';
2
+ import { GLType } from '../types/webgl';
2
3
  declare type TypedArrayConstructor = Float32ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor;
3
4
  /**
4
5
  * Converts TYPED ARRAYS to corresponding GL constant
@@ -6,7 +7,7 @@ declare type TypedArrayConstructor = Float32ArrayConstructor | Uint16ArrayConstr
6
7
  * @param {*} arrayOrType
7
8
  * @returns
8
9
  */
9
- export declare function getGLTypeFromTypedArray(arrayOrType: any): GL.BYTE | GL.UNSIGNED_BYTE | GL.SHORT | GL.UNSIGNED_SHORT | GL.INT | GL.UNSIGNED_INT | GL.FLOAT;
10
+ export declare function getGLTypeFromTypedArray(arrayOrType: TypedArray): GLType;
10
11
  /**
11
12
  * Converts GL constant to corresponding TYPED ARRAY
12
13
  * Used to auto deduce gl parameter types
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed-array-utils.d.ts","sourceRoot":"","sources":["../../src/classic/typed-array-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAA;AAIrC,aAAK,qBAAqB,GACtB,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,4BAA4B,GAC5B,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,CAAC;AAE1B;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,UAAU,GAAG,MAAM,CAuBvE;AAED;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,GAAG,EACX,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GACA,qBAAqB,CAwBvB;AAED;;;;;GAKG;AACF,wBAAgB,QAAQ,CAAC,OAAO,EAAE;IACjC,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,GAAG,IAAI,CAgBP;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAE;IACnC,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;CACb,GAAG;IACF,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAaA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/classic/typed-array-utils.ts"],"names":["GL","ERR_TYPE_DEDUCTION","getGLTypeFromTypedArray","arrayOrType","type","ArrayBuffer","isView","constructor","Float32Array","FLOAT","Uint16Array","UNSIGNED_SHORT","Uint32Array","UNSIGNED_INT","Uint8Array","UNSIGNED_BYTE","Uint8ClampedArray","Int8Array","BYTE","Int16Array","SHORT","Int32Array","INT","Error","getTypedArrayFromGLType","glType","options","clamped","UNSIGNED_SHORT_5_6_5","UNSIGNED_SHORT_4_4_4_4","UNSIGNED_SHORT_5_5_5_1","flipRows","data","width","height","bytesPerPixel","temp","bytesPerRow","tempBuffer","y","topOffset","bottomOffset","set","subarray","copyWithin","scalePixels","newWidth","Math","round","newHeight","newData","x","c"],"mappings":"AACA,OAAOA,EAAP,MAAe,oBAAf;AAGA,MAAMC,kBAAkB,GAAG,+CAA3B;AAkBA,OAAO,SAASC,uBAAT,CAAiCC,WAAjC,EAAkE;AAEvE,QAAMC,IAAI,GAAGC,WAAW,CAACC,MAAZ,CAAmBH,WAAnB,IAAkCA,WAAW,CAACI,WAA9C,GAA4DJ,WAAzE;;AACA,UAAQC,IAAR;AACE,SAAKI,YAAL;AACE,aAAOR,EAAE,CAACS,KAAV;;AACF,SAAKC,WAAL;AACE,aAAOV,EAAE,CAACW,cAAV;;AACF,SAAKC,WAAL;AACE,aAAOZ,EAAE,CAACa,YAAV;;AACF,SAAKC,UAAL;AACE,aAAOd,EAAE,CAACe,aAAV;;AACF,SAAKC,iBAAL;AACE,aAAOhB,EA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,GAAeK,CAAhB,IAAqB,CAArB,GAAyBC,CAA1B,CAAP,GAAsCpB,IAAI,CAAC,CAACO,CAAC,GAAG,CAAJ,GAAQN,KAAR,GAAgBkB,CAAC,GAAG,CAArB,IAA0B,CAA1B,GAA8BC,CAA/B,CAA1C;AACD;AACF;AACF;;AACD,SAAO;AAACpB,IAAAA,IAAI,EAAEkB,OAAP;AAAgBjB,IAAAA,KAAK,EAAEa,QAAvB;AAAiCZ,IAAAA,MAAM,EAAEe;AAAzC,GAAP;AACD","sourcesContent":["import {TypedArray} from '@luma.gl/api/types';\nimport GL from '@luma.gl/constants';\nimport {GLType} from '../types/webgl'\n\nconst ERR_TYPE_DEDUCTION = 'Failed to deduce GL constant from typed array';\n\ntype TypedArrayConstructor =\n | Float32ArrayConstructor\n | Uint16ArrayConstructor\n | Uint32ArrayConstructor\n | Uint8ArrayConstructor\n | Uint8ClampedArrayConstructor\n | Int8ArrayConstructor\n | Int16ArrayConstructor\n | Int32ArrayConstructor;\n\n/**\n * Converts TYPED ARRAYS to corresponding GL constant\n * Used to auto deduce gl parameter types\n * @param {*} arrayOrType\n * @returns\n */\nexport function getGLTypeFromTypedArray(arrayOrType: TypedArray): GLType {\n // If typed array, look up constructor\n const type = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;\n switch (type) {\n case Float32Array:\n return GL.FLOAT;\n case Uint16Array:\n return GL.UNSIGNED_SHORT;\n case Uint32Array:\n return GL.UNSIGNED_INT;\n case Uint8Array:\n return GL.UNSIGNED_BYTE;\n case Uint8ClampedArray:\n return GL.UNSIGNED_BYTE;\n case Int8Array:\n return GL.BYTE;\n case Int16Array:\n return GL.SHORT;\n case Int32Array:\n return GL.INT;\n default:\n throw new Error(ERR_TYPE_DEDUCTION);\n }\n}\n\n/**\n * Converts GL constant to corresponding TYPED ARRAY\n * Used to auto deduce gl parameter types\n * @param {*} glType\n * @param {*} param1\n * @returns\n */\n// eslint-disable-next-line complexity\nexport function getTypedArrayFromGLType(\n glType: any,\n options?: {\n clamped?: boolean;\n }\n): TypedArrayConstructor {\n const {clamped = true} = options || {};\n // Sorted in some order of likelihood to reduce amount of comparisons\n switch (glType) {\n case GL.FLOAT:\n return Float32Array;\n case GL.UNSIGNED_SHORT:\n case GL.UNSIGNED_SHORT_5_6_5:\n case GL.UNSIGNED_SHORT_4_4_4_4:\n case GL.UNSIGNED_SHORT_5_5_5_1:\n return Uint16Array;\n case GL.UNSIGNED_INT:\n return Uint32Array;\n case GL.UNSIGNED_BYTE:\n return clamped ? Uint8ClampedArray : Uint8Array;\n case GL.BYTE:\n return Int8Array;\n case GL.SHORT:\n return Int16Array;\n case GL.INT:\n return Int32Array;\n default:\n throw new Error('Failed to deduce typed array type from GL constant');\n }\n}\n\n/**\n * Flip rows (can be used on arrays returned from `Framebuffer.readPixels`)\n * https: *stackoverflow.com/questions/41969562/\n * how-can-i-flip-the-result-of-webglrenderingcontext-readpixels\n * @param {*} param0\n */\n export function flipRows(options: {\n data: any;\n width: any;\n height: any;\n bytesPerPixel?: number;\n temp?: any;\n}): void {\n const {data, width, height, bytesPerPixel = 4, temp} = options;\n const bytesPerRow = width * bytesPerPixel;\n\n // make a temp buffer to hold one row\n const tempBuffer = temp || new Uint8Array(bytesPerRow);\n for (let y = 0; y < height / 2; ++y) {\n const topOffset = y * bytesPerRow;\n const bottomOffset = (height - y - 1) * bytesPerRow;\n // make copy of a row on the top half\n tempBuffer.set(data.subarray(topOffset, topOffset + bytesPerRow));\n // copy a row from the bottom half to the top\n data.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);\n // copy the copy of the top half row to the bottom half\n data.set(tempBuffer, bottomOffset);\n }\n}\n\n\nexport function scalePixels(options: {\n data: any;\n width: any;\n height: any;\n}): {\n data: Uint8Array;\n width: number;\n height: number;\n} {\n const {data, width, height} = options;\n const newWidth = Math.round(width / 2);\n const newHeight = Math.round(height / 2);\n const newData = new Uint8Array(newWidth * newHeight * 4);\n for (let y = 0; y < newHeight; y++) {\n for (let x = 0; x < newWidth; x++) {\n for (let c = 0; c < 4; c++) {\n newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];\n }\n }\n }\n return {data: newData, width: newWidth, height: newHeight};\n}\n"],"file":"typed-array-utils.js"}
@@ -1 +1 @@
1
- {"version":3,"file":"context-state.d.ts","sourceRoot":"","sources":["../../../src/context/context/context-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,qBAAqB,GAAG,YAAY,CAqBvE"}
1
+ {"version":3,"file":"context-state.d.ts","sourceRoot":"","sources":["../../../src/context/context/context-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,qBAAqB,GAAG,YAAY,CAuBvE"}
@@ -21,6 +21,6 @@ export function getContextState(gl) {
21
21
  gl.luma = contextState;
22
22
  }
23
23
 
24
- return gl.luma;
24
+ throw new Error('context state without device');
25
25
  }
26
26
  //# sourceMappingURL=context-state.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/context/context-state.ts"],"names":["getContextState","gl","device","luma","contextState","_canvasSizeInfo","clientWidth","clientHeight","devicePixelRatio","_polyfilled","_extensions"],"mappings":"AAiBA,OAAO,SAASA,eAAT,CAAyBC,EAAzB,EAAkE;AAEvE,QAAM;AAACC,IAAAA,MAAD;AAASC,IAAAA;AAAT,MAAiBF,EAAvB;;AACA,MAAIC,MAAJ,EAAY;AACV,WAAOA,MAAP;AACD;;AACD,MAAI,CAACC,IAAL,EAAW;AACT,UAAMC,YAA0B,GAAG;AACjCC,MAAAA,eAAe,EAAE;AACfC,QAAAA,WAAW,EAAE,CADE;AAEfC,QAAAA,YAAY,EAAE,CAFC;AAGfC,QAAAA,gBAAgB,EAAE;AAHH,OADgB;AAMjCC,MAAAA,WAAW,EAAE,KANoB;AAOjCC,MAAAA,WAAW,EAAE;AAPoB,KAAnC;AAUAT,IAAAA,EAAE,CAACE,IAAH,GAAUC,YAAV;AACD;;AAED,SAAOH,EAAE,CAACE,IAAV;AACD","sourcesContent":["/**\n * Stores luma.gl specific state associated with a context\n */\nexport interface ContextState {\n _canvasSizeInfo: {\n clientWidth: number;\n clientHeight: number;\n devicePixelRatio: number;\n };\n _polyfilled: boolean;\n _extensions: Record<string, any>;\n}\n\n/**\n * Gets luma.gl specific state from a context\n * @returns context state\n */\nexport function getContextState(gl: WebGLRenderingContext): ContextState {\n // @ts-expect-error\n const {device, luma} = gl;\n if (device) {\n return device as ContextState;\n }\n if (!luma) {\n const contextState: ContextState = {\n _canvasSizeInfo: {\n clientWidth: 0,\n clientHeight: 0,\n devicePixelRatio: 1,\n },\n _polyfilled: false,\n _extensions: {}\n };\n // @ts-expect-error\n gl.luma = contextState;\n }\n // @ts-expect-error\n return gl.luma;\n}\n"],"file":"context-state.js"}
1
+ {"version":3,"sources":["../../../src/context/context/context-state.ts"],"names":["getContextState","gl","device","luma","contextState","_canvasSizeInfo","clientWidth","clientHeight","devicePixelRatio","_polyfilled","_extensions","Error"],"mappings":"AAiBA,OAAO,SAASA,eAAT,CAAyBC,EAAzB,EAAkE;AAEvE,QAAM;AAACC,IAAAA,MAAD;AAASC,IAAAA;AAAT,MAAiBF,EAAvB;;AACA,MAAIC,MAAJ,EAAY;AACV,WAAOA,MAAP;AACD;;AACD,MAAI,CAACC,IAAL,EAAW;AACT,UAAMC,YAA0B,GAAG;AACjCC,MAAAA,eAAe,EAAE;AACfC,QAAAA,WAAW,EAAE,CADE;AAEfC,QAAAA,YAAY,EAAE,CAFC;AAGfC,QAAAA,gBAAgB,EAAE;AAHH,OADgB;AAMjCC,MAAAA,WAAW,EAAE,KANoB;AAOjCC,MAAAA,WAAW,EAAE;AAPoB,KAAnC;AAUAT,IAAAA,EAAE,CAACE,IAAH,GAAUC,YAAV;AACD;;AACD,QAAM,IAAIO,KAAJ,CAAU,8BAAV,CAAN;AAID","sourcesContent":["/**\n * Stores luma.gl specific state associated with a context\n */\nexport interface ContextState {\n _canvasSizeInfo: {\n clientWidth: number;\n clientHeight: number;\n devicePixelRatio: number;\n };\n _polyfilled: boolean;\n _extensions: Record<string, any>;\n}\n\n/**\n * Gets luma.gl specific state from a context\n * @returns context state\n */\nexport function getContextState(gl: WebGLRenderingContext): ContextState {\n // @ts-expect-error\n const {device, luma} = gl;\n if (device) {\n return device as ContextState;\n }\n if (!luma) {\n const contextState: ContextState = {\n _canvasSizeInfo: {\n clientWidth: 0,\n clientHeight: 0,\n devicePixelRatio: 1,\n },\n _polyfilled: false,\n _extensions: {}\n };\n // @ts-expect-error\n gl.luma = contextState;\n }\n throw new Error('context state without device');\n\n // // @ts-expect-error\n // return gl.luma;\n}\n"],"file":"context-state.js"}
@@ -17,6 +17,7 @@
17
17
  * @param failIfMajorPerformanceCaveat Do not create if the system performance is low.
18
18
  */
19
19
  declare type ContextProps = {
20
+ type?: 'webgl' | 'webgl1' | 'webgl2' | string;
20
21
  webgl1?: boolean;
21
22
  webgl2?: boolean;
22
23
  onContextLost?: (event: Event) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"create-context.d.ts","sourceRoot":"","sources":["../../../src/context/context/create-context.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;EAgBE;AAEF,aAAK,YAAY,GAAG;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,eAAe,CAAC,EAAE,SAAS,GAAI,kBAAkB,GAAG,WAAW,CAAC;IAChE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC;AAUF;;;;GAIG;AACF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,eAAe,EAAE,KAAK,EAAE,YAAY,GAAG,qBAAqB,CAkC7H"}
1
+ {"version":3,"file":"create-context.d.ts","sourceRoot":"","sources":["../../../src/context/context/create-context.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;EAgBE;AACF,aAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,eAAe,CAAC,EAAE,SAAS,GAAI,kBAAkB,GAAG,WAAW,CAAC;IAChE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC;AAUF;;;;GAIG;AACF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,eAAe,EAAE,KAAK,EAAE,YAAY,GAAG,qBAAqB,CAyC7H"}
@@ -16,6 +16,18 @@ export function createBrowserContext(canvas, props) {
16
16
  canvas.addEventListener('webglcontextcreationerror', onCreateError, false);
17
17
  let gl = null;
18
18
 
19
+ if (props.type === 'webgl2') {
20
+ props = { ...props,
21
+ webgl1: false
22
+ };
23
+ }
24
+
25
+ if (props.type === 'webgl1') {
26
+ props = { ...props,
27
+ webgl2: false
28
+ };
29
+ }
30
+
19
31
  if (props.webgl2) {
20
32
  gl = gl || canvas.getContext('webgl2', props);
21
33
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/context/create-context.ts"],"names":["DEFAULT_CONTEXT_PROPS","webgl2","webgl1","powerPreference","onContextLost","console","error","onContextRestored","info","createBrowserContext","canvas","props","errorMessage","onCreateError","statusMessage","addEventListener","gl","getContext","removeEventListener","Error"],"mappings":"AAmCA,MAAMA,qBAAmC,GAAG;AAC1CC,EAAAA,MAAM,EAAE,IADkC;AAE1CC,EAAAA,MAAM,EAAE,IAFkC;AAG1CC,EAAAA,eAAe,EAAE,kBAHyB;AAI1CC,EAAAA,aAAa,EAAE,MAAMC,OAAO,CAACC,KAAR,CAAc,oBAAd,CAJqB;AAK1CC,EAAAA,iBAAiB,EAAE,MAAMF,OAAO,CAACG,IAAR,CAAa,wBAAb;AALiB,CAA5C;AAaC,OAAO,SAASC,oBAAT,CAA8BC,MAA9B,EAA2EC,KAA3E,EAAuH;AAC5HA,EAAAA,KAAK,GAAG,EAAC,GAAGX,qBAAJ;AAA2B,OAAGW;AAA9B,GAAR;AAGD,MAAIC,YAAY,GAAG,IAAnB;;AACA,QAAMC,aAAa,GAAIP,KAAD,IAAYM,YAAY,GAAGN,KAAK,CAACQ,aAAN,IAAuBF,YAAxE;;AACAF,EAAAA,MAAM,CAACK,gBAAP,CAAwB,2BAAxB,EAAqDF,aAArD,EAAoE,KAApE;AAGA,MAAIG,EAAE,GAAG,IAAT;;AAGA,MAAIL,KAAK,CAACV,MAAV,EAAkB;AAChBe,IAAAA,EAAE,GAAGA,EAAE,IAAIN,MAAM,CAACO,UAAP,CAAkB,QAAlB,EAA4BN,KAA5B,CAAX;AACD;;AACD,MAAIA,KAAK,CAACT,MAAV,EAAkB;AAChBc,IAAAA,EAAE,GAAGA,EAAE,IAAIN,MAAM,CAACO,UAAP,CAAkB,OAAlB,EAA2BN,KAA3B,CAAX;AACD;;AAGDD,EAAAA,MAAM,CAACQ,mBAAP,CAA2B,2BAA3B,EAAwDL,aAAxD,EAAuE,KAAvE;;AAEA,MAAI,CAACG,EAAL,EAAS;AACP,UAAM,IAAIG,KAAJ,4BACgBR,KAAK,CAACV,MAAN,IAAgB,CAACU,KAAK,CAACT,MAAvB,GAAgC,QAAhC,GAA2C,OAD3D,uBAEFU,YAAY,IAAI,eAFd,EAAN;AAKD;;AAEDF,EAAAA,MAAM,CAACK,gBAAP,CAAwB,kBAAxB,EAA4CJ,KAAK,CAACP,aAAlD,EAAiE,KAAjE;AACAM,EAAAA,MAAM,CAACK,gBAAP,CAAwB,sBAAxB,EAAgDJ,KAAK,CAACJ,iBAAtD,EAAyE,KAAzE;AAEA,SAAOS,EAAP;AACD","sourcesContent":["// luma.gl, MIT license\n\n/**\n * ContextProps\n* @param webgl2 Set to false to not create a WebGL2 context (force webgl1)\n* @param webgl1 set to false to not create a WebGL1 context (fail if webgl2 not available)\n* @param onContextLost\n* @param onContextRestored\n*\n* BROWSER CONTEXT PARAMETERS\n* @param debug Instrument context (at the expense of performance).\n* @param alpha Default render target has an alpha buffer.\n* @param depth Default render target has a depth buffer of at least 16 bits.\n* @param stencil Default render target has a stencil buffer of at least 8 bits.\n* @param antialias Boolean that indicates whether or not to perform anti-aliasing.\n* @param premultipliedAlpha Boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.\n* @param preserveDrawingBuffer Default render target buffers will not be automatically cleared and will preserve their values until cleared or overwritten\n* @param failIfMajorPerformanceCaveat Do not create if the system performance is low.\n*/\n\ntype ContextProps = {\n webgl1?: boolean;\n webgl2?: boolean;\n onContextLost?: (event: Event) => void;\n onContextRestored?: (event: Event) => void;\n alpha?: boolean; // indicates if the canvas contains an alpha buffer.\n desynchronized?: boolean; // hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop\n antialias?: boolean; // indicates whether or not to perform anti-aliasing.\n depth?: boolean; // indicates that the drawing buffer has a depth buffer of at least 16 bits.\n failIfMajorPerformanceCaveat?: boolean, // indicates if a context will be created if the system performance is low or if no hardware GPU is available.\n powerPreference?: 'default' | 'high-performance' | 'low-power',\n premultipliedAlpha?: boolean, // page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.\n preserveDrawingBuffer?: boolean // buffers will not be cleared and will preserve their values until cleared or overwritten by the author.\n};\n\nconst DEFAULT_CONTEXT_PROPS: ContextProps = {\n webgl2: true, // Attempt to create a WebGL2 context\n webgl1: true, // Attempt to create a WebGL1 context (false to fail if webgl2 not available)\n powerPreference: 'high-performance', // After all, most apps are using WebGL for performance reasons\n onContextLost: () => console.error('WebGL context lost'),\n onContextRestored: () => console.info('WebGL context restored'),\n};\n\n/**\n * Create a WebGL context for a canvas\n * Note calling this multiple time on the same canvas does return the same context\n* @param canvas A canvas element or offscreen canvas\n */\n export function createBrowserContext(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): WebGLRenderingContext {\n props = {...DEFAULT_CONTEXT_PROPS, ...props};\n\n // Try to extract any extra information about why context creation failed\n let errorMessage = null;\n const onCreateError = (error) => (errorMessage = error.statusMessage || errorMessage);\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n\n // Create the desired context\n let gl = null;\n\n // Prefer webgl2 over webgl1 if both are acceptable\n if (props.webgl2) {\n gl = gl || canvas.getContext('webgl2', props);\n }\n if (props.webgl1) {\n gl = gl || canvas.getContext('webgl', props);\n }\n\n // TODO are we removing this listener before giving it a chance to fire?\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n\n if (!gl) {\n throw new Error(\n `Failed to create ${props.webgl2 && !props.webgl1 ? 'WebGL2' : 'WebGL'} context: ${\n errorMessage || 'Unknown error'\n }`\n );\n }\n\n canvas.addEventListener('webglcontextlost', props.onContextLost, false);\n canvas.addEventListener('webglcontextrestored', props.onContextRestored, false);\n\n return gl;\n}\n"],"file":"create-context.js"}
1
+ {"version":3,"sources":["../../../src/context/context/create-context.ts"],"names":["DEFAULT_CONTEXT_PROPS","webgl2","webgl1","powerPreference","onContextLost","console","error","onContextRestored","info","createBrowserContext","canvas","props","errorMessage","onCreateError","statusMessage","addEventListener","gl","type","getContext","removeEventListener","Error"],"mappings":"AAmCA,MAAMA,qBAAmC,GAAG;AAC1CC,EAAAA,MAAM,EAAE,IADkC;AAE1CC,EAAAA,MAAM,EAAE,IAFkC;AAG1CC,EAAAA,eAAe,EAAE,kBAHyB;AAI1CC,EAAAA,aAAa,EAAE,MAAMC,OAAO,CAACC,KAAR,CAAc,oBAAd,CAJqB;AAK1CC,EAAAA,iBAAiB,EAAE,MAAMF,OAAO,CAACG,IAAR,CAAa,wBAAb;AALiB,CAA5C;AAaC,OAAO,SAASC,oBAAT,CAA8BC,MAA9B,EAA2EC,KAA3E,EAAuH;AAC5HA,EAAAA,KAAK,GAAG,EAAC,GAAGX,qBAAJ;AAA2B,OAAGW;AAA9B,GAAR;AAGD,MAAIC,YAAY,GAAG,IAAnB;;AACA,QAAMC,aAAa,GAAIP,KAAD,IAAYM,YAAY,GAAGN,KA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gl2 Set to false to not create a WebGL2 context (force webgl1)\n* @param webgl1 set to false to not create a WebGL1 context (fail if webgl2 not available)\n* @param onContextLost\n* @param onContextRestored\n*\n* BROWSER CONTEXT PARAMETERS\n* @param debug Instrument context (at the expense of performance).\n* @param alpha Default render target has an alpha buffer.\n* @param depth Default render target has a depth buffer of at least 16 bits.\n* @param stencil Default render target has a stencil buffer of at least 8 bits.\n* @param antialias Boolean that indicates whether or not to perform anti-aliasing.\n* @param premultipliedAlpha Boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.\n* @param preserveDrawingBuffer Default render target buffers will not be automatically cleared and will preserve their values until cleared or overwritten\n* @param failIfMajorPerformanceCaveat Do not create if the system performance is low.\n*/\ntype ContextProps = {\n type?: 'webgl' | 'webgl1' | 'webgl2' | string;\n webgl1?: boolean;\n webgl2?: boolean;\n onContextLost?: (event: Event) => void;\n onContextRestored?: (event: Event) => void;\n alpha?: boolean; // indicates if the canvas contains an alpha buffer.\n desynchronized?: boolean; // hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop\n antialias?: boolean; // indicates whether or not to perform anti-aliasing.\n depth?: boolean; // indicates that the drawing buffer has a depth buffer of at least 16 bits.\n failIfMajorPerformanceCaveat?: boolean, // indicates if a context will be created if the system performance is low or if no hardware GPU is available.\n powerPreference?: 'default' | 'high-performance' | 'low-power',\n premultipliedAlpha?: boolean, // page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.\n preserveDrawingBuffer?: boolean // buffers will not be cleared and will preserve their values until cleared or overwritten by the author.\n};\n\nconst DEFAULT_CONTEXT_PROPS: ContextProps = {\n webgl2: true, // Attempt to create a WebGL2 context\n webgl1: true, // Attempt to create a WebGL1 context (false to fail if webgl2 not available)\n powerPreference: 'high-performance', // After all, most apps are using WebGL for performance reasons\n onContextLost: () => console.error('WebGL context lost'),\n onContextRestored: () => console.info('WebGL context restored'),\n};\n\n/**\n * Create a WebGL context for a canvas\n * Note calling this multiple time on the same canvas does return the same context\n* @param canvas A canvas element or offscreen canvas\n */\n export function createBrowserContext(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): WebGLRenderingContext {\n props = {...DEFAULT_CONTEXT_PROPS, ...props};\n\n // Try to extract any extra information about why context creation failed\n let errorMessage = null;\n const onCreateError = (error) => (errorMessage = error.statusMessage || errorMessage);\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n\n // Create the desired context\n let gl = null;\n\n if (props.type === 'webgl2') {\n props = {...props, webgl1: false};\n }\n if (props.type === 'webgl1') {\n props = {...props, webgl2: false};\n }\n\n // Prefer webgl2 over webgl1 if both are acceptable\n if (props.webgl2) {\n gl = gl || canvas.getContext('webgl2', props);\n }\n if (props.webgl1) {\n gl = gl || canvas.getContext('webgl', props);\n }\n\n // TODO are we removing this listener before giving it a chance to fire?\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n\n if (!gl) {\n throw new Error(\n `Failed to create ${props.webgl2 && !props.webgl1 ? 'WebGL2' : 'WebGL'} context: ${\n errorMessage || 'Unknown error'\n }`\n );\n }\n\n canvas.addEventListener('webglcontextlost', props.onContextLost, false);\n canvas.addEventListener('webglcontextrestored', props.onContextRestored, false);\n\n return gl;\n}\n\n/* TODO - can we call this asynchronously to catch the error events?\nexport async function createBrowserContextAsync(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): Promise<WebGLRenderingContext> {\n props = {...DEFAULT_CONTEXT_PROPS, ...props};\n\n // Try to extract any extra information about why context creation failed\n let errorMessage = null;\n const onCreateError = (error) => (errorMessage = error.statusMessage || errorMessage);\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n\n const gl = createBrowserContext(canvas, props);\n\n // Give the listener a chance to fire\n await new Promise(resolve => setTimeout(resolve, 0));\n\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n\n return gl;\n}\n*/\n"],"file":"create-context.js"}
@@ -18,7 +18,7 @@ export declare function cssToDevicePixels(gl: WebGLRenderingContext, cssPixel: n
18
18
  * @return - device pixel ratio
19
19
  */
20
20
  export declare function getDevicePixelRatio(useDevicePixels: boolean | number): number;
21
- export declare function setDevicePixelRatio(gl: any, devicePixelRatio: any, options?: {
21
+ export declare function setDevicePixelRatio(gl: WebGLRenderingContext, devicePixelRatio: number, options?: {
22
22
  width?: number;
23
23
  height?: number;
24
24
  }): void;
@@ -1 +1 @@
1
- {"version":3,"file":"device-pixels.d.ts","sourceRoot":"","sources":["../../../src/context/context/device-pixels.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,qBAAqB,GAAG,MAAM,CAWlE;AAED;;GAEG;AACF,wBAAgB,iBAAiB,CAChC,EAAE,EAAE,qBAAqB,EACzB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,GAAE,OAAc,GACtB;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAKA;AAED;;;;;GAKG;AACF,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAO9E;AAGD,wBAAgB,mBAAmB,CAAC,EAAE,KAAA,EAAE,gBAAgB,KAAA,EAAE,OAAO,GAAE;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAM,QA4CxG"}
1
+ {"version":3,"file":"device-pixels.d.ts","sourceRoot":"","sources":["../../../src/context/context/device-pixels.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,qBAAqB,GAAG,MAAM,CAWlE;AAED;;GAEG;AACF,wBAAgB,iBAAiB,CAChC,EAAE,EAAE,qBAAqB,EACzB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,GAAE,OAAc,GACtB;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAKA;AAED;;;;;GAKG;AACF,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAO9E;AAGD,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,GAAE;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAM,QA4CvI"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/context/device-pixels.ts"],"names":["log","getContextState","cssToDeviceRatio","gl","state","canvas","clientWidth","_canvasSizeInfo","drawingBufferWidth","cssToDevicePixels","cssPixel","yInvert","ratio","width","height","drawingBufferHeight","scalePixels","getDevicePixelRatio","useDevicePixels","windowRatio","window","devicePixelRatio","Number","isFinite","setDevicePixelRatio","options","clientHeight","contextState","cachedSize","clampedPixelRatio","canvasWidth","Math","floor","canvasHeight","warn","min","Object","assign","pixel","x","scaleX","y","scaleY","t","xHigh","yHigh","max","r","round"],"mappings":"AAAA,SAAQA,GAAR,QAAkB,cAAlB;AACA,SAAQC,eAAR,QAA8B,iBAA9B;AAKA,OAAO,SAASC,gBAAT,CAA0BC,EAA1B,EAA6D;AAClE,QAAMC,KAAK,GAAGH,eAAe,CAACE,EAAD,CAA7B;;AAEA,MAAIA,EAAE,CAACE,MAAH,IAAaD,KAAjB,EAAwB;AAGtB,UAAM;AAACE,MAAAA;AAAD,QAAgBF,KAAK,CAACG,eAA5B;AACA,WAAOD,WAAW,GAAGH,EAAE,CAACK,kBAAH,GAAwBF,WAA3B,GAAyC,CAA3D;AACD;;AAED,SAAO,CAAP;AACD;AAKA,OAAO,SAASG,iBAAT,CACNN,EADM,EAENO,QAFM,EAGNC,OAAgB,GAAG,IAHb,EASN;AACA,QAAMC,KAAK,GAAGV,gBAAgB,CAACC,EAAD,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B,EAA0BC,KAA1B,EAAiC;AAE/B,QAAMkC,CAAC,GAAGhB,IAAI,CAACI,GAAL,CAASJ,IAAI,CAACiB,KAAL,CAAWT,CAAC,GAAG3B,KAAf,CAAT,EAAgCC,KAAK,GAAG,CAAxC,CAAV;AACA,SAAOkC,CAAP;AACD;;AAED,SAASL,MAAT,CAAgBD,CAAhB,EAAmB7B,KAAnB,EAA0BE,MAA1B,EAAkCH,OAAlC,EAA2C;AAEzC,SAAOA,OAAO,GACVoB,IAAI,CAACe,GAAL,CAAS,CAAT,EAAYhC,MAAM,GAAG,CAAT,GAAaiB,IAAI,CAACiB,KAAL,CAAWP,CAAC,GAAG7B,KAAf,CAAzB,CADU,GAEVmB,IAAI,CAACI,GAAL,CAASJ,IAAI,CAACiB,KAAL,CAAWP,CAAC,GAAG7B,KAAf,CAAT,EAAgCE,MAAM,GAAG,CAAzC,CAFJ;AAGD","sourcesContent":["import {log} from '@luma.gl/api';\nimport {getContextState} from './context-state';\n\n/**\n * Returns multiplier need to convert CSS size to Device size\n */\nexport function cssToDeviceRatio(gl: WebGLRenderingContext): number {\n const state = getContextState(gl);\n\n if (gl.canvas && state) {\n // For headless gl we might have used custom width and height\n // hence use cached clientWidth\n const {clientWidth} = state._canvasSizeInfo;\n return clientWidth ? gl.drawingBufferWidth / clientWidth : 1;\n }\n // use default device pixel ratio\n return 1;\n}\n\n/**\n * Maps CSS pixel position to device pixel position\n */\n export function cssToDevicePixels(\n gl: WebGLRenderingContext,\n cssPixel: number[],\n yInvert: boolean = true\n): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n const ratio = cssToDeviceRatio(gl);\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n return scalePixels(cssPixel, ratio, width, height, yInvert);\n}\n\n/**\n * Calulates device pixel ratio, used during context creation\n *\n * @param useDevicePixels - boolean or a number\n * @return - device pixel ratio\n */\n export function getDevicePixelRatio(useDevicePixels: boolean | number): number {\n const windowRatio = typeof window === 'undefined' ? 1 : window.devicePixelRatio || 1;\n if (Number.isFinite(useDevicePixels)) {\n // @ts-expect-error Can no longer be boolean after previous line\n return useDevicePixels <= 0 ? 1 : useDevicePixels;\n }\n return useDevicePixels ? windowRatio : 1;\n}\n\n// use devicePixelRatio to set canvas width and height\nexport function setDevicePixelRatio(gl, devicePixelRatio, options: {width?: number, height?: number} = {}) {\n // NOTE: if options.width and options.height not used remove in v8\n let clientWidth = 'width' in options ? options.width : gl.canvas.clientWidth;\n let clientHeight = 'height' in options ? options.height : gl.canvas.clientHeight;\n\n if (!clientWidth || !clientHeight) {\n log.log(1, 'Canvas clientWidth/clientHeight is 0')();\n // by forcing devicePixel ratio to 1, we do not scale gl.canvas.width and height in each frame.\n devicePixelRatio = 1;\n clientWidth = gl.canvas.width || 1;\n clientHeight = gl.canvas.height || 1;\n }\n\n const contextState = getContextState(gl);\n const cachedSize = contextState._canvasSizeInfo;\n // Check if canvas needs to be resized\n if (\n cachedSize.clientWidth !== clientWidth ||\n cachedSize.clientHeight !== clientHeight ||\n cachedSize.devicePixelRatio !== devicePixelRatio\n ) {\n let clampedPixelRatio = devicePixelRatio;\n\n const canvasWidth = Math.floor(clientWidth * clampedPixelRatio);\n const canvasHeight = Math.floor(clientHeight * clampedPixelRatio);\n gl.canvas.width = canvasWidth;\n gl.canvas.height = canvasHeight;\n\n // Note: when devicePixelRatio is too high, it is possible we might hit system limit for\n // drawing buffer width and hight, in those cases they get clamped and resulting aspect ration may not be maintained\n // for those cases, reduce devicePixelRatio.\n if (gl.drawingBufferWidth !== canvasWidth || gl.drawingBufferHeight !== canvasHeight) {\n log.warn(`Device pixel ratio clamped`)();\n clampedPixelRatio = Math.min(\n gl.drawingBufferWidth / clientWidth,\n gl.drawingBufferHeight / clientHeight\n );\n\n gl.canvas.width = Math.floor(clientWidth * clampedPixelRatio);\n gl.canvas.height = Math.floor(clientHeight * clampedPixelRatio);\n }\n\n Object.assign(contextState._canvasSizeInfo, {clientWidth, clientHeight, devicePixelRatio});\n }\n}\n\n\n// PRIVATE\n\nfunction scalePixels(pixel, ratio, width, height, yInvert) {\n const x = scaleX(pixel[0], ratio, width);\n let y = scaleY(pixel[1], ratio, height, yInvert);\n\n // Find boundaries of next pixel to provide valid range of device pixel locaitons\n\n let t = scaleX(pixel[0] + 1, ratio, width);\n // If next pixel's position is clamped to boundary, use it as is, otherwise subtract 1 for current pixel boundary\n const xHigh = t === width - 1 ? t : t - 1;\n\n t = scaleY(pixel[1] + 1, ratio, height, yInvert);\n let yHigh;\n if (yInvert) {\n // If next pixel's position is clamped to boundary, use it as is, otherwise clamp it to valid range\n t = t === 0 ? t : t + 1;\n // swap y and yHigh\n yHigh = y;\n y = t;\n } else {\n // If next pixel's position is clamped to boundary, use it as is, otherwise clamp it to valid range\n yHigh = t === height - 1 ? t : t - 1;\n // y remains same\n }\n return {\n x,\n y,\n // when ratio < 1, current css pixel and next css pixel may point to same device pixel, set width/height to 1 in those cases.\n width: Math.max(xHigh - x + 1, 1),\n height: Math.max(yHigh - y + 1, 1)\n };\n}\n\nfunction scaleX(x, ratio, width) {\n // since we are rounding to nearest, when ratio > 1, edge pixels may point to out of bounds value, clamp to the limit\n const r = Math.min(Math.round(x * ratio), width - 1);\n return r;\n}\n\nfunction scaleY(y, ratio, height, yInvert) {\n // since we are rounding to nearest, when ratio > 1, edge pixels may point to out of bounds value, clamp to the limit\n return yInvert\n ? Math.max(0, height - 1 - Math.round(y * ratio))\n : Math.min(Math.round(y * ratio), height - 1);\n}\n"],"file":"device-pixels.js"}
1
+ {"version":3,"sources":["../../../src/context/context/device-pixels.ts"],"names":["log","getContextState","cssToDeviceRatio","gl","state","canvas","clientWidth","_canvasSizeInfo","drawingBufferWidth","cssToDevicePixels","cssPixel","yInvert","ratio","width","height","drawingBufferHeight","scalePixels","getDevicePixelRatio","useDevicePixels","windowRatio","window","devicePixelRatio","Number","isFinite","setDevicePixelRatio","options","clientHeight","contextState","cachedSize","clampedPixelRatio","canvasWidth","Math","floor","canvasHeight","warn","min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,CAAN,GAAUA,CAAV,GAAcA,CAAC,GAAG,CAAtB;AAEAE,IAAAA,KAAK,GAAGJ,CAAR;AACAA,IAAAA,CAAC,GAAGE,CAAJ;AACD,GAND,MAMO;AAELE,IAAAA,KAAK,GAAGF,CAAC,KAAK7B,MAAM,GAAG,CAAf,GAAmB6B,CAAnB,GAAuBA,CAAC,GAAG,CAAnC;AAED;;AACD,SAAO;AACLJ,IAAAA,CADK;AAELE,IAAAA,CAFK;AAIL5B,IAAAA,KAAK,EAAEkB,IAAI,CAACe,GAAL,CAASF,KAAK,GAAGL,CAAR,GAAY,CAArB,EAAwB,CAAxB,CAJF;AAKLzB,IAAAA,MAAM,EAAEiB,IAAI,CAACe,GAAL,CAASD,KAAK,GAAGJ,CAAR,GAAY,CAArB,EAAwB,CAAxB;AALH,GAAP;AAOD;;AAED,SAASD,MAAT,CAAgBD,CAAhB,EAA2B3B,KAA3B,EAA0CC,KAA1C,EAAiE;AAE/D,QAAMkC,CAAC,GAAGhB,IAAI,CAACI,GAAL,CAASJ,IAAI,CAACiB,KAAL,CAAWT,CAAC,GAAG3B,KAAf,CAAT,EAAgCC,KAAK,GAAG,CAAxC,CAAV;AACA,SAAOkC,CAAP;AACD;;AAED,SAASL,MAAT,CAAgBD,CAAhB,EAA2B7B,KAA3B,EAA0CE,MAA1C,EAA0DH,OAA1D,EAAoF;AAElF,SAAOA,OAAO,GACVoB,IAAI,CAACe,GAAL,CAAS,CAAT,EAAYhC,MAAM,GAAG,CAAT,GAAaiB,IAAI,CAACiB,KAAL,CAAWP,CAAC,GAAG7B,KAAf,CAAzB,CADU,GAEVmB,IAAI,CAACI,GAAL,CAASJ,IAAI,CAACiB,KAAL,CAAWP,CAAC,GAAG7B,KAAf,CAAT,EAAgCE,MAAM,GAAG,CAAzC,CAFJ;AAGD","sourcesContent":["import {log} from '@luma.gl/api';\nimport {getContextState} from './context-state';\n\n/**\n * Returns multiplier need to convert CSS size to Device size\n */\nexport function cssToDeviceRatio(gl: WebGLRenderingContext): number {\n const state = getContextState(gl);\n\n if (gl.canvas && state) {\n // For headless gl we might have used custom width and height\n // hence use cached clientWidth\n const {clientWidth} = state._canvasSizeInfo;\n return clientWidth ? gl.drawingBufferWidth / clientWidth : 1;\n }\n // use default device pixel ratio\n return 1;\n}\n\n/**\n * Maps CSS pixel position to device pixel position\n */\n export function cssToDevicePixels(\n gl: WebGLRenderingContext,\n cssPixel: number[],\n yInvert: boolean = true\n): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n const ratio = cssToDeviceRatio(gl);\n const width = gl.drawingBufferWidth;\n const height = gl.drawingBufferHeight;\n return scalePixels(cssPixel, ratio, width, height, yInvert);\n}\n\n/**\n * Calulates device pixel ratio, used during context creation\n *\n * @param useDevicePixels - boolean or a number\n * @return - device pixel ratio\n */\n export function getDevicePixelRatio(useDevicePixels: boolean | number): number {\n const windowRatio = typeof window === 'undefined' ? 1 : window.devicePixelRatio || 1;\n if (Number.isFinite(useDevicePixels)) {\n // @ts-expect-error Can no longer be boolean after previous line\n return useDevicePixels <= 0 ? 1 : useDevicePixels;\n }\n return useDevicePixels ? windowRatio : 1;\n}\n\n// use devicePixelRatio to set canvas width and height\nexport function setDevicePixelRatio(gl: WebGLRenderingContext, devicePixelRatio: number, options: {width?: number, height?: number} = {}) {\n // NOTE: if options.width and options.height not used remove in v8\n let clientWidth = 'width' in options ? options.width : gl.canvas.clientWidth;\n let clientHeight = 'height' in options ? options.height : gl.canvas.clientHeight;\n\n if (!clientWidth || !clientHeight) {\n log.log(1, 'Canvas clientWidth/clientHeight is 0')();\n // by forcing devicePixel ratio to 1, we do not scale gl.canvas.width and height in each frame.\n devicePixelRatio = 1;\n clientWidth = gl.canvas.width || 1;\n clientHeight = gl.canvas.height || 1;\n }\n\n const contextState = getContextState(gl);\n const cachedSize = contextState._canvasSizeInfo;\n // Check if canvas needs to be resized\n if (\n cachedSize.clientWidth !== clientWidth ||\n cachedSize.clientHeight !== clientHeight ||\n cachedSize.devicePixelRatio !== devicePixelRatio\n ) {\n let clampedPixelRatio = devicePixelRatio;\n\n const canvasWidth = Math.floor(clientWidth * clampedPixelRatio);\n const canvasHeight = Math.floor(clientHeight * clampedPixelRatio);\n gl.canvas.width = canvasWidth;\n gl.canvas.height = canvasHeight;\n\n // Note: when devicePixelRatio is too high, it is possible we might hit system limit for\n // drawing buffer width and hight, in those cases they get clamped and resulting aspect ration may not be maintained\n // for those cases, reduce devicePixelRatio.\n if (gl.drawingBufferWidth !== canvasWidth || gl.drawingBufferHeight !== canvasHeight) {\n log.warn(`Device pixel ratio clamped`)();\n clampedPixelRatio = Math.min(\n gl.drawingBufferWidth / clientWidth,\n gl.drawingBufferHeight / clientHeight\n );\n\n gl.canvas.width = Math.floor(clientWidth * clampedPixelRatio);\n gl.canvas.height = Math.floor(clientHeight * clampedPixelRatio);\n }\n\n Object.assign(contextState._canvasSizeInfo, {clientWidth, clientHeight, devicePixelRatio});\n }\n}\n\n\n// PRIVATE\n\nfunction scalePixels(pixel: number[], ratio: number, width: number, height: number, yInvert: boolean): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n const x = scaleX(pixel[0], ratio, width);\n let y = scaleY(pixel[1], ratio, height, yInvert);\n\n // Find boundaries of next pixel to provide valid range of device pixel locaitons\n\n let t = scaleX(pixel[0] + 1, ratio, width);\n // If next pixel's position is clamped to boundary, use it as is, otherwise subtract 1 for current pixel boundary\n const xHigh = t === width - 1 ? t : t - 1;\n\n t = scaleY(pixel[1] + 1, ratio, height, yInvert);\n let yHigh;\n if (yInvert) {\n // If next pixel's position is clamped to boundary, use it as is, otherwise clamp it to valid range\n t = t === 0 ? t : t + 1;\n // swap y and yHigh\n yHigh = y;\n y = t;\n } else {\n // If next pixel's position is clamped to boundary, use it as is, otherwise clamp it to valid range\n yHigh = t === height - 1 ? t : t - 1;\n // y remains same\n }\n return {\n x,\n y,\n // when ratio < 1, current css pixel and next css pixel may point to same device pixel, set width/height to 1 in those cases.\n width: Math.max(xHigh - x + 1, 1),\n height: Math.max(yHigh - y + 1, 1)\n };\n}\n\nfunction scaleX(x: number, ratio: number, width: number): number {\n // since we are rounding to nearest, when ratio > 1, edge pixels may point to out of bounds value, clamp to the limit\n const r = Math.min(Math.round(x * ratio), width - 1);\n return r;\n}\n\nfunction scaleY(y: number, ratio: number, height: number, yInvert: boolean): number {\n // since we are rounding to nearest, when ratio > 1, edge pixels may point to out of bounds value, clamp to the limit\n return yInvert\n ? Math.max(0, height - 1 - Math.round(y * ratio))\n : Math.min(Math.round(y * ratio), height - 1);\n}\n"],"file":"device-pixels.js"}
@@ -0,0 +1,18 @@
1
+ /// <reference types="offscreencanvas" />
2
+ /** Spector debug initialization options */
3
+ declare type SpectorProps = {
4
+ /** Canvas to monitor */
5
+ canvas?: HTMLCanvasElement | OffscreenCanvas;
6
+ /** Whether debug is enabled. Auto-detected if ommitted */
7
+ debug?: boolean;
8
+ /** Whether spector is disabled */
9
+ spector?: boolean | string | object;
10
+ };
11
+ declare global {
12
+ var SPECTOR: any;
13
+ }
14
+ /** Loads spector from CDN if not already installed */
15
+ export declare function loadSpectorJS(props?: SpectorProps): Promise<void>;
16
+ export declare function initializeSpectorJS(props?: SpectorProps): any;
17
+ export {};
18
+ //# sourceMappingURL=spector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spector.d.ts","sourceRoot":"","sources":["../../../src/context/debug/spector.ts"],"names":[],"mappings":";AAGA,2CAA2C;AAC3C,aAAK,YAAY,GAAG;IAClB,wBAAwB;IACxB,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAC7C,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CACrC,CAAC;AAaF,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,OAAO,EAAE,GAAG,CAAC;CAClB;AAED,sDAAsD;AACtD,wBAAsB,aAAa,CAAC,KAAK,CAAC,EAAE,YAAY,iBAQvD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,YAAY,OAoDvD"}