@luma.gl/webgl 9.0.0-alpha.5 → 9.0.0-alpha.50

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 (531) hide show
  1. package/LICENSE +3 -1
  2. package/dist/adapter/converters/device-parameters.d.ts +23 -4
  3. package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
  4. package/dist/adapter/converters/device-parameters.js +101 -73
  5. package/dist/adapter/converters/device-parameters.js.map +1 -1
  6. package/dist/adapter/converters/sampler-parameters.d.ts +6 -6
  7. package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
  8. package/dist/adapter/converters/sampler-parameters.js +74 -111
  9. package/dist/adapter/converters/sampler-parameters.js.map +1 -1
  10. package/dist/adapter/converters/shader-formats.d.ts +9 -0
  11. package/dist/adapter/converters/shader-formats.d.ts.map +1 -0
  12. package/dist/adapter/converters/shader-formats.js +52 -0
  13. package/dist/adapter/converters/shader-formats.js.map +1 -0
  14. package/dist/adapter/converters/texture-formats.d.ts +32 -44
  15. package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
  16. package/dist/adapter/converters/texture-formats.js +309 -346
  17. package/dist/adapter/converters/texture-formats.js.map +1 -1
  18. package/dist/adapter/converters/vertex-formats.d.ts +9 -3
  19. package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
  20. package/dist/adapter/converters/vertex-formats.js +53 -22
  21. package/dist/adapter/converters/vertex-formats.js.map +1 -1
  22. package/dist/adapter/device-helpers/device-features.d.ts +1 -1
  23. package/dist/adapter/device-helpers/device-features.d.ts.map +1 -1
  24. package/dist/adapter/device-helpers/device-features.js +17 -23
  25. package/dist/adapter/device-helpers/device-features.js.map +1 -1
  26. package/dist/adapter/device-helpers/device-limits.d.ts +3 -3
  27. package/dist/adapter/device-helpers/device-limits.d.ts.map +1 -1
  28. package/dist/adapter/device-helpers/device-limits.js +54 -58
  29. package/dist/adapter/device-helpers/device-limits.js.map +1 -1
  30. package/dist/adapter/device-helpers/get-device-info.d.ts +1 -1
  31. package/dist/adapter/device-helpers/get-device-info.d.ts.map +1 -1
  32. package/dist/adapter/device-helpers/get-device-info.js +31 -22
  33. package/dist/adapter/device-helpers/get-device-info.js.map +1 -1
  34. package/dist/adapter/device-helpers/is-old-ie.d.ts.map +1 -1
  35. package/dist/adapter/device-helpers/is-old-ie.js +2 -1
  36. package/dist/adapter/device-helpers/is-old-ie.js.map +1 -1
  37. package/dist/adapter/helpers/decode-webgl-types.d.ts +26 -0
  38. package/dist/adapter/helpers/decode-webgl-types.d.ts.map +1 -0
  39. package/dist/adapter/helpers/decode-webgl-types.js +89 -0
  40. package/dist/adapter/helpers/decode-webgl-types.js.map +1 -0
  41. package/dist/adapter/helpers/get-shader-info.d.ts +9 -0
  42. package/dist/adapter/helpers/get-shader-info.d.ts.map +1 -0
  43. package/dist/adapter/helpers/get-shader-info.js +25 -0
  44. package/dist/adapter/helpers/get-shader-info.js.map +1 -0
  45. package/dist/adapter/helpers/get-shader-layout.d.ts +1 -48
  46. package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
  47. package/dist/adapter/helpers/get-shader-layout.js +87 -143
  48. package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
  49. package/dist/adapter/helpers/parse-shader-compiler-log.d.ts +1 -1
  50. package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
  51. package/dist/adapter/helpers/parse-shader-compiler-log.js +16 -11
  52. package/dist/adapter/helpers/parse-shader-compiler-log.js.map +1 -1
  53. package/dist/adapter/helpers/set-uniform.d.ts +3 -2
  54. package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
  55. package/dist/adapter/helpers/set-uniform.js +51 -82
  56. package/dist/adapter/helpers/set-uniform.js.map +1 -1
  57. package/dist/adapter/helpers/webgl-topology-utils.d.ts +16 -0
  58. package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -0
  59. package/dist/adapter/helpers/webgl-topology-utils.js +103 -0
  60. package/dist/adapter/helpers/webgl-topology-utils.js.map +1 -0
  61. package/dist/adapter/objects/constants-to-keys.d.ts +1 -3
  62. package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
  63. package/dist/adapter/objects/constants-to-keys.js +2 -29
  64. package/dist/adapter/objects/constants-to-keys.js.map +1 -1
  65. package/dist/adapter/objects/webgl-renderbuffer.d.ts +15 -12
  66. package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
  67. package/dist/adapter/objects/webgl-renderbuffer.js +36 -44
  68. package/dist/adapter/objects/webgl-renderbuffer.js.map +1 -1
  69. package/dist/adapter/objects/webgl-resource.d.ts +6 -9
  70. package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
  71. package/dist/adapter/objects/webgl-resource.js +26 -83
  72. package/dist/adapter/objects/webgl-resource.js.map +1 -1
  73. package/dist/adapter/resources/webgl-buffer.d.ts +19 -11
  74. package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
  75. package/dist/adapter/resources/webgl-buffer.js +60 -88
  76. package/dist/adapter/resources/webgl-buffer.js.map +1 -1
  77. package/dist/adapter/resources/webgl-command-buffer.d.ts +15 -9
  78. package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
  79. package/dist/adapter/resources/webgl-command-buffer.js +175 -48
  80. package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
  81. package/dist/adapter/resources/webgl-command-encoder.d.ts +7 -6
  82. package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
  83. package/dist/adapter/resources/webgl-command-encoder.js +10 -20
  84. package/dist/adapter/resources/webgl-command-encoder.js.map +1 -1
  85. package/dist/adapter/resources/webgl-external-texture.js.map +1 -1
  86. package/dist/adapter/resources/webgl-framebuffer.d.ts +21 -24
  87. package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
  88. package/dist/adapter/resources/webgl-framebuffer.js +63 -173
  89. package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
  90. package/dist/adapter/resources/webgl-render-pass.d.ts +19 -4
  91. package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
  92. package/dist/adapter/resources/webgl-render-pass.js +99 -11
  93. package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
  94. package/dist/adapter/resources/webgl-render-pipeline.d.ts +55 -21
  95. package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
  96. package/dist/adapter/resources/webgl-render-pipeline.js +108 -270
  97. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
  98. package/dist/adapter/resources/webgl-sampler.d.ts +6 -5
  99. package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
  100. package/dist/adapter/resources/webgl-sampler.js +11 -21
  101. package/dist/adapter/resources/webgl-sampler.js.map +1 -1
  102. package/dist/adapter/resources/webgl-shader.d.ts +3 -4
  103. package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
  104. package/dist/adapter/resources/webgl-shader.js +21 -34
  105. package/dist/adapter/resources/webgl-shader.js.map +1 -1
  106. package/dist/adapter/resources/webgl-texture.d.ts +62 -42
  107. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
  108. package/dist/adapter/resources/webgl-texture.js +137 -256
  109. package/dist/adapter/resources/webgl-texture.js.map +1 -1
  110. package/dist/adapter/resources/webgl-transform-feedback.d.ts +47 -0
  111. package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -0
  112. package/dist/adapter/resources/webgl-transform-feedback.js +164 -0
  113. package/dist/adapter/resources/webgl-transform-feedback.js.map +1 -0
  114. package/dist/adapter/resources/webgl-vertex-array.d.ts +67 -0
  115. package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -0
  116. package/dist/adapter/resources/webgl-vertex-array.js +167 -0
  117. package/dist/adapter/resources/webgl-vertex-array.js.map +1 -0
  118. package/dist/adapter/webgl-canvas-context.d.ts +6 -7
  119. package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
  120. package/dist/adapter/webgl-canvas-context.js +10 -23
  121. package/dist/adapter/webgl-canvas-context.js.map +1 -1
  122. package/dist/adapter/webgl-device.d.ts +76 -41
  123. package/dist/adapter/webgl-device.d.ts.map +1 -1
  124. package/dist/adapter/webgl-device.js +219 -129
  125. package/dist/adapter/webgl-device.js.map +1 -1
  126. package/dist/classic/accessor.d.ts +3 -3
  127. package/dist/classic/accessor.d.ts.map +1 -1
  128. package/dist/classic/accessor.js +26 -52
  129. package/dist/classic/accessor.js.map +1 -1
  130. package/dist/classic/clear.d.ts +22 -0
  131. package/dist/classic/clear.d.ts.map +1 -0
  132. package/dist/classic/clear.js +88 -0
  133. package/dist/classic/clear.js.map +1 -0
  134. package/dist/classic/copy-and-blit.d.ts +62 -0
  135. package/dist/classic/copy-and-blit.d.ts.map +1 -0
  136. package/dist/classic/copy-and-blit.js +191 -0
  137. package/dist/classic/copy-and-blit.js.map +1 -0
  138. package/dist/classic/format-utils.d.ts +3 -0
  139. package/dist/classic/format-utils.d.ts.map +1 -0
  140. package/dist/classic/format-utils.js +37 -0
  141. package/dist/classic/format-utils.js.map +1 -0
  142. package/dist/classic/typed-array-utils.d.ts +17 -17
  143. package/dist/classic/typed-array-utils.d.ts.map +1 -1
  144. package/dist/classic/typed-array-utils.js +18 -39
  145. package/dist/classic/typed-array-utils.js.map +1 -1
  146. package/dist/context/context/create-browser-context.d.ts +40 -0
  147. package/dist/context/context/create-browser-context.d.ts.map +1 -0
  148. package/dist/context/context/create-browser-context.js +53 -0
  149. package/dist/context/context/create-browser-context.js.map +1 -0
  150. package/dist/context/context/create-headless-context.d.ts +9 -0
  151. package/dist/context/context/create-headless-context.d.ts.map +1 -0
  152. package/dist/context/context/create-headless-context.js +42 -0
  153. package/dist/context/context/create-headless-context.js.map +1 -0
  154. package/dist/context/context/webgl-checks.d.ts.map +1 -1
  155. package/dist/context/context/webgl-checks.js +1 -4
  156. package/dist/context/context/webgl-checks.js.map +1 -1
  157. package/dist/context/debug/spector.d.ts +1 -2
  158. package/dist/context/debug/spector.d.ts.map +1 -1
  159. package/dist/context/debug/spector.js +8 -20
  160. package/dist/context/debug/spector.js.map +1 -1
  161. package/dist/context/debug/webgl-developer-tools.d.ts +2 -2
  162. package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
  163. package/dist/context/debug/webgl-developer-tools.js +15 -39
  164. package/dist/context/debug/webgl-developer-tools.js.map +1 -1
  165. package/dist/context/parameters/unified-parameter-api.d.ts +9 -8
  166. package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
  167. package/dist/context/parameters/unified-parameter-api.js +9 -19
  168. package/dist/context/parameters/unified-parameter-api.js.map +1 -1
  169. package/dist/context/parameters/webgl-parameter-tables.d.ts +105 -106
  170. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
  171. package/dist/context/parameters/webgl-parameter-tables.js +267 -286
  172. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
  173. package/dist/context/polyfill/context-data.d.ts +13 -0
  174. package/dist/context/polyfill/context-data.d.ts.map +1 -0
  175. package/dist/context/polyfill/context-data.js +12 -0
  176. package/dist/context/polyfill/context-data.js.map +1 -0
  177. package/dist/context/polyfill/get-parameter-polyfill.d.ts +1 -1
  178. package/dist/context/polyfill/get-parameter-polyfill.d.ts.map +1 -1
  179. package/dist/context/polyfill/get-parameter-polyfill.js +37 -43
  180. package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -1
  181. package/dist/context/polyfill/polyfill-context.d.ts.map +1 -1
  182. package/dist/context/polyfill/polyfill-context.js +22 -30
  183. package/dist/context/polyfill/polyfill-context.js.map +1 -1
  184. package/dist/context/polyfill/polyfill-table.d.ts +8 -8
  185. package/dist/context/polyfill/polyfill-table.d.ts.map +1 -1
  186. package/dist/context/polyfill/polyfill-table.js +18 -41
  187. package/dist/context/polyfill/polyfill-table.js.map +1 -1
  188. package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +1 -1
  189. package/dist/context/polyfill/polyfill-vertex-array-object.js +17 -87
  190. package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -1
  191. package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
  192. package/dist/context/state-tracker/deep-array-equal.js +0 -4
  193. package/dist/context/state-tracker/deep-array-equal.js.map +1 -1
  194. package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
  195. package/dist/context/state-tracker/track-context-state.js +26 -62
  196. package/dist/context/state-tracker/track-context-state.js.map +1 -1
  197. package/dist/context/state-tracker/with-parameters.d.ts +2 -1
  198. package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
  199. package/dist/context/state-tracker/with-parameters.js +8 -10
  200. package/dist/context/state-tracker/with-parameters.js.map +1 -1
  201. package/dist/dist.dev.js +8555 -0
  202. package/dist/index.cjs +6602 -0
  203. package/dist/index.d.ts +26 -24
  204. package/dist/index.d.ts.map +1 -1
  205. package/dist/index.js +27 -26
  206. package/dist/index.js.map +1 -1
  207. package/dist/types.d.ts +3 -1
  208. package/dist/types.d.ts.map +1 -1
  209. package/dist/types.js.map +1 -1
  210. package/dist.min.js +49 -0
  211. package/package.json +21 -9
  212. package/src/adapter/converters/device-parameters.ts +144 -41
  213. package/src/adapter/converters/sampler-parameters.ts +103 -41
  214. package/src/adapter/converters/shader-formats.ts +44 -0
  215. package/src/adapter/converters/texture-formats.ts +268 -195
  216. package/src/adapter/converters/vertex-formats.ts +71 -10
  217. package/src/adapter/device-helpers/device-features.ts +14 -3
  218. package/src/adapter/device-helpers/device-limits.ts +5 -3
  219. package/src/adapter/device-helpers/get-device-info.ts +53 -18
  220. package/src/adapter/device-helpers/is-old-ie.ts +3 -0
  221. package/src/adapter/helpers/{uniforms.ts → decode-webgl-types.ts} +39 -21
  222. package/src/adapter/helpers/get-shader-info.ts +41 -0
  223. package/src/adapter/helpers/get-shader-layout.ts +121 -146
  224. package/src/adapter/helpers/parse-shader-compiler-log.ts +24 -8
  225. package/src/adapter/helpers/set-uniform.ts +39 -35
  226. package/src/adapter/helpers/webgl-topology-utils.ts +103 -0
  227. package/src/adapter/objects/constants-to-keys.ts +6 -25
  228. package/src/adapter/objects/webgl-renderbuffer.ts +43 -37
  229. package/src/adapter/objects/webgl-resource.ts +16 -23
  230. package/src/adapter/resources/webgl-buffer.ts +67 -62
  231. package/src/adapter/resources/webgl-command-buffer.ts +327 -25
  232. package/src/adapter/resources/webgl-command-encoder.ts +20 -12
  233. package/src/adapter/resources/webgl-external-texture.ts +5 -2
  234. package/src/adapter/resources/webgl-framebuffer.ts +90 -134
  235. package/src/adapter/resources/webgl-render-pass.ts +166 -4
  236. package/src/adapter/resources/webgl-render-pipeline.ts +256 -192
  237. package/src/adapter/resources/webgl-sampler.ts +16 -10
  238. package/src/adapter/resources/webgl-shader.ts +14 -11
  239. package/src/adapter/resources/webgl-texture.ts +138 -99
  240. package/src/adapter/resources/webgl-transform-feedback.ts +202 -0
  241. package/src/adapter/resources/webgl-vertex-array.ts +283 -0
  242. package/src/adapter/webgl-canvas-context.ts +16 -14
  243. package/src/adapter/webgl-device.ts +328 -79
  244. package/src/classic/accessor.ts +8 -18
  245. package/src/classic/clear.ts +113 -0
  246. package/src/classic/copy-and-blit.ts +311 -0
  247. package/src/classic/format-utils.ts +46 -0
  248. package/src/classic/typed-array-utils.ts +21 -27
  249. package/src/context/context/create-browser-context.ts +140 -0
  250. package/src/context/context/create-headless-context.ts +51 -0
  251. package/src/context/context/webgl-checks.ts +3 -1
  252. package/src/context/debug/spector.ts +9 -6
  253. package/src/context/debug/webgl-developer-tools.ts +23 -15
  254. package/src/context/parameters/unified-parameter-api.ts +23 -14
  255. package/src/context/parameters/webgl-parameter-tables.ts +120 -98
  256. package/src/context/polyfill/context-data.ts +30 -0
  257. package/src/context/polyfill/get-parameter-polyfill.ts +11 -7
  258. package/src/context/polyfill/polyfill-context.ts +10 -9
  259. package/src/context/polyfill/polyfill-table.ts +21 -16
  260. package/src/context/polyfill/polyfill-vertex-array-object.ts +5 -0
  261. package/src/context/state-tracker/deep-array-equal.ts +2 -0
  262. package/src/context/state-tracker/track-context-state.ts +14 -11
  263. package/src/context/state-tracker/with-parameters.ts +13 -4
  264. package/src/index.ts +70 -35
  265. package/src/types.ts +5 -0
  266. package/dist/adapter/converters/renderbuffer-formats.d.ts +0 -16
  267. package/dist/adapter/converters/renderbuffer-formats.d.ts.map +0 -1
  268. package/dist/adapter/converters/renderbuffer-formats.js +0 -185
  269. package/dist/adapter/converters/renderbuffer-formats.js.map +0 -1
  270. package/dist/adapter/helpers/attribute-utils.d.ts +0 -11
  271. package/dist/adapter/helpers/attribute-utils.d.ts.map +0 -1
  272. package/dist/adapter/helpers/attribute-utils.js +0 -81
  273. package/dist/adapter/helpers/attribute-utils.js.map +0 -1
  274. package/dist/adapter/helpers/uniforms.d.ts +0 -26
  275. package/dist/adapter/helpers/uniforms.d.ts.map +0 -1
  276. package/dist/adapter/helpers/uniforms.js +0 -99
  277. package/dist/adapter/helpers/uniforms.js.map +0 -1
  278. package/dist/adapter/objects/webgl-vertex-array-object.d.ts +0 -27
  279. package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +0 -1
  280. package/dist/adapter/objects/webgl-vertex-array-object.js +0 -84
  281. package/dist/adapter/objects/webgl-vertex-array-object.js.map +0 -1
  282. package/dist/bundle.d.ts +0 -2
  283. package/dist/bundle.d.ts.map +0 -1
  284. package/dist/bundle.js +0 -5
  285. package/dist/bundle.js.map +0 -1
  286. package/dist/classic/buffer.d.ts +0 -95
  287. package/dist/classic/buffer.d.ts.map +0 -1
  288. package/dist/classic/buffer.js +0 -384
  289. package/dist/classic/buffer.js.map +0 -1
  290. package/dist/context/context/context-state.d.ts +0 -18
  291. package/dist/context/context/context-state.d.ts.map +0 -1
  292. package/dist/context/context/context-state.js +0 -26
  293. package/dist/context/context/context-state.js.map +0 -1
  294. package/dist/context/context/create-context.d.ts +0 -41
  295. package/dist/context/context/create-context.d.ts.map +0 -1
  296. package/dist/context/context/create-context.js +0 -49
  297. package/dist/context/context/create-context.js.map +0 -1
  298. package/dist/context/context/device-pixels.d.ts +0 -25
  299. package/dist/context/context/device-pixels.d.ts.map +0 -1
  300. package/dist/context/context/device-pixels.js +0 -98
  301. package/dist/context/context/device-pixels.js.map +0 -1
  302. package/dist/es5/adapter/converters/device-parameters.js +0 -170
  303. package/dist/es5/adapter/converters/device-parameters.js.map +0 -1
  304. package/dist/es5/adapter/converters/renderbuffer-formats.js +0 -163
  305. package/dist/es5/adapter/converters/renderbuffer-formats.js.map +0 -1
  306. package/dist/es5/adapter/converters/sampler-parameters.js +0 -226
  307. package/dist/es5/adapter/converters/sampler-parameters.js.map +0 -1
  308. package/dist/es5/adapter/converters/texture-formats.js +0 -1031
  309. package/dist/es5/adapter/converters/texture-formats.js.map +0 -1
  310. package/dist/es5/adapter/converters/vertex-formats.js +0 -45
  311. package/dist/es5/adapter/converters/vertex-formats.js.map +0 -1
  312. package/dist/es5/adapter/device-helpers/device-features.js +0 -144
  313. package/dist/es5/adapter/device-helpers/device-features.js.map +0 -1
  314. package/dist/es5/adapter/device-helpers/device-limits.js +0 -64
  315. package/dist/es5/adapter/device-helpers/device-limits.js.map +0 -1
  316. package/dist/es5/adapter/device-helpers/get-device-info.js +0 -55
  317. package/dist/es5/adapter/device-helpers/get-device-info.js.map +0 -1
  318. package/dist/es5/adapter/device-helpers/is-old-ie.js +0 -16
  319. package/dist/es5/adapter/device-helpers/is-old-ie.js.map +0 -1
  320. package/dist/es5/adapter/helpers/attribute-utils.js +0 -91
  321. package/dist/es5/adapter/helpers/attribute-utils.js.map +0 -1
  322. package/dist/es5/adapter/helpers/get-shader-layout.js +0 -371
  323. package/dist/es5/adapter/helpers/get-shader-layout.js.map +0 -1
  324. package/dist/es5/adapter/helpers/parse-shader-compiler-log.js +0 -72
  325. package/dist/es5/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
  326. package/dist/es5/adapter/helpers/set-uniform.js +0 -125
  327. package/dist/es5/adapter/helpers/set-uniform.js.map +0 -1
  328. package/dist/es5/adapter/helpers/uniforms.js +0 -112
  329. package/dist/es5/adapter/helpers/uniforms.js.map +0 -1
  330. package/dist/es5/adapter/objects/constants-to-keys.js +0 -54
  331. package/dist/es5/adapter/objects/constants-to-keys.js.map +0 -1
  332. package/dist/es5/adapter/objects/webgl-renderbuffer.js +0 -150
  333. package/dist/es5/adapter/objects/webgl-renderbuffer.js.map +0 -1
  334. package/dist/es5/adapter/objects/webgl-resource.js +0 -292
  335. package/dist/es5/adapter/objects/webgl-resource.js.map +0 -1
  336. package/dist/es5/adapter/objects/webgl-vertex-array-object.js +0 -137
  337. package/dist/es5/adapter/objects/webgl-vertex-array-object.js.map +0 -1
  338. package/dist/es5/adapter/resources/webgl-buffer.js +0 -243
  339. package/dist/es5/adapter/resources/webgl-buffer.js.map +0 -1
  340. package/dist/es5/adapter/resources/webgl-command-buffer.js +0 -96
  341. package/dist/es5/adapter/resources/webgl-command-buffer.js.map +0 -1
  342. package/dist/es5/adapter/resources/webgl-command-encoder.js +0 -98
  343. package/dist/es5/adapter/resources/webgl-command-encoder.js.map +0 -1
  344. package/dist/es5/adapter/resources/webgl-external-texture.js +0 -2
  345. package/dist/es5/adapter/resources/webgl-external-texture.js.map +0 -1
  346. package/dist/es5/adapter/resources/webgl-framebuffer.js +0 -345
  347. package/dist/es5/adapter/resources/webgl-framebuffer.js.map +0 -1
  348. package/dist/es5/adapter/resources/webgl-render-pass.js +0 -61
  349. package/dist/es5/adapter/resources/webgl-render-pass.js.map +0 -1
  350. package/dist/es5/adapter/resources/webgl-render-pipeline.js +0 -505
  351. package/dist/es5/adapter/resources/webgl-render-pipeline.js.map +0 -1
  352. package/dist/es5/adapter/resources/webgl-sampler.js +0 -96
  353. package/dist/es5/adapter/resources/webgl-sampler.js.map +0 -1
  354. package/dist/es5/adapter/resources/webgl-shader.js +0 -149
  355. package/dist/es5/adapter/resources/webgl-shader.js.map +0 -1
  356. package/dist/es5/adapter/resources/webgl-texture.js +0 -986
  357. package/dist/es5/adapter/resources/webgl-texture.js.map +0 -1
  358. package/dist/es5/adapter/webgl-canvas-context.js +0 -97
  359. package/dist/es5/adapter/webgl-canvas-context.js.map +0 -1
  360. package/dist/es5/adapter/webgl-device.js +0 -399
  361. package/dist/es5/adapter/webgl-device.js.map +0 -1
  362. package/dist/es5/bundle.js +0 -7
  363. package/dist/es5/bundle.js.map +0 -1
  364. package/dist/es5/classic/accessor.js +0 -181
  365. package/dist/es5/classic/accessor.js.map +0 -1
  366. package/dist/es5/classic/buffer.js +0 -470
  367. package/dist/es5/classic/buffer.js.map +0 -1
  368. package/dist/es5/classic/typed-array-utils.js +0 -126
  369. package/dist/es5/classic/typed-array-utils.js.map +0 -1
  370. package/dist/es5/context/context/context-state.js +0 -31
  371. package/dist/es5/context/context/context-state.js.map +0 -1
  372. package/dist/es5/context/context/create-context.js +0 -69
  373. package/dist/es5/context/context/create-context.js.map +0 -1
  374. package/dist/es5/context/context/device-pixels.js +0 -115
  375. package/dist/es5/context/context/device-pixels.js.map +0 -1
  376. package/dist/es5/context/context/webgl-checks.js +0 -54
  377. package/dist/es5/context/context/webgl-checks.js.map +0 -1
  378. package/dist/es5/context/debug/spector.js +0 -133
  379. package/dist/es5/context/debug/spector.js.map +0 -1
  380. package/dist/es5/context/debug/webgl-developer-tools.js +0 -198
  381. package/dist/es5/context/debug/webgl-developer-tools.js.map +0 -1
  382. package/dist/es5/context/parameters/unified-parameter-api.js +0 -97
  383. package/dist/es5/context/parameters/unified-parameter-api.js.map +0 -1
  384. package/dist/es5/context/parameters/webgl-parameter-tables.js +0 -392
  385. package/dist/es5/context/parameters/webgl-parameter-tables.js.map +0 -1
  386. package/dist/es5/context/polyfill/get-parameter-polyfill.js +0 -81
  387. package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +0 -1
  388. package/dist/es5/context/polyfill/polyfill-context.js +0 -135
  389. package/dist/es5/context/polyfill/polyfill-context.js.map +0 -1
  390. package/dist/es5/context/polyfill/polyfill-table.js +0 -166
  391. package/dist/es5/context/polyfill/polyfill-table.js.map +0 -1
  392. package/dist/es5/context/polyfill/polyfill-vertex-array-object.js +0 -341
  393. package/dist/es5/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
  394. package/dist/es5/context/state-tracker/deep-array-equal.js +0 -28
  395. package/dist/es5/context/state-tracker/deep-array-equal.js.map +0 -1
  396. package/dist/es5/context/state-tracker/track-context-state.js +0 -211
  397. package/dist/es5/context/state-tracker/track-context-state.js.map +0 -1
  398. package/dist/es5/context/state-tracker/with-parameters.js +0 -44
  399. package/dist/es5/context/state-tracker/with-parameters.js.map +0 -1
  400. package/dist/es5/index.js +0 -276
  401. package/dist/es5/index.js.map +0 -1
  402. package/dist/es5/init.js +0 -10
  403. package/dist/es5/init.js.map +0 -1
  404. package/dist/es5/types/webgl.js +0 -6
  405. package/dist/es5/types/webgl.js.map +0 -1
  406. package/dist/es5/types.js +0 -2
  407. package/dist/es5/types.js.map +0 -1
  408. package/dist/esm/adapter/converters/device-parameters.js +0 -155
  409. package/dist/esm/adapter/converters/device-parameters.js.map +0 -1
  410. package/dist/esm/adapter/converters/renderbuffer-formats.js +0 -185
  411. package/dist/esm/adapter/converters/renderbuffer-formats.js.map +0 -1
  412. package/dist/esm/adapter/converters/sampler-parameters.js +0 -208
  413. package/dist/esm/adapter/converters/sampler-parameters.js.map +0 -1
  414. package/dist/esm/adapter/converters/texture-formats.js +0 -954
  415. package/dist/esm/adapter/converters/texture-formats.js.map +0 -1
  416. package/dist/esm/adapter/converters/vertex-formats.js +0 -35
  417. package/dist/esm/adapter/converters/vertex-formats.js.map +0 -1
  418. package/dist/esm/adapter/device-helpers/device-features.js +0 -102
  419. package/dist/esm/adapter/device-helpers/device-features.js.map +0 -1
  420. package/dist/esm/adapter/device-helpers/device-limits.js +0 -91
  421. package/dist/esm/adapter/device-helpers/device-limits.js.map +0 -1
  422. package/dist/esm/adapter/device-helpers/get-device-info.js +0 -44
  423. package/dist/esm/adapter/device-helpers/get-device-info.js.map +0 -1
  424. package/dist/esm/adapter/device-helpers/is-old-ie.js +0 -8
  425. package/dist/esm/adapter/device-helpers/is-old-ie.js.map +0 -1
  426. package/dist/esm/adapter/helpers/attribute-utils.js +0 -81
  427. package/dist/esm/adapter/helpers/attribute-utils.js.map +0 -1
  428. package/dist/esm/adapter/helpers/get-shader-layout.js +0 -306
  429. package/dist/esm/adapter/helpers/get-shader-layout.js.map +0 -1
  430. package/dist/esm/adapter/helpers/parse-shader-compiler-log.js +0 -37
  431. package/dist/esm/adapter/helpers/parse-shader-compiler-log.js.map +0 -1
  432. package/dist/esm/adapter/helpers/set-uniform.js +0 -115
  433. package/dist/esm/adapter/helpers/set-uniform.js.map +0 -1
  434. package/dist/esm/adapter/helpers/uniforms.js +0 -99
  435. package/dist/esm/adapter/helpers/uniforms.js.map +0 -1
  436. package/dist/esm/adapter/objects/constants-to-keys.js +0 -42
  437. package/dist/esm/adapter/objects/constants-to-keys.js.map +0 -1
  438. package/dist/esm/adapter/objects/webgl-renderbuffer.js +0 -94
  439. package/dist/esm/adapter/objects/webgl-renderbuffer.js.map +0 -1
  440. package/dist/esm/adapter/objects/webgl-resource.js +0 -216
  441. package/dist/esm/adapter/objects/webgl-resource.js.map +0 -1
  442. package/dist/esm/adapter/objects/webgl-vertex-array-object.js +0 -84
  443. package/dist/esm/adapter/objects/webgl-vertex-array-object.js.map +0 -1
  444. package/dist/esm/adapter/resources/webgl-buffer.js +0 -164
  445. package/dist/esm/adapter/resources/webgl-buffer.js.map +0 -1
  446. package/dist/esm/adapter/resources/webgl-command-buffer.js +0 -65
  447. package/dist/esm/adapter/resources/webgl-command-buffer.js.map +0 -1
  448. package/dist/esm/adapter/resources/webgl-command-encoder.js +0 -53
  449. package/dist/esm/adapter/resources/webgl-command-encoder.js.map +0 -1
  450. package/dist/esm/adapter/resources/webgl-external-texture.js +0 -2
  451. package/dist/esm/adapter/resources/webgl-external-texture.js.map +0 -1
  452. package/dist/esm/adapter/resources/webgl-framebuffer.js +0 -265
  453. package/dist/esm/adapter/resources/webgl-framebuffer.js.map +0 -1
  454. package/dist/esm/adapter/resources/webgl-render-pass.js +0 -19
  455. package/dist/esm/adapter/resources/webgl-render-pass.js.map +0 -1
  456. package/dist/esm/adapter/resources/webgl-render-pipeline.js +0 -400
  457. package/dist/esm/adapter/resources/webgl-render-pipeline.js.map +0 -1
  458. package/dist/esm/adapter/resources/webgl-sampler.js +0 -50
  459. package/dist/esm/adapter/resources/webgl-sampler.js.map +0 -1
  460. package/dist/esm/adapter/resources/webgl-shader.js +0 -75
  461. package/dist/esm/adapter/resources/webgl-shader.js.map +0 -1
  462. package/dist/esm/adapter/resources/webgl-texture.js +0 -833
  463. package/dist/esm/adapter/resources/webgl-texture.js.map +0 -1
  464. package/dist/esm/adapter/webgl-canvas-context.js +0 -54
  465. package/dist/esm/adapter/webgl-canvas-context.js.map +0 -1
  466. package/dist/esm/adapter/webgl-device.js +0 -280
  467. package/dist/esm/adapter/webgl-device.js.map +0 -1
  468. package/dist/esm/bundle.js +0 -5
  469. package/dist/esm/bundle.js.map +0 -1
  470. package/dist/esm/classic/accessor.js +0 -144
  471. package/dist/esm/classic/accessor.js.map +0 -1
  472. package/dist/esm/classic/buffer.js +0 -384
  473. package/dist/esm/classic/buffer.js.map +0 -1
  474. package/dist/esm/classic/typed-array-utils.js +0 -112
  475. package/dist/esm/classic/typed-array-utils.js.map +0 -1
  476. package/dist/esm/context/context/context-state.js +0 -26
  477. package/dist/esm/context/context/context-state.js.map +0 -1
  478. package/dist/esm/context/context/create-context.js +0 -49
  479. package/dist/esm/context/context/create-context.js.map +0 -1
  480. package/dist/esm/context/context/device-pixels.js +0 -98
  481. package/dist/esm/context/context/device-pixels.js.map +0 -1
  482. package/dist/esm/context/context/webgl-checks.js +0 -34
  483. package/dist/esm/context/context/webgl-checks.js.map +0 -1
  484. package/dist/esm/context/debug/spector.js +0 -76
  485. package/dist/esm/context/debug/spector.js.map +0 -1
  486. package/dist/esm/context/debug/webgl-developer-tools.js +0 -121
  487. package/dist/esm/context/debug/webgl-developer-tools.js.map +0 -1
  488. package/dist/esm/context/parameters/unified-parameter-api.js +0 -65
  489. package/dist/esm/context/parameters/unified-parameter-api.js.map +0 -1
  490. package/dist/esm/context/parameters/webgl-parameter-tables.js +0 -445
  491. package/dist/esm/context/parameters/webgl-parameter-tables.js.map +0 -1
  492. package/dist/esm/context/polyfill/get-parameter-polyfill.js +0 -91
  493. package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +0 -1
  494. package/dist/esm/context/polyfill/polyfill-context.js +0 -92
  495. package/dist/esm/context/polyfill/polyfill-context.js.map +0 -1
  496. package/dist/esm/context/polyfill/polyfill-table.js +0 -160
  497. package/dist/esm/context/polyfill/polyfill-table.js.map +0 -1
  498. package/dist/esm/context/polyfill/polyfill-vertex-array-object.js +0 -335
  499. package/dist/esm/context/polyfill/polyfill-vertex-array-object.js.map +0 -1
  500. package/dist/esm/context/state-tracker/deep-array-equal.js +0 -21
  501. package/dist/esm/context/state-tracker/deep-array-equal.js.map +0 -1
  502. package/dist/esm/context/state-tracker/track-context-state.js +0 -183
  503. package/dist/esm/context/state-tracker/track-context-state.js.map +0 -1
  504. package/dist/esm/context/state-tracker/with-parameters.js +0 -36
  505. package/dist/esm/context/state-tracker/with-parameters.js.map +0 -1
  506. package/dist/esm/index.js +0 -27
  507. package/dist/esm/index.js.map +0 -1
  508. package/dist/esm/init.js +0 -4
  509. package/dist/esm/init.js.map +0 -1
  510. package/dist/esm/types/webgl.js +0 -2
  511. package/dist/esm/types/webgl.js.map +0 -1
  512. package/dist/esm/types.js +0 -2
  513. package/dist/esm/types.js.map +0 -1
  514. package/dist/init.d.ts +0 -2
  515. package/dist/init.d.ts.map +0 -1
  516. package/dist/init.js +0 -4
  517. package/dist/init.js.map +0 -1
  518. package/dist/types/webgl.d.ts +0 -145
  519. package/dist/types/webgl.d.ts.map +0 -1
  520. package/dist/types/webgl.js +0 -2
  521. package/dist/types/webgl.js.map +0 -1
  522. package/src/adapter/converters/renderbuffer-formats.ts +0 -92
  523. package/src/adapter/helpers/attribute-utils.ts +0 -61
  524. package/src/adapter/objects/webgl-vertex-array-object.ts +0 -111
  525. package/src/bundle.ts +0 -4
  526. package/src/classic/buffer.ts +0 -474
  527. package/src/context/context/context-state.ts +0 -41
  528. package/src/context/context/create-context.ts +0 -110
  529. package/src/context/context/device-pixels.ts +0 -152
  530. package/src/init.ts +0 -4
  531. package/src/types/webgl.ts +0 -284
@@ -1,4 +1,4 @@
1
- declare type DebugContextProps = {
1
+ type DebugContextProps = {
2
2
  debug?: boolean;
3
3
  throwOnError?: boolean;
4
4
  break?: string[];
@@ -14,6 +14,6 @@ declare global {
14
14
  * @see https://github.com/vorg/webgl-debug
15
15
  */
16
16
  export declare function loadWebGLDeveloperTools(): Promise<void>;
17
- export declare function makeDebugContext(gl: WebGLRenderingContext, props?: DebugContextProps): WebGLRenderingContext;
17
+ export declare function makeDebugContext(gl: WebGLRenderingContext, props?: DebugContextProps): WebGLRenderingContext | null;
18
18
  export {};
19
19
  //# sourceMappingURL=webgl-developer-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-developer-tools.d.ts","sourceRoot":"","sources":["../../../src/context/debug/webgl-developer-tools.ts"],"names":[],"mappings":"AAMA,aAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAeF,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,eAAe,EAAE,GAAG,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ7D;AAID,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,qBAAqB,EAAE,KAAK,GAAE,iBAAsB,GAAG,qBAAqB,CAOhH"}
1
+ {"version":3,"file":"webgl-developer-tools.d.ts","sourceRoot":"","sources":["../../../src/context/debug/webgl-developer-tools.ts"],"names":[],"mappings":"AASA,KAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAoBF,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,eAAe,EAAE,GAAG,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAO7D;AAID,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,qBAAqB,EAAE,KAAK,GAAE,iBAAsB,GAAG,qBAAqB,GAAG,IAAI,CAOvH"}
@@ -1,63 +1,48 @@
1
- import { log, loadScript } from '@luma.gl/api/';
2
- import GL from '@luma.gl/constants';
1
+ import { log, loadScript } from '@luma.gl/core';
2
+ import { isBrowser } from '@probe.gl/env';
3
3
  const WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';
4
- const DEFAULT_DEBUG_CONTEXT_PROPS = {
5
- debug: true,
6
- throwOnError: false,
7
- break: undefined,
8
- webgl2: false
9
- };
10
-
11
4
  function getContextData(gl) {
12
5
  gl.luma = gl.luma || {};
13
6
  return gl.luma;
14
7
  }
15
-
16
8
  export async function loadWebGLDeveloperTools() {
17
- if (!globalThis.WebGLDebugUtils) {
9
+ if (isBrowser() && !globalThis.WebGLDebugUtils) {
18
10
  globalThis.global = globalThis.global || globalThis;
19
11
  globalThis.global.module = {};
20
12
  await loadScript(WEBGL_DEBUG_CDN_URL);
21
13
  }
22
14
  }
23
- export function makeDebugContext(gl, props = {}) {
15
+ export function makeDebugContext(gl) {
16
+ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24
17
  if (!gl) {
25
18
  return null;
26
19
  }
27
-
28
20
  return props.debug ? getDebugContext(gl, props) : getRealContext(gl);
29
21
  }
30
-
31
22
  function getRealContext(gl) {
32
23
  const data = getContextData(gl);
33
24
  return data.realContext ? data.realContext : gl;
34
25
  }
35
-
36
26
  function getDebugContext(gl, props) {
37
27
  if (!globalThis.WebGLDebugUtils) {
38
28
  log.warn('webgl-debug not loaded')();
39
29
  return gl;
40
30
  }
41
-
42
31
  const data = getContextData(gl);
43
-
44
32
  if (data.debugContext) {
45
33
  return data.debugContext;
46
34
  }
47
-
48
- globalThis.WebGLDebugUtils.init({ ...GL,
35
+ globalThis.WebGLDebugUtils.init({
36
+ ...GL,
49
37
  ...gl
50
38
  });
51
39
  const glDebug = globalThis.WebGLDebugUtils.makeDebugContext(gl, onGLError.bind(null, props), onValidateGLFunc.bind(null, props));
52
-
53
40
  for (const key in GL) {
54
41
  if (!(key in glDebug) && typeof GL[key] === 'number') {
55
42
  glDebug[key] = GL[key];
56
43
  }
57
44
  }
58
-
59
45
  class WebGLDebugContext {}
60
-
61
46
  Object.setPrototypeOf(glDebug, Object.getPrototypeOf(gl));
62
47
  Object.setPrototypeOf(WebGLDebugContext, glDebug);
63
48
  const debugContext = Object.create(WebGLDebugContext);
@@ -66,53 +51,44 @@ function getDebugContext(gl, props) {
66
51
  debugContext.debug = true;
67
52
  return debugContext;
68
53
  }
69
-
70
54
  function getFunctionString(functionName, functionArgs) {
71
55
  functionArgs = Array.from(functionArgs).map(arg => arg === undefined ? 'undefined' : arg);
72
56
  let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);
73
- args = "".concat(args.slice(0, 100)).concat(args.length > 100 ? '...' : '');
74
- return "gl.".concat(functionName, "(").concat(args, ")");
57
+ args = `${args.slice(0, 100)}${args.length > 100 ? '...' : ''}`;
58
+ return `gl.${functionName}(${args})`;
75
59
  }
76
-
77
60
  function onGLError(props, err, functionName, args) {
78
61
  args = Array.from(args).map(arg => arg === undefined ? 'undefined' : arg);
79
62
  const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);
80
63
  const functionArgs = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, args);
81
64
  const glName = props.webgl2 ? 'gl2' : 'gl1';
82
- const message = "".concat(errorMessage, " in ").concat(glName, ".").concat(functionName, "(").concat(functionArgs, ")");
65
+ const message = `${errorMessage} in ${glName}.${functionName}(${functionArgs})`;
83
66
  log.error(message)();
84
67
  debugger;
85
-
86
68
  if (props.throwOnError) {
87
69
  throw new Error(message);
88
70
  }
89
71
  }
90
-
91
72
  function onValidateGLFunc(props, functionName, functionArgs) {
92
- let functionString;
93
-
73
+ let functionString = '';
94
74
  if (log.level >= 1) {
95
75
  functionString = getFunctionString(functionName, functionArgs);
96
76
  log.log(1, functionString)();
97
77
  }
98
-
99
- if (props.break) {
78
+ if (props.break && props.break.length > 0) {
100
79
  functionString = functionString || getFunctionString(functionName, functionArgs);
101
- const isBreakpoint = props.break && props.break.every(breakOn => functionString.indexOf(breakOn) !== -1);
102
-
80
+ const isBreakpoint = props.break.every(breakOn => functionString.indexOf(breakOn) !== -1);
103
81
  if (isBreakpoint) {
104
82
  debugger;
105
83
  }
106
84
  }
107
-
108
85
  for (const arg of functionArgs) {
109
86
  if (arg === undefined) {
110
87
  functionString = functionString || getFunctionString(functionName, functionArgs);
111
-
112
88
  if (props.throwOnError) {
113
- throw new Error("Undefined argument: ".concat(functionString));
89
+ throw new Error(`Undefined argument: ${functionString}`);
114
90
  } else {
115
- log.error("Undefined argument: ".concat(functionString))();
91
+ log.error(`Undefined argument: ${functionString}`)();
116
92
  debugger;
117
93
  }
118
94
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/debug/webgl-developer-tools.ts"],"names":["log","loadScript","GL","WEBGL_DEBUG_CDN_URL","DEFAULT_DEBUG_CONTEXT_PROPS","debug","throwOnError","break","undefined","webgl2","getContextData","gl","luma","loadWebGLDeveloperTools","globalThis","WebGLDebugUtils","global","module","makeDebugContext","props","getDebugContext","getRealContext","data","realContext","warn","debugContext","init","glDebug","onGLError","bind","onValidateGLFunc","key","WebGLDebugContext","Object","setPrototypeOf","getPrototypeOf","create","getFunctionString","functionName","functionArgs","Array","from","map","arg","args","glFunctionArgsToString","slice","length","err","errorMessage","glEnumToString","glName","message","error","Error","functionString","level","isBreakpoint","every","breakOn","indexOf"],"mappings":"AACA,SAAQA,GAAR,EAAaC,UAAb,QAA8B,eAA9B;AACA,OAAOC,EAAP,MAAe,oBAAf;AAEA,MAAMC,mBAAmB,GAAG,8CAA5B;AASA,MAAMC,2BAAwD,GAAG;AAC/DC,EAAAA,KAAK,EAAE,IADwD;AAE/DC,EAAAA,YAAY,EAAE,KAFiD;AAG/DC,EAAAA,KAAK,EAAEC,SAHwD;AAI/DC,EAAAA,MAAM,EAAE;AAJuD,CAAjE;;AAQA,SAASC,cAAT,CAAwBC,EAAxB,EAAiC;AAC/BA,EAAAA,EAAE,CAACC,IAAH,GAAUD,EAAE,CAACC,IAAH,IAAW,EAArB;AACA,SAAOD,EAAE,CAACC,IAAV;AACD;;AAYD,OAAO,eAAeC,uBAAf,GAAwD;AAC7D,MAAI,CAACC,UAAU,CAACC,eAAhB,EAAiC;AAE/BD,IAAAA,UAAU,CAACE,MAAX,GAAoBF,UAAU,CAACE,MAAX,IAAqBF,UAAzC;AAEAA,IAAAA,UAAU,CAACE,MAAX,CAAkBC,MAAlB,GAA2B,EAA3B;AACA,UAAMhB,UAAU,CAACE,mBAAD,CAAhB;AACD;AACF;AAID,OAAO,SAASe,gBAAT,CAA0BP,EAA1B,EAAqDQ,KAAwB,GAAG,EAAhF,EAA2G;AAEhH,MAAI,CAACR,EAAL,EAAS;AACP,WAAO,IAAP;AACD;;AAED,SAAOQ,KAAK,CAACd,KAAN,GAAce,eAAe,CAACT,EAAD,EAAKQ,KAAL,CAA7B,GAA2CE,cAAc,CAACV,EAAD,CAAhE;AACD;;AAGD,SAASU,cAAT,CAAwBV,EAAxB,EAA0E;AACxE,QAAMW,IAAI,GAAGZ,cAAc,CAACC,EAAD,CAA3B;AAEA,SAAOW,IAAI,CAACC,WAAL,GAAmBD,IAAI,CAACC,WAAxB,GAAsCZ,EAA7C;AACD;;AA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M,IAAIgD,KAAJ,CAAUF,OAAV,CAAN;AACD;AACF;;AAGD,SAAStB,gBAAT,CAA0BX,KAA1B,EAAoDmB,YAApD,EAA0EC,YAA1E,EAAqG;AACnG,MAAIgB,cAAJ;;AACA,MAAIvD,GAAG,CAACwD,KAAJ,IAAa,CAAjB,EAAoB;AAClBD,IAAAA,cAAc,GAAGlB,iBAAiB,CAACC,YAAD,EAAeC,YAAf,CAAlC;AACAvC,IAAAA,GAAG,CAACA,GAAJ,CAAQ,CAAR,EAAWuD,cAAX;AACD;;AAED,MAAIpC,KAAK,CAACZ,KAAV,EAAiB;AACfgD,IAAAA,cAAc,GAAGA,cAAc,IAAIlB,iBAAiB,CAACC,YAAD,EAAeC,YAAf,CAApD;AACA,UAAMkB,YAAY,GAChBtC,KAAK,CAACZ,KAAN,IAAeY,KAAK,CAACZ,KAAN,CAAYmD,KAAZ,CAAmBC,OAAD,IAAqBJ,cAAc,CAACK,OAAf,CAAuBD,OAAvB,MAAoC,CAAC,CAA5E,CADjB;;AAEA,QAAIF,YAAJ,EAAkB;AAChB;AACD;AACF;;AAED,OAAK,MAAMd,GAAX,IAAkBJ,YAAlB,EAAgC;AAC9B,QAAII,GAAG,KAAKnC,SAAZ,EAAuB;AACrB+C,MAAAA,cAAc,GAAGA,cAAc,IAAIlB,iBAAiB,CAACC,YAAD,EAAeC,YAAf,CAApD;;AACA,UAAIpB,KAAK,CAACb,YAAV,EAAwB;AACtB,cAAM,IAAIgD,KAAJ,+BAAiCC,cAAjC,EAAN;AACD,OAFD,MAEO;AACLvD,QAAAA,GAAG,CAACqD,KAAJ,+BAAiCE,cAAjC;AACA;AACD;AACF;AACF;AACF","sourcesContent":["// luma.gl, MIT license\nimport {log, loadScript} from '@luma.gl/api/';\nimport GL from '@luma.gl/constants';\n\nconst WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';\n\ntype DebugContextProps = {\n debug?: boolean;\n throwOnError?: boolean;\n break?: string[];\n webgl2?: boolean;\n};\n\nconst DEFAULT_DEBUG_CONTEXT_PROPS: Required<DebugContextProps> = {\n debug: true,\n throwOnError: false,\n break: undefined,\n webgl2: false,\n}\n\n// Helper to get shared context data\nfunction getContextData(gl: any) {\n gl.luma = gl.luma || {};\n return gl.luma;\n}\n\ndeclare global {\n var WebGLDebugUtils: any;\n}\n\n/**\n * Loads Khronos WebGLDeveloperTools from CDN if not already installed \n * const WebGLDebugUtils = require('webgl-debug');\n * @see https://github.com/KhronosGroup/WebGLDeveloperTools\n * @see https://github.com/vorg/webgl-debug\n */\nexport async function loadWebGLDeveloperTools(): Promise<void> {\n if (!globalThis.WebGLDebugUtils) {\n // @ts-expect-error Developer tools expects global to be set\n globalThis.global = globalThis.global || globalThis;\n // @ts-expect-error Developer tools expects global to be set\n globalThis.global.module = {};\n await loadScript(WEBGL_DEBUG_CDN_URL);\n }\n}\n\n// Returns (a potentially new) context with debug instrumentation turned off or on.\n// Note that this actually returns a new context\nexport function makeDebugContext(gl: WebGLRenderingContext, props: DebugContextProps = {}): WebGLRenderingContext {\n // Return null to ensure we don't try to create a context in this case (TODO what case is that?)\n if (!gl) {\n return null;\n }\n\n return props.debug ? getDebugContext(gl, props) : getRealContext(gl);\n}\n\n// Returns the real context from either of the real/debug contexts\nfunction getRealContext(gl: WebGLRenderingContext): WebGLRenderingContext {\n const data = getContextData(gl);\n // If the context has a realContext member, it is a debug context so return the realContext\n return data.realContext ? data.realContext : gl;\n}\n\n// Returns the debug context from either of the real/debug contexts\nfunction getDebugContext(gl: WebGLRenderingContext, props: DebugContextProps): WebGLRenderingContext {\n if (!globalThis.WebGLDebugUtils) {\n log.warn('webgl-debug not loaded')();\n return gl;\n }\n\n const data = getContextData(gl);\n\n // If this already has a debug context, return it.\n if (data.debugContext) {\n return data.debugContext;\n }\n\n // Create a new debug context\n globalThis.WebGLDebugUtils.init({...GL, ...gl});\n const glDebug = globalThis.WebGLDebugUtils.makeDebugContext(\n gl,\n onGLError.bind(null, props),\n onValidateGLFunc.bind(null, props)\n );\n\n // Make sure we have all WebGL2 and extension constants (todo dynamic import to circumvent minification?)\n for (const key in GL) {\n if (!(key in glDebug) && typeof GL[key] === 'number') {\n glDebug[key] = GL[key];\n }\n }\n \n // Ensure we have a clean prototype on the instrumented object\n // Note: setPrototypeOf does come with perf warnings, but we already take a bigger perf reduction\n // by synchronizing the WebGL errors after each WebGL call.\n class WebGLDebugContext {}\n Object.setPrototypeOf(glDebug, Object.getPrototypeOf(gl));\n Object.setPrototypeOf(WebGLDebugContext, glDebug);\n const debugContext = Object.create(WebGLDebugContext);\n // Store the debug context\n data.realContext = gl;\n data.debugContext = debugContext;\n debugContext.debug = true;\n\n // Return it\n return debugContext;\n}\n\n// DEBUG TRACING\n\nfunction getFunctionString(functionName: string, functionArgs): string {\n // Cover bug in webgl-debug-tools\n functionArgs = Array.from(functionArgs).map(arg => arg === undefined ? 'undefined' : arg);\n let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);\n args = `${args.slice(0, 100)}${args.length > 100 ? '...' : ''}`;\n return `gl.${functionName}(${args})`;\n}\n\nfunction onGLError(props: DebugContextProps, err, functionName: string, args: any[]): void {\n // Cover bug in webgl-debug-tools\n args = Array.from(args).map(arg => arg === undefined ? 'undefined' : arg);\n const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);\n const functionArgs = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, args);\n const glName = props.webgl2 ? 'gl2' : 'gl1';\n const message = `${errorMessage} in ${glName}.${functionName}(${functionArgs})`;\n log.error(message)();\n debugger; // eslint-disable-line\n if (props.throwOnError) {\n throw new Error(message);\n }\n}\n\n// Don't generate function string until it is needed\nfunction onValidateGLFunc(props: DebugContextProps, functionName: string, functionArgs: any[]): void {\n let functionString: string;\n if (log.level >= 1) {\n functionString = getFunctionString(functionName, functionArgs);\n log.log(1, functionString)();\n }\n\n if (props.break) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n const isBreakpoint =\n props.break && props.break.every((breakOn: string) => functionString.indexOf(breakOn) !== -1);\n if (isBreakpoint) {\n debugger; // eslint-disable-line\n }\n }\n\n for (const arg of functionArgs) {\n if (arg === undefined) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n if (props.throwOnError) {\n throw new Error(`Undefined argument: ${functionString}`);\n } else {\n log.error(`Undefined argument: ${functionString}`)();\n debugger; // eslint-disable-line\n }\n }\n }\n}\n"],"file":"webgl-developer-tools.js"}
1
+ {"version":3,"file":"webgl-developer-tools.js","names":["log","loadScript","isBrowser","WEBGL_DEBUG_CDN_URL","getContextData","gl","luma","loadWebGLDeveloperTools","globalThis","WebGLDebugUtils","global","module","makeDebugContext","props","arguments","length","undefined","debug","getDebugContext","getRealContext","data","realContext","warn","debugContext","init","GL","glDebug","onGLError","bind","onValidateGLFunc","key","WebGLDebugContext","Object","setPrototypeOf","getPrototypeOf","create","getFunctionString","functionName","functionArgs","Array","from","map","arg","args","glFunctionArgsToString","slice","err","errorMessage","glEnumToString","glName","webgl2","message","error","throwOnError","Error","functionString","level","break","isBreakpoint","every","breakOn","indexOf"],"sources":["../../../src/context/debug/webgl-developer-tools.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport {log, loadScript} from '@luma.gl/core';\nimport {GL} from '@luma.gl/constants';\nimport {isBrowser} from '@probe.gl/env'\n\nconst WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';\n\ntype DebugContextProps = {\n debug?: boolean;\n throwOnError?: boolean;\n break?: string[];\n webgl2?: boolean;\n};\n\n// const DEFAULT_DEBUG_CONTEXT_PROPS: Required<DebugContextProps> = {\n// debug: true,\n// throwOnError: false,\n// break: [],\n// webgl2: false,\n// }\n\ntype ContextData = {\n realContext?: WebGLRenderingContext;\n debugContext?: WebGLRenderingContext;\n}\n\n// Helper to get shared context data\nfunction getContextData(gl: any): ContextData {\n gl.luma = gl.luma || {};\n return gl.luma;\n}\n\ndeclare global {\n // eslint-disable-next-line no-var\n var WebGLDebugUtils: any;\n}\n\n/**\n * Loads Khronos WebGLDeveloperTools from CDN if not already installed \n * const WebGLDebugUtils = require('webgl-debug');\n * @see https://github.com/KhronosGroup/WebGLDeveloperTools\n * @see https://github.com/vorg/webgl-debug\n */\nexport async function loadWebGLDeveloperTools(): Promise<void> {\n if (isBrowser() && !globalThis.WebGLDebugUtils) {\n globalThis.global = globalThis.global || globalThis;\n // @ts-expect-error Developer tools expects global to be set\n globalThis.global.module = {};\n await loadScript(WEBGL_DEBUG_CDN_URL);\n }\n}\n\n// Returns (a potentially new) context with debug instrumentation turned off or on.\n// Note that this actually returns a new context\nexport function makeDebugContext(gl: WebGLRenderingContext, props: DebugContextProps = {}): WebGLRenderingContext | null {\n // Return null to ensure we don't try to create a context in this case (TODO what case is that?)\n if (!gl) {\n return null;\n }\n\n return props.debug ? getDebugContext(gl, props) : getRealContext(gl);\n}\n\n// Returns the real context from either of the real/debug contexts\nfunction getRealContext(gl: WebGLRenderingContext): WebGLRenderingContext {\n const data = getContextData(gl);\n // If the context has a realContext member, it is a debug context so return the realContext\n return data.realContext ? data.realContext : gl;\n}\n\n// Returns the debug context from either of the real/debug contexts\nfunction getDebugContext(gl: WebGLRenderingContext, props: DebugContextProps): WebGLRenderingContext {\n if (!globalThis.WebGLDebugUtils) {\n log.warn('webgl-debug not loaded')();\n return gl;\n }\n\n const data = getContextData(gl);\n\n // If this already has a debug context, return it.\n if (data.debugContext) {\n return data.debugContext;\n }\n\n // Create a new debug context\n globalThis.WebGLDebugUtils.init({...GL, ...gl});\n const glDebug = globalThis.WebGLDebugUtils.makeDebugContext(\n gl,\n onGLError.bind(null, props),\n onValidateGLFunc.bind(null, props)\n );\n\n // Make sure we have all WebGL2 and extension constants (todo dynamic import to circumvent minification?)\n for (const key in GL) {\n if (!(key in glDebug) && typeof GL[key] === 'number') {\n glDebug[key] = GL[key];\n }\n }\n \n // Ensure we have a clean prototype on the instrumented object\n // Note: setPrototypeOf does come with perf warnings, but we already take a bigger perf reduction\n // by synchronizing the WebGL errors after each WebGL call.\n class WebGLDebugContext {}\n Object.setPrototypeOf(glDebug, Object.getPrototypeOf(gl));\n Object.setPrototypeOf(WebGLDebugContext, glDebug);\n const debugContext = Object.create(WebGLDebugContext);\n // Store the debug context\n data.realContext = gl;\n data.debugContext = debugContext;\n debugContext.debug = true;\n\n // Return it\n return debugContext;\n}\n\n// DEBUG TRACING\n\nfunction getFunctionString(functionName: string, functionArgs): string {\n // Cover bug in webgl-debug-tools\n functionArgs = Array.from(functionArgs).map(arg => arg === undefined ? 'undefined' : arg);\n let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);\n args = `${args.slice(0, 100)}${args.length > 100 ? '...' : ''}`;\n return `gl.${functionName}(${args})`;\n}\n\nfunction onGLError(props: DebugContextProps, err, functionName: string, args: any[]): void {\n // Cover bug in webgl-debug-tools\n args = Array.from(args).map(arg => arg === undefined ? 'undefined' : arg);\n const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);\n const functionArgs = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, args);\n const glName = props.webgl2 ? 'gl2' : 'gl1';\n const message = `${errorMessage} in ${glName}.${functionName}(${functionArgs})`;\n log.error(message)();\n debugger; // eslint-disable-line\n if (props.throwOnError) {\n throw new Error(message);\n }\n}\n\n// Don't generate function string until it is needed\nfunction onValidateGLFunc(props: DebugContextProps, functionName: string, functionArgs: any[]): void {\n let functionString: string = '';\n if (log.level >= 1) {\n functionString = getFunctionString(functionName, functionArgs);\n log.log(1, functionString)();\n }\n\n // If array of breakpoint strings supplied, check if any of them is contained in current GL function\n if (props.break && props.break.length > 0) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n const isBreakpoint = props.break.every((breakOn: string) => functionString.indexOf(breakOn) !== -1);\n if (isBreakpoint) {\n debugger; // eslint-disable-line\n }\n }\n\n for (const arg of functionArgs) {\n if (arg === undefined) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n if (props.throwOnError) {\n throw new Error(`Undefined argument: ${functionString}`);\n } else {\n log.error(`Undefined argument: ${functionString}`)();\n debugger; // eslint-disable-line\n }\n }\n }\n}\n"],"mappings":"AAGA,SAAQA,GAAG,EAAEC,UAAU,QAAO,eAAe;AAE7C,SAAQC,SAAS,QAAO,eAAe;AAEvC,MAAMC,mBAAmB,GAAG,8CAA8C;AAsB1E,SAASC,cAAcA,CAACC,EAAO,EAAe;EAC5CA,EAAE,CAACC,IAAI,GAAGD,EAAE,CAACC,IAAI,IAAI,CAAC,CAAC;EACvB,OAAOD,EAAE,CAACC,IAAI;AAChB;AAaA,OAAO,eAAeC,uBAAuBA,CAAA,EAAkB;EAC7D,IAAIL,SAAS,CAAC,CAAC,IAAI,CAACM,UAAU,CAACC,eAAe,EAAE;IAC9CD,UAAU,CAACE,MAAM,GAAGF,UAAU,CAACE,MAAM,IAAIF,UAAU;IAEnDA,UAAU,CAACE,MAAM,CAACC,MAAM,GAAG,CAAC,CAAC;IAC7B,MAAMV,UAAU,CAACE,mBAAmB,CAAC;EACvC;AACF;AAIA,OAAO,SAASS,gBAAgBA,CAACP,EAAyB,EAA+D;EAAA,IAA7DQ,KAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEvF,IAAI,CAACT,EAAE,EAAE;IACP,OAAO,IAAI;EACb;EAEA,OAAOQ,KAAK,CAACI,KAAK,GAAGC,eAAe,CAACb,EAAE,EAAEQ,KAAK,CAAC,GAAGM,cAAc,CAACd,EAAE,CAAC;AACtE;AAGA,SAASc,cAAcA,CAACd,EAAyB,EAAyB;EACxE,MAAMe,IAAI,GAAGhB,cAAc,CAACC,EAAE,CAAC;EAE/B,OAAOe,IAAI,CAACC,WAAW,GAAGD,IAAI,CAACC,WAAW,GAAGhB,EAAE;AACjD;AAGA,SAASa,eAAeA,CAACb,EAAyB,EAAEQ,KAAwB,EAAyB;EACnG,IAAI,CAAC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AAG,CAACwD,KAAK,IAAI,CAAC,EAAE;IAClBD,cAAc,GAAGnB,iBAAiB,CAACC,YAAY,EAAEC,YAAY,CAAC;IAC9DtC,GAAG,CAACA,GAAG,CAAC,CAAC,EAAEuD,cAAc,CAAC,CAAC,CAAC;EAC9B;EAGA,IAAI1C,KAAK,CAAC4C,KAAK,IAAI5C,KAAK,CAAC4C,KAAK,CAAC1C,MAAM,GAAG,CAAC,EAAE;IACzCwC,cAAc,GAAGA,cAAc,IAAInB,iBAAiB,CAACC,YAAY,EAAEC,YAAY,CAAC;IAChF,MAAMoB,YAAY,GAAG7C,KAAK,CAAC4C,KAAK,CAACE,KAAK,CAAEC,OAAe,IAAKL,cAAc,CAACM,OAAO,CAACD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACnG,IAAIF,YAAY,EAAE;MAChB;IACF;EACF;EAEA,KAAK,MAAMhB,GAAG,IAAIJ,YAAY,EAAE;IAC9B,IAAII,GAAG,KAAK1B,SAAS,EAAE;MACrBuC,cAAc,GAAGA,cAAc,IAAInB,iBAAiB,CAACC,YAAY,EAAEC,YAAY,CAAC;MAChF,IAAIzB,KAAK,CAACwC,YAAY,EAAE;QACtB,MAAM,IAAIC,KAAK,CAAE,uBAAsBC,cAAe,EAAC,CAAC;MAC1D,CAAC,MAAM;QACLvD,GAAG,CAACoD,KAAK,CAAE,uBAAsBG,cAAe,EAAC,CAAC,CAAC,CAAC;QACpD;MACF;IACF;EACF;AACF"}
@@ -1,5 +1,5 @@
1
- import { Device } from '@luma.gl/api';
2
- import type { GLParameters } from '../../types/webgl';
1
+ import { Device } from '@luma.gl/core';
2
+ import type { GLParameters } from '@luma.gl/constants';
3
3
  export type { GLParameters };
4
4
  /**
5
5
  * Sets any GL parameter regardless of function (gl.blendMode, ...)
@@ -7,10 +7,13 @@ export type { GLParameters };
7
7
  * @note requires a `cache` object to be set on the context (gl.state.cache)
8
8
  * This object is used to fill in any missing values for composite setter functions
9
9
  */
10
- export declare function setParameters(device: Device | WebGLRenderingContext, parameters: GLParameters): void;
10
+ export declare function setGLParameters(device: Device | WebGLRenderingContext, parameters: GLParameters): void;
11
11
  /**
12
12
  * Reads the entire WebGL state from a context
13
- * @returns - a newly created map, with values keyed by GL parameters
13
+
14
+ // default to querying all parameters
15
+
16
+ * @returns - a newly created map, with values keyed by GL parameters
14
17
  *
15
18
  * @note Copies the state from a context (gl.getParameter should not be overriden)
16
19
  * Reads the entire WebGL state from a context
@@ -19,14 +22,12 @@ export declare function setParameters(device: Device | WebGLRenderingContext, pa
19
22
  * considered a very slow operation, to be used only if/when a context already manipulated
20
23
  * by external code needs to be synchronized for the first time
21
24
  */
22
- export declare function getParameters(gl: WebGLRenderingContext, parameters?: Record<keyof GLParameters, any>): GLParameters;
23
- export declare function getParameters(gl: WebGLRenderingContext, parameters?: (keyof GLParameters)[]): GLParameters;
24
- export declare function getParameters(gl: WebGLRenderingContext, parameters: keyof GLParameters): GLParameters;
25
+ export declare function getGLParameters(device: Device | WebGLRenderingContext, parameters?: keyof GLParameters | (keyof GLParameters)[] | GLParameters): GLParameters;
25
26
  /**
26
27
  * Reset all parameters to a (almost) pure context state
27
28
  * @note viewport and scissor will be set to the values in GL_PARAMETER_DEFAULTS,
28
29
  * NOT the canvas size dimensions, so they will have to be properly set after
29
30
  * calling this function.
30
31
  */
31
- export declare function resetParameters(gl: WebGLRenderingContext): void;
32
+ export declare function resetGLParameters(device: Device | WebGLRenderingContext): void;
32
33
  //# sourceMappingURL=unified-parameter-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unified-parameter-api.d.ts","sourceRoot":"","sources":["../../../src/context/parameters/unified-parameter-api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAWpD,YAAY,EAAC,YAAY,EAAC,CAAC;AAE3B;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,EAAE,UAAU,EAAE,YAAY,GAAG,IAAI,CAiDpG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,qBAAqB,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,YAAY,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC;AACrH,wBAAgB,aAAa,CAAC,EAAE,EAAE,qBAAqB,EAAE,UAAU,CAAC,EAAE,CAAC,MAAM,YAAY,CAAC,EAAE,GAAG,YAAY,CAAC;AAC5G,wBAAgB,aAAa,CAAC,EAAE,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,YAAY,GAAG,YAAY,CAAC;AAwBvG;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,qBAAqB,GAAG,IAAI,CAE/D"}
1
+ {"version":3,"file":"unified-parameter-api.d.ts","sourceRoot":"","sources":["../../../src/context/parameters/unified-parameter-api.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAUrD,YAAY,EAAC,YAAY,EAAC,CAAC;AAE3B;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,qBAAqB,EACtC,UAAU,EAAE,YAAY,GACvB,IAAI,CAiDN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,qBAAqB,EACtC,UAAU,GAAE,MAAM,YAAY,GAAG,CAAC,MAAM,YAAY,CAAC,EAAE,GAAG,YAAoC,GAC7F,YAAY,CAqBd;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAE9E"}
@@ -1,19 +1,15 @@
1
- import { GL_PARAMETER_DEFAULTS, GL_PARAMETER_SETTERS, GL_COMPOSITE_PARAMETER_SETTERS, GL_PARAMETER_GETTERS } from './webgl-parameter-tables';
2
- import WebGLDevice from '../../adapter/webgl-device';
3
- export function setParameters(device, parameters) {
1
+ import { GL_PARAMETER_DEFAULTS, GL_PARAMETER_SETTERS, GL_COMPOSITE_PARAMETER_SETTERS, GL_PARAMETER_GETTERS } from "./webgl-parameter-tables.js";
2
+ import { WebGLDevice } from "../../adapter/webgl-device.js";
3
+ export function setGLParameters(device, parameters) {
4
4
  const webglDevice = WebGLDevice.attach(device);
5
5
  const gl = webglDevice.gl;
6
-
7
6
  if (isObjectEmpty(parameters)) {
8
7
  return;
9
8
  }
10
-
11
9
  const compositeSetters = {};
12
-
13
10
  for (const key in parameters) {
14
11
  const glConstant = Number(key);
15
12
  const setter = GL_PARAMETER_SETTERS[key];
16
-
17
13
  if (setter) {
18
14
  if (typeof setter === 'string') {
19
15
  compositeSetters[setter] = true;
@@ -22,9 +18,7 @@ export function setParameters(device, parameters) {
22
18
  }
23
19
  }
24
20
  }
25
-
26
21
  const cache = gl.state && gl.state.cache;
27
-
28
22
  if (cache) {
29
23
  for (const key in compositeSetters) {
30
24
  const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];
@@ -32,34 +26,30 @@ export function setParameters(device, parameters) {
32
26
  }
33
27
  }
34
28
  }
35
- export function getParameters(gl, parameters) {
36
- parameters = parameters || GL_PARAMETER_DEFAULTS;
37
-
29
+ export function getGLParameters(device) {
30
+ let parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GL_PARAMETER_DEFAULTS;
31
+ const webglDevice = WebGLDevice.attach(device);
32
+ const gl = webglDevice.gl;
38
33
  if (typeof parameters === 'number') {
39
34
  const key = parameters;
40
35
  const getter = GL_PARAMETER_GETTERS[key];
41
36
  return getter ? getter(gl, key) : gl.getParameter(key);
42
37
  }
43
-
44
38
  const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);
45
39
  const state = {};
46
-
47
40
  for (const key of parameterKeys) {
48
41
  const getter = GL_PARAMETER_GETTERS[key];
49
42
  state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));
50
43
  }
51
-
52
44
  return state;
53
45
  }
54
- export function resetParameters(gl) {
55
- setParameters(gl, GL_PARAMETER_DEFAULTS);
46
+ export function resetGLParameters(device) {
47
+ setGLParameters(device, GL_PARAMETER_DEFAULTS);
56
48
  }
57
-
58
49
  function isObjectEmpty(object) {
59
50
  for (const key in object) {
60
51
  return false;
61
52
  }
62
-
63
53
  return true;
64
54
  }
65
55
  //# sourceMappingURL=unified-parameter-api.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/context/parameters/unified-parameter-api.ts"],"names":["GL_PARAMETER_DEFAULTS","GL_PARAMETER_SETTERS","GL_COMPOSITE_PARAMETER_SETTERS","GL_PARAMETER_GETTERS","WebGLDevice","setParameters","device","parameters","webglDevice","attach","gl","isObjectEmpty","compositeSetters","key","glConstant","Number","setter","cache","state","compositeSetter","getParameters","getter","getParameter","parameterKeys","Array","isArray","Object","keys","resetParameters","object"],"mappings":"AAKA,SACEA,qBADF,EAEEC,oBAFF,EAGEC,8BAHF,EAIEC,oBAJF,QAKO,0BALP;AAQA,OAAOC,WAAP,MAAwB,4BAAxB;AAUA,OAAO,SAASC,aAAT,CAAuBC,MAAvB,EAA+DC,UAA/D,EAA+F;AACpG,QAAMC,WAAW,GAAGJ,WAAW,CAACK,MAAZ,CAAmBH,MAAnB,CAApB;AACA,QAAMI,EAAE,GAAGF,WAAW,CAACE,EAAvB;;AAEA,MAAIC,aAAa,CAACJ,UAAD,CAAjB,EAA+B;AAC7B;AACD;;AAED,QAAMK,gBAAgB,GAAG,EAAzB;;AAIA,OAAK,MAAMC,GAAX,IAAkBN,UAAlB,EAA8B;AAC5B,UAAMO,UAAU,GAAGC,MAAM,CAACF,GAAD,CAAzB;AACA,UAAMG,MAAM,GAAGf,oBAAoB,CAACY,GAAD,CAAnC;;AACA,QAAIG,MAAJ,EAAY;AAEV,UAAI,OA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GAAD,CAAX,CAAT,GAA6BH,EAAE,CAACY,YAAH,CAAgBP,MAAM,CAACF,GAAD,CAAtB,CAAhD;AACD;;AACD,SAAOK,KAAP;AACD;AAQD,OAAO,SAASU,eAAT,CAAyBlB,EAAzB,EAA0D;AAC/DL,EAAAA,aAAa,CAACK,EAAD,EAAKV,qBAAL,CAAb;AACD;;AAKD,SAASW,aAAT,CAAuBkB,MAAvB,EAA+B;AAC7B,OAAK,MAAMhB,GAAX,IAAkBgB,MAAlB,EAA0B;AACxB,WAAO,KAAP;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["// Provides a unified API for getting and setting any WebGL parameter\n// Also knows default values of all parameters, enabling fast cache initialization\n// Provides base functionality for the state caching.\nimport {Device} from '@luma.gl/api';\nimport type {GLParameters} from '../../types/webgl';\nimport {\n GL_PARAMETER_DEFAULTS,\n GL_PARAMETER_SETTERS,\n GL_COMPOSITE_PARAMETER_SETTERS,\n GL_PARAMETER_GETTERS\n} from './webgl-parameter-tables';\n\nimport {isWebGL} from '../context/webgl-checks';\nimport WebGLDevice from '../../adapter/webgl-device';\n\nexport type {GLParameters};\n\n/**\n * Sets any GL parameter regardless of function (gl.blendMode, ...)\n *\n * @note requires a `cache` object to be set on the context (gl.state.cache)\n * This object is used to fill in any missing values for composite setter functions\n */\nexport function setParameters(device: Device | WebGLRenderingContext, parameters: GLParameters): void {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n return;\n }\n\n const compositeSetters = {};\n\n // HANDLE PRIMITIVE SETTERS (and make note of any composite setters)\n\n for (const key in parameters) {\n const glConstant = Number(key);\n const setter = GL_PARAMETER_SETTERS[key];\n if (setter) {\n // Composite setters should only be called once, so save them\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n } else {\n // if (gl[glConstant] !== undefined) {\n // TODO - added above check since this is being called on WebGL2 parameters in WebGL1...\n // TODO - deep equal on values? only call setter if value has changed?\n // NOTE - the setter will automatically update this.state\n setter(gl, parameters[key], glConstant);\n }\n }\n }\n\n // HANDLE COMPOSITE SETTERS\n\n // NOTE: any non-provided values needed by composite setters are filled in from state cache\n // The cache parameter is automatically retrieved from the context\n // This depends on `trackContextState`, which is technically a \"circular\" dependency.\n // But it is too inconvenient to always require a cache parameter here.\n // This is the ONLY external dependency in this module/\n // @ts-expect-error\n const cache = gl.state && gl.state.cache;\n if (cache) {\n for (const key in compositeSetters) {\n // TODO - avoid calling composite setters if values have not changed.\n const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];\n // Note - if `trackContextState` has been called,\n // the setter will automatically update this.state.cache\n compositeSetter(gl, parameters, cache);\n }\n }\n\n // Add a log for the else case?\n}\n\n/**\n * Reads the entire WebGL state from a context\n * @returns - a newly created map, with values keyed by GL parameters\n *\n * @note Copies the state from a context (gl.getParameter should not be overriden)\n * Reads the entire WebGL state from a context\n *\n * @note This can generates a huge amount of synchronous driver roundtrips and should be\n * considered a very slow operation, to be used only if/when a context already manipulated\n * by external code needs to be synchronized for the first time\n */\nexport function getParameters(gl: WebGLRenderingContext, parameters?: Record<keyof GLParameters, any>): GLParameters;\nexport function getParameters(gl: WebGLRenderingContext, parameters?: (keyof GLParameters)[]): GLParameters;\nexport function getParameters(gl: WebGLRenderingContext, parameters: keyof GLParameters): GLParameters;\n\nexport function getParameters(gl, parameters) {\n // default to querying all parameters\n parameters = parameters || GL_PARAMETER_DEFAULTS;\n // support both arrays of parameters and objects (keys represent parameters)\n\n if (typeof parameters === 'number') {\n // single GL enum\n const key = parameters;\n const getter = GL_PARAMETER_GETTERS[key];\n return getter ? getter(gl, key) : gl.getParameter(key);\n }\n\n const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);\n\n const state = {};\n for (const key of parameterKeys) {\n const getter = GL_PARAMETER_GETTERS[key];\n state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));\n }\n return state;\n}\n\n/**\n * Reset all parameters to a (almost) pure context state\n * @note viewport and scissor will be set to the values in GL_PARAMETER_DEFAULTS,\n * NOT the canvas size dimensions, so they will have to be properly set after\n * calling this function.\n */\nexport function resetParameters(gl: WebGLRenderingContext): void {\n setParameters(gl, GL_PARAMETER_DEFAULTS);\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"file":"unified-parameter-api.js"}
1
+ {"version":3,"file":"unified-parameter-api.js","names":["GL_PARAMETER_DEFAULTS","GL_PARAMETER_SETTERS","GL_COMPOSITE_PARAMETER_SETTERS","GL_PARAMETER_GETTERS","WebGLDevice","setGLParameters","device","parameters","webglDevice","attach","gl","isObjectEmpty","compositeSetters","key","glConstant","Number","setter","cache","state","compositeSetter","getGLParameters","arguments","length","undefined","getter","getParameter","parameterKeys","Array","isArray","Object","keys","resetGLParameters","object"],"sources":["../../../src/context/parameters/unified-parameter-api.ts"],"sourcesContent":["// luma.gl, MIT license\n// Copyright (c) vis.gl contributors\n\n// Provides a unified API for getting and setting any WebGL parameter\n// Also knows default values of all parameters, enabling fast cache initialization\n// Provides base functionality for the state caching.\nimport {Device} from '@luma.gl/core';\nimport type {GLParameters} from '@luma.gl/constants';\nimport {\n GL_PARAMETER_DEFAULTS,\n GL_PARAMETER_SETTERS,\n GL_COMPOSITE_PARAMETER_SETTERS,\n GL_PARAMETER_GETTERS\n} from './webgl-parameter-tables';\n\nimport {WebGLDevice} from '../../adapter/webgl-device';\n\nexport type {GLParameters};\n\n/**\n * Sets any GL parameter regardless of function (gl.blendMode, ...)\n *\n * @note requires a `cache` object to be set on the context (gl.state.cache)\n * This object is used to fill in any missing values for composite setter functions\n */\nexport function setGLParameters(\n device: Device | WebGLRenderingContext,\n parameters: GLParameters\n): void {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n if (isObjectEmpty(parameters)) {\n return;\n }\n\n const compositeSetters = {};\n\n // HANDLE PRIMITIVE SETTERS (and make note of any composite setters)\n\n for (const key in parameters) {\n const glConstant = Number(key);\n const setter = GL_PARAMETER_SETTERS[key];\n if (setter) {\n // Composite setters should only be called once, so save them\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n } else {\n // if (gl[glConstant] !== undefined) {\n // TODO - added above check since this is being called on WebGL2 parameters in WebGL1...\n // TODO - deep equal on values? only call setter if value has changed?\n // NOTE - the setter will automatically update this.state\n setter(gl, parameters[key], glConstant);\n }\n }\n }\n\n // HANDLE COMPOSITE SETTERS\n\n // NOTE: any non-provided values needed by composite setters are filled in from state cache\n // The cache parameter is automatically retrieved from the context\n // This depends on `trackContextState`, which is technically a \"circular\" dependency.\n // But it is too inconvenient to always require a cache parameter here.\n // This is the ONLY external dependency in this module/\n // @ts-expect-error\n const cache = gl.state && gl.state.cache;\n if (cache) {\n for (const key in compositeSetters) {\n // TODO - avoid calling composite setters if values have not changed.\n const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];\n // Note - if `trackContextState` has been called,\n // the setter will automatically update this.state.cache\n compositeSetter(gl, parameters, cache);\n }\n }\n\n // Add a log for the else case?\n}\n\n/**\n * Reads the entire WebGL state from a context\n\n // default to querying all parameters\n\n * @returns - a newly created map, with values keyed by GL parameters\n *\n * @note Copies the state from a context (gl.getParameter should not be overriden)\n * Reads the entire WebGL state from a context\n *\n * @note This can generates a huge amount of synchronous driver roundtrips and should be\n * considered a very slow operation, to be used only if/when a context already manipulated\n * by external code needs to be synchronized for the first time\n */\nexport function getGLParameters(\n device: Device | WebGLRenderingContext,\n parameters: keyof GLParameters | (keyof GLParameters)[] | GLParameters = GL_PARAMETER_DEFAULTS\n): GLParameters {\n const webglDevice = WebGLDevice.attach(device);\n const gl = webglDevice.gl;\n\n // support both arrays of parameters and objects (keys represent parameters)\n\n if (typeof parameters === 'number') {\n // single GL enum\n const key = parameters;\n const getter = GL_PARAMETER_GETTERS[key];\n return getter ? getter(gl, key) : gl.getParameter(key);\n }\n\n const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);\n\n const state = {};\n for (const key of parameterKeys) {\n const getter = GL_PARAMETER_GETTERS[key];\n state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));\n }\n return state;\n}\n\n/**\n * Reset all parameters to a (almost) pure context state\n * @note viewport and scissor will be set to the values in GL_PARAMETER_DEFAULTS,\n * NOT the canvas size dimensions, so they will have to be properly set after\n * calling this function.\n */\nexport function resetGLParameters(device: Device | WebGLRenderingContext): void {\n setGLParameters(device, GL_PARAMETER_DEFAULTS);\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n // @ts-ignore dummy key variable\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"mappings":"SASEA,qBAAqB,EACrBC,oBAAoB,EACpBC,8BAA8B,EAC9BC,oBAAoB;AAAA,SAGdC,WAAW;AAUnB,OAAO,SAASC,eAAeA,CAC7BC,MAAsC,EACtCC,UAAwB,EAClB;EACN,MAAMC,WAAW,GAAGJ,WAAW,CAACK,MAAM,CAACH,MAAM,CAAC;EAC9C,MAAMI,EAAE,GAAGF,WAAW,CAACE,EAAE;EAEzB,IAAIC,aAAa,CAACJ,UAAU,CAAC,EAAE;IAC7B;EACF;EAEA,MAAMK,gBAAgB,GAAG,CAAC,CAAC;EAI3B,KAAK,MAAMC,GAAG,IAAIN,UAAU,EAAE;IAC5B,MAAMO,UAAU,GAAGC,MAAM,CAACF,GAAG,CAAC;IAC9B,MAAMG,MAAM,GAAGf,oBAAoB,CAACY,GAAG,CAAC;IACxC,IAAIG,MAAM,EAAE;MAEV,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;QAC9BJ,gBAAgB,CAACI,MAAM,CAAC,GAAG,IAAI;MACjC,CAAC,MAAM;QAKLA,MAAM,CAACN,EAAE,EAAEH,UAAU,CAACM,GAAG,CAAC,EAAEC,UAAU,CAAC;MACzC;IACF;EACF;EAUA,MAAMG,KAAK,GAAGP,EAAE,CAACQ,KAAK,IAAIR,EAAE,CAACQ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,EAAQ;EAC9ED,eAAe,CAACC,MAAM,EAAEN,qBAAqB,CAAC;AAChD;AAKA,SAASW,aAAaA,CAACqB,MAAM,EAAE;EAE7B,KAAK,MAAMnB,GAAG,IAAImB,MAAM,EAAE;IACxB,OAAO,KAAK;EACd;EACA,OAAO,IAAI;AACb"}
@@ -1,54 +1,53 @@
1
- import GL from '@luma.gl/constants';
2
- import type { GLParameters } from '../../types/webgl';
1
+ import { GL, GLParameters } from '@luma.gl/constants';
3
2
  export declare const GL_PARAMETER_DEFAULTS: GLParameters;
4
3
  export declare const GL_PARAMETER_SETTERS: {
5
- 3042: (gl: any, value: any, key: any) => any;
6
- 32773: (gl: any, value: any) => any;
4
+ 3042: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
5
+ 32773: (gl: WebGLRenderingContext, value: [number, number, number, number]) => void;
7
6
  32777: string;
8
7
  34877: string;
9
8
  32969: string;
10
9
  32968: string;
11
10
  32971: string;
12
11
  32970: string;
13
- 3106: (gl: any, value: any) => any;
14
- 3107: (gl: any, value: any) => any;
15
- 2884: (gl: any, value: any, key: any) => any;
16
- 2885: (gl: any, value: any) => any;
17
- 2929: (gl: any, value: any, key: any) => any;
18
- 2931: (gl: any, value: any) => any;
19
- 2932: (gl: any, value: any) => any;
20
- 2928: (gl: any, value: any) => any;
21
- 2930: (gl: any, value: any) => any;
22
- 3024: (gl: any, value: any, key: any) => any;
23
- 35723: (gl: any, value: any, key: any) => any;
24
- 35725: (gl: any, value: any) => any;
25
- 36007: (gl: any, value: any) => any;
26
- 36389: (gl: any, value: any) => any;
27
- 34229: (gl: any, value: any) => any;
28
- 36006: (gl: any, value: any, key: any) => any;
29
- 36010: (gl: any, value: any, key: any) => any;
30
- 34964: (gl: any, value: any, key: any) => void;
31
- 36662: (gl: any, value: any, key: any) => void;
32
- 36663: (gl: any, value: any, key: any) => void;
33
- 35053: (gl: any, value: any, key: any) => void;
34
- 35055: (gl: any, value: any, key: any) => void;
35
- 2886: (gl: any, value: any) => any;
36
- 33170: (gl: any, value: any, key: any) => any;
37
- 2849: (gl: any, value: any) => any;
38
- 32823: (gl: any, value: any, key: any) => any;
12
+ 3106: (gl: WebGLRenderingContext, value: [number, number, number, number]) => void;
13
+ 3107: (gl: WebGLRenderingContext, value: [boolean, boolean, boolean, boolean]) => void;
14
+ 2884: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
15
+ 2885: (gl: WebGLRenderingContext, value: any) => void;
16
+ 2929: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
17
+ 2931: (gl: WebGLRenderingContext, value: any) => void;
18
+ 2932: (gl: WebGLRenderingContext, value: any) => void;
19
+ 2928: (gl: WebGLRenderingContext, value: [number, number]) => void;
20
+ 2930: (gl: WebGLRenderingContext, value: any) => void;
21
+ 3024: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
22
+ 35723: (gl: WebGLRenderingContext, value: GL, key: GL) => void;
23
+ 35725: (gl: WebGLRenderingContext, value: any) => void;
24
+ 36007: (gl: WebGLRenderingContext, value: any) => void;
25
+ 36389: (gl: WebGLRenderingContext, value: any) => void;
26
+ 34229: (gl: WebGLRenderingContext, value: any) => void;
27
+ 36006: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
28
+ 36010: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
29
+ 34964: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
30
+ 36662: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
31
+ 36663: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
32
+ 35053: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
33
+ 35055: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
34
+ 2886: (gl: WebGLRenderingContext, value: any) => void;
35
+ 33170: (gl: WebGLRenderingContext, value: GL, key: GL) => void;
36
+ 2849: (gl: WebGLRenderingContext, value: any) => void;
37
+ 32823: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
39
38
  32824: string;
40
39
  10752: string;
41
- 35977: (gl: any, value: any, key: any) => any;
42
- 32926: (gl: any, value: any, key: any) => any;
43
- 32928: (gl: any, value: any, key: any) => any;
40
+ 35977: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
41
+ 32926: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
42
+ 32928: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
44
43
  32938: string;
45
44
  32939: string;
46
- 3089: (gl: any, value: any, key: any) => any;
47
- 3088: (gl: any, value: any) => any;
48
- 2960: (gl: any, value: any, key: any) => any;
49
- 2961: (gl: any, value: any) => any;
50
- 2968: (gl: any, value: any) => any;
51
- 36005: (gl: any, value: any) => any;
45
+ 3089: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
46
+ 3088: (gl: WebGLRenderingContext, value: [number, number, number, number]) => void;
47
+ 2960: (gl: WebGLRenderingContext, value: unknown, key: GL) => void;
48
+ 2961: (gl: WebGLRenderingContext, value: any) => void;
49
+ 2968: (gl: WebGLRenderingContext, value: any) => void;
50
+ 36005: (gl: WebGLRenderingContext, value: any) => void;
52
51
  2962: string;
53
52
  2967: string;
54
53
  2963: string;
@@ -61,67 +60,67 @@ export declare const GL_PARAMETER_SETTERS: {
61
60
  34817: string;
62
61
  34818: string;
63
62
  34819: string;
64
- 2978: (gl: any, value: any) => any;
65
- 3333: (gl: any, value: any, key: any) => any;
66
- 3317: (gl: any, value: any, key: any) => any;
67
- 37440: (gl: any, value: any, key: any) => any;
68
- 37441: (gl: any, value: any, key: any) => any;
69
- 37443: (gl: any, value: any, key: any) => any;
70
- 3330: (gl: any, value: any, key: any) => any;
71
- 3332: (gl: any, value: any, key: any) => any;
72
- 3331: (gl: any, value: any, key: any) => any;
73
- 3314: (gl: any, value: any, key: any) => any;
74
- 32878: (gl: any, value: any, key: any) => any;
75
- 3316: (gl: any, value: any, key: any) => any;
76
- 3315: (gl: any, value: any, key: any) => any;
77
- 32877: (gl: any, value: any, key: any) => any;
78
- framebuffer: (gl: any, framebuffer: any) => any;
79
- blend: (gl: any, value: any) => any;
80
- blendColor: (gl: any, value: any) => any;
81
- blendEquation: (gl: any, args: any) => void;
82
- blendFunc: (gl: any, args: any) => void;
83
- clearColor: (gl: any, value: any) => any;
84
- clearDepth: (gl: any, value: any) => any;
85
- clearStencil: (gl: any, value: any) => any;
86
- colorMask: (gl: any, value: any) => any;
87
- cull: (gl: any, value: any) => any;
88
- cullFace: (gl: any, value: any) => any;
89
- depthTest: (gl: any, value: any) => any;
90
- depthFunc: (gl: any, value: any) => any;
91
- depthMask: (gl: any, value: any) => any;
92
- depthRange: (gl: any, value: any) => any;
93
- dither: (gl: any, value: any) => any;
94
- derivativeHint: (gl: any, value: any) => void;
95
- frontFace: (gl: any, value: any) => any;
96
- mipmapHint: (gl: any, value: any) => any;
97
- lineWidth: (gl: any, value: any) => any;
98
- polygonOffsetFill: (gl: any, value: any) => any;
99
- polygonOffset: (gl: any, value: any) => any;
100
- sampleCoverage: (gl: any, value: any) => any;
101
- scissorTest: (gl: any, value: any) => any;
102
- scissor: (gl: any, value: any) => any;
103
- stencilTest: (gl: any, value: any) => any;
104
- stencilMask: (gl: any, value: any) => void;
105
- stencilFunc: (gl: any, args: any) => void;
106
- stencilOp: (gl: any, args: any) => void;
107
- viewport: (gl: any, value: any) => any;
63
+ 2978: (gl: WebGLRenderingContext, value: [number, number, number, number]) => void;
64
+ 3333: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
65
+ 3317: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
66
+ 37440: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
67
+ 37441: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
68
+ 37443: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
69
+ 3330: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
70
+ 3332: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
71
+ 3331: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
72
+ 3314: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
73
+ 32878: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
74
+ 3316: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
75
+ 3315: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
76
+ 32877: (gl: WebGLRenderingContext, value: number | boolean, key: GL) => void;
77
+ framebuffer: (gl: WebGLRenderingContext, framebuffer: any) => void;
78
+ blend: (gl: WebGLRenderingContext, value: any) => void;
79
+ blendColor: (gl: WebGLRenderingContext, value: [number, number, number, number]) => void;
80
+ blendEquation: (gl: WebGLRenderingContext, args: number | [number, number]) => void;
81
+ blendFunc: (gl: WebGLRenderingContext, args: [number, number] | [number, number, number, number]) => void;
82
+ clearColor: (gl: WebGLRenderingContext, value: [number, number, number, number]) => void;
83
+ clearDepth: (gl: WebGLRenderingContext, value: any) => void;
84
+ clearStencil: (gl: WebGLRenderingContext, value: any) => void;
85
+ colorMask: (gl: WebGLRenderingContext, value: [boolean, boolean, boolean, boolean]) => void;
86
+ cull: (gl: WebGLRenderingContext, value: any) => void;
87
+ cullFace: (gl: WebGLRenderingContext, value: any) => void;
88
+ depthTest: (gl: WebGLRenderingContext, value: any) => void;
89
+ depthFunc: (gl: WebGLRenderingContext, value: any) => void;
90
+ depthMask: (gl: WebGLRenderingContext, value: any) => void;
91
+ depthRange: (gl: WebGLRenderingContext, value: [number, number]) => void;
92
+ dither: (gl: WebGLRenderingContext, value: any) => void;
93
+ derivativeHint: (gl: WebGLRenderingContext, value: any) => void;
94
+ frontFace: (gl: WebGLRenderingContext, value: any) => void;
95
+ mipmapHint: (gl: WebGLRenderingContext, value: any) => void;
96
+ lineWidth: (gl: WebGLRenderingContext, value: any) => void;
97
+ polygonOffsetFill: (gl: WebGLRenderingContext, value: any) => void;
98
+ polygonOffset: (gl: WebGLRenderingContext, value: [number, number]) => void;
99
+ sampleCoverage: (gl: WebGLRenderingContext, value: [number, boolean?]) => void;
100
+ scissorTest: (gl: WebGLRenderingContext, value: any) => void;
101
+ scissor: (gl: WebGLRenderingContext, value: [number, number, number, number]) => void;
102
+ stencilTest: (gl: WebGLRenderingContext, value: any) => void;
103
+ stencilMask: (gl: WebGLRenderingContext, value: any) => void;
104
+ stencilFunc: (gl: WebGLRenderingContext, args: any) => void;
105
+ stencilOp: (gl: WebGLRenderingContext, args: any) => void;
106
+ viewport: (gl: WebGLRenderingContext, value: [number, number, number, number]) => void;
108
107
  };
109
108
  export declare const GL_COMPOSITE_PARAMETER_SETTERS: {
110
- blendEquation: (gl: any, values: any, cache: any) => any;
111
- blendFunc: (gl: any, values: any, cache: any) => any;
112
- polygonOffset: (gl: any, values: any, cache: any) => any;
113
- sampleCoverage: (gl: any, values: any, cache: any) => any;
114
- stencilFuncFront: (gl: any, values: any, cache: any) => any;
115
- stencilFuncBack: (gl: any, values: any, cache: any) => any;
116
- stencilOpFront: (gl: any, values: any, cache: any) => any;
117
- stencilOpBack: (gl: any, values: any, cache: any) => any;
109
+ blendEquation: (gl: WebGLRenderingContext, values: any, cache: any) => void;
110
+ blendFunc: (gl: WebGLRenderingContext, values: any, cache: any) => void;
111
+ polygonOffset: (gl: WebGLRenderingContext, values: any, cache: any) => void;
112
+ sampleCoverage: (gl: WebGLRenderingContext, values: any, cache: any) => void;
113
+ stencilFuncFront: (gl: WebGLRenderingContext, values: any, cache: any) => void;
114
+ stencilFuncBack: (gl: WebGLRenderingContext, values: any, cache: any) => void;
115
+ stencilOpFront: (gl: WebGLRenderingContext, values: any, cache: any) => void;
116
+ stencilOpBack: (gl: WebGLRenderingContext, values: any, cache: any) => void;
118
117
  };
119
- declare type UpdateFunc = (params: Record<string, any>) => void;
118
+ type UpdateFunc = (params: Record<string, any>) => void;
120
119
  export declare const GL_HOOKED_SETTERS: {
121
- enable: (update: UpdateFunc, capability: any) => void;
122
- disable: (update: UpdateFunc, capability: any) => void;
123
- pixelStorei: (update: UpdateFunc, pname: any, value: any) => void;
124
- hint: (update: UpdateFunc, pname: any, hint: any) => void;
120
+ enable: (update: UpdateFunc, capability: GL) => void;
121
+ disable: (update: UpdateFunc, capability: GL) => void;
122
+ pixelStorei: (update: UpdateFunc, pname: GL, value: any) => void;
123
+ hint: (update: UpdateFunc, pname: GL, hint: GL) => void;
125
124
  useProgram: (update: UpdateFunc, value: any) => void;
126
125
  bindRenderbuffer: (update: UpdateFunc, target: any, value: any) => void;
127
126
  bindTransformFeedback: (update: UpdateFunc, target: any, value: any) => void;
@@ -157,16 +156,16 @@ export declare const GL_HOOKED_SETTERS: {
157
156
  viewport: (update: UpdateFunc, x: any, y: any, width: any, height: any) => void;
158
157
  };
159
158
  export declare const GL_PARAMETER_GETTERS: {
160
- 3042: (gl: any, key: any) => any;
161
- 2884: (gl: any, key: any) => any;
162
- 2929: (gl: any, key: any) => any;
163
- 3024: (gl: any, key: any) => any;
164
- 32823: (gl: any, key: any) => any;
165
- 32926: (gl: any, key: any) => any;
166
- 32928: (gl: any, key: any) => any;
167
- 3089: (gl: any, key: any) => any;
168
- 2960: (gl: any, key: any) => any;
169
- 35977: (gl: any, key: any) => any;
159
+ 3042: (gl: WebGLRenderingContext, key: any) => boolean;
160
+ 2884: (gl: WebGLRenderingContext, key: any) => boolean;
161
+ 2929: (gl: WebGLRenderingContext, key: any) => boolean;
162
+ 3024: (gl: WebGLRenderingContext, key: any) => boolean;
163
+ 32823: (gl: WebGLRenderingContext, key: any) => boolean;
164
+ 32926: (gl: WebGLRenderingContext, key: any) => boolean;
165
+ 32928: (gl: WebGLRenderingContext, key: any) => boolean;
166
+ 3089: (gl: WebGLRenderingContext, key: any) => boolean;
167
+ 2960: (gl: WebGLRenderingContext, key: any) => boolean;
168
+ 35977: (gl: WebGLRenderingContext, key: any) => boolean;
170
169
  };
171
170
  export declare const NON_CACHE_PARAMETERS: Set<GL>;
172
171
  export {};