@arcgis/core 4.23.0-next.20220106 → 4.23.0-next.20220124

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 (642) hide show
  1. package/assets/components/assets/calcite-date-picker/nls/bg.json +31 -0
  2. package/assets/components/assets/calcite-icon/centerAlign16.json +1 -0
  3. package/assets/components/assets/calcite-icon/centerAlign24.json +1 -0
  4. package/assets/components/assets/calcite-icon/centerAlign32.json +1 -0
  5. package/assets/components/assets/calcite-icon/checkSquareF16.json +1 -0
  6. package/assets/components/assets/calcite-icon/checkSquareF24.json +1 -0
  7. package/assets/components/assets/calcite-icon/checkSquareF32.json +1 -0
  8. package/assets/components/assets/calcite-icon/convert16.json +1 -0
  9. package/assets/components/assets/calcite-icon/convert24.json +1 -0
  10. package/assets/components/assets/calcite-icon/convert32.json +1 -0
  11. package/assets/components/assets/calcite-icon/explore16.json +1 -0
  12. package/assets/components/assets/calcite-icon/explore24.json +1 -0
  13. package/assets/components/assets/calcite-icon/explore32.json +1 -0
  14. package/assets/components/assets/calcite-icon/formDropdown16.json +1 -0
  15. package/assets/components/assets/calcite-icon/formDropdown24.json +1 -0
  16. package/assets/components/assets/calcite-icon/formDropdown32.json +1 -0
  17. package/assets/components/assets/calcite-icon/language16.json +1 -0
  18. package/assets/components/assets/calcite-icon/language24.json +1 -0
  19. package/assets/components/assets/calcite-icon/language32.json +1 -0
  20. package/assets/components/assets/calcite-icon/languageTranslate16.json +1 -0
  21. package/assets/components/assets/calcite-icon/languageTranslate24.json +1 -0
  22. package/assets/components/assets/calcite-icon/languageTranslate32.json +1 -0
  23. package/assets/components/assets/calcite-icon/leftAlign16.json +1 -0
  24. package/assets/components/assets/calcite-icon/leftAlign24.json +1 -0
  25. package/assets/components/assets/calcite-icon/leftAlign32.json +1 -0
  26. package/assets/components/assets/calcite-icon/lineSolid4.json +1 -0
  27. package/assets/components/assets/calcite-icon/partlyCloudy16.json +1 -0
  28. package/assets/components/assets/calcite-icon/partlyCloudy24.json +1 -0
  29. package/assets/components/assets/calcite-icon/partlyCloudy32.json +1 -0
  30. package/assets/components/assets/calcite-icon/rightAlign16.json +1 -0
  31. package/assets/components/assets/calcite-icon/rightAlign24.json +1 -0
  32. package/assets/components/assets/calcite-icon/rightAlign32.json +1 -0
  33. package/assets/components/assets/calcite-icon/screenshotMode16.json +1 -0
  34. package/assets/components/assets/calcite-icon/screenshotMode24.json +1 -0
  35. package/assets/components/assets/calcite-icon/screenshotMode32.json +1 -0
  36. package/assets/components/assets/calcite-icon/squareF16.json +1 -0
  37. package/assets/components/assets/calcite-icon/squareF24.json +1 -0
  38. package/assets/components/assets/calcite-icon/squareF32.json +1 -0
  39. package/assets/components/assets/calcite-icon/terminal16.json +1 -0
  40. package/assets/components/assets/calcite-icon/terminal24.json +1 -0
  41. package/assets/components/assets/calcite-icon/terminal32.json +1 -0
  42. package/assets/components/assets/calcite-icon/touch16.json +1 -0
  43. package/assets/components/assets/calcite-icon/touch24.json +1 -0
  44. package/assets/components/assets/calcite-icon/touch32.json +1 -0
  45. package/assets/components/assets/calcite-icon/xHexagon16.json +1 -0
  46. package/assets/components/assets/calcite-icon/xHexagon24.json +1 -0
  47. package/assets/components/assets/calcite-icon/xHexagon32.json +1 -0
  48. package/assets/components/assets/calcite-icon/xHexagonF16.json +1 -0
  49. package/assets/components/assets/calcite-icon/xHexagonF24.json +1 -0
  50. package/assets/components/assets/calcite-icon/xHexagonF32.json +1 -0
  51. package/assets/components/assets/calcite-icon/xOctagonF16.json +1 -0
  52. package/assets/components/assets/calcite-icon/xOctagonF24.json +1 -0
  53. package/assets/components/assets/calcite-icon/xOctagonF32.json +1 -0
  54. package/assets/esri/core/workers/RemoteClient.js +1 -1
  55. package/assets/esri/core/workers/chunks/09da224052976e290828.js +1 -0
  56. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +1 -0
  57. package/assets/esri/core/workers/chunks/{ce5ca5e95b2378ec55b9.js → 1305ef8717da6e902a55.js} +1 -1
  58. package/assets/esri/core/workers/chunks/199670a3a564ebe3bd79.js +1 -0
  59. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +1 -0
  60. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +1 -0
  61. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +1 -0
  62. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +1 -0
  63. package/assets/esri/core/workers/chunks/{99f0d896c17dd09cd285.js → 2629adf79e7fd9f25f07.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{9c417740bf3707a0d465.js → 2c607d30ff8ca1b61286.js} +1 -1
  65. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +1 -0
  66. package/assets/esri/core/workers/chunks/37a7bd30352b1309b8f8.js +1 -0
  67. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +1 -0
  68. package/assets/esri/core/workers/chunks/{3d5169ea9810d10caf0d.js → 3a9740dccda6a733313c.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{8a250ec51097f16feb66.js → 40a1e713f63ec77110c0.js} +1 -1
  70. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +1 -0
  71. package/assets/esri/core/workers/chunks/4c9084a04948b6924749.js +1 -0
  72. package/assets/esri/core/workers/chunks/{4beba242e7540ee3182b.js → 5538639a49c7cc2eca63.js} +1 -1
  73. package/assets/esri/core/workers/chunks/57c67e260267a1dbc5e3.js +1 -0
  74. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +1 -0
  75. package/assets/esri/core/workers/chunks/5ac4c1d54b94c7d87835.js +1 -0
  76. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +1 -0
  77. package/assets/esri/core/workers/chunks/{ba6fdaed6c315dc13981.js → 625d2663daa8e0cf64b0.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{3a2b2dc3e938d53faa30.js → 64276aacaafa4c8a15bd.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{75466e0c8c8da499b150.js → 662d13f68cf3ec92439b.js} +1 -1
  80. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +1 -0
  81. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +1 -0
  82. package/assets/esri/core/workers/chunks/68a59ce98177d8513337.js +1 -0
  83. package/assets/esri/core/workers/chunks/6cdfe175c965918b741b.js +1 -0
  84. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +1 -0
  85. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +1 -0
  86. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +1 -0
  87. package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js → 7a8764ae8a0041e1151d.js} +2 -2
  88. package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js.LICENSE.txt → 7a8764ae8a0041e1151d.js.LICENSE.txt} +1 -1
  89. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +1 -0
  90. package/assets/esri/core/workers/chunks/{f52b6d5037e4205b035c.js → 7bc5cc5dbf1b7b70ddac.js} +1 -1
  91. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +1 -0
  92. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +1 -0
  93. package/assets/esri/core/workers/chunks/8cbb04a9065aa3756638.js +1 -0
  94. package/assets/esri/core/workers/chunks/8fa0a14165d43ffe87a5.js +1 -0
  95. package/assets/esri/core/workers/chunks/94b8dbf859df71858d1c.js +1 -0
  96. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +1 -0
  97. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +1 -0
  98. package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +1 -0
  99. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +1 -0
  100. package/assets/esri/core/workers/chunks/9d77467aa71d345fc1b6.js +1 -0
  101. package/assets/esri/core/workers/chunks/9f8b7b6b4e95f9a794fc.js +1 -0
  102. package/assets/esri/core/workers/chunks/a78757b9c7e8cbea08fa.js +1 -0
  103. package/assets/esri/core/workers/chunks/{9b7c51ff3d2b42aa62f5.js → a7b1b75643ed31489495.js} +1 -1
  104. package/assets/esri/core/workers/chunks/a8b13fb804bb775e4967.js +1 -0
  105. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +1 -0
  106. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +1 -0
  107. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +1 -0
  108. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +1 -0
  109. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +1 -0
  110. package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +1 -0
  111. package/assets/esri/core/workers/chunks/b0b036ad3ad3cd956747.js +1 -0
  112. package/assets/esri/core/workers/chunks/{2a39d520b192b8e552b5.js → b2ae5fc4f787ea568b88.js} +1 -1
  113. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +1 -0
  114. package/assets/esri/core/workers/chunks/{b87bc1481a49b38109f4.js → b9c177524b3e7de1ffd1.js} +1 -1
  115. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +1 -0
  116. package/assets/esri/core/workers/chunks/{7c1b9ae141112a63b446.js → ba6654a885be4b7a43f0.js} +1 -1
  117. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +1 -0
  118. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +1 -0
  119. package/assets/esri/core/workers/chunks/bf6dda4a2af14c4b7716.js +1 -0
  120. package/assets/esri/core/workers/chunks/{ed0297fc61014e848c18.js → c080114a69fa95b88d22.js} +1 -1
  121. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +1 -0
  122. package/assets/esri/core/workers/chunks/c36f84daa7736878418d.js +1 -0
  123. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +1 -0
  124. package/assets/esri/core/workers/chunks/{573dc3064e84ca86844d.js → c959e0d1cf7dce0421b9.js} +1 -1
  125. package/assets/esri/core/workers/chunks/{1fd48459afb58a6cf14f.js → ca2f5faa01d99c21ec14.js} +1 -1
  126. package/assets/esri/core/workers/chunks/cbb291412fd1a5261aa9.js +1 -0
  127. package/assets/esri/core/workers/chunks/{7aa543a97f055cddea99.js → cc146c57bbdac8029fd8.js} +1 -1
  128. package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +1 -0
  129. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +1 -0
  130. package/assets/esri/core/workers/chunks/d1454155ee1b8a421cbb.js +1 -0
  131. package/assets/esri/core/workers/chunks/{0cd583c3233573cb8468.js → d24c4fbc567486b1188f.js} +1 -1
  132. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +1 -0
  133. package/assets/esri/core/workers/chunks/d72488db62fcf39447b6.js +1 -0
  134. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +1 -0
  135. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +981 -0
  136. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +1 -0
  137. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +1 -0
  138. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +1 -0
  139. package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +1 -0
  140. package/assets/esri/core/workers/chunks/{2f66fcb8670b108af549.js → ed0bcc66fb1e0ee75a4b.js} +1 -1
  141. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +1 -0
  142. package/assets/esri/core/workers/chunks/{b4ed7856cd9c98434477.js → fe864d01e72aa24574b6.js} +1 -1
  143. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  144. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.svg +1 -0
  145. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.ttf +0 -0
  146. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.woff +0 -0
  147. package/assets/esri/themes/base/icons/selection.json +1 -1
  148. package/assets/esri/themes/base/icons/style.css +4 -0
  149. package/assets/esri/themes/base/icons/style.scss +6 -0
  150. package/assets/esri/themes/base/icons/variables.scss +1 -0
  151. package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
  152. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  153. package/assets/esri/themes/dark/main.css +1 -1
  154. package/assets/esri/themes/dark-blue/main.css +1 -1
  155. package/assets/esri/themes/dark-green/main.css +1 -1
  156. package/assets/esri/themes/dark-purple/main.css +1 -1
  157. package/assets/esri/themes/dark-red/main.css +1 -1
  158. package/assets/esri/themes/light/main.css +1 -1
  159. package/assets/esri/themes/light/view.css +1 -1
  160. package/assets/esri/themes/light-blue/main.css +1 -1
  161. package/assets/esri/themes/light-green/main.css +1 -1
  162. package/assets/esri/themes/light-purple/main.css +1 -1
  163. package/assets/esri/themes/light-red/main.css +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  194. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  195. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  196. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  197. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  198. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  199. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  200. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  201. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  202. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  203. package/assets/esri/widgets/ElevationProfile/t9n/ElevationProfile_ja.json +1 -1
  204. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ar.json +1 -1
  205. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bg.json +1 -1
  206. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bs.json +1 -1
  207. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ca.json +1 -1
  208. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_cs.json +1 -1
  209. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_da.json +1 -1
  210. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_de.json +1 -1
  211. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_el.json +1 -1
  212. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_es.json +1 -1
  213. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_et.json +1 -1
  214. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fi.json +1 -1
  215. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fr.json +1 -1
  216. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_he.json +1 -1
  217. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hr.json +1 -1
  218. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hu.json +1 -1
  219. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_id.json +1 -1
  220. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_it.json +1 -1
  221. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ja.json +1 -1
  222. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ko.json +1 -1
  223. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lt.json +1 -1
  224. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lv.json +1 -1
  225. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nb.json +1 -1
  226. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nl.json +1 -1
  227. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pl.json +1 -1
  228. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-BR.json +1 -1
  229. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-PT.json +1 -1
  230. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ro.json +1 -1
  231. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ru.json +1 -1
  232. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sk.json +1 -1
  233. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sl.json +1 -1
  234. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sr.json +1 -1
  235. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sv.json +1 -1
  236. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_th.json +1 -1
  237. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_tr.json +1 -1
  238. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_uk.json +1 -1
  239. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_vi.json +1 -1
  240. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-CN.json +1 -1
  241. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-HK.json +1 -1
  242. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-TW.json +1 -1
  243. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  244. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  245. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  246. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  247. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  248. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  249. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  250. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  251. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  252. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  253. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  254. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  255. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  256. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  257. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  258. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  259. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  260. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  261. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  262. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  263. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  264. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  265. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  266. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  267. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  268. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  269. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  270. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  271. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  272. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  273. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  274. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  275. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  276. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  277. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  278. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  279. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  280. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  281. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  282. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  283. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  284. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  285. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  286. package/chunks/Clouds.glsl.js +14 -14
  287. package/chunks/CloudsComposition.glsl.js +4 -4
  288. package/chunks/DefaultMaterial.glsl.js +2 -2
  289. package/chunks/HUDMaterial.glsl.js +22 -21
  290. package/chunks/RibbonLine.glsl.js +10 -14
  291. package/chunks/persistableUrlUtils.js +1 -1
  292. package/chunks/vec32.js +1 -1
  293. package/chunks/vec42.js +1 -1
  294. package/chunks/vxlLayer.js +1 -1
  295. package/core/accessorSupport/ensureType.js +1 -1
  296. package/core/accessorSupport/get.js +1 -1
  297. package/core/accessorSupport/set.js +1 -1
  298. package/core/has.js +1 -1
  299. package/core/urlUtils.js +1 -1
  300. package/core/workers/workerFactory.js +1 -1
  301. package/form/elements/FieldElement.js +1 -1
  302. package/geometry/support/buffer/math/common.js +1 -1
  303. package/geometry/support/heightModelInfoUtils.js +1 -1
  304. package/interfaces.d.ts +372 -126
  305. package/layers/FeatureLayer.js +1 -1
  306. package/layers/RouteLayer.js +1 -1
  307. package/layers/SubtypeGroupLayer.js +1 -1
  308. package/layers/VectorTileLayer.js +1 -1
  309. package/layers/VoxelLayer.js +1 -1
  310. package/layers/VoxelWasmPerScene.js +1 -1
  311. package/layers/WMSLayer.js +1 -1
  312. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  313. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  314. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  315. package/layers/mixins/ArcGISImageService.js +1 -1
  316. package/layers/mixins/OperationalLayer.js +1 -1
  317. package/layers/ogc/crsUtils.js +5 -0
  318. package/layers/support/RasterFunction.js +1 -1
  319. package/layers/support/RasterWorker.js +1 -1
  320. package/layers/support/capabilities.js +1 -1
  321. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  322. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  323. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  324. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  325. package/layers/support/vectorTileLayerLoader.js +1 -1
  326. package/layers/support/wmsUtils.js +1 -1
  327. package/layers/support/wmtsUtils.js +1 -1
  328. package/libs/vxl/enums.js +1 -1
  329. package/package.json +5 -5
  330. package/portal/schemas/buildingSceneLayerItem.js +1 -1
  331. package/portal/schemas/definitions.js +1 -1
  332. package/portal/schemas/integratedMeshLayerItem.js +1 -1
  333. package/portal/schemas/pointCloudLayerItem.js +1 -1
  334. package/portal/schemas/sceneLayerItem.js +1 -1
  335. package/portal/schemas/webScene.js +1 -1
  336. package/rasterRenderers.js +1 -1
  337. package/renderers/support/RasterSymbolizer.js +1 -1
  338. package/request.js +1 -1
  339. package/rest/find.js +1 -1
  340. package/rest/geometryService/generalize.js +1 -1
  341. package/rest/geometryService/lengths.js +1 -1
  342. package/rest/geometryService/offset.js +1 -1
  343. package/rest/geometryService/relation.js +1 -1
  344. package/rest/geometryService/trimExtend.js +1 -1
  345. package/rest/identify.js +1 -1
  346. package/{tasks → rest}/operations/find.js +0 -0
  347. package/{tasks → rest}/operations/generalize.js +0 -0
  348. package/rest/operations/identify.js +5 -0
  349. package/{tasks → rest}/operations/lengths.js +0 -0
  350. package/{tasks → rest}/operations/offset.js +0 -0
  351. package/{tasks → rest}/operations/relation.js +0 -0
  352. package/{tasks → rest}/operations/trimExtend.js +0 -0
  353. package/{tasks → rest}/operations/urlUtils.js +0 -0
  354. package/rest/print.js +1 -1
  355. package/rest/query/operations/query.js +1 -1
  356. package/rest/query/operations/queryAttachments.js +1 -1
  357. package/rest/query/operations/queryRelatedRecords.js +1 -1
  358. package/rest/query/operations/queryTopFeatures.js +1 -1
  359. package/rest/route/utils.js +1 -1
  360. package/rest/support/ImageIdentifyParameters.js +1 -1
  361. package/rest/support/NetworkServiceDescription.js +1 -1
  362. package/rest/support/RouteInfo.js +1 -1
  363. package/rest/support/RouteParameters.js +1 -1
  364. package/rest/support/RouteSettings.js +5 -0
  365. package/rest/support/StatisticDefinition.js +1 -1
  366. package/rest/support/Stop.js +1 -1
  367. package/rest/support/networkEnums.js +1 -1
  368. package/smartMapping/renderers/univariateColorSize.js +1 -1
  369. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  370. package/support/featureFlags.js +1 -1
  371. package/support/revision.js +1 -1
  372. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  373. package/symbols/Font.js +1 -1
  374. package/symbols/IconSymbol3DLayer.js +1 -1
  375. package/symbols/ObjectSymbol3DLayer.js +1 -1
  376. package/symbols/PathSymbol3DLayer.js +1 -1
  377. package/symbols/TextSymbol.js +1 -1
  378. package/symbols/TextSymbol3DLayer.js +1 -1
  379. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  380. package/symbols/support/Symbol3DHalo.js +1 -1
  381. package/symbols/support/Symbol3DMaterial.js +1 -1
  382. package/symbols/support/cimSymbolUtils.js +1 -1
  383. package/symbols/support/textUtils.js +5 -0
  384. package/symbols/support/utils.js +1 -1
  385. package/views/2d/engine/Stage.js +1 -1
  386. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  387. package/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js +1 -1
  388. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  389. package/views/2d/engine/vectorTiles/style/VectorTilesRequestManager.js +5 -0
  390. package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
  391. package/views/2d/engine/webgl/MaterialManager.js +1 -1
  392. package/views/2d/engine/webgl/alignmentUtils.js +1 -1
  393. package/views/2d/engine/webgl/effects/BlendEffect.js +1 -1
  394. package/views/2d/engine/webgl/materialKey/MaterialKey.js +1 -1
  395. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  396. package/views/2d/engine/webgl/shaders/BlendPrograms.js +1 -1
  397. package/views/2d/engine/webgl/shaders/MaterialPrograms.js +1 -1
  398. package/views/2d/layers/BaseLayerView2D.js +1 -1
  399. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  400. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  401. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  402. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  403. package/views/2d/layers/LayerView2D.js +1 -1
  404. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  405. package/views/2d/layers/RouteLayerView2D.js +1 -1
  406. package/views/2d/layers/TileLayerView2D.js +1 -1
  407. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  408. package/views/2d/layers/WMSLayerView2D.js +1 -1
  409. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  410. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  411. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  412. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  413. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  414. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  415. package/views/2d/support/engineHelpers.js +1 -1
  416. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  417. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  418. package/views/3d/environment/CloudsComposition.js +1 -1
  419. package/views/3d/environment/CloudsGenerator.js +1 -1
  420. package/views/3d/environment/CloudyWeather.js +1 -1
  421. package/views/3d/environment/Fog.js +1 -1
  422. package/views/3d/environment/FoggyWeather.js +1 -1
  423. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  424. package/views/3d/environment/RainyWeather.js +1 -1
  425. package/views/3d/environment/Stars.js +1 -1
  426. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  427. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  428. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  429. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  430. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  431. package/views/3d/layers/GraphicsView3D.js +1 -1
  432. package/views/3d/layers/I3SMeshView3D.js +1 -1
  433. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  434. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  435. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  436. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  437. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  438. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  439. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  440. package/views/3d/layers/SceneLayerView3D.js +1 -1
  441. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  442. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  443. package/views/3d/layers/WMSLayerView3D.js +1 -1
  444. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  445. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  446. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  447. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  448. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  449. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +5 -0
  450. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  451. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  452. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  453. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  454. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  455. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  456. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  457. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  458. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  459. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  460. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  461. package/views/3d/layers/graphics/GraphicsProcessor.js +5 -0
  462. package/views/3d/layers/graphics/IGraphics3DFeatureProcessor.js +4 -0
  463. package/views/3d/layers/graphics/Labeler.js +1 -1
  464. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  465. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  466. package/views/3d/state/controllers/RotateController.js +1 -1
  467. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  468. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  469. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  470. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  471. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  472. package/views/3d/support/debugFlags.js +1 -1
  473. package/views/3d/support/sunUtils.js +1 -1
  474. package/views/3d/terrain/Overlay.js +1 -1
  475. package/views/3d/terrain/OverlayManager.js +1 -1
  476. package/views/3d/terrain/OverlayRenderer.js +1 -1
  477. package/views/3d/terrain/TerrainSurface.js +1 -1
  478. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +7 -1
  479. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +28 -24
  480. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +19 -14
  481. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +12 -14
  482. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  483. package/views/3d/webgl-engine/lib/InstanceParameters.js +5 -0
  484. package/views/3d/webgl-engine/lib/{localOrigin.js → LocalOriginFactory.js} +0 -0
  485. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  486. package/views/3d/webgl-engine/lib/Program.js +1 -1
  487. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  488. package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
  489. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  490. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  491. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  492. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  493. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  494. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  495. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  496. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  497. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  498. package/views/3d/webgl-engine/parts/Model.js +1 -1
  499. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  500. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  501. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  502. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  503. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  504. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  505. package/views/LayerViewManager.js +1 -1
  506. package/views/MapView.js +1 -1
  507. package/views/SceneView.js +1 -1
  508. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  509. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  510. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  511. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  512. package/views/layers/ImageryTileLayerView.js +1 -1
  513. package/views/layers/LayerView.js +1 -1
  514. package/views/layers/OGCFeatureLayerView.js +1 -1
  515. package/views/layers/RefreshableLayerView.js +1 -1
  516. package/views/overlay/ViewOverlay.js +1 -1
  517. package/views/support/DefaultsFromMap.js +1 -1
  518. package/views/support/WatchUpdatingTracking.js +1 -1
  519. package/views/support/imageReprojection.js +1 -1
  520. package/views/webgl/BufferObject.js +1 -1
  521. package/views/webgl/ContextState.js +1 -1
  522. package/views/webgl/FramebufferObject.js +1 -1
  523. package/views/webgl/Program.js +1 -1
  524. package/views/webgl/ProgramCache.js +1 -1
  525. package/views/webgl/ProgramTemplate.js +1 -1
  526. package/views/webgl/Renderbuffer.js +1 -1
  527. package/views/webgl/RenderingContext.js +1 -1
  528. package/views/webgl/ShaderTranspiler.js +1 -1
  529. package/views/webgl/Texture.js +1 -1
  530. package/views/webgl/UniformBufferLayout.js +5 -0
  531. package/views/webgl/UniformBufferObject.js +5 -0
  532. package/views/webgl/Util.js +1 -1
  533. package/views/webgl/enums.js +1 -1
  534. package/views/webgl/rasterUtils.js +1 -1
  535. package/views/webgl/storageLayouts.js +5 -0
  536. package/views/webgl/testDoublePrecisionArithmetic.js +1 -1
  537. package/views/webgl/testFloatBufferBlend.js +1 -1
  538. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  539. package/views/webgl/testSamplerPrecision.js +1 -1
  540. package/views/webgl/tests/SimpleDraw.js +1 -1
  541. package/widgets/BasemapLayerList.js +1 -1
  542. package/widgets/BuildingExplorer/BuildingDisciplinesViewModel.js +1 -1
  543. package/widgets/Editor/BatchCreateWorkflow.js +1 -1
  544. package/widgets/Editor/CreateWorkflow.js +1 -1
  545. package/widgets/Editor/UpdateWorkflow.js +1 -1
  546. package/widgets/Editor/workflowUtils.js +1 -1
  547. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  548. package/widgets/ElevationProfile.js +1 -1
  549. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  550. package/widgets/Feature/FeatureExpression.js +1 -1
  551. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  552. package/widgets/Feature/FeatureMedia.js +1 -1
  553. package/widgets/Feature/FeatureViewModel.js +1 -1
  554. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  555. package/widgets/FeatureForm/InputField.js +1 -1
  556. package/widgets/FeatureForm/InputFieldGroup.js +1 -1
  557. package/widgets/FeatureForm.js +1 -1
  558. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  559. package/widgets/FeatureTable.js +1 -1
  560. package/widgets/FeatureTemplates.js +1 -1
  561. package/widgets/FloorFilter.js +1 -1
  562. package/widgets/LayerList/LayerListViewModel.js +1 -1
  563. package/widgets/LayerList/ListItemPanel.js +1 -1
  564. package/widgets/LayerList/support/layerListUtils.js +1 -1
  565. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  566. package/widgets/Popup.js +1 -1
  567. package/widgets/Print.js +1 -1
  568. package/widgets/Search.js +1 -1
  569. package/widgets/Sketch/SketchViewModel.js +1 -1
  570. package/widgets/Weather/CoverageSlider.js +5 -0
  571. package/widgets/Weather/WeatherViewModel.js +1 -1
  572. package/widgets/Weather/css.js +1 -1
  573. package/widgets/Weather.js +1 -1
  574. package/widgets/support/geolocationUtils.js +1 -1
  575. package/assets/esri/core/workers/chunks/0881ce46b10362861f87.js +0 -1
  576. package/assets/esri/core/workers/chunks/0c0a02770eeeb3e28ea1.js +0 -1
  577. package/assets/esri/core/workers/chunks/0d2effbd84a9482eb639.js +0 -1
  578. package/assets/esri/core/workers/chunks/0f04246c1b591a3ac74d.js +0 -1
  579. package/assets/esri/core/workers/chunks/1ac6be0dc25e16c75d06.js +0 -1
  580. package/assets/esri/core/workers/chunks/1f8110ea12d65ca94b55.js +0 -1
  581. package/assets/esri/core/workers/chunks/2025d0fd61a64876c81b.js +0 -1
  582. package/assets/esri/core/workers/chunks/241859d74c0daac62e11.js +0 -1
  583. package/assets/esri/core/workers/chunks/2c9af2ebd72d9b55329b.js +0 -1
  584. package/assets/esri/core/workers/chunks/331be347c1b1ca0be2d2.js +0 -1
  585. package/assets/esri/core/workers/chunks/39af317388ecebb4387d.js +0 -1
  586. package/assets/esri/core/workers/chunks/39be2893a7dbdecfd65a.js +0 -1
  587. package/assets/esri/core/workers/chunks/3a20f66b0b7d08064e34.js +0 -1
  588. package/assets/esri/core/workers/chunks/445099d037affd139ed0.js +0 -1
  589. package/assets/esri/core/workers/chunks/45848fecec88ed2da33d.js +0 -1
  590. package/assets/esri/core/workers/chunks/48d3a3abc53abe6a4017.js +0 -1
  591. package/assets/esri/core/workers/chunks/5005b8c1fdd5cb9a4c19.js +0 -1
  592. package/assets/esri/core/workers/chunks/52e4c367c72ea7cc3457.js +0 -1
  593. package/assets/esri/core/workers/chunks/5d8170f6207dbeb4de1b.js +0 -1
  594. package/assets/esri/core/workers/chunks/615aa2d3ecafe30c80c0.js +0 -1
  595. package/assets/esri/core/workers/chunks/642c38ac00a962f35d44.js +0 -1
  596. package/assets/esri/core/workers/chunks/64459604505647e9c714.js +0 -1
  597. package/assets/esri/core/workers/chunks/653d1550dd1a4867a9fc.js +0 -1
  598. package/assets/esri/core/workers/chunks/65f73fbbc3c7c60c6d3d.js +0 -1
  599. package/assets/esri/core/workers/chunks/6db7081d344bea26ef64.js +0 -1
  600. package/assets/esri/core/workers/chunks/6deac533bb455be4004b.js +0 -1
  601. package/assets/esri/core/workers/chunks/6e13dab8ec43f7494297.js +0 -1
  602. package/assets/esri/core/workers/chunks/722a10c65456844d72b9.js +0 -1
  603. package/assets/esri/core/workers/chunks/7bd4c3ee43fb038b88d8.js +0 -1
  604. package/assets/esri/core/workers/chunks/803de5097a8a2c4b58a8.js +0 -1
  605. package/assets/esri/core/workers/chunks/8298231a0fd0129b0d5c.js +0 -1
  606. package/assets/esri/core/workers/chunks/8500c6c011400af1b7bd.js +0 -1
  607. package/assets/esri/core/workers/chunks/8b322a2a47dfdbb59b45.js +0 -1
  608. package/assets/esri/core/workers/chunks/8f83bebef9174c3f15da.js +0 -1
  609. package/assets/esri/core/workers/chunks/904332faa22bc0e876cb.js +0 -1
  610. package/assets/esri/core/workers/chunks/950565d1e682fc4072e1.js +0 -1
  611. package/assets/esri/core/workers/chunks/9846098704ee38bf6350.js +0 -1
  612. package/assets/esri/core/workers/chunks/a247ddd84245c81112c8.js +0 -1
  613. package/assets/esri/core/workers/chunks/a721342a32541717324d.js +0 -1
  614. package/assets/esri/core/workers/chunks/a9ffa806df20130ecfb6.js +0 -1
  615. package/assets/esri/core/workers/chunks/af13e534e4160636bd3d.js +0 -1
  616. package/assets/esri/core/workers/chunks/b2f62234ebb8b6158baa.js +0 -1
  617. package/assets/esri/core/workers/chunks/b51261a9a9ab62388839.js +0 -971
  618. package/assets/esri/core/workers/chunks/b58eba403bd517a7bb15.js +0 -1
  619. package/assets/esri/core/workers/chunks/b5bb7cfa26b1f0cec67a.js +0 -1
  620. package/assets/esri/core/workers/chunks/b8666d1a4e4fff7a4703.js +0 -1
  621. package/assets/esri/core/workers/chunks/bea1da9e3f878e0e2c83.js +0 -1
  622. package/assets/esri/core/workers/chunks/c1b6c31fa3ec1542f996.js +0 -1
  623. package/assets/esri/core/workers/chunks/c32a4fbdc87225f84019.js +0 -1
  624. package/assets/esri/core/workers/chunks/c67fea81f69a60c0eaef.js +0 -1
  625. package/assets/esri/core/workers/chunks/cb68db7169b9dfd1c3ff.js +0 -1
  626. package/assets/esri/core/workers/chunks/cc96608b2802fbfe7a08.js +0 -1
  627. package/assets/esri/core/workers/chunks/cd02fe27eb07681cb366.js +0 -1
  628. package/assets/esri/core/workers/chunks/d336afd5890dcdbf5341.js +0 -1
  629. package/assets/esri/core/workers/chunks/da69e3e5949fe1716e34.js +0 -1
  630. package/assets/esri/core/workers/chunks/daa9c450b2e2a5371249.js +0 -1
  631. package/assets/esri/core/workers/chunks/dd63ba77b7e4c3c9c594.js +0 -1
  632. package/assets/esri/core/workers/chunks/dfa57982d28c9aeb97b9.js +0 -1
  633. package/assets/esri/core/workers/chunks/e01812116b27874948f0.js +0 -1
  634. package/assets/esri/core/workers/chunks/e5c9d8482b913cf3580a.js +0 -1
  635. package/assets/esri/core/workers/chunks/eeadd92f0bede9fc8745.js +0 -1
  636. package/assets/esri/core/workers/chunks/fbb67cb6224aed2cce16.js +0 -1
  637. package/assets/esri/core/workers/chunks/feeaf61424336e9eac88.js +0 -1
  638. package/assets/esri/core/workers/chunks/ff02295329a8986d0568.js +0 -1
  639. package/tasks/operations/identify.js +0 -5
  640. package/views/2d/engine/webgl/mesh/templates/meshUtils.js +0 -5
  641. package/views/3d/layers/graphics/Graphics3DFeatureLikeLayerView.js +0 -5
  642. package/views/3d/layers/graphics/Graphics3DGraphicLikeLayerView.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../request.js";import e from"../../geometry/Point.js";import{project as r}from"../../geometry/projection.js";import{projectResolution as i,getProjectionOffsetGrid as a}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{isImageSource as s,rasterize as o}from"../2d/engine/Bitmap.js";import n from"../2d/engine/webgl/VertexStream.js";import{createProgramTemplate as m}from"../2d/engine/webgl/shaders/MaterialPrograms.js";import{PixelFormat as p,PixelType as h,TextureWrapMode as c,TextureSamplingMode as x,TargetType as d,DepthStencilTargetType as g,ColorAttachment as u}from"../webgl/enums.js";import{FramebufferObject as _}from"../webgl/FramebufferObject.js";import{ProgramCache as f}from"../webgl/ProgramCache.js";import{createTransformTexture as l}from"../webgl/rasterUtils.js";import{RenderingContext as w}from"../webgl/RenderingContext.js";import{Texture as b}from"../webgl/Texture.js";class j{constructor(t){if(t)this._ownsRctx=!1,this._rctx=t;else{this._ownsRctx=!0;const t=document.createElement("canvas").getContext("webgl");t.getExtension("OES_texture_float"),this._rctx=new w(t,{})}const e=m("raster/reproject","raster/reproject",new Map([["a_position",0]])),r=new f(this._rctx);this._program=r.getProgram(e,{applyProjection:!0,bilinear:!1,bicubic:!1}),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new n(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,s,o=!1){const n=r(t.extent,s),m=new e({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:f,y:w}=i(m,s,t.extent);let j=(f+w)/2;const T=Math.round((n.xmax-n.xmin)/j),D=Math.round((n.ymax-n.ymin)/j);j=(n.width/T+n.height/D)/2;const E=new e({x:j,y:j,spatialReference:n.spatialReference}),y=a({projectedExtent:n,srcBufferExtent:t.extent,pixelSize:E,hasWrapAround:!0,spacing:[16,16]}),R=l(this._rctx,y),M=new b(this._rctx,{width:T,height:D,pixelFormat:p.RGBA,dataType:h.UNSIGNED_BYTE,wrapMode:c.CLAMP_TO_EDGE,samplingMode:x.LINEAR,hasMipmap:!1}),A=new _(this._rctx,{colorTarget:d.TEXTURE,depthStencilTarget:g.NONE,width:T,height:D},M);if(this._rctx.bindFramebuffer(A),this._rctx.setViewport(0,0,T,D),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(R,1),this._quad.bind(),this._program.setUniform2f("u_srcImageSize",t.texture.descriptor.width,t.texture.descriptor.height),this._program.setUniform2fv("u_transformSpacing",y.spacing),this._program.setUniform2fv("u_transformGridSize",y.size),this._program.setUniform2f("u_targetImageSize",T,D),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),R.dispose(),o){const t=new ImageData(A.descriptor.width,A.descriptor.height);return A.readPixels(0,0,A.descriptor.width,A.descriptor.height,p.RGBA,h.UNSIGNED_BYTE,t.data),A.detachColorTexture(u.COLOR_ATTACHMENT0),A.dispose(),{texture:M,extent:n,imageData:t}}return A.detachColorTexture(u.COLOR_ATTACHMENT0),A.dispose(),{texture:M,extent:n}}reprojectBitmapData(t,e){const r=s(t.bitmapData)?o(t.bitmapData):t.bitmapData,i=new b(this._rctx,{width:t.bitmapData.width,height:t.bitmapData.height,pixelFormat:p.RGBA,dataType:h.UNSIGNED_BYTE,wrapMode:c.CLAMP_TO_EDGE,samplingMode:x.LINEAR,hasMipmap:!1},r),a=this.reprojectTexture({texture:i,extent:t.extent},e,!0);a.texture.dispose();const n=document.createElement("canvas");n.width=a.imageData.width,n.height=a.imageData.height;return n.getContext("2d").putImageData(a.imageData,0,0),{bitmapData:n,extent:a.extent}}async loadAndReprojectBitmapData(e,r,i){const a=(await t(e,{responseType:"image"})).data,s=document.createElement("canvas");s.width=a.width,s.height=a.height;const o=s.getContext("2d");o.drawImage(a,0,0);const n=o.getImageData(0,0,s.width,s.height),m=this.reprojectBitmapData({bitmapData:n,extent:r},i);return{bitmapData:m.bitmapData,extent:m.extent}}destroy(){this._quad.dispose(),this._program.dispose(),this._ownsRctx&&this._rctx.dispose()}}export{j as ImageReprojector};
5
+ import t from"../../request.js";import e from"../../geometry/Point.js";import{project as r}from"../../geometry/projection.js";import{projectResolution as i,getProjectionOffsetGrid as a}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{isImageSource as s,rasterize as o}from"../2d/engine/Bitmap.js";import n from"../2d/engine/webgl/VertexStream.js";import{createProgramTemplate as m}from"../2d/engine/webgl/shaders/MaterialPrograms.js";import{PixelFormat as p,PixelType as h,TextureWrapMode as c,TextureSamplingMode as x,TargetType as d,DepthStencilTargetType as g,ColorAttachment as u}from"../webgl/enums.js";import{FramebufferObject as _}from"../webgl/FramebufferObject.js";import{createTransformTexture as f}from"../webgl/rasterUtils.js";import{RenderingContext as l}from"../webgl/RenderingContext.js";import{Texture as w}from"../webgl/Texture.js";class b{constructor(t){if(t)this._ownsRctx=!1,this._rctx=t;else{this._ownsRctx=!0;const t=document.createElement("canvas").getContext("webgl");t.getExtension("OES_texture_float"),this._rctx=new l(t,{})}const e={applyProjection:!0,bilinear:!1,bicubic:!1},r=m("raster/reproject","raster/reproject",new Map([["a_position",0]]),e);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new n(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,s,o=!1){const n=r(t.extent,s),m=new e({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:l,y:b}=i(m,s,t.extent);let T=(l+b)/2;const j=Math.round((n.xmax-n.xmin)/T),D=Math.round((n.ymax-n.ymin)/T);T=(n.width/j+n.height/D)/2;const E=new e({x:T,y:T,spatialReference:n.spatialReference}),y=a({projectedExtent:n,srcBufferExtent:t.extent,pixelSize:E,hasWrapAround:!0,spacing:[16,16]}),R=f(this._rctx,y),M=new w(this._rctx,{width:j,height:D,pixelFormat:p.RGBA,dataType:h.UNSIGNED_BYTE,wrapMode:c.CLAMP_TO_EDGE,samplingMode:x.LINEAR,hasMipmap:!1}),A=new _(this._rctx,{colorTarget:d.TEXTURE,depthStencilTarget:g.NONE,width:j,height:D},M);if(this._rctx.bindFramebuffer(A),this._rctx.setViewport(0,0,j,D),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(R,1),this._quad.bind(),this._program.setUniform2f("u_srcImageSize",t.texture.descriptor.width,t.texture.descriptor.height),this._program.setUniform2fv("u_transformSpacing",y.spacing),this._program.setUniform2fv("u_transformGridSize",y.size),this._program.setUniform2f("u_targetImageSize",j,D),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),R.dispose(),o){const t=new ImageData(A.descriptor.width,A.descriptor.height);return A.readPixels(0,0,A.descriptor.width,A.descriptor.height,p.RGBA,h.UNSIGNED_BYTE,t.data),A.detachColorTexture(u.COLOR_ATTACHMENT0),A.dispose(),{texture:M,extent:n,imageData:t}}return A.detachColorTexture(u.COLOR_ATTACHMENT0),A.dispose(),{texture:M,extent:n}}reprojectBitmapData(t,e){const r=s(t.bitmapData)?o(t.bitmapData):t.bitmapData,i=new w(this._rctx,{width:t.bitmapData.width,height:t.bitmapData.height,pixelFormat:p.RGBA,dataType:h.UNSIGNED_BYTE,wrapMode:c.CLAMP_TO_EDGE,samplingMode:x.LINEAR,hasMipmap:!1},r),a=this.reprojectTexture({texture:i,extent:t.extent},e,!0);a.texture.dispose();const n=document.createElement("canvas");n.width=a.imageData.width,n.height=a.imageData.height;return n.getContext("2d").putImageData(a.imageData,0,0),{bitmapData:n,extent:a.extent}}async loadAndReprojectBitmapData(e,r,i){const a=(await t(e,{responseType:"image"})).data,s=document.createElement("canvas");s.width=a.width,s.height=a.height;const o=s.getContext("2d");o.drawImage(a,0,0);const n=o.getImageData(0,0,s.width,s.height),m=this.reprojectBitmapData({bitmapData:n,extent:r},i);return{bitmapData:m.bitmapData,extent:m.extent}}destroy(){this._quad.dispose(),this._program.dispose(),this._ownsRctx&&this._rctx.dispose()}}export{b as ImageReprojector};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Logger.js";import{isSome as e}from"../../core/maybe.js";import{isUint16Array as i,isUint32Array as s}from"../../core/typedArrayUtil.js";import{checkWebGLError as r}from"./checkWebGLError.js";import{BufferType as n,ResourceType as o,DataType as h}from"./enums.js";const f=t.getLogger("esri.views.webgl.BufferObject");class u{constructor(t,e,i,s){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,t.instanceCounter.increment(o.Buffer,this),this._glName=this._context.gl.createBuffer(),r(this._context.gl),s&&this.setData(s)}static createIndex(t,e,i){return new u(t,n.ELEMENT_ARRAY_BUFFER,e,i)}static createVertex(t,e,i){return new u(t,n.ARRAY_BUFFER,e,i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===n.ARRAY_BUFFER?this._size:this._indexType===h.UNSIGNED_INT?4*this._size:2*this._size}dispose(){var t;if(null!=(t=this._context)&&t.gl){if(this._glName){this._context.gl.deleteBuffer(this._glName),this._glName=null}this._context.instanceCounter.decrement(o.Buffer,this),this._context=null}else this._glName&&f.warn("Leaked WebGL buffer object")}setSize(t,i=null){if(t<=0&&f.error("Buffer size needs to be positive!"),this.bufferType===n.ELEMENT_ARRAY_BUFFER&&e(i))switch(this._indexType=i,i){case h.UNSIGNED_SHORT:t*=2;break;case h.UNSIGNED_INT:t*=4}this._setBufferData(t)}setData(t){if(!t)return;let e=t.byteLength;i(t)&&(e/=2,this._indexType=h.UNSIGNED_SHORT),s(t)&&(e/=4,this._indexType=h.UNSIGNED_INT),this._setBufferData(e,t)}_setBufferData(t,i=null){this._size=t;const s=this._context.getBoundVAO();this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;e(i)?n.bufferData(this.bufferType,i,this.usage):n.bufferData(this.bufferType,t,this.usage),r(n),this._context.bindVAO(s)}setSubData(t,e=0,n=0,o=t.byteLength){if(!t)return;(e<0||e>=this._size)&&f.error("offset is out of range!");let h=e,u=n,_=o,a=t.byteLength;i(t)?(a/=2,h*=2,u*=2,_*=2):s(t)&&(a/=4,h*=4,u*=4,_*=4),void 0===o&&(o=a-1),n>=o&&f.error("end must be bigger than start!"),e+n-o>this._size&&f.error("An attempt to write beyond the end of the buffer!");const c=this._context.getBoundVAO();this._context.bindVAO(null),this._context.bindBuffer(this);const b=this._context.gl,g=ArrayBuffer.isView(t)?t.buffer:t,l=0===u&&_===t.byteLength?g:g.slice(u,_);b.bufferSubData(this.bufferType,h,l),r(b),this._context.bindVAO(c)}setSubDataFromView(t,e,i,s){if(!t)return;(e<0||e>=this._size)&&f.error("offset is out of range!"),i>=s&&f.error("end must be bigger than start!"),e+i-s>this._size&&f.error("An attempt to write beyond the end of the buffer!");const n=this._context.getBoundVAO();this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl,h=0===i&&s===t.length?t:t.subarray(i,s);o.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,h),r(o),this._context.bindVAO(n)}}export{u as BufferObject};
5
+ import t from"../../core/Logger.js";import{isSome as e}from"../../core/maybe.js";import{isUint16Array as i,isUint32Array as s}from"../../core/typedArrayUtil.js";import{checkWebGLError as r}from"./checkWebGLError.js";import{ContextType as n}from"./context-util.js";import{BufferType as f,ResourceType as o,Usage as _,DataType as h}from"./enums.js";const a=t.getLogger("esri.views.webgl.BufferObject");class u{constructor(t,e,i,s){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,t.instanceCounter.increment(o.Buffer,this),this._glName=this._context.gl.createBuffer(),r(this._context.gl),s&&this.setData(s)}static createIndex(t,e,i){return new u(t,f.ELEMENT_ARRAY_BUFFER,e,i)}static createVertex(t,e,i){return new u(t,f.ARRAY_BUFFER,e,i)}static createUniform(t,e,i){return new u(t,f.UNIFORM_BUFFER,e,i)}static createPixelPack(t,e=_.STREAM_READ,i){const s=new u(t,f.PIXEL_PACK_BUFFER,e);return i&&s.setSize(i),s}static createPixelUnpack(t,e=_.STREAM_DRAW,i){return new u(t,f.PIXEL_UNPACK_BUFFER,e,i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===f.ELEMENT_ARRAY_BUFFER?this._indexType===h.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===f.ELEMENT_ARRAY_BUFFER||this.bufferType===f.ARRAY_BUFFER}dispose(){var t;if(null!=(t=this._context)&&t.gl){if(this._glName){this._context.gl.deleteBuffer(this._glName),this._glName=null}this._context.instanceCounter.decrement(o.Buffer,this),this._context=null}else this._glName&&a.warn("Leaked WebGL buffer object")}setSize(t,i=null){if(t<=0&&a.error("Buffer size needs to be positive!"),this.bufferType===f.ELEMENT_ARRAY_BUFFER&&e(i))switch(this._indexType=i,i){case h.UNSIGNED_SHORT:t*=2;break;case h.UNSIGNED_INT:t*=4}this._setBufferData(t)}setData(t){if(!t)return;let e=t.byteLength;this.bufferType===f.ELEMENT_ARRAY_BUFFER&&(i(t)&&(e/=2,this._indexType=h.UNSIGNED_SHORT),s(t)&&(e/=4,this._indexType=h.UNSIGNED_INT)),this._setBufferData(e,t)}_setBufferData(t,i=null){this._size=t;const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;e(i)?n.bufferData(this.bufferType,i,this.usage):n.bufferData(this.bufferType,t,this.usage),r(n),this._isVAOAware&&this._context.bindVAO(s)}setSubData(t,e=0,n=0,o=t.byteLength){if(!t)return;(e<0||e>=this._size)&&a.error("offset is out of range!");let _=e,h=n,u=o,c=t.byteLength;this.bufferType===f.ELEMENT_ARRAY_BUFFER&&(i(t)?(c/=2,_*=2,h*=2,u*=2):s(t)&&(c/=4,_*=4,h*=4,u*=4)),void 0===o&&(o=c-1),n>=o&&a.error("end must be bigger than start!"),e+n-o>this._size&&a.error("An attempt to write beyond the end of the buffer!");const b=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const E=this._context.gl,A=ArrayBuffer.isView(t)?t.buffer:t,l=0===h&&u===t.byteLength?A:A.slice(h,u);E.bufferSubData(this.bufferType,_,l),r(E),this._isVAOAware&&this._context.bindVAO(b)}setSubDataFromView(t,e,i,s){if(!t)return;(e<0||e>=this._size)&&a.error("offset is out of range!"),i>=s&&a.error("end must be bigger than start!"),e+i-s>this._size&&a.error("An attempt to write beyond the end of the buffer!");const f=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl;if(this._context.type===n.WEBGL2)o.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,s-i);else{const r=0===i&&s===t.length?t:t.subarray(i,s);o.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,r)}r(o),this._isVAOAware&&this._context.bindVAO(f)}getSubData(t,e=0,i,s){if(this._context.type!==n.WEBGL2)return void a.error("Get buffer subdata is only supported in WebGL2!");const r=this._context.gl;this._context.bindBuffer(this,f.COPY_READ_BUFFER),r.getBufferSubData(f.COPY_READ_BUFFER,e,t,i,s),this._context.unbindBuffer(f.COPY_READ_BUFFER)}async getSubDataAsync(t,e=0,i,s){this._context.type===n.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(t,e,i,s)):a.error("Get buffer subdata is only supported in WebGL2!")}}export{u as BufferObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{BlendFactor as t,BlendOperation as s,Face as e,CullMode as i,CompareFunction as h,StencilOperation as l}from"./enums.js";class r{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:t.ONE,dstRGB:t.ZERO,srcAlpha:t.ONE,dstAlpha:t.ZERO},this.blendEquation={mode:s.ADD,modeAlpha:s.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=e.BACK,this.frontFace=i.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=h.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:e.FRONT_AND_BACK,func:h.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:e.FRONT_AND_BACK,fail:l.KEEP,zFail:l.KEEP,zPass:l.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.framebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array}}export{r as ContextState};
5
+ import{BlendFactor as t,BlendOperation as i,Face as e,CullMode as s,CompareFunction as l,StencilOperation as r}from"./enums.js";class h{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:t.ONE,dstRGB:t.ZERO,srcAlpha:t.ONE,dstAlpha:t.ZERO},this.blendEquation={mode:i.ADD,modeAlpha:i.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=e.BACK,this.frontFace=s.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=l.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:e.FRONT_AND_BACK,func:l.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:e.FRONT_AND_BACK,fail:r.KEEP,zFail:r.KEEP,zPass:r.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.uniformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array}}export{h as ContextState};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Logger.js";import{isSome as e,isNone as i}from"../../core/maybe.js";import{webglValidateShadersEnabled as r}from"./checkWebGLError.js";import{ResourceType as s,ColorAttachment as h,TargetType as n,DepthStencilTargetType as o,TextureType as c,PixelFormat as _,PixelType as a,DepthStencilAttachment as l,RenderbufferFormat as T,TextureSamplingMode as E,TextureWrapMode as d}from"./enums.js";import{Renderbuffer as u}from"./Renderbuffer.js";import{Texture as f}from"./Texture.js";import{getGpuMemoryUsage as m}from"./Util.js";const R=t.getLogger("esri.views.webgl.FrameBufferObject");class A{constructor(t,i,r=null,c=null){if(this._context=t,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._initialized=!1,this._desc={...i},t.instanceCounter.increment(s.Framebuffer,this),e(r)){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){var _,a;const i=r[e];let s;p(i)?(s=i.descriptor,this._colorAttachments.set(h.COLOR_ATTACHMENT0+e,i)):(s=i,this._colorAttachments.set(h.COLOR_ATTACHMENT0+e,new f(t,i))),(null==(_=this._desc)?void 0:_.colorTarget)!==n.TEXTURE&&(null==(a=this._desc)?void 0:a.colorTarget)!==n.CUBEMAP&&console.error("Framebuffer is initialized with a texture however the descriptor indicates using a renderbuffer color attachment!"),this._validateColorAttachmentPoint(h.COLOR_ATTACHMENT0+e),this._validateTextureDimensions(s,this._desc)}}if(c instanceof u){var l;const t=null!=(l=this._desc.depthStencilTarget)?l:o.DEPTH_STENCIL_RENDER_BUFFER;t===o.STENCIL_RENDER_BUFFER?this._stencilAttachment=c:t===o.DEPTH_RENDER_BUFFER||t===o.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=c:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),N(c.descriptor,this._desc)}else if(e(c)){let t;this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"),p(c)?(this._depthStencilTexture=c,t=c.descriptor):this._depthStencilTexture=new f(this._context,c),this._validateTextureDimensions(t,this._desc)}}dispose(){if(!this._desc)return;const t=this._context.getBoundFramebufferObject();if(this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName){this._context.gl.deleteFramebuffer(this._glName),this._glName=null}this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(s.Framebuffer,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const t=this._colorAttachments.get(h.COLOR_ATTACHMENT0);return t&&p(t)?t:null}get colorAttachment(){return this._colorAttachments.get(h.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width}get height(){return this._desc.height}get gpuMemoryUsage(){return m(this.colorAttachment)+m(this.depthStencilAttachment)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&p(e)?e:null}framebufferTexture2D(t,e,i=h.COLOR_ATTACHMENT0,r=c.TEXTURE_2D,s=0){e.framebufferTexture2D(e.FRAMEBUFFER,i,r,t,s)}attachColorTexture(t,e=h.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const i=t.descriptor;this._validateTextureDimensions(i,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(t.glName,this._context.gl,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=h.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(p(e)){const i=e;return this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,t)),this._colorAttachments.delete(t),i}}attachDepthStencilTexture(t){if(i(t))return;const e=t.descriptor;e.pixelFormat!==_.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==a.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDimensions(e,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==o.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=o.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(t.glName,this._context.gl,l)),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,l)),this._depthStencilTexture=null,t}attachDepthStencilBuffer(t){if(i(t))return;const e=t.descriptor;if(e.internalFormat!==T.DEPTH_STENCIL&&e.internalFormat!==T.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),N(e,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=e.internalFormat===T.DEPTH_STENCIL?o.DEPTH_STENCIL_RENDER_BUFFER:o.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const e=this._context.gl,i=this._desc.depthStencilTarget===o.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,t.glName)}this._depthAttachment=t}detachDepthStencilBuffer(){const t=this._context.gl,e=this._depthAttachment;if(e&&this._initialized){this._context.bindFramebuffer(this);const e=this._desc.depthStencilTarget===o.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}return this._depthAttachment=null,e}detachAll(){this.detachColorTexture(),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(t,e,i,r,s,h,n){(t<0||e<0||s<0||h<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const o=this._desc,_=n.descriptor;n.descriptor.target!==c.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(t+i>o.width||e+r>o.height||s+i>_.width||h+r>_.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const a=this._context,l=a.bindTexture(n,f.TEXTURE_UNIT_FOR_UPDATES);a.bindFramebuffer(this),a.gl.copyTexSubImage2D(c.TEXTURE_2D,0,s,h,t,e,i,r),a.bindTexture(l,f.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,s,h,n){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),n||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this);this._context.gl.readPixels(t,e,i,r,s,h,n)}resize(t,e){const i=this._desc;if(i.width!==t||i.height!==e){if(!this._initialized)return i.width=t,i.height=e,this._colorAttachments.forEach((i=>{i&&i.resize(t,e)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(t,e));i.width=t,i.height=e,this._colorAttachments.forEach((i=>{i&&i.resize(t,e)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(t,e):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(t,e),this._stencilAttachment&&this._stencilAttachment.resize(t,e)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(t=c.TEXTURE_2D){var e,i,s,l;const m=this._context.gl;if(this._initialized)return void m.bindFramebuffer(m.FRAMEBUFFER,this.glName);this._glName&&m.deleteFramebuffer(this._glName);const R=this._context,A=m.createFramebuffer(),N=this._desc,g=null!=(e=N.colorTarget)?e:n.RENDER_BUFFER,x=null!=(i=N.width)?i:1,D=null!=(s=N.height)?s:1;if(m.bindFramebuffer(m.FRAMEBUFFER,A),0===this._colorAttachments.size)if(g===n.TEXTURE)this._colorAttachments.set(h.COLOR_ATTACHMENT0,F(R,N,this.descriptor.colorTarget===n.CUBEMAP?c.TEXTURE_CUBE_MAP:c.TEXTURE_2D));else{const t=new u(R,{internalFormat:T.RGBA4,width:x,height:D});this._colorAttachments.set(h.COLOR_ATTACHMENT0,t)}this._colorAttachments.forEach(((e,i)=>{e&&(p(e)?this.framebufferTexture2D(e.glName,m,i,t):m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,e.glName))}));const b=null!=(l=N.depthStencilTarget)?l:o.NONE;switch(b){case o.DEPTH_RENDER_BUFFER:case o.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new u(R,{internalFormat:N.depthStencilTarget===o.DEPTH_RENDER_BUFFER?T.DEPTH_COMPONENT16:T.DEPTH_STENCIL,width:x,height:D}));const t=b===o.DEPTH_RENDER_BUFFER?m.DEPTH_ATTACHMENT:m.DEPTH_STENCIL_ATTACHMENT;m.framebufferRenderbuffer(m.FRAMEBUFFER,t,m.RENDERBUFFER,this._depthAttachment.glName);break}case o.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new u(R,{internalFormat:T.STENCIL_INDEX8,width:x,height:D})),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.STENCIL_ATTACHMENT,m.RENDERBUFFER,this._stencilAttachment.glName);break;case o.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){R.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const t={target:c.TEXTURE_2D,pixelFormat:_.DEPTH_STENCIL,dataType:a.UNSIGNED_INT_24_8,samplingMode:E.NEAREST,wrapMode:d.CLAMP_TO_EDGE,width:x,height:D};this._depthStencilTexture=new f(R,t)}this.framebufferTexture2D(this._depthStencilTexture.glName,m,m.DEPTH_STENCIL_ATTACHMENT,t)}if(r()){m.checkFramebufferStatus(m.FRAMEBUFFER)!==m.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=A,this._initialized=!0}_disposeColorAttachments(){this._colorAttachments.forEach(((t,e)=>{if(p(t))this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,e)),t.dispose();else if(t instanceof WebGLRenderbuffer){const i=this._context.gl;this._initialized&&(this._context.bindFramebuffer(this),i.framebufferRenderbuffer(i.FRAMEBUFFER,e,i.RENDERBUFFER,null)),this._context.gl.deleteRenderbuffer(t)}})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const e=this._desc.depthStencilTarget===o.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,t,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateTextureDimensions(t,e){t.target!==c.TEXTURE_2D&&t.target!==c.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==e.width&&e.width>=0&&void 0!==e.height&&e.height>=0?e.width===t.width&&e.height===t.height||console.error("Color attachment texture must match the framebuffer's!"):(e.width=t.width,e.height=t.height)}_validateColorAttachmentPoint(t){if(-1===A._MAX_COLOR_ATTACHMENTS){const t=this._context.capabilities.drawBuffers;if(t){const e=this._context.gl;A._MAX_COLOR_ATTACHMENTS=e.getParameter(t.MAX_COLOR_ATTACHMENTS)}else A._MAX_COLOR_ATTACHMENTS=1}const e=t-h.COLOR_ATTACHMENT0;e+1>A._MAX_COLOR_ATTACHMENTS&&R.error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${A._MAX_COLOR_ATTACHMENTS} color attachments`)}}function p(t){return"type"in t&&"texture"===t.type}function F(t,e,i){return new f(t,{target:i,pixelFormat:_.RGBA,dataType:a.UNSIGNED_BYTE,samplingMode:E.NEAREST,wrapMode:d.CLAMP_TO_EDGE,width:e.width,height:e.height})}function N(t,e){void 0!==e.width&&e.width>=0&&void 0!==e.height&&e.height>=0?e.width===t.width&&e.height===t.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(e.width=t.width,e.height=t.height)}A._MAX_COLOR_ATTACHMENTS=-1;export{A as FramebufferObject};
5
+ import t from"../../core/Logger.js";import{isSome as e,isNone as i}from"../../core/maybe.js";import{BufferObject as r}from"./BufferObject.js";import{webglDebugEnabled as s,webglValidateShadersEnabled as h}from"./checkWebGLError.js";import{ContextType as n}from"./context-util.js";import{ResourceType as c,ColorAttachment as o,DepthStencilTargetType as _,PixelFormat as a,PixelType as l,DepthStencilAttachment as T,RenderbufferFormat as E,FramebufferTarget as d,TextureType as u,Usage as f,BufferType as m,TargetType as A,TextureSamplingMode as p,TextureWrapMode as R,SizedPixelFormat as N}from"./enums.js";import{Renderbuffer as g}from"./Renderbuffer.js";import{Texture as F}from"./Texture.js";import{getGpuMemoryUsage as x}from"./Util.js";const b=t.getLogger("esri.views.webgl.FrameBufferObject");class D{constructor(t,i,r=null,s=null){if(this._context=t,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._initialized=!1,this._desc={...i},t.instanceCounter.increment(c.Framebuffer,this),e(r)){Array.isArray(r)||(r=[r]);for(let t=0;t<r.length;++t){const e=r[t],i=o.COLOR_ATTACHMENT0+t;let s;U(e)?(C(e)?(s=e.descriptor,this._colorAttachments.set(i,e)):(s=e,this._colorAttachments.set(i,new F(this._context,s))),P(s,this._desc)):(S(e)?(s=e.descriptor,this._colorAttachments.set(i,e)):(s=e,this._colorAttachments.set(i,new g(this._context,s))),B(s,this._desc)),this._validateColorAttachmentPoint(i)}}if(e(s)){let t,e;if(U(s))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),C(s)?(e=s.descriptor,this._depthStencilTexture=s):(e=s,this._depthStencilTexture=new F(this._context,e)),P(e,this._desc);else{var h;S(s)?(e=s.descriptor,t=s):(e=s,t=new g(this._context,e));const i=null!=(h=this._desc.depthStencilTarget)?h:_.DEPTH_STENCIL_RENDER_BUFFER;i===_.STENCIL_RENDER_BUFFER?this._stencilAttachment=t:i===_.DEPTH_RENDER_BUFFER||i===_.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=t:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),B(e,this._desc)}}}dispose(){if(!this._desc)return;const t=this._context.getBoundFramebufferObject();if(this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName){this._context.gl.deleteFramebuffer(this._glName),this._glName=null}this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(c.Framebuffer,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const t=this._colorAttachments.get(o.COLOR_ATTACHMENT0);return t&&C(t)?t:null}get colorAttachment(){return this._colorAttachments.get(o.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width}get height(){return this._desc.height}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((t,[e,i])=>t+x(i)),0)+x(this.depthStencilAttachment)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&C(e)?e:null}attachColorTexture(t,e=o.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);P(t.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=o.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(C(e)){const i=e;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)),this._colorAttachments.delete(t),i}}setColorTextureTarget(t,e=o.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);C(i)&&this._framebufferTexture2D(i.glName,e,t)}attachDepthStencilTexture(t){if(i(t))return;const e=t.descriptor;e.pixelFormat!==a.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==l.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),P(e,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==_.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=_.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,T)),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,T)),this._depthStencilTexture=null,t}attachDepthStencilBuffer(t){if(i(t))return;const e=t.descriptor;if(e.internalFormat!==E.DEPTH_STENCIL&&e.internalFormat!==E.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),B(e,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=e.internalFormat===E.DEPTH_STENCIL?_.DEPTH_STENCIL_RENDER_BUFFER:_.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const e=this._context.gl,i=this._desc.depthStencilTarget===_.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(d.FRAMEBUFFER,i,e.RENDERBUFFER,t.glName)}this._depthAttachment=t}detachDepthStencilBuffer(){const t=this._context.gl,e=this._depthAttachment;if(e&&this._initialized){this._context.bindFramebuffer(this);const e=this._desc.depthStencilTarget===_.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(d.FRAMEBUFFER,e,t.RENDERBUFFER,null)}return this._depthAttachment=null,e}detachAll(){this._colorAttachments.forEach(((t,e)=>this._detachColorAttachment(e))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(t,e,i,r,s,h,n){(t<0||e<0||s<0||h<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const c=this._desc,o=n.descriptor;n.descriptor.target!==u.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(t+i>c.width||e+r>c.height||s+i>o.width||h+r>o.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const _=this._context,a=_.bindTexture(n,F.TEXTURE_UNIT_FOR_UPDATES);_.setActiveTexture(F.TEXTURE_UNIT_FOR_UPDATES),_.bindFramebuffer(this),_.gl.copyTexSubImage2D(u.TEXTURE_2D,0,s,h,t,e,i,r),_.bindTexture(a,F.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,s,h,n){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),n||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this);this._context.gl.readPixels(t,e,i,r,s,h,n)}async readPixelsAsync(t,e,i,h,c,o,_){if(this._context.type!==n.WEBGL2)return s()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(t,e,i,h,c,o,_);const a=this._context.gl,l=r.createPixelPack(this._context,f.STREAM_READ,_.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),a.readPixels(t,e,i,h,c,o,0),this._context.unbindBuffer(m.PIXEL_PACK_BUFFER),await l.getSubDataAsync(_),l.dispose()}resize(t,e){const i=this._desc;if(i.width!==t||i.height!==e){if(!this._initialized)return i.width=t,i.height=e,this._colorAttachments.forEach((i=>{i&&i.resize(t,e)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(t,e));i.width=t,i.height=e,this._colorAttachments.forEach((i=>{i&&i.resize(t,e)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(t,e):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(t,e),this._stencilAttachment&&this._stencilAttachment.resize(t,e)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(t=d.FRAMEBUFFER){var e,i,r,s;const n=this._context.gl;if(this._initialized)return void n.bindFramebuffer(t,this.glName);this._glName&&n.deleteFramebuffer(this._glName);const c=this._context,T=n.createFramebuffer(),f=this._desc,m=null!=(e=f.colorTarget)?e:A.RENDER_BUFFER,x=null!=(i=f.width)?i:1,b=null!=(r=f.height)?r:1;if(n.bindFramebuffer(t,T),0===this._colorAttachments.size)if(m===A.TEXTURE||m===A.CUBEMAP)this._colorAttachments.set(o.COLOR_ATTACHMENT0,H(c,f,this.descriptor.colorTarget===A.CUBEMAP?u.TEXTURE_CUBE_MAP:u.TEXTURE_2D));else{const t=new g(c,{internalFormat:N.RGBA4,width:x,height:b});this._colorAttachments.set(o.COLOR_ATTACHMENT0,t)}this._colorAttachments.forEach(((e,i)=>{e&&(C(e)?this._framebufferTexture2D(e.glName,i,M(e),t):n.framebufferRenderbuffer(t,i,n.RENDERBUFFER,e.glName))}));const D=null!=(s=f.depthStencilTarget)?s:_.NONE;switch(D){case _.DEPTH_RENDER_BUFFER:case _.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new g(c,{internalFormat:f.depthStencilTarget===_.DEPTH_RENDER_BUFFER?E.DEPTH_COMPONENT16:E.DEPTH_STENCIL,width:x,height:b}));const e=D===_.DEPTH_RENDER_BUFFER?n.DEPTH_ATTACHMENT:n.DEPTH_STENCIL_ATTACHMENT;n.framebufferRenderbuffer(t,e,n.RENDERBUFFER,this._depthAttachment.glName);break}case _.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new g(c,{internalFormat:E.STENCIL_INDEX8,width:x,height:b})),n.framebufferRenderbuffer(t,n.STENCIL_ATTACHMENT,n.RENDERBUFFER,this._stencilAttachment.glName);break;case _.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){c.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const t={target:u.TEXTURE_2D,pixelFormat:a.DEPTH_STENCIL,dataType:l.UNSIGNED_INT_24_8,samplingMode:p.NEAREST,wrapMode:R.CLAMP_TO_EDGE,width:x,height:b};this._depthStencilTexture=new F(c,t)}this._framebufferTexture2D(this._depthStencilTexture.glName,n.DEPTH_STENCIL_ATTACHMENT,M(this._depthStencilTexture),t)}if(h()){n.checkFramebufferStatus(t)!==n.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=T,this._initialized=!0}_framebufferTexture2D(t,e=o.COLOR_ATTACHMENT0,i=u.TEXTURE_2D,r=d.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(r,e,i,t,s)}_detachColorAttachment(t){s()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const e=this._context.gl,i=this._colorAttachments.get(t);return C(i)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)):this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(d.FRAMEBUFFER,t,e.RENDERBUFFER,null)),this._colorAttachments.delete(t),i}_disposeColorAttachments(){this._colorAttachments.forEach(((t,e)=>{this._detachColorAttachment(e),t.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const e=this._desc.depthStencilTarget===_.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(d.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(d.FRAMEBUFFER,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(t){if(-1===D._MAX_COLOR_ATTACHMENTS){const t=this._context.capabilities.drawBuffers;if(t){const e=this._context.gl;D._MAX_COLOR_ATTACHMENTS=e.getParameter(t.MAX_COLOR_ATTACHMENTS)}else D._MAX_COLOR_ATTACHMENTS=1}const e=t-o.COLOR_ATTACHMENT0;e+1>D._MAX_COLOR_ATTACHMENTS&&b.error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${D._MAX_COLOR_ATTACHMENTS} color attachments`)}}function C(t){return"type"in t&&"texture"===t.type}function S(t){return"type"in t&&"renderbuffer"===t.type}function U(t){return C(t)||"pixelFormat"in t}function H(t,e,i){return new F(t,{target:i,pixelFormat:a.RGBA,dataType:l.UNSIGNED_BYTE,samplingMode:p.NEAREST,wrapMode:R.CLAMP_TO_EDGE,width:e.width,height:e.height})}function P(t,e){t.target!==u.TEXTURE_2D&&t.target!==u.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==e.width&&e.width>=0&&void 0!==e.height&&e.height>=0?e.width===t.width&&e.height===t.height||console.error("Color attachment texture must match the framebuffer's!"):(e.width=t.width,e.height=t.height)}function B(t,e){void 0!==e.width&&e.width>=0&&void 0!==e.height&&e.height>=0?e.width===t.width&&e.height===t.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(e.width=t.width,e.height=t.height)}function M(t){return t.descriptor.target===u.TEXTURE_CUBE_MAP?u.TEXTURE_CUBE_MAP_POSITIVE_X:u.TEXTURE_2D}D._MAX_COLOR_ATTACHMENTS=-1;export{D as FramebufferObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{isSome as t,isNone as o}from"../../core/maybe.js";import{webglValidateShadersEnabled as i}from"./checkWebGLError.js";import{ContextType as r}from"./context-util.js";import{ShaderType as n,ResourceType as e}from"./enums.js";import{transpileShader as s}from"./ShaderTranspiler.js";class m{constructor(t,o,i,r){this._context=t,this._locations=r,this._refCount=1,this._nameToUniformLocation={},this._nameToUniform1={},this._nameToUniform1v={},this._nameToUniform2={},this._nameToUniform3={},this._nameToUniform4={},this._nameToUniformMatrix3={},this._nameToUniformMatrix4={},t||console.error("RenderingContext isn't initialized!"),0===o.length&&console.error("Shaders source should not be empty!"),this._vShader=f(this._context,n.VERTEX_SHADER,o),this._fShader=f(this._context,n.FRAGMENT_SHADER,i),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(e.Shader,this)}get glName(){if(t(this._glName))return this._glName;if(o(this._vShader))return null;const r=this._context.gl,n=r.createProgram();return r.attachShader(n,this._vShader),r.attachShader(n,this._fShader),this._locations.forEach(((t,o)=>r.bindAttribLocation(n,t,o))),r.linkProgram(n),i()&&!r.getProgramParameter(n,r.LINK_STATUS)&&console.error(`Could not link shader\nvalidated: ${r.getProgramParameter(n,r.VALIDATE_STATUS)}, gl error ${r.getError()}, vertex: ${r.getShaderParameter(this._vShader,r.COMPILE_STATUS)}, fragment: ${r.getShaderParameter(this._fShader,r.COMPILE_STATUS)}, info log: ${r.getProgramInfoLog(n)}`),this._glName=n,this._context.instanceCounter.increment(e.Program,this),n}dispose(){if(--this._refCount>0)return;const t=this._context.gl;this._vShader&&(t.deleteShader(this._vShader),this._vShader=null,this._context.instanceCounter.decrement(e.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,this._context.instanceCounter.decrement(e.Program,this))}ref(){++this._refCount}_getUniformLocation(t){return void 0===this._nameToUniformLocation[t]&&(this._nameToUniformLocation[t]=this._context.gl.getUniformLocation(this.glName,t)),this._nameToUniformLocation[t]}hasUniform(t){return null!==this._getUniformLocation(t)}setUniform1i(t,o){const i=this._nameToUniform1[t];if(void 0===i||o!==i){this._context.gl.uniform1i(this._getUniformLocation(t),o),this._nameToUniform1[t]=o}}setUniform1iv(t,o){const i=this._nameToUniform1v[t];if(a(i,o)){this._context.gl.uniform1iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform1v[t]=Array.from(o):c(o,i)}}setUniform2iv(t,o){const i=this._nameToUniform2[t];if(a(i,o)){this._context.gl.uniform2iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform2[t]=Array.from(o):c(o,i)}}setUniform3iv(t,o){const i=this._nameToUniform3[t];if(a(i,o)){this._context.gl.uniform3iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform3[t]=Array.from(o):c(o,i)}}setUniform4iv(t,o){const i=this._nameToUniform4[t];if(a(i,o)){this._context.gl.uniform4iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform4[t]=Array.from(o):c(o,i)}}setUniform1f(t,o){const i=this._nameToUniform1[t];if(void 0===i||o!==i){this._context.gl.uniform1f(this._getUniformLocation(t),o),this._nameToUniform1[t]=o}}setUniform1fv(t,o){const i=this._nameToUniform1v[t];if(a(i,o)){this._context.gl.uniform1fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform1v[t]=Array.from(o):c(o,i)}}setUniform2f(t,o,i){const r=this._nameToUniform2[t];if(void 0===r||o!==r[0]||i!==r[1]){this._context.gl.uniform2f(this._getUniformLocation(t),o,i),void 0===r?this._nameToUniform2[t]=[o,i]:(r[0]=o,r[1]=i)}}setUniform2fv(t,o){const i=this._nameToUniform2[t];if(a(i,o)){this._context.gl.uniform2fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform2[t]=Array.from(o):c(o,i)}}setUniform3f(t,o,i,r){const n=this._nameToUniform3[t];if(void 0===n||o!==n[0]||i!==n[1]||r!==n[2]){this._context.gl.uniform3f(this._getUniformLocation(t),o,i,r),void 0===n?this._nameToUniform3[t]=[o,i,r]:(n[0]=o,n[1]=i,n[2]=r)}}setUniform3fv(t,o){const i=this._nameToUniform3[t];if(a(i,o)){this._context.gl.uniform3fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform3[t]=Array.from(o):c(o,i)}}setUniform4f(t,o,i,r,n){const e=this._nameToUniform4[t];if(void 0===e||o!==e[0]||i!==e[1]||r!==e[2]||n!==e[3]){this._context.gl.uniform4f(this._getUniformLocation(t),o,i,r,n),void 0===e?this._nameToUniform4[t]=[o,i,r,n]:(e[0]=o,e[1]=i,e[2]=r,e[3]=n)}}setUniform4fv(t,o){const i=this._nameToUniform4[t];if(a(i,o)){this._context.gl.uniform4fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform4[t]=Array.from(o):c(o,i)}}setUniformMatrix3fv(t,o,i=!1){const r=this._nameToUniformMatrix3[t];if(g(r,o)){this._context.gl.uniformMatrix3fv(this._getUniformLocation(t),i,o),void 0===r?this._nameToUniformMatrix3[t]=Array.from(o):c(o,r)}}setUniformMatrix4fv(t,o,i=!1){const r=this._nameToUniformMatrix4[t];if(l(r,o)){this._context.gl.uniformMatrix4fv(this._getUniformLocation(t),i,o),void 0===r?this._nameToUniformMatrix4[t]=Array.from(o):c(o,r)}}stop(){}}function a(t,i){if(o(t)||t.length!==i.length)return!0;for(let o=0;o<t.length;++o)if(t[o]!==i[o])return!0;return!1}function f(t,o,e){const m=t.type===r.WEBGL2?s(e,o):e,a=t.gl,f=a.createShader(o);return a.shaderSource(f,m),a.compileShader(f),i()&&!a.getShaderParameter(f,a.COMPILE_STATUS)&&(console.error("Compile error in ".concat(o===n.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(a.getShaderInfoLog(f)),console.error(h(m)),t.type===r.WEBGL2&&(console.log("Shader source before transpilation:"),console.log(e))),f}function h(t){let o=2;return t.replace(/\n/g,(()=>"\n"+_(o++)+":"))}function _(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function c(t,o){for(let i=0;i<t.length;++i)o[i]=t[i]}function g(t,i){return!!o(t)||(9!==t.length?a(t,i):9!==t.length||t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8])}function l(t,i){return!!o(t)||(16!==t.length?a(t,i):16!==t.length||t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8]||t[9]!==i[9]||t[10]!==i[10]||t[11]!==i[11]||t[12]!==i[12]||t[13]!==i[13]||t[14]!==i[14]||t[15]!==i[15])}export{m as Program};
5
+ import"../../core/has.js";import{isSome as t,isNone as o}from"../../core/maybe.js";import{webglValidateShadersEnabled as i}from"./checkWebGLError.js";import{ContextType as n}from"./context-util.js";import{ShaderType as r,ResourceType as e}from"./enums.js";import{transpileShader as s}from"./ShaderTranspiler.js";const m=4294967295;class a{constructor(t,o,m,a,f=new Map){this._context=t,this._locations=a,this._uniformBlockBindings=f,this._refCount=1,this._nameToUniformLocation={},this._nameToUniform1={},this._nameToUniform1v={},this._nameToUniform2={},this._nameToUniform3={},this._nameToUniform4={},this._nameToUniformMatrix3={},this._nameToUniformMatrix4={},t||console.error("RenderingContext isn't initialized!"),0===o.length&&console.error("Shaders source should not be empty!"),this._context.type===n.WEBGL2&&(o=s(o,r.VERTEX_SHADER),m=s(m,r.FRAGMENT_SHADER)),this._vShader=h(this._context,r.VERTEX_SHADER,o),this._fShader=h(this._context,r.FRAGMENT_SHADER,m),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(e.Shader,this),i()&&(this.vertexShader=o,this.fragmentShader=m)}get glName(){if(t(this._glName))return this._glName;if(o(this._vShader))return null;const r=this._context.gl,s=r.createProgram();if(r.attachShader(s,this._vShader),r.attachShader(s,this._fShader),this._locations.forEach(((t,o)=>r.bindAttribLocation(s,t,o))),r.linkProgram(s),i()&&!r.getProgramParameter(s,r.LINK_STATUS)&&console.error(`Could not link shader\nvalidated: ${r.getProgramParameter(s,r.VALIDATE_STATUS)}, gl error ${r.getError()}, vertex: ${r.getShaderParameter(this._vShader,r.COMPILE_STATUS)}, fragment: ${r.getShaderParameter(this._fShader,r.COMPILE_STATUS)}, info log: ${r.getProgramInfoLog(s)}`),this._context.type===n.WEBGL2){const t=r;for(const[o,i]of this._uniformBlockBindings){const n=t.getUniformBlockIndex(s,o);n<m&&t.uniformBlockBinding(s,n,i)}}return this._glName=s,this._context.instanceCounter.increment(e.Program,this),s}get hasGLName(){return t(this._glName)}dispose(){if(--this._refCount>0)return;const t=this._context.gl;this._vShader&&(t.deleteShader(this._vShader),this._vShader=null,this._context.instanceCounter.decrement(e.Shader,this)),this._fShader&&(t.deleteShader(this._fShader),this._fShader=null),this._glName&&(t.deleteProgram(this._glName),this._glName=null,this._context.instanceCounter.decrement(e.Program,this))}ref(){++this._refCount}_getUniformLocation(t){return void 0===this._nameToUniformLocation[t]&&(this._nameToUniformLocation[t]=this._context.gl.getUniformLocation(this.glName,t),i()&&null===this._nameToUniformLocation[t]&&console.error(`Uniform ${t} not found in Program:\n${this.vertexShader}\n${this.fragmentShader} `)),this._nameToUniformLocation[t]}setUniform1i(t,o){const i=this._nameToUniform1[t];if(void 0===i||o!==i){this._context.gl.uniform1i(this._getUniformLocation(t),o),this._nameToUniform1[t]=o}}setUniform1iv(t,o){const i=this._nameToUniform1v[t];if(f(i,o)){this._context.gl.uniform1iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform1v[t]=Array.from(o):g(o,i)}}setUniform2iv(t,o){const i=this._nameToUniform2[t];if(f(i,o)){this._context.gl.uniform2iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform2[t]=Array.from(o):g(o,i)}}setUniform3iv(t,o){const i=this._nameToUniform3[t];if(f(i,o)){this._context.gl.uniform3iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform3[t]=Array.from(o):g(o,i)}}setUniform4iv(t,o){const i=this._nameToUniform4[t];if(f(i,o)){this._context.gl.uniform4iv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform4[t]=Array.from(o):g(o,i)}}setUniform1f(t,o){const i=this._nameToUniform1[t];if(void 0===i||o!==i){this._context.gl.uniform1f(this._getUniformLocation(t),o),this._nameToUniform1[t]=o}}setUniform1fv(t,o){const i=this._nameToUniform1v[t];if(f(i,o)){this._context.gl.uniform1fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform1v[t]=Array.from(o):g(o,i)}}setUniform2f(t,o,i){const n=this._nameToUniform2[t];if(void 0===n||o!==n[0]||i!==n[1]){this._context.gl.uniform2f(this._getUniformLocation(t),o,i),void 0===n?this._nameToUniform2[t]=[o,i]:(n[0]=o,n[1]=i)}}setUniform2fv(t,o){const i=this._nameToUniform2[t];if(f(i,o)){this._context.gl.uniform2fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform2[t]=Array.from(o):g(o,i)}}setUniform3f(t,o,i,n){const r=this._nameToUniform3[t];if(void 0===r||o!==r[0]||i!==r[1]||n!==r[2]){this._context.gl.uniform3f(this._getUniformLocation(t),o,i,n),void 0===r?this._nameToUniform3[t]=[o,i,n]:(r[0]=o,r[1]=i,r[2]=n)}}setUniform3fv(t,o){const i=this._nameToUniform3[t];if(f(i,o)){this._context.gl.uniform3fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform3[t]=Array.from(o):g(o,i)}}setUniform4f(t,o,i,n,r){const e=this._nameToUniform4[t];if(void 0===e||o!==e[0]||i!==e[1]||n!==e[2]||r!==e[3]){this._context.gl.uniform4f(this._getUniformLocation(t),o,i,n,r),void 0===e?this._nameToUniform4[t]=[o,i,n,r]:(e[0]=o,e[1]=i,e[2]=n,e[3]=r)}}setUniform4fv(t,o){const i=this._nameToUniform4[t];if(f(i,o)){this._context.gl.uniform4fv(this._getUniformLocation(t),o),void 0===i?this._nameToUniform4[t]=Array.from(o):g(o,i)}}setUniformMatrix3fv(t,o,i=!1){const n=this._nameToUniformMatrix3[t];if(l(n,o)){this._context.gl.uniformMatrix3fv(this._getUniformLocation(t),i,o),void 0===n?this._nameToUniformMatrix3[t]=Array.from(o):g(o,n)}}setUniformMatrix4fv(t,o,i=!1){const n=this._nameToUniformMatrix4[t];if(U(n,o)){this._context.gl.uniformMatrix4fv(this._getUniformLocation(t),i,o),void 0===n?this._nameToUniformMatrix4[t]=Array.from(o):g(o,n)}}stop(){}}function f(t,i){if(o(t)||t.length!==i.length)return!0;for(let o=0;o<t.length;++o)if(t[o]!==i[o])return!0;return!1}function h(t,o,e){const s=t.gl,m=s.createShader(o);return s.shaderSource(m,e),s.compileShader(m),i()&&!s.getShaderParameter(m,s.COMPILE_STATUS)&&(console.error("Compile error in ".concat(o===r.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(s.getShaderInfoLog(m)),console.error(c(e)),t.type===n.WEBGL2&&(console.log("Shader source before transpilation:"),console.log(e))),m}function c(t){let o=2;return t.replace(/\n/g,(()=>"\n"+_(o++)+":"))}function _(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function g(t,o){for(let i=0;i<t.length;++i)o[i]=t[i]}function l(t,i){return!!o(t)||(9!==t.length?f(t,i):9!==t.length||t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8])}function U(t,i){return!!o(t)||(16!==t.length?f(t,i):16!==t.length||t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8]||t[9]!==i[9]||t[10]!==i[10]||t[11]!==i[11]||t[12]!==i[12]||t[13]!==i[13]||t[14]!==i[14]||t[15]!==i[15])}export{a as Program};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{createProgram as r}from"./ProgramTemplate.js";class t{constructor(r){this._programCacheByTemplate=new Map,this._rctx=r}dispose(){this._programCacheByTemplate.forEach((r=>r.programs.forEach((r=>r.dispose())))),this._programCacheByTemplate=null}getProgram(t,a){return this._programCacheByTemplate.has(t)||this._addProgramTemplate(t,(a=>r(this._rctx,t,a))),this._getProgramTemplateInstance(t,a)}_addProgramTemplate(r,t){this._programCacheByTemplate.set(r,{constructor:t,programs:new Map})}_getProgramTemplateInstance(r,t){const a=this._programCacheByTemplate.get(r);if(a){const r=t?JSON.stringify(t):"default";if(!a.programs.has(r)){const e=a.constructor(t);a.programs.set(r,e)}return a.programs.get(r)}return null}}export{t as ProgramCache};
5
+ import{isSome as r}from"../../core/maybe.js";import{NestedMap as t}from"../../core/NestedMap.js";import{Program as e}from"./Program.js";class s{constructor(r){this._rctx=r,this._store=new t}dispose(){this._store.forEach((r=>r.forEach((r=>r.dispose())))),this._store.clear()}acquire(t,s,o,c){const i=this._store.get(t,s);if(r(i))return i.ref(),i;const h=new e(this._rctx,t,s,o,c);return h.ref(),this._store.set(t,s,h),h}get test(){let r=0;return this._store.forEach((t=>t.forEach((t=>r+=t.hasGLName?2:1)))),{cachedWebGLObjects:r}}}export{s as ProgramCache};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{Program as r}from"./Program.js";function e(e,t,s,a){s=s||{},a=a||"";const n="function"==typeof t.shaders?t.shaders(s):t.shaders;return new r(e,a+n.vertexShader,a+n.fragmentShader,t.attributes)}export{e as createProgram};
5
+ import{Program as r}from"./Program.js";function e(e,t,a=""){return new r(e,a+t.shaders.vertexShader,a+t.shaders.fragmentShader,t.attributes)}export{e as createProgram};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{ResourceType as t}from"./enums.js";class e{constructor(e,n){this._context=e,this._desc=n,this._context.instanceCounter.increment(t.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this),r.renderbufferStorage(r.RENDERBUFFER,n.internalFormat,n.width,n.height)}get descriptor(){return this._desc}resize(t,e){const n=this._desc;if(n.width===t&&n.height===e)return;n.width=t,n.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),r.renderbufferStorage(r.RENDERBUFFER,n.internalFormat,n.width,n.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(t.Renderbuffer,this),this._context=null)}}export{e as Renderbuffer};
5
+ import{ContextType as e}from"./context-util.js";import{ResourceType as t}from"./enums.js";class r{constructor(r,s){this._context=r,this._desc=s,this.type="renderbuffer",this._context.instanceCounter.increment(t.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:h,internalFormat:o,multisampled:a}=s;if(a){if(this._context.type!==e.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,o,n,h)}else i.renderbufferStorage(i.RENDERBUFFER,o,n,h)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const s=this._context.gl;if(this._context.bindRenderbuffer(this),r.multisampled){s.renderbufferStorageMultisample(s.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height)}else s.renderbufferStorage(s.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(t.Renderbuffer,this),this._context=null)}}export{r as Renderbuffer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,isNone as e}from"../../core/maybe.js";import{NestedMap as s}from"../../core/NestedMap.js";import{webglDebugEnabled as i}from"./checkWebGLError.js";import{ContextType as a}from"./context-util.js";import{ContextState as n}from"./ContextState.js";import{BufferType as r,Face as l,BASE_TEXTURE_UNIT as h,ClearBufferBit as o,TextureType as c,BlendFactor as _,BlendOperation as u,CullMode as d,CompareFunction as f,StencilOperation as g,PrimitiveType as p}from"./enums.js";import{InstanceCounter as b}from"./InstanceCounter.js";import{Program as T}from"./Program.js";import{StateTracker as E}from"./renderState.js";import{Texture as F}from"./Texture.js";import{WebGLDriverTest as m}from"./WebGLDriverTest.js";import{Capabilities as x}from"./capabilities/Capabilities.js";import R from"./capabilities/isWebGL2Context.js";class O{constructor(t,e){this.gl=t,this.instanceCounter=new b,this._state=new n,this._programCache=new s,this._numOfDrawCalls=0,this._numOfTriangles=0,this.type=R(t)?a.WEBGL2:a.WEBGL1,this._loadExtensions(),this.configure(e)}configure(t){this._capabilities=new x(this.gl,t),this._parameters=this._loadParameters(t);const e=this.gl.getParameter(this.gl.VIEWPORT);this._state=new n,this._state.viewport={x:e[0],y:e[1],width:e[2],height:e[3]},this._stateTracker=new E({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)}}),this.enforceState(),this._driverTest=new m(this)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}dispose(){this._programCache.forEach((t=>t.forEach((t=>t.dispose())))),this._programCache.clear(),this.bindVAO(null),this.unbindBuffer(r.ARRAY_BUFFER),this.unbindBuffer(r.ELEMENT_ARRAY_BUFFER),this._state.textureUnitMap.length=0,i()&&this.instanceCounter.printResourceCount()}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){var t;null==(t=this._state.program)||t.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){const t=this.capabilities.vao;t&&(t.bindVertexArray(null),this._state.vertexArrayObject=null),this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=l.FRONT_AND_BACK,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){this._state.stencilOperation.face===l.FRONT_AND_BACK&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=l.FRONT_AND_BACK,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(h+t),this._state.activeTexture=t),s}clear(t){t&&this.gl.clear(t)}clearSafe(t,e=255){t&&(t&o.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),t&o.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),t&o.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(e),this.gl.clear(t))}drawArrays(t,e,s){i()&&(this._numOfDrawCalls++,this._numOfTriangles+=S(t,s)),this.gl.drawArrays(t,e,s)}drawElements(t,e,s,a){i()&&(this._numOfDrawCalls++,this._numOfTriangles+=S(t,e)),this.gl.drawElements(t,e,s,a)}logIno(){i()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}getViewport(){return{x:this._state.viewport.x,y:this._state.viewport.y,width:this._state.viewport.width,height:this._state.viewport.height}}newProgram(e,s,i){const a=this._programCache.get(e,s);if(t(a))return a.ref(),a;const n=new T(this,e,s,i);return n.ref(),this._programCache.set(e,s,n),n}useProgram(t){var e,s;this._state.program!==t&&(null==(e=this._state.program)||e.stop(),this._state.program=t,this.gl.useProgram(null!=(s=null==t?void 0:t.glName)?s:null))}bindTexture(s,i,a=!1){(i>=this.parameters.maxTextureImageUnits||i<0)&&console.error("Input texture unit is out of range of available units!");const n=this._state.textureUnitMap[i];return e(s)||null==s.glName?(t(n)&&(this.setActiveTexture(i,a),this.gl.bindTexture(n.descriptor.target,null)),this._state.textureUnitMap[i]=null,n):a||n!==s?(this.setActiveTexture(i,a),this.gl.bindTexture(s.descriptor.target,s.glName),s.applyChanges(),this._state.textureUnitMap[i]=s,n):(s.isDirty&&(this.setActiveTexture(i,a),s.applyChanges()),n)}unbindTextureAllUnits(t){for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,s=!1,i=c.TEXTURE_2D){if(e(t))return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null),void(this._state.framebuffer=null);(s||this._state.framebuffer!==t)&&(t.initializeAndBind(i),this._state.framebuffer=t)}bindBuffer(t){t&&(t.bufferType===r.ARRAY_BUFFER?this._state.vertexBuffer=C(this.gl,t,t.bufferType,this._state.vertexBuffer):this._state.indexBuffer=C(this.gl,t,t.bufferType,this._state.indexBuffer))}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}unbindBuffer(t){t===r.ARRAY_BUFFER?this._state.vertexBuffer=C(this.gl,null,t,this._state.vertexBuffer):this._state.indexBuffer=C(this.gl,null,t,this._state.indexBuffer)}bindVAO(t=null){e(t)?this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null):this._state.vertexArrayObject!==t&&(t.bind(),this._state.vertexArrayObject=t)}getBoundFramebufferObject(){return this._state.framebuffer}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null),this.unbindBuffer(r.ARRAY_BUFFER),this.unbindBuffer(r.ELEMENT_ARRAY_BUFFER);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(_.ONE,_.ZERO),this.setBlendEquation(u.ADD),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(l.BACK),this.setFrontFace(d.CCW),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(f.LESS),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(f.ALWAYS,0,0),this.setStencilOp(g.KEEP,g.KEEP,g.KEEP),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){var e,s,a,n;const l=this.gl,o=this.capabilities.vao;o&&o.bindVertexArray(null);for(let t=0;t<this.parameters.maxVertexAttributes;t++)l.disableVertexAttribArray(t);if(this._state.vertexBuffer?l.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):l.bindBuffer(r.ARRAY_BUFFER,null),this._state.indexBuffer?l.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):l.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null),o&&this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}l.bindFramebuffer(l.FRAMEBUFFER,null!=(e=null==(s=this._state.framebuffer)?void 0:s.glName)?e:null),l.useProgram(null!=(a=null==(n=this._state.program)?void 0:n.glName)?a:null),l.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),l.bindRenderbuffer(l.RENDERBUFFER,this._state.renderbuffer?this._state.renderbuffer.glName:null),!0===this._state.blend?l.enable(this.gl.BLEND):l.disable(this.gl.BLEND),l.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),l.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),l.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),l.clearDepth(this._state.clearDepth),l.clearStencil(this._state.clearStencil),l.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),l.cullFace(this._state.cullFace),l.depthFunc(this._state.depthFunction),l.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),l.depthMask(this._state.depthWrite),l.frontFace(this._state.frontFace),l.lineWidth(1),!0===this._state.faceCulling?l.enable(l.CULL_FACE):l.disable(l.CULL_FACE),l.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),l.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST),l.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),l.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?l.enable(l.STENCIL_TEST):l.disable(l.STENCIL_TEST),l.stencilMask(this._state.stencilWriteMask);for(let i=0;i<this.parameters.maxTextureImageUnits;i++){l.activeTexture(h+i),l.bindTexture(c.TEXTURE_2D,null),l.bindTexture(c.TEXTURE_CUBE_MAP,null),R(l)&&l.bindTexture(c.TEXTURE_3D,null);const e=this._state.textureUnitMap[i];t(e)&&l.bindTexture(e.descriptor.target,e.glName)}l.activeTexture(h+this._state.activeTexture),l.viewport(this._state.viewport.x,this._state.viewport.y,this._state.viewport.width,this._state.viewport.height),i()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}_loadExtensions(){this.type===a.WEBGL1&&this.gl.getExtension("OES_element_index_uint"),this.gl.getExtension("KHR_parallel_shader_compile")}_loadParameters(t){var e;const s=this.capabilities.textureFilterAnisotropic,i=null!=(e=t.maxAnisotropy)?e:1/0,a={versionString:this.gl.getParameter(this.gl.VERSION),maxVertexTextureImageUnits:this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS),maxMaxAnisotropy:s?Math.min(this.gl.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY),i):1,maxTextureImageUnits:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),maxTextureSize:this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE)};return F.TEXTURE_UNIT_FOR_UPDATES=a.maxTextureImageUnits-1,a}}function C(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function S(t,e){switch(t){case p.POINTS:return 2*e;case p.TRIANGLES:return e/3;case p.TRIANGLE_STRIP:case p.TRIANGLE_FAN:return e-2;default:return 0}}export{O as RenderingContext};
5
+ import{isNone as t,isSome as e,unwrapOr as s}from"../../core/maybe.js";import{after as i}from"../../core/promiseUtils.js";import"./BufferObject.js";import"./FramebufferObject.js";import"../../core/has.js";import{webglDebugEnabled as a}from"./checkWebGLError.js";import{ContextType as r}from"./context-util.js";import{BufferType as n,Face as l,BASE_TEXTURE_UNIT as h,ClearBufferBit as f,FramebufferTarget as o,TextureSamplingMode as _,SyncCondition as u,ClientWaitSyncStatus as c,BlendFactor as d,BlendOperation as b,CullMode as F,CompareFunction as g,StencilOperation as p,TextureType as E,PrimitiveType as B}from"./enums.js";import"./ShaderTranspiler.js";import{ProgramCache as m}from"./ProgramCache.js";import{Texture as R}from"./Texture.js";import"./VertexArrayObject.js";import{ContextState as T}from"./ContextState.js";import{InstanceCounter as A}from"./InstanceCounter.js";import{StateTracker as x}from"./renderState.js";import{WebGLDriverTest as O}from"./WebGLDriverTest.js";import{Capabilities as U}from"./capabilities/Capabilities.js";import C from"./capabilities/isWebGL2Context.js";class S{constructor(t,e){this.gl=t,this.instanceCounter=new A,this.programCache=new m(this),this._state=new T,this._numOfDrawCalls=0,this._numOfTriangles=0,this.type=C(t)?r.WEBGL2:r.WEBGL1,this._loadExtensions(),this.configure(e)}configure(t){this._capabilities=new U(this.gl,t),this._parameters=this._loadParameters(t);const e=this.gl.getParameter(this.gl.VIEWPORT);this._state=new T,this._state.viewport={x:e[0],y:e[1],width:e[2],height:e[3]},this._stateTracker=new x({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)}}),this.enforceState(),this._driverTest=new O(this)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}dispose(){this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(n.ARRAY_BUFFER),this.unbindBuffer(n.ELEMENT_ARRAY_BUFFER),C(this.gl)&&(this.unbindBuffer(n.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(n.PIXEL_PACK_BUFFER),this.unbindBuffer(n.PIXEL_UNPACK_BUFFER),this.unbindBuffer(n.COPY_READ_BUFFER),this.unbindBuffer(n.COPY_WRITE_BUFFER)),this._state.textureUnitMap.length=0,a()&&this.instanceCounter.printResourceCount()}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){var t;null==(t=this._state.program)||t.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){const t=this.capabilities.vao;t&&(t.bindVertexArray(null),this._state.vertexArrayObject=null),this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=l.FRONT_AND_BACK,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){this._state.stencilOperation.face===l.FRONT_AND_BACK&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=l.FRONT_AND_BACK,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(h+t),this._state.activeTexture=t),s}clear(t){t&&this.gl.clear(t)}clearSafe(t,e=255){t&&(t&f.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),t&f.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),t&f.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(e),this.gl.clear(t))}drawArrays(t,e,s){a()&&(this._numOfDrawCalls++,this._numOfTriangles+=M(t,s)),this.gl.drawArrays(t,e,s)}drawElements(t,e,s,i){a()&&(this._numOfDrawCalls++,this._numOfTriangles+=M(t,e)),this.gl.drawElements(t,e,s,i)}logIno(){a()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}getViewport(){return{x:this._state.viewport.x,y:this._state.viewport.y,width:this._state.viewport.width,height:this._state.viewport.height}}useProgram(t){var e,s;this._state.program!==t&&(null==(e=this._state.program)||e.stop(),this._state.program=t,this.gl.useProgram(null!=(s=null==t?void 0:t.glName)?s:null))}bindTexture(s,i,a=!1){(i>=this.parameters.maxTextureImageUnits||i<0)&&console.error("Input texture unit is out of range of available units!");const r=this._state.textureUnitMap[i];return t(s)||null==s.glName?(e(r)&&(this.setActiveTexture(i,a),this.gl.bindTexture(r.descriptor.target,null)),this._state.textureUnitMap[i]=null,r):a||r!==s?(this.setActiveTexture(i,a),this.gl.bindTexture(s.descriptor.target,s.glName),s.applyChanges(),this._state.textureUnitMap[i]=s,r):(s.isDirty&&(this.setActiveTexture(i,a),s.applyChanges()),r)}unbindTextureAllUnits(t){for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(e,s=!1){if(s||this._state.readFramebuffer!==e||this._state.drawFramebuffer!==e){if(t(e))return this.gl.bindFramebuffer(o.FRAMEBUFFER,null),this._state.readFramebuffer=null,void(this._state.drawFramebuffer=null);e.initializeAndBind(o.FRAMEBUFFER),this._state.readFramebuffer=e,this._state.drawFramebuffer=e}}bindFramebufferSeparate(e,i,a=!1){const r=i===o.READ_FRAMEBUFFER,n=r?this._state.readFramebuffer:this._state.drawFramebuffer;(a||n!==e)&&(t(e)?this.gl.bindFramebuffer(i,null):e.initializeAndBind(i),r?this._state.readFramebuffer=s(e,null):this._state.drawFramebuffer=s(e,null))}blitFramebuffer(t,e,s=0,i=0,a=t.width,r=t.height,n=0,l=0,h=e.width,u=e.height,c=f.COLOR_BUFFER_BIT,d=_.NEAREST){this.bindFramebufferSeparate(t,o.READ_FRAMEBUFFER),this.bindFramebufferSeparate(e,o.DRAW_FRAMEBUFFER);this.gl.blitFramebuffer(s,i,a,r,n,l,h,u,c,d)}bindBuffer(t,e){if(t)switch(null!=e||(e=t.bufferType),e){case n.ARRAY_BUFFER:this._state.vertexBuffer=P(this.gl,t,e,this._state.vertexBuffer);break;case n.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=P(this.gl,t,e,this._state.indexBuffer);break;case n.UNIFORM_BUFFER:this._state.uniformBuffer=P(this.gl,t,e,this._state.uniformBuffer);break;case n.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=P(this.gl,t,e,this._state.pixelPackBuffer);break;case n.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=P(this.gl,t,e,this._state.pixelUnpackBuffer);break;case n.COPY_READ_BUFFER:this._state.copyReadBuffer=P(this.gl,t,e,this._state.copyReadBuffer);break;case n.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=P(this.gl,t,e,this._state.copyWriteBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(e,s){if(s>=this.parameters.maxUniformBufferBindings||s<0)return console.error("Uniform buffer binding point is out of range!"),null;const i=this._state.uniformBufferBindingPoints;let a=i[s];return t(a)&&(a={buffer:null,offset:0,size:0},i[s]=a),a}bindBufferBase(e,s,i){const a=this._getBufferBinding(e,s);if(t(a))return;if(a.buffer===i&&0===a.offset&&0===a.size)return;this.gl.bindBufferBase(e,s,i?i.glName:null),a.buffer=i,a.offset=0,a.size=0}bindBufferRange(e,s,i,a,r){const n=this._getBufferBinding(e,s);if(t(n))return;if(n.buffer===i&&n.offset===a&&n.size===r)return;if(a%this._parameters.uniformBufferOffsetAlignment!=0)return void console.error("Uniform buffer binding offset is not a multiple of the context offset alignment");this.gl.bindBufferRange(e,s,i.glName,a,r),n.buffer=i,n.offset=a,n.size=r}bindUBO(e,s,i,r){t(s)?this.bindBufferBase(n.UNIFORM_BUFFER,e,null):(a()&&(null!=r?r:s.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),s.initialize(),void 0!==i&&void 0!==r?this.bindBufferRange(n.UNIFORM_BUFFER,e,s.buffer,i,r):this.bindBufferBase(n.UNIFORM_BUFFER,e,s.buffer))}unbindUBO(t){for(let s=0,i=this._state.uniformBufferBindingPoints.length;s<i;s++){const i=this._state.uniformBufferBindingPoints[s];e(i)&&i.buffer===t.buffer&&this.bindBufferBase(n.UNIFORM_BUFFER,s,null)}}unbindBuffer(t){switch(t){case n.ARRAY_BUFFER:this._state.vertexBuffer=P(this.gl,null,t,this._state.vertexBuffer);break;case n.ELEMENT_ARRAY_BUFFER:this._state.indexBuffer=P(this.gl,null,t,this._state.indexBuffer);break;case n.UNIFORM_BUFFER:this._state.uniformBuffer=P(this.gl,null,t,this._state.uniformBuffer);break;case n.PIXEL_PACK_BUFFER:this._state.pixelPackBuffer=P(this.gl,null,t,this._state.pixelPackBuffer);break;case n.PIXEL_UNPACK_BUFFER:this._state.pixelUnpackBuffer=P(this.gl,null,t,this._state.pixelUnpackBuffer);break;case n.COPY_READ_BUFFER:this._state.copyReadBuffer=P(this.gl,null,t,this._state.copyReadBuffer);break;case n.COPY_WRITE_BUFFER:this._state.copyWriteBuffer=P(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(e=null){t(e)?this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null):this._state.vertexArrayObject!==e&&(e.bind(),this._state.vertexArrayObject=e)}async clientWaitAsync(t=0){const e=this.gl,s=e.fenceSync(u.SYNC_GPU_COMMANDS_COMPLETE,0);let a;e.flush();do{await i(t),a=e.clientWaitSync(s,0,0)}while(a===c.TIMEOUT_EXPIRED);if(e.deleteSync(s),a===c.WAIT_FAILED)throw new Error("Client wait failed")}getBoundFramebufferObject(t=o.FRAMEBUFFER){return t===o.READ_FRAMEBUFFER?this._state.readFramebuffer:this._state.drawFramebuffer}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(n.ARRAY_BUFFER),this.unbindBuffer(n.ELEMENT_ARRAY_BUFFER),C(this.gl)&&(this.unbindBuffer(n.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(n.PIXEL_PACK_BUFFER),this.unbindBuffer(n.PIXEL_UNPACK_BUFFER),this.unbindBuffer(n.COPY_READ_BUFFER),this.unbindBuffer(n.COPY_WRITE_BUFFER));for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(d.ONE,d.ZERO),this.setBlendEquation(b.ADD),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(l.BACK),this.setFrontFace(F.CCW),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(g.LESS),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(g.ALWAYS,0,0),this.setStencilOp(p.KEEP,p.KEEP,p.KEEP),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){var t,s;const i=this.gl,r=this.capabilities.vao;r&&r.bindVertexArray(null);for(let e=0;e<this.parameters.maxVertexAttributes;e++)i.disableVertexAttribArray(e);if(this._state.vertexBuffer?i.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):i.bindBuffer(n.ARRAY_BUFFER,null),this._state.indexBuffer?i.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):i.bindBuffer(n.ELEMENT_ARRAY_BUFFER,null),C(i)){var l,f,_,u;this._state.uniformBuffer?i.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):i.bindBuffer(n.UNIFORM_BUFFER,null);for(let t=0;t<this._parameters.maxUniformBufferBindings;t++){const s=this._state.uniformBufferBindingPoints[t];if(e(s)&&null!==s.buffer){const{buffer:e,offset:a,size:r}=s;0===a&&0===r?i.bindBufferBase(n.UNIFORM_BUFFER,t,e.glName):i.bindBufferRange(n.UNIFORM_BUFFER,t,e.glName,a,r)}else i.bindBufferBase(n.UNIFORM_BUFFER,t,null)}this._state.pixelPackBuffer?i.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):i.bindBuffer(n.PIXEL_PACK_BUFFER,null),this._state.pixelUnpackBuffer?i.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):i.bindBuffer(n.PIXEL_UNPACK_BUFFER,null),this._state.copyReadBuffer?i.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):i.bindBuffer(n.COPY_READ_BUFFER,null),this._state.copyWriteBuffer?i.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):i.bindBuffer(n.COPY_WRITE_BUFFER,null),i.bindFramebuffer(o.READ_FRAMEBUFFER,null!=(l=null==(f=this._state.readFramebuffer)?void 0:f.glName)?l:null),i.bindFramebuffer(o.DRAW_FRAMEBUFFER,null!=(_=null==(u=this._state.drawFramebuffer)?void 0:u.glName)?_:null)}else{var c,d;this._state.readFramebuffer=this._state.drawFramebuffer,i.bindFramebuffer(o.FRAMEBUFFER,null!=(c=null==(d=this._state.drawFramebuffer)?void 0:d.glName)?c:null)}if(r&&this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}i.useProgram(null!=(t=null==(s=this._state.program)?void 0:s.glName)?t:null),i.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),i.bindRenderbuffer(i.RENDERBUFFER,this._state.renderbuffer?this._state.renderbuffer.glName:null),!0===this._state.blend?i.enable(this.gl.BLEND):i.disable(this.gl.BLEND),i.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),i.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),i.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),i.clearDepth(this._state.clearDepth),i.clearStencil(this._state.clearStencil),i.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),i.cullFace(this._state.cullFace),i.depthFunc(this._state.depthFunction),i.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?i.enable(i.DEPTH_TEST):i.disable(i.DEPTH_TEST),i.depthMask(this._state.depthWrite),i.frontFace(this._state.frontFace),i.lineWidth(1),!0===this._state.faceCulling?i.enable(i.CULL_FACE):i.disable(i.CULL_FACE),i.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?i.enable(i.POLYGON_OFFSET_FILL):i.disable(i.POLYGON_OFFSET_FILL),i.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?i.enable(i.SCISSOR_TEST):i.disable(i.SCISSOR_TEST),i.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),i.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?i.enable(i.STENCIL_TEST):i.disable(i.STENCIL_TEST),i.stencilMask(this._state.stencilWriteMask);for(let a=0;a<this.parameters.maxTextureImageUnits;a++){i.activeTexture(h+a),i.bindTexture(E.TEXTURE_2D,null),i.bindTexture(E.TEXTURE_CUBE_MAP,null),C(i)&&(i.bindTexture(E.TEXTURE_3D,null),i.bindTexture(E.TEXTURE_2D_ARRAY,null));const t=this._state.textureUnitMap[a];e(t)&&i.bindTexture(t.descriptor.target,t.glName)}i.activeTexture(h+this._state.activeTexture),i.viewport(this._state.viewport.x,this._state.viewport.y,this._state.viewport.width,this._state.viewport.height),a()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}_loadExtensions(){this.type===r.WEBGL1&&this.gl.getExtension("OES_element_index_uint"),this.gl.getExtension("KHR_parallel_shader_compile")}_loadParameters(t){var e;const s=this.capabilities.textureFilterAnisotropic,i=null!=(e=t.maxAnisotropy)?e:1/0,a=C(this.gl),r=this.gl,n={versionString:this.gl.getParameter(this.gl.VERSION),maxVertexTextureImageUnits:this.gl.getParameter(this.gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxVertexAttributes:this.gl.getParameter(this.gl.MAX_VERTEX_ATTRIBS),maxMaxAnisotropy:s?Math.min(this.gl.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY),i):1,maxTextureImageUnits:this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),maxTextureSize:this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),maxUniformBufferBindings:a?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0,maxVertexUniformBlocks:a?r.getParameter(r.MAX_VERTEX_UNIFORM_BLOCKS):0,maxFragmentUniformBlocks:a?r.getParameter(r.MAX_FRAGMENT_UNIFORM_BLOCKS):0,maxUniformBlockSize:a?r.getParameter(r.MAX_UNIFORM_BLOCK_SIZE):0,uniformBufferOffsetAlignment:a?r.getParameter(r.UNIFORM_BUFFER_OFFSET_ALIGNMENT):1,maxArrayTextureLayers:a?r.getParameter(r.MAX_ARRAY_TEXTURE_LAYERS):1,maxSamples:a?r.getParameter(r.MAX_SAMPLES):1};return R.TEXTURE_UNIT_FOR_UPDATES=n.maxTextureImageUnits-1,n}}function P(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function M(t,e){switch(t){case B.POINTS:return 2*e;case B.TRIANGLES:return e/3;case B.TRIANGLE_STRIP:case B.TRIANGLE_FAN:return e-2;default:return 0}}export{S as RenderingContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../core/maybe.js";import{ShaderType as t}from"./enums.js";import r from"./reservedWordsGLSL3.js";var a,o={exports:{}};void 0!==(a=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])&&(o.exports=a);const n=o.exports;var i,l={exports:{}};i=l,function(e){var t=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];void 0!==t&&(i.exports=t)}();const s=l.exports;var c={exports:{}};!function(e){!function(t){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]}();void 0!==r&&(e.exports=r)}()}(c);const d=c.exports;var u=999,g=9999,p=0,f=1,_=2,h=3,x=4,m=5,y=6,w=7,M=8,v=9,T=10,b=11,E=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function P(){var e,t,r,a=0,o=0,i=u,l=[],c=[],P=1,C=0,k=0,D=!1,j=!1,F="";return function(e){return c=[],null!==e?S(e.replace?e.replace(/\r\n/g,"\n"):e):R()};function L(e){e.length&&c.push({type:E[i],data:e,position:k,line:P,column:C})}function S(t){var n;for(a=0,r=(F+=t).length;e=F[a],a<r;){switch(n=a,i){case p:a=I();break;case f:a=G();break;case _:a=A();break;case h:a=O();break;case x:a=H();break;case b:a=B();break;case m:a=N();break;case g:a=U();break;case v:a=X();break;case u:a=V()}if(n!==a)if("\n"===F[n])C=0,++P;else++C}return o+=a,F=F.slice(a),c}function R(e){return l.length&&L(l.join("")),i=T,L("(eof)"),c}function V(){return l=l.length?[]:l,"/"===t&&"*"===e?(k=o+a-1,i=p,t=e,a+1):"/"===t&&"/"===e?(k=o+a-1,i=f,t=e,a+1):"#"===e?(i=_,k=o+a,a):/\s/.test(e)?(i=v,k=o+a,a):(D=/\d/.test(e),j=/[^\w_]/.test(e),k=o+a,i=D?x:j?h:g,a)}function X(){return/[^\s]/g.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function A(){return"\r"!==e&&"\n"!==e||"\\"===t?(l.push(e),t=e,a+1):(L(l.join("")),i=u,a)}function G(){return A()}function I(){return"/"===e&&"*"===t?(l.push(e),L(l.join("")),i=u,a+1):(l.push(e),t=e,a+1)}function O(){if("."===t&&/\d/.test(e))return i=m,a;if("/"===t&&"*"===e)return i=p,a;if("/"===t&&"/"===e)return i=f,a;if("."===e&&l.length){for(;q(l););return i=m,a}if(";"===e||")"===e||"("===e){if(l.length)for(;q(l););return L(e),i=u,a+1}var r=2===l.length&&"="!==e;if(/[\w_\d\s]/.test(e)||r){for(;q(l););return i=u,a}return l.push(e),t=e,a+1}function q(e){for(var t,r,a=0;;){if(t=s.indexOf(e.slice(0,e.length+a).join("")),r=s[t],-1===t){if(a--+e.length>0)continue;r=e.slice(0,1).join("")}return L(r),k+=r.length,(l=l.slice(r.length)).length}}function B(){return/[^a-fA-F0-9]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function H(){return"."===e||/[eE]/.test(e)?(l.push(e),i=m,t=e,a+1):"x"===e&&1===l.length&&"0"===l[0]?(i=b,l.push(e),t=e,a+1):/[^\d]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function N(){return"f"===e&&(l.push(e),t=e,a+=1),/[eE]/.test(e)||"-"===e&&/[eE]/.test(t)?(l.push(e),t=e,a+1):/[^\d]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function U(){if(/[^\d\w_]/.test(e)){var r=l.join("");return i=n.indexOf(r)>-1?M:d.indexOf(r)>-1?w:y,L(l.join("")),i=u,a}return l.push(e),t=e,a+1}}function C(e){var t=P(),r=[];return r=(r=r.concat(t(e))).concat(t(null))}function k(e){return C(e)}function D(e){return e.map((e=>"eof"!==e.type?e.data:"")).join("")}const j=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function F(e,t="100",r="300 es"){const a=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const o of e)if("preprocessor"===o.type){const e=a.exec(o.data);if(e){const a=e[1].replace(/\s\s+/g," ");if(a===r)return a;if(a===t)return o.data="#version "+r,t;throw new Error("unknown glsl version: "+a)}}return e.splice(0,0,{type:"preprocessor",data:"#version "+r},{type:"whitespace",data:"\n"}),null}function L(e,t){for(let r=t-1;r>=0;r--){const t=e[r];if("whitespace"!==t.type&&"block-comment"!==t.type){if("keyword"!==t.type)break;if("attribute"===t.data||"in"===t.data)return!0}}return!1}function S(e,t,r,a){a=a||r;for(const o of e)if("ident"===o.type&&o.data===r){a in t?t[a]++:t[a]=0;return S(e,t,a+"_"+t[a],a)}return r}function R(e,t,r="afterVersion"){function a(e,t){for(let r=t;r<e.length;r++){const t=e[r];if("operator"===t.type&&";"===t.data)return r}return null}function o(e){let t=-1,o=0,n=-1;for(let i=0;i<e.length;i++){const l=e[i];if("preprocessor"===l.type&&(l.data.match(/\#(if|ifdef|ifndef)\s+.+/)?++o:l.data.match(/\#endif\s*.*/)&&--o),"afterVersion"!==r&&"afterPrecision"!==r||"preprocessor"===l.type&&/^#version/.test(l.data)&&(n=Math.max(n,i)),"afterPrecision"===r&&"keyword"===l.type&&"precision"===l.data){const t=a(e,i);if(null===t)throw new Error("precision statement not followed by any semicolons!");n=Math.max(n,t)}t<n&&0===o&&(t=i)}return t+1}const n={data:"\n",type:"whitespace"},i=t=>t<e.length&&/[^\r\n]$/.test(e[t].data);let l=o(e);i(l-1)&&e.splice(l++,0,n);for(const s of t)e.splice(l++,0,s);i(l-1)&&i(l)&&e.splice(l,0,n)}function V(e,t,r,a="lowp"){R(e,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:a},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function X(e,t,r,a,o="lowp"){R(e,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace",data:" "},{type:"operator",data:"="},{type:"whitespace",data:" "},{type:"integer",data:a.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:o},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function A(e,t){let r,a,o=-1;for(let n=t;n<e.length;n++){const t=e[n];if("operator"===t.type&&("["===t.data&&(r=n),"]"===t.data)){a=n;break}"integer"===t.type&&(o=parseInt(t.data,10))}return r&&a&&e.splice(r,a-r+1),o}function G(a,o){const n=q(a);if(e(n))return n;const i=k(a);if("300 es"===F(i,"100","300 es"))throw new Error("shader is already glsl 300 es");let l=null,s=null;const c={},d={};for(let e=0;e<i.length;++e){const a=i[e];switch(a.type){case"keyword":o===t.VERTEX_SHADER&&"attribute"===a.data?a.data="in":"varying"===a.data&&(a.data=o===t.VERTEX_SHADER?"out":"in");break;case"builtin":if(/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(a.data.trim())&&(a.data=a.data.replace(/(2D|Cube|EXT)/g,"")),o===t.FRAGMENT_SHADER&&"gl_FragColor"===a.data&&(l||(l=S(i,c,"fragColor"),V(i,l,"vec4")),a.data=l),o===t.FRAGMENT_SHADER&&"gl_FragData"===a.data){const t=A(i,e+1),r=S(i,c,"fragData");X(i,r,"vec4",t,"mediump"),a.data=r}else o===t.FRAGMENT_SHADER&&"gl_FragDepthEXT"===a.data&&(s||(s=S(i,c,"gl_FragDepth")),a.data=s);break;case"ident":if(r.indexOf(a.data)>=0){if(o===t.VERTEX_SHADER&&L(i,e))throw new Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");a.data in d||(d[a.data]=S(i,c,a.data)),a.data=d[a.data]}}}for(let e=i.length-1;e>=0;--e){const t=i[e];if("preprocessor"===t.type){const r=t.data.match(/\#extension\s+(.*)\:/);if(r&&r[1]&&j.indexOf(r[1].trim())>=0){const t=i[e+1];i.splice(e,t&&"whitespace"===t.type?2:1)}const a=t.data.match(/\#ifdef\s+(.*)/);a&&a[1]&&j.indexOf(a[1].trim())>=0&&(t.data="#if 1");const o=t.data.match(/\#ifndef\s+(.*)/);o&&o[1]&&j.indexOf(o[1].trim())>=0&&(t.data="#if 0")}}return B(a,D(i))}const I={enableCache:!1},O=new Map;function q(e){return I.enableCache?O.get(e):null}function B(e,t){return I.enableCache&&O.set(e,t),t}export{I as test,G as transpileShader};
5
+ import"../../core/has.js";import{isSome as e}from"../../core/maybe.js";import{ShaderType as t}from"./enums.js";import r from"./reservedWordsGLSL3.js";var a,o={exports:{}};void 0!==(a=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])&&(o.exports=a);const n=o.exports;var i,l={exports:{}};i=l,function(e){var t=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];void 0!==t&&(i.exports=t)}();const s=l.exports;var c={exports:{}};!function(e){!function(t){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]}();void 0!==r&&(e.exports=r)}()}(c);const d=c.exports;var u=999,g=9999,p=0,f=1,_=2,h=3,x=4,m=5,y=6,w=7,M=8,v=9,T=10,b=11,P=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function E(){var e,t,r,a=0,o=0,i=u,l=[],c=[],E=1,C=0,k=0,D=!1,j=!1,F="";return function(e){return c=[],null!==e?S(e.replace?e.replace(/\r\n/g,"\n"):e):R()};function L(e){e.length&&c.push({type:P[i],data:e,position:k,line:E,column:C})}function S(t){var n;for(a=0,r=(F+=t).length;e=F[a],a<r;){switch(n=a,i){case p:a=I();break;case f:a=G();break;case _:a=A();break;case h:a=O();break;case x:a=H();break;case b:a=B();break;case m:a=N();break;case g:a=U();break;case v:a=X();break;case u:a=V()}if(n!==a)if("\n"===F[n])C=0,++E;else++C}return o+=a,F=F.slice(a),c}function R(e){return l.length&&L(l.join("")),i=T,L("(eof)"),c}function V(){return l=l.length?[]:l,"/"===t&&"*"===e?(k=o+a-1,i=p,t=e,a+1):"/"===t&&"/"===e?(k=o+a-1,i=f,t=e,a+1):"#"===e?(i=_,k=o+a,a):/\s/.test(e)?(i=v,k=o+a,a):(D=/\d/.test(e),j=/[^\w_]/.test(e),k=o+a,i=D?x:j?h:g,a)}function X(){return/[^\s]/g.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function A(){return"\r"!==e&&"\n"!==e||"\\"===t?(l.push(e),t=e,a+1):(L(l.join("")),i=u,a)}function G(){return A()}function I(){return"/"===e&&"*"===t?(l.push(e),L(l.join("")),i=u,a+1):(l.push(e),t=e,a+1)}function O(){if("."===t&&/\d/.test(e))return i=m,a;if("/"===t&&"*"===e)return i=p,a;if("/"===t&&"/"===e)return i=f,a;if("."===e&&l.length){for(;q(l););return i=m,a}if(";"===e||")"===e||"("===e){if(l.length)for(;q(l););return L(e),i=u,a+1}var r=2===l.length&&"="!==e;if(/[\w_\d\s]/.test(e)||r){for(;q(l););return i=u,a}return l.push(e),t=e,a+1}function q(e){for(var t,r,a=0;;){if(t=s.indexOf(e.slice(0,e.length+a).join("")),r=s[t],-1===t){if(a--+e.length>0)continue;r=e.slice(0,1).join("")}return L(r),k+=r.length,(l=l.slice(r.length)).length}}function B(){return/[^a-fA-F0-9]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function H(){return"."===e||/[eE]/.test(e)?(l.push(e),i=m,t=e,a+1):"x"===e&&1===l.length&&"0"===l[0]?(i=b,l.push(e),t=e,a+1):/[^\d]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function N(){return"f"===e&&(l.push(e),t=e,a+=1),/[eE]/.test(e)||"-"===e&&/[eE]/.test(t)?(l.push(e),t=e,a+1):/[^\d]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function U(){if(/[^\d\w_]/.test(e)){var r=l.join("");return i=n.indexOf(r)>-1?M:d.indexOf(r)>-1?w:y,L(l.join("")),i=u,a}return l.push(e),t=e,a+1}}function C(e){var t=E(),r=[];return r=(r=r.concat(t(e))).concat(t(null))}function k(e){return C(e)}function D(e){return e.map((e=>"eof"!==e.type?e.data:"")).join("")}const j=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function F(e,t="100",r="300 es"){const a=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const o of e)if("preprocessor"===o.type){const e=a.exec(o.data);if(e){const a=e[1].replace(/\s\s+/g," ");if(a===r)return a;if(a===t)return o.data="#version "+r,t;throw new Error("unknown glsl version: "+a)}}return e.splice(0,0,{type:"preprocessor",data:"#version "+r},{type:"whitespace",data:"\n"}),null}function L(e,t){for(let r=t-1;r>=0;r--){const t=e[r];if("whitespace"!==t.type&&"block-comment"!==t.type){if("keyword"!==t.type)break;if("attribute"===t.data||"in"===t.data)return!0}}return!1}function S(e,t,r,a){a=a||r;for(const o of e)if("ident"===o.type&&o.data===r){a in t?t[a]++:t[a]=0;return S(e,t,a+"_"+t[a],a)}return r}function R(e,t,r="afterVersion"){function a(e,t){for(let r=t;r<e.length;r++){const t=e[r];if("operator"===t.type&&";"===t.data)return r}return null}function o(e){let t=-1,o=0,n=-1;for(let i=0;i<e.length;i++){const l=e[i];if("preprocessor"===l.type&&(l.data.match(/\#(if|ifdef|ifndef)\s+.+/)?++o:l.data.match(/\#endif\s*.*/)&&--o),"afterVersion"!==r&&"afterPrecision"!==r||"preprocessor"===l.type&&/^#version/.test(l.data)&&(n=Math.max(n,i)),"afterPrecision"===r&&"keyword"===l.type&&"precision"===l.data){const t=a(e,i);if(null===t)throw new Error("precision statement not followed by any semicolons!");n=Math.max(n,t)}t<n&&0===o&&(t=i)}return t+1}const n={data:"\n",type:"whitespace"},i=t=>t<e.length&&/[^\r\n]$/.test(e[t].data);let l=o(e);i(l-1)&&e.splice(l++,0,n);for(const s of t)e.splice(l++,0,s);i(l-1)&&i(l)&&e.splice(l,0,n)}function V(e,t,r,a="lowp"){R(e,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:a},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function X(e,t,r,a,o="lowp"){R(e,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace",data:" "},{type:"operator",data:"="},{type:"whitespace",data:" "},{type:"integer",data:a.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:o},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function A(e,t){let r,a,o=-1;for(let n=t;n<e.length;n++){const t=e[n];if("operator"===t.type&&("["===t.data&&(r=n),"]"===t.data)){a=n;break}"integer"===t.type&&(o=parseInt(t.data,10))}return r&&a&&e.splice(r,a-r+1),o}function G(a,o){const n=q(a);if(e(n))return n;const i=k(a);if("300 es"===F(i,"100","300 es"))return a;let l=null,s=null;const c={},d={};for(let e=0;e<i.length;++e){const a=i[e];switch(a.type){case"keyword":o===t.VERTEX_SHADER&&"attribute"===a.data?a.data="in":"varying"===a.data&&(a.data=o===t.VERTEX_SHADER?"out":"in");break;case"builtin":if(/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(a.data.trim())&&(a.data=a.data.replace(/(2D|Cube|EXT)/g,"")),o===t.FRAGMENT_SHADER&&"gl_FragColor"===a.data&&(l||(l=S(i,c,"fragColor"),V(i,l,"vec4")),a.data=l),o===t.FRAGMENT_SHADER&&"gl_FragData"===a.data){const t=A(i,e+1),r=S(i,c,"fragData");X(i,r,"vec4",t,"mediump"),a.data=r}else o===t.FRAGMENT_SHADER&&"gl_FragDepthEXT"===a.data&&(s||(s=S(i,c,"gl_FragDepth")),a.data=s);break;case"ident":if(r.indexOf(a.data)>=0){if(o===t.VERTEX_SHADER&&L(i,e))throw new Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");a.data in d||(d[a.data]=S(i,c,a.data)),a.data=d[a.data]}}}for(let e=i.length-1;e>=0;--e){const t=i[e];if("preprocessor"===t.type){const r=t.data.match(/\#extension\s+(.*)\:/);if(r&&r[1]&&j.indexOf(r[1].trim())>=0){const t=i[e+1];i.splice(e,t&&"whitespace"===t.type?2:1)}const a=t.data.match(/\#ifdef\s+(.*)/);a&&a[1]&&j.indexOf(a[1].trim())>=0&&(t.data="#if 1");const o=t.data.match(/\#ifndef\s+(.*)/);o&&o[1]&&j.indexOf(o[1].trim())>=0&&(t.data="#if 0")}}return B(a,D(i))}const I={enableCache:!1},O=new Map;function q(e){return I.enableCache?O.get(e):null}function B(e,t){return I.enableCache&&O.set(e,t),t}export{I as test,G as transpileShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isPowerOfTwo as t}from"../../core/mathUtils.js";import{isSome as e}from"../../core/maybe.js";import{checkWebGLError as i}from"./checkWebGLError.js";import{ContextType as a}from"./context-util.js";import{ResourceType as r,TextureType as s,TextureSamplingMode as o,TextureWrapMode as p,PixelType as n,PixelFormat as _}from"./enums.js";import h from"./capabilities/isWebGL2Context.js";const l=4;class d{constructor(t,e,i=null){this._context=t,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,t.instanceCounter.increment(r.Texture,this),this._descriptor={target:s.TEXTURE_2D,samplingMode:o.LINEAR,wrapMode:p.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,...e},this._descriptor.target===s.TEXTURE_CUBE_MAP?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTextureAllUnits(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(r.Texture,this))}release(){this.dispose()}resize(t,e){const i=this._descriptor;i.width===t&&i.height===e||(i.width=t,i.height=e,this._descriptor.target===s.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null))}_setDataCubeMap(t=null){for(let e=s.TEXTURE_CUBE_MAP_POSITIVE_X;e<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this.setData(t,e)}setData(t,a=s.TEXTURE_2D){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===t&&(t=null),null===t&&(this._descriptor.width=this._descriptor.width||l,this._descriptor.height=this._descriptor.height||l);const o=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES),p=this._descriptor;d._validateTexture(this._context,p),r.pixelStorei(r.UNPACK_ALIGNMENT,p.unpackAlignment),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,p.flipped?1:0),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p.preMultiplyAlpha?1:0);const n=p.pixelFormat;let _=p.internalFormat?p.internalFormat:this._deriveInternalFormat(n,p.dataType);if(t instanceof ImageData||t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){let e=t.width,s=t.height;t instanceof HTMLVideoElement&&(e=t.videoWidth,s=t.videoHeight),p.width&&p.height,r.texImage2D(a,0,_,n,p.dataType,t),i(r),p.hasMipmap&&this.generateMipmap(),void 0===p.width&&(p.width=e),void 0===p.height&&(p.height=s)}else{null!=p.width&&null!=p.height||console.error("Width and height must be specified!"),r.DEPTH24_STENCIL8&&_===r.DEPTH_STENCIL&&(_=r.DEPTH24_STENCIL8);let s=p.width,o=p.height;if(E(t)){const e=Math.round(Math.log(Math.max(s,o))/Math.LN2)+1;p.hasMipmap=p.hasMipmap&&e===t.levels.length;for(let i=0;;++i){const e=t.levels[Math.min(i,t.levels.length-1)];if(r.compressedTexImage2D(a,i,_,s,o,0,e),1===s&&1===o||!p.hasMipmap)break;s=Math.max(1,s>>1),o=Math.max(1,o>>1)}}else if(e(t))r.texImage2D(a,0,_,s,o,0,n,p.dataType,t),i(r),p.hasMipmap&&this.generateMipmap();else for(let t=0;r.texImage2D(a,t,_,s,o,0,n,p.dataType,null),i(r),(1!==s||1!==o)&&p.hasMipmap;++t)s=Math.max(1,s>>1),o=Math.max(1,o>>1)}d._applySamplingMode(r,this._descriptor),d._applyWrapMode(r,this._descriptor),d._applyAnisotropicFilteringParameters(this._context,this._descriptor),i(r),this._context.bindTexture(o,d.TEXTURE_UNIT_FOR_UPDATES)}updateData(t,e,i,a,r,o,p=s.TEXTURE_2D){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const n=this._context.gl,_=this._descriptor,h=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);(e<0||i<0||a>_.width||r>_.height||e+a>_.width||i+r>_.height)&&console.error("An attempt to update out of bounds of the texture!"),n.pixelStorei(n.UNPACK_ALIGNMENT,_.unpackAlignment),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,_.flipped?1:0),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_.preMultiplyAlpha?1:0),o instanceof ImageData||o instanceof HTMLImageElement||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement?n.texSubImage2D(p,t,e,i,_.pixelFormat,_.dataType,o):n.texSubImage2D(p,t,e,i,a,r,_.pixelFormat,_.dataType,o),this._context.bindTexture(h,d.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;t.hasMipmap||(t.hasMipmap=!0,this._samplingModeDirty=!0,d._validateTexture(this._context,t)),t.samplingMode===o.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=o.LINEAR_MIPMAP_NEAREST):t.samplingMode===o.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=o.NEAREST_MIPMAP_NEAREST);const e=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._context.gl.generateMipmap(t.target),this._context.bindTexture(e,d.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,d._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const t=this._context.gl,e=this._descriptor;this._samplingModeDirty&&(d._applySamplingMode(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(d._applyWrapMode(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(t,e){if(this._context.type===a.WEBGL1)return t;if(e===n.FLOAT)switch(t){case _.RGBA:return _.RGBA32F;case _.RGB:return _.RGB32F;default:throw new Error("Unable to derive format")}return t}static _validateTexture(e,i){(i.width<0||i.height<0)&&console.error("Negative dimension parameters are not allowed!");const a=t(i.width)&&t(i.height);h(e.gl)||a||("number"==typeof i.wrapMode?i.wrapMode!==p.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):i.wrapMode.s===p.CLAMP_TO_EDGE&&i.wrapMode.t===p.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),i.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(t,e){let i=e.samplingMode,a=e.samplingMode;i===o.LINEAR_MIPMAP_NEAREST||i===o.LINEAR_MIPMAP_LINEAR?(i=o.LINEAR,e.hasMipmap||(a=o.LINEAR)):i!==o.NEAREST_MIPMAP_NEAREST&&i!==o.NEAREST_MIPMAP_LINEAR||(i=o.NEAREST,e.hasMipmap||(a=o.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,i),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,a)}static _applyWrapMode(t,e){"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}static _applyAnisotropicFilteringParameters(t,e){var i;const a=t.capabilities.textureFilterAnisotropic;if(!a)return;t.gl.texParameterf(e.target,a.TEXTURE_MAX_ANISOTROPY,null!=(i=e.maxAnisotropy)?i:1)}}function E(t){return e(t)&&"type"in t&&"compressed"===t.type}d.TEXTURE_UNIT_FOR_UPDATES=0;export{d as Texture};
5
+ import"../../core/has.js";import{isPowerOfTwo as t}from"../../core/mathUtils.js";import{isSome as e,unwrap as i}from"../../core/maybe.js";import{checkWebGLError as r}from"./checkWebGLError.js";import{ContextType as a}from"./context-util.js";import{ResourceType as s,TextureType as o,TextureSamplingMode as n,TextureWrapMode as p,CompressedTextureFormat as h,PixelType as l,PixelFormat as _,SizedPixelFormat as m}from"./enums.js";import d from"./capabilities/isWebGL2Context.js";const c=4;class u{constructor(t,e,i=null){if(this._context=t,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,t.instanceCounter.increment(s.Texture,this),this._descriptor={target:o.TEXTURE_2D,samplingMode:n.LINEAR,wrapMode:p.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1,...e},t.type!==a.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),A(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTextureAllUnits(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s.Texture,this))}release(){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");i.width=t,i.height=e,this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(t=null){for(let e=o.TEXTURE_CUBE_MAP_POSITIVE_X;e<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}setData(t){this._setData(t)}_setData(t,i){if(!this._context||!this._context.gl)return;const a=this._context.gl;this._glName||(this._glName=a.createTexture()),void 0===t&&(t=null);const s=this._descriptor;null!=i||(i=s.target);const o=A(i);var n;null===t&&(s.width=s.width||c,s.height=s.height||c,o&&(s.depth=null!=(n=s.depth)?n:1));const p=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),u._validateTexture(this._context,s),this._configurePixelStorage();const h=s.pixelFormat;let l=s.internalFormat?s.internalFormat:this._deriveInternalFormat(h,s.dataType);if(M(t)){let e=t.width,n=t.height;const p=1;t instanceof HTMLVideoElement&&(e=t.videoWidth,n=t.videoHeight),s.width&&s.height,o&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(i,l,s.hasMipmap,e,n,p),this._texImage(i,0,l,e,n,p,t),r(a),s.hasMipmap&&this.generateMipmap(),void 0===s.width&&(s.width=e),void 0===s.height&&(s.height=n),o&&void 0===s.depth&&(s.depth=p)}else{const{width:n,height:p,depth:h}=s;if(null!=n&&null!=p||console.error("Width and height must be specified!"),o&&null==h&&console.error("Depth must be specified!"),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(i,l,s.hasMipmap,n,p,h),a.DEPTH24_STENCIL8&&l===a.DEPTH_STENCIL&&(l=a.DEPTH24_STENCIL8),g(t)){const e=t.levels,r=I(i,n,p,h),o=Math.min(r-1,e.length-1);d(a)?a.texParameteri(s.target,a.TEXTURE_MAX_LEVEL,o):s.hasMipmap=s.hasMipmap&&r===e.length;const _=l;if(!T(_))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((t,r,a,s)=>{const o=e[Math.min(t,e.length-1)];this._compressedTexImage(i,t,_,r,a,s,o)}),o)}else e(t)?(this._texImage(i,0,l,n,p,h,t),r(a),s.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((t,e,s,o)=>{this._texImage(i,t,l,e,s,o,null),r(a)}))}u._applySamplingMode(a,this._descriptor),u._applyWrapMode(a,this._descriptor),u._applyAnisotropicFilteringParameters(this._context,this._descriptor),r(a),this._context.bindTexture(p,u.TEXTURE_UNIT_FOR_UPDATES)}updateData(t,e,i,r,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const o=this._context.gl,n=this._descriptor,{pixelFormat:p,internalFormat:h,dataType:l,isImmutable:_,target:m}=n;if(_&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const d=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);(e<0||i<0||r>n.width||a>n.height||e+r>n.width||i+a>n.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),M(s)?o.texSubImage2D(m,t,e,i,p,l,s):g(s)?o.compressedTexSubImage2D(m,t,e,i,r,a,h,s.levels[t]):o.texSubImage2D(m,t,e,i,r,a,p,l,s),this._context.bindTexture(d,u.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,r,a,s,o,n){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const p=this._context.gl;if(!d(p))throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:l,dataType:_,isImmutable:m,target:c,internalFormat:E}=h;if(m&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");A(c)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||r<0||a>h.width||s>h.height||o>h.depth||e+a>h.width||i+s>h.height||r+o>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),g(n))n=n.levels[t],p.compressedTexSubImage3D(c,t,e,i,r,a,s,o,E,n);else{const h=n;p.texSubImage3D(c,t,e,i,r,a,s,o,l,_,h)}this._context.bindTexture(T,u.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,u._validateTexture(this._context,t)}t.samplingMode===n.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=n.LINEAR_MIPMAP_NEAREST):t.samplingMode===n.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=n.NEAREST_MIPMAP_NEAREST);const e=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES);this._context.gl.generateMipmap(t.target),this._context.bindTexture(e,u.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,u._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const t=this._context.gl,e=this._descriptor;this._samplingModeDirty&&(u._applySamplingMode(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(u._applyWrapMode(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(t,e){if(this._context.type===a.WEBGL1)return t;switch(e){case l.FLOAT:switch(t){case _.RGBA:return m.RGBA32F;case _.RGB:return m.RGB32F;default:throw new Error("Unable to derive format")}case l.UNSIGNED_BYTE:switch(t){case _.RGBA:return m.RGBA8;case _.RGB:return m.RGB8}default:return t}}_configurePixelStorage(){const t=this._context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_texStorage(t,e,i,r,a,s){const o=this._context.gl;if(!d(o))throw new Error("Immutable textures are not supported in WebGL1");if(!E(e))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const n=i?I(t,r,a,s):1;A(t)?o.texStorage3D(t,n,e,r,a,s):o.texStorage2D(t,n,e,r,a),this._wasImmutablyAllocated=!0}_texImage(t,r,s,o,n,p,h){const l=this._context.gl;let _=null;const m=this._context.type===a.WEBGL2,d=A(t),{isImmutable:c,pixelFormat:u,dataType:E}=this._descriptor;if(m&&(_=l),m||!M(h))if(c){if(e(h)){const e=h;d?_.texSubImage3D(t,r,0,0,0,o,n,p,u,E,e):l.texSubImage2D(t,r,0,0,o,n,u,E,e)}}else{const e=i(h);d?_.texImage3D(t,r,s,o,n,p,0,u,E,e):l.texImage2D(t,r,s,o,n,0,u,E,e)}else l.texImage2D(t,0,s,u,E,h)}_compressedTexImage(t,i,r,s,o,n,p){const h=this._context.gl;let l=null;const _=A(t),m=this._descriptor.isImmutable;if(_){if(this._context.type!==a.WEBGL2)throw new Error("3D textures are not supported in WebGL1");l=h}m?e(p)&&(_?l.compressedTexSubImage3D(t,i,0,0,0,s,o,n,r,p):h.compressedTexSubImage2D(t,i,0,0,s,o,r,p)):_?l.compressedTexImage3D(t,i,r,s,o,n,0,p):h.compressedTexImage2D(t,i,r,s,o,0,p)}_forEachMipmapLevel(t,e=1/0){let{width:i,height:r,depth:a,hasMipmap:s,target:n}=this._descriptor;const p=n===o.TEXTURE_3D;for(let o=0;t(o,i,r,a),s&&(1!==i||1!==r||p&&1!==a)&&!(o>=e);++o)i=Math.max(1,i>>1),r=Math.max(1,r>>1),p&&(a=Math.max(1,a>>1))}static _validateTexture(e,i){(i.width<0||i.height<0||i.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=d(e.gl),a=t(i.width)&&t(i.height);r||!i.isImmutable&&!A(i.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||a||("number"==typeof i.wrapMode?i.wrapMode!==p.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):i.wrapMode.s===p.CLAMP_TO_EDGE&&i.wrapMode.t===p.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),i.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(t,e){let i=e.samplingMode,r=e.samplingMode;i===n.LINEAR_MIPMAP_NEAREST||i===n.LINEAR_MIPMAP_LINEAR?(i=n.LINEAR,e.hasMipmap||(r=n.LINEAR)):i!==n.NEAREST_MIPMAP_NEAREST&&i!==n.NEAREST_MIPMAP_LINEAR||(i=n.NEAREST,e.hasMipmap||(r=n.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,i),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,r)}static _applyWrapMode(t,e){"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}static _applyAnisotropicFilteringParameters(t,e){var i;const r=t.capabilities.textureFilterAnisotropic;if(!r)return;t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,null!=(i=e.maxAnisotropy)?i:1)}}function E(t){return t in m}function T(t){return t in h}function g(t){return e(t)&&"type"in t&&"compressed"===t.type}function x(t){return e(t)&&"byteLength"in t}function M(t){return e(t)&&!g(t)&&!x(t)}function A(t){return t===o.TEXTURE_3D||t===o.TEXTURE_2D_ARRAY}function I(t,e,i,r=1){let a=Math.max(e,i);return t===o.TEXTURE_3D&&(a=Math.max(a,r)),Math.round(Math.log(a)/Math.LN2)+1}u.TEXTURE_UNIT_FOR_UPDATES=0;export{u as Texture};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import t from"../../core/Logger.js";import{STD140_LAYOUT as e}from"./storageLayouts.js";function a(t,e){return t+(e-t%e)%e}const r=(()=>{const t=new ArrayBuffer(2),e=new Uint8Array(t),a=new Uint16Array(t);return e[0]=170,e[1]=187,48042===a[0]})(),n=4,i=t.getLogger("esri.views.webgl.UniformBufferLayout");class s{constructor(t){this._layout=new Map,this.byteLength=this._buildLayout(t),this.array=new ArrayBuffer(this.byteLength),this.arrayView32=new Float32Array(this.array),this._dataView=new DataView(this.array)}setValues(t,e){for(const a in t)this.setValue(a,t[a],e)}setValue(t,a,r){if(!this._layout.has(t))return void i.warn("Trying to set an unrecognized layout array member!");let s=this.byteLength/n,o=0;const{type:h,offset:y,arrayLength:u}=this._layout.get(t),{numberType:l,elementLength:f,elementCount:g,arrayStride:m}=e[h],w="number"!=typeof a,c=u*g,_=c*f;if((w?"byteLength"in a?a.byteLength/n:a.length:1)!==_&&i.warn("Attempting to set layout array member value with the wrong length!"),w)for(let e=0;e<c;e++)for(let t=0;t<f;t++){const r=y+e*m+t*n,i=e*f+t;if(this._setData(r,a[i],l)){const t=r/n;s=Math.min(s,t),o=Math.max(o,t+1)}}else if(this._setData(y,a,l)){const t=y/n;s=Math.min(s,t),o=Math.max(o,t+1)}r&&(r.from=Math.min(s,r.from),r.to=Math.max(o,r.to))}_setData(t,e,a){switch(a){case"Int32":if(e!==this._dataView.getInt32(t,r))return this._dataView.setInt32(t,e,r),!0;break;case"Uint32":if(e!==this._dataView.getUint32(t,r))return this._dataView.setUint32(t,e,r),!0;break;case"Float32":if(e!==this._dataView.getFloat32(t,r))return this._dataView.setFloat32(t,e,r),!0}return!1}_buildLayout(t){let r=0;for(const{name:i,type:s,count:o}of t){const{elementLength:t,elementCount:h,elementAlignment:y,arrayStride:u,arrayAlignment:l}=e[s],f=null!=o?o:1,g=f*h,m=g>1,w=m?l:y,c=m?g*u:t*n;r=a(r,w),this._layout.set(i,{type:s,offset:r,arrayLength:f}),r+=c,m&&(r=a(r,w))}return a(r,4*n)}}export{s as UniformBufferLayout};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import t from"../../core/Logger.js";import{disposeMaybe as i}from"../../core/maybe.js";import{BufferObject as e}from"./BufferObject.js";import{ContextType as r}from"./context-util.js";import{Usage as s}from"./enums.js";import{UniformBufferLayout as o}from"./UniformBufferLayout.js";const a=t.getLogger("esri.views.webgl.UniformBufferObject");class n{constructor(t,i,e=s.DYNAMIC_DRAW){this._context=t,this._usage=e,this._dirtyRange={from:1/0,to:-1},this._initialized=!1,this._context.type!==r.WEBGL2&&a.error("Attempting to create a uniform buffer without WebGL2!"),this._data=new o(i)}get byteLength(){return this._data.byteLength}initialize(){this._initialized||(this.buffer=e.createUniform(this._context,this._usage,this._data.array),this._resetDirtyRange(),this._initialized=!0)}dispose(){this._context.unbindUBO(this),this.buffer=i(this.buffer)}set(t){this._data.setValues(t,this._dirtyRange)}setUniform(t,i){this._data.setValue(t,i,this._dirtyRange)}upload(){this.initialize();const{from:t,to:i}=this._dirtyRange;i>-1&&t<i&&(this.buffer.setSubDataFromView(this._data.arrayView32,t,t,i),this._resetDirtyRange())}_resetDirtyRange(){this._dirtyRange.from=1/0,this._dirtyRange.to=-1}}export{n as UniformBufferObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{isNone as e}from"../../core/maybe.js";import{BufferType as r,CompressedTextureFormat as t,PixelFormat as i,RenderbufferFormat as s}from"./enums.js";function o(e,r){return e.vertexBuffers[r].size/n(e.layout[r])}function n(e){return e[0].stride}function a(e,r,t,i,s=0){const o=e.gl,n=e.capabilities.instancing;e.bindBuffer(t);for(const a of i){const e=r.get(a.name);void 0===e&&console.error(`There is no location for vertex attribute '${a.name}' defined.`);const t=s*a.stride;if(a.count<=4)o.vertexAttribPointer(e,a.count,a.type,a.normalized,a.stride,a.offset+t),o.enableVertexAttribArray(e),a.divisor>0&&n&&n.vertexAttribDivisor(e,a.divisor);else if(9===a.count)for(let r=0;r<3;r++)o.vertexAttribPointer(e+r,3,a.type,a.normalized,a.stride,a.offset+12*r+t),o.enableVertexAttribArray(e+r),a.divisor>0&&n&&n.vertexAttribDivisor(e+r,a.divisor);else if(16===a.count)for(let r=0;r<4;r++)o.vertexAttribPointer(e+r,4,a.type,a.normalized,a.stride,a.offset+16*r+t),o.enableVertexAttribArray(e+r),a.divisor>0&&n&&n.vertexAttribDivisor(e+r,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count)}}function c(e,t,i,s){const o=e.gl,n=e.capabilities.instancing;e.bindBuffer(i);for(const r of s){const e=t.get(r.name);if(r.count<=4)o.disableVertexAttribArray(e),r.divisor&&r.divisor>0&&n&&n.vertexAttribDivisor(e,0);else if(9===r.count)for(let t=0;t<3;t++)o.disableVertexAttribArray(e+t),r.divisor&&r.divisor>0&&n&&n.vertexAttribDivisor(e+t,0);else if(16===r.count)for(let t=0;t<4;t++)o.disableVertexAttribArray(e+t),r.divisor&&r.divisor>0&&n&&n.vertexAttribDivisor(e+t,0);else console.error("Unsupported vertex attribute element count: "+r.count)}e.unbindBuffer(r.ARRAY_BUFFER)}function E(e){switch(e){case i.ALPHA:case i.LUMINANCE:case s.STENCIL_INDEX8:return 1;case i.LUMINANCE_ALPHA:case i.RGBA4:case i.R16F:case s.RGBA4:case s.DEPTH_COMPONENT16:return 2;case i.RGB:case i.DEPTH_COMPONENT:return 3;case i.RGBA:case i.DEPTH_STENCIL:case i.R32F:case i.R11F_G11F_B10F:case i.RG16F:case s.DEPTH_STENCIL:return 4;case i.RG32F:case i.RGBA16F:return 8;case i.RGB32F:return 12;case i.RGBA32F:return 16;case t.COMPRESSED_RGB_S3TC_DXT1_EXT:case t.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case t.COMPRESSED_RGBA_S3TC_DXT3_EXT:case t.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case t.COMPRESSED_R11_EAC:case t.COMPRESSED_SIGNED_R11_EAC:case t.COMPRESSED_RGB8_ETC2:case t.COMPRESSED_SRGB8_ETC2:case t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case t.COMPRESSED_RG11_EAC:case t.COMPRESSED_SIGNED_RG11_EAC:case t.COMPRESSED_RGBA8_ETC2_EAC:case t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function _(r){if(e(r))return 0;if("descriptor"in r)return r.glName?_(r.descriptor):0;const t=r.internalFormat||"pixelFormat"in r&&r.pixelFormat;if(!t)return 0;const i="hasMipmap"in r&&r.hasMipmap?1.3:1,s=r.width*r.height;return E(t)*s*i}export{a as bindVertexBufferLayout,E as getBytesPerElementFormat,_ as getGpuMemoryUsage,n as getStride,c as unbindVertexBufferLayout,o as vertexCount};
5
+ import"../../core/has.js";import{isNone as e}from"../../core/maybe.js";import{BufferType as r,CompressedTextureFormat as s,SizedPixelFormat as t,RenderbufferFormat as a,PixelFormat as c}from"./enums.js";function i(e,r){return e.vertexBuffers[r].size/R(e.layout[r])}function R(e){return e[0].stride}function o(e,r,s,t,a=0){const c=e.gl,i=e.capabilities.instancing;e.bindBuffer(s);for(const R of t){const e=r.get(R.name);void 0===e&&console.error(`There is no location for vertex attribute '${R.name}' defined.`);const s=a*R.stride;if(R.count<=4)c.vertexAttribPointer(e,R.count,R.type,R.normalized,R.stride,R.offset+s),c.enableVertexAttribArray(e),R.divisor>0&&i&&i.vertexAttribDivisor(e,R.divisor);else if(9===R.count)for(let r=0;r<3;r++)c.vertexAttribPointer(e+r,3,R.type,R.normalized,R.stride,R.offset+12*r+s),c.enableVertexAttribArray(e+r),R.divisor>0&&i&&i.vertexAttribDivisor(e+r,R.divisor);else if(16===R.count)for(let r=0;r<4;r++)c.vertexAttribPointer(e+r,4,R.type,R.normalized,R.stride,R.offset+16*r+s),c.enableVertexAttribArray(e+r),R.divisor>0&&i&&i.vertexAttribDivisor(e+r,R.divisor);else console.error("Unsupported vertex attribute element count: "+R.count)}}function n(e,s,t,a){const c=e.gl,i=e.capabilities.instancing;e.bindBuffer(t);for(const r of a){const e=s.get(r.name);if(r.count<=4)c.disableVertexAttribArray(e),r.divisor&&r.divisor>0&&i&&i.vertexAttribDivisor(e,0);else if(9===r.count)for(let s=0;s<3;s++)c.disableVertexAttribArray(e+s),r.divisor&&r.divisor>0&&i&&i.vertexAttribDivisor(e+s,0);else if(16===r.count)for(let s=0;s<4;s++)c.disableVertexAttribArray(e+s),r.divisor&&r.divisor>0&&i&&i.vertexAttribDivisor(e+s,0);else console.error("Unsupported vertex attribute element count: "+r.count)}e.unbindBuffer(r.ARRAY_BUFFER)}function E(e){switch(e){case c.ALPHA:case c.LUMINANCE:case c.RED:case c.RED_INTEGER:case t.R8:case t.R8I:case t.R8UI:case t.R8_SNORM:case a.STENCIL_INDEX8:return 1;case c.LUMINANCE_ALPHA:case c.RG:case c.RG_INTEGER:case t.RGBA4:case t.R16F:case t.R16I:case t.R16UI:case t.RG8:case t.RG8I:case t.RG8UI:case t.RG8_SNORM:case t.RGB565:case t.RGB5_A1:case a.DEPTH_COMPONENT16:return 2;case c.DEPTH_COMPONENT:case c.RGB:case c.RGB_INTEGER:case t.RGB8:case t.RGB8I:case t.RGB8UI:case t.RGB8_SNORM:case t.SRGB8:case a.DEPTH_COMPONENT24:return 3;case c.DEPTH_STENCIL:case c.RGBA:case c.RGBA_INTEGER:case t.RGBA8:case t.R32F:case t.R11F_G11F_B10F:case t.RG16F:case t.R32I:case t.R32UI:case t.RG16I:case t.RG16UI:case t.RGBA8I:case t.RGBA8UI:case t.RGBA8_SNORM:case t.SRGB8_ALPHA8:case t.RGB9_E5:case t.RGB10_A2UI:case t.RGB10_A2:case a.DEPTH_STENCIL:case a.DEPTH_COMPONENT32F:case a.DEPTH24_STENCIL8:return 4;case a.DEPTH32F_STENCIL8:return 5;case t.RGB16F:case t.RGB16I:case t.RGB16UI:return 6;case t.RG32F:case t.RG32I:case t.RG32UI:case t.RGBA16F:case t.RGBA16I:case t.RGBA16UI:return 8;case t.RGB32F:case t.RGB32I:case t.RGB32UI:return 12;case t.RGBA32F:case t.RGBA32I:case t.RGBA32UI:return 16;case s.COMPRESSED_RGB_S3TC_DXT1_EXT:case s.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case s.COMPRESSED_RGBA_S3TC_DXT3_EXT:case s.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case s.COMPRESSED_R11_EAC:case s.COMPRESSED_SIGNED_R11_EAC:case s.COMPRESSED_RGB8_ETC2:case s.COMPRESSED_SRGB8_ETC2:case s.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case s.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case s.COMPRESSED_RG11_EAC:case s.COMPRESSED_SIGNED_RG11_EAC:case s.COMPRESSED_RGBA8_ETC2_EAC:case s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function _(r){if(e(r))return 0;if("descriptor"in r)return r.glName?_(r.descriptor):0;const s=r.internalFormat||"pixelFormat"in r&&r.pixelFormat;if(!s)return 0;const t="hasMipmap"in r&&r.hasMipmap?1.3:1,a=r.width*r.height;return E(s)*a*t}export{o as bindVertexBufferLayout,E as getBytesPerElementFormat,_ as getGpuMemoryUsage,R as getStride,n as unbindVertexBufferLayout,i as vertexCount};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- var E,_,T,R,A,C,N,S,O,P,L,I,M,D,U,H,B,G,F,n;!function(E){E[E.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",E[E.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",E[E.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"}(E||(E={})),function(E){E[E.POINTS=0]="POINTS",E[E.LINES=1]="LINES",E[E.LINE_LOOP=2]="LINE_LOOP",E[E.LINE_STRIP=3]="LINE_STRIP",E[E.TRIANGLES=4]="TRIANGLES",E[E.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",E[E.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(_||(_={})),function(E){E[E.ZERO=0]="ZERO",E[E.ONE=1]="ONE",E[E.SRC_COLOR=768]="SRC_COLOR",E[E.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",E[E.SRC_ALPHA=770]="SRC_ALPHA",E[E.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",E[E.DST_ALPHA=772]="DST_ALPHA",E[E.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",E[E.DST_COLOR=774]="DST_COLOR",E[E.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",E[E.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",E[E.CONSTANT_COLOR=32769]="CONSTANT_COLOR",E[E.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",E[E.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",E[E.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(T||(T={})),function(E){E[E.ADD=32774]="ADD",E[E.SUBTRACT=32778]="SUBTRACT",E[E.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(R||(R={})),function(E){E[E.ARRAY_BUFFER=34962]="ARRAY_BUFFER",E[E.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"}(A||(A={})),function(E){E[E.FRONT=1028]="FRONT",E[E.BACK=1029]="BACK",E[E.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(C||(C={})),function(E){E[E.CW=2304]="CW",E[E.CCW=2305]="CCW"}(N||(N={})),function(E){E[E.BYTE=5120]="BYTE",E[E.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",E[E.SHORT=5122]="SHORT",E[E.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",E[E.INT=5124]="INT",E[E.UNSIGNED_INT=5125]="UNSIGNED_INT",E[E.FLOAT=5126]="FLOAT"}(S||(S={})),function(E){E[E.NEVER=512]="NEVER",E[E.LESS=513]="LESS",E[E.EQUAL=514]="EQUAL",E[E.LEQUAL=515]="LEQUAL",E[E.GREATER=516]="GREATER",E[E.NOTEQUAL=517]="NOTEQUAL",E[E.GEQUAL=518]="GEQUAL",E[E.ALWAYS=519]="ALWAYS"}(O||(O={})),function(E){E[E.ZERO=0]="ZERO",E[E.KEEP=7680]="KEEP",E[E.REPLACE=7681]="REPLACE",E[E.INCR=7682]="INCR",E[E.DECR=7683]="DECR",E[E.INVERT=5386]="INVERT",E[E.INCR_WRAP=34055]="INCR_WRAP",E[E.DECR_WRAP=34056]="DECR_WRAP"}(P||(P={})),function(E){E[E.NEAREST=9728]="NEAREST",E[E.LINEAR=9729]="LINEAR",E[E.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",E[E.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",E[E.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",E[E.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(L||(L={})),function(E){E[E.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",E[E.REPEAT=10497]="REPEAT",E[E.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(I||(I={})),function(E){E[E.TEXTURE_2D=3553]="TEXTURE_2D",E[E.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",E[E.TEXTURE_3D=32879]="TEXTURE_3D",E[E.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",E[E.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",E[E.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",E[E.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(M||(M={})),function(E){E[E.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",E[E.ALPHA=6406]="ALPHA",E[E.RGB=6407]="RGB",E[E.RGBA=6408]="RGBA",E[E.LUMINANCE=6409]="LUMINANCE",E[E.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",E[E.RGBA4=32854]="RGBA4",E[E.DEPTH_STENCIL=34041]="DEPTH_STENCIL",E[E.R16F=33325]="R16F",E[E.RG16F=33327]="RG16F",E[E.RGB32F=34837]="RGB32F",E[E.RGBA16F=34842]="RGBA16F",E[E.R32F=33326]="R32F",E[E.RG32F=33328]="RG32F",E[E.RGBA32F=34836]="RGBA32F",E[E.R11F_G11F_B10F=35898]="R11F_G11F_B10F"}(D||(D={})),function(E){E[E.FLOAT=5126]="FLOAT",E[E.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",E[E.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",E[E.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",E[E.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",E[E.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5"}(U||(U={})),function(E){E[E.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",E[E.STENCIL_INDEX8=36168]="STENCIL_INDEX8",E[E.DEPTH_STENCIL=34041]="DEPTH_STENCIL",E[E.RGBA4=32854]="RGBA4"}(H||(H={})),function(E){E[E.STATIC_DRAW=35044]="STATIC_DRAW",E[E.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",E[E.STREAM_DRAW=35040]="STREAM_DRAW"}(B||(B={})),function(E){E[E.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",E[E.VERTEX_SHADER=35633]="VERTEX_SHADER"}(G||(G={})),function(E){E[E.TEXTURE=0]="TEXTURE",E[E.RENDER_BUFFER=1]="RENDER_BUFFER",E[E.CUBEMAP=2]="CUBEMAP"}(F||(F={})),function(E){E[E.NONE=0]="NONE",E[E.DEPTH_RENDER_BUFFER=1]="DEPTH_RENDER_BUFFER",E[E.STENCIL_RENDER_BUFFER=2]="STENCIL_RENDER_BUFFER",E[E.DEPTH_STENCIL_RENDER_BUFFER=3]="DEPTH_STENCIL_RENDER_BUFFER",E[E.DEPTH_STENCIL_TEXTURE=4]="DEPTH_STENCIL_TEXTURE"}(n||(n={}));const X=33984;var f,u;!function(E){E[E.Texture=0]="Texture",E[E.Buffer=1]="Buffer",E[E.VAO=2]="VAO",E[E.Shader=3]="Shader",E[E.Program=4]="Program",E[E.Framebuffer=5]="Framebuffer",E[E.Renderbuffer=6]="Renderbuffer",E[E.COUNT=7]="COUNT"}(f||(f={})),function(E){E[E.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",E[E.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",E[E.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",E[E.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",E[E.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",E[E.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",E[E.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",E[E.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",E[E.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",E[E.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",E[E.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",E[E.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",E[E.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",E[E.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",E[E.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",E[E.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(u||(u={}));const o=33306;var t;!function(E){E[E.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",E[E.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",E[E.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",E[E.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",E[E.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",E[E.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",E[E.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",E[E.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",E[E.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",E[E.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",E[E.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",E[E.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",E[E.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",E[E.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(t||(t={}));export{X as BASE_TEXTURE_UNIT,T as BlendFactor,R as BlendOperation,A as BufferType,E as ClearBufferBit,u as ColorAttachment,O as CompareFunction,t as CompressedTextureFormat,N as CullMode,S as DataType,o as DepthStencilAttachment,n as DepthStencilTargetType,C as Face,D as PixelFormat,U as PixelType,_ as PrimitiveType,H as RenderbufferFormat,f as ResourceType,G as ShaderType,P as StencilOperation,F as TargetType,L as TextureSamplingMode,M as TextureType,I as TextureWrapMode,B as Usage};
5
+ var _,E,R,T,A,N,S,C,I,O,L,D,M,P,U,G,B,F,H,n,Y,V;!function(_){_[_.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",_[_.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",_[_.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"}(_||(_={})),function(_){_[_.POINTS=0]="POINTS",_[_.LINES=1]="LINES",_[_.LINE_LOOP=2]="LINE_LOOP",_[_.LINE_STRIP=3]="LINE_STRIP",_[_.TRIANGLES=4]="TRIANGLES",_[_.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",_[_.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(E||(E={})),function(_){_[_.ZERO=0]="ZERO",_[_.ONE=1]="ONE",_[_.SRC_COLOR=768]="SRC_COLOR",_[_.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",_[_.SRC_ALPHA=770]="SRC_ALPHA",_[_.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",_[_.DST_ALPHA=772]="DST_ALPHA",_[_.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",_[_.DST_COLOR=774]="DST_COLOR",_[_.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",_[_.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",_[_.CONSTANT_COLOR=32769]="CONSTANT_COLOR",_[_.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",_[_.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",_[_.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(R||(R={})),function(_){_[_.ADD=32774]="ADD",_[_.SUBTRACT=32778]="SUBTRACT",_[_.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(T||(T={})),function(_){_[_.ARRAY_BUFFER=34962]="ARRAY_BUFFER",_[_.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",_[_.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",_[_.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",_[_.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",_[_.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",_[_.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER"}(A||(A={})),function(_){_[_.FRONT=1028]="FRONT",_[_.BACK=1029]="BACK",_[_.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(N||(N={})),function(_){_[_.CW=2304]="CW",_[_.CCW=2305]="CCW"}(S||(S={})),function(_){_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.INT=5124]="INT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.FLOAT=5126]="FLOAT"}(C||(C={})),function(_){_[_.NEVER=512]="NEVER",_[_.LESS=513]="LESS",_[_.EQUAL=514]="EQUAL",_[_.LEQUAL=515]="LEQUAL",_[_.GREATER=516]="GREATER",_[_.NOTEQUAL=517]="NOTEQUAL",_[_.GEQUAL=518]="GEQUAL",_[_.ALWAYS=519]="ALWAYS"}(I||(I={})),function(_){_[_.ZERO=0]="ZERO",_[_.KEEP=7680]="KEEP",_[_.REPLACE=7681]="REPLACE",_[_.INCR=7682]="INCR",_[_.DECR=7683]="DECR",_[_.INVERT=5386]="INVERT",_[_.INCR_WRAP=34055]="INCR_WRAP",_[_.DECR_WRAP=34056]="DECR_WRAP"}(O||(O={})),function(_){_[_.NEAREST=9728]="NEAREST",_[_.LINEAR=9729]="LINEAR",_[_.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",_[_.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",_[_.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",_[_.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(L||(L={})),function(_){_[_.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",_[_.REPEAT=10497]="REPEAT",_[_.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(D||(D={})),function(_){_[_.TEXTURE_2D=3553]="TEXTURE_2D",_[_.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",_[_.TEXTURE_3D=32879]="TEXTURE_3D",_[_.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",_[_.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",_[_.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",_[_.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",_[_.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(M||(M={})),function(_){_[_.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL",_[_.ALPHA=6406]="ALPHA",_[_.RGB=6407]="RGB",_[_.RGBA=6408]="RGBA",_[_.LUMINANCE=6409]="LUMINANCE",_[_.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",_[_.RED=6403]="RED",_[_.RG=33319]="RG",_[_.RED_INTEGER=36244]="RED_INTEGER",_[_.RG_INTEGER=33320]="RG_INTEGER",_[_.RGB_INTEGER=36248]="RGB_INTEGER",_[_.RGBA_INTEGER=36249]="RGBA_INTEGER"}(P||(P={})),function(_){_[_.RGBA4=32854]="RGBA4",_[_.R16F=33325]="R16F",_[_.RG16F=33327]="RG16F",_[_.RGB32F=34837]="RGB32F",_[_.RGBA16F=34842]="RGBA16F",_[_.R32F=33326]="R32F",_[_.RG32F=33328]="RG32F",_[_.RGBA32F=34836]="RGBA32F",_[_.R11F_G11F_B10F=35898]="R11F_G11F_B10F",_[_.RGB8=32849]="RGB8",_[_.RGBA8=32856]="RGBA8",_[_.RGB5_A1=32855]="RGB5_A1",_[_.R8=33321]="R8",_[_.RG8=33323]="RG8",_[_.R8I=33329]="R8I",_[_.R8UI=33330]="R8UI",_[_.R16I=33331]="R16I",_[_.R16UI=33332]="R16UI",_[_.R32I=33333]="R32I",_[_.R32UI=33334]="R32UI",_[_.RG8I=33335]="RG8I",_[_.RG8UI=33336]="RG8UI",_[_.RG16I=33337]="RG16I",_[_.RG16UI=33338]="RG16UI",_[_.RG32I=33339]="RG32I",_[_.RG32UI=33340]="RG32UI",_[_.RGB16F=34843]="RGB16F",_[_.RGB9_E5=35901]="RGB9_E5",_[_.SRGB8=35905]="SRGB8",_[_.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",_[_.RGB565=36194]="RGB565",_[_.RGBA32UI=36208]="RGBA32UI",_[_.RGB32UI=36209]="RGB32UI",_[_.RGBA16UI=36214]="RGBA16UI",_[_.RGB16UI=36215]="RGB16UI",_[_.RGBA8UI=36220]="RGBA8UI",_[_.RGB8UI=36221]="RGB8UI",_[_.RGBA32I=36226]="RGBA32I",_[_.RGB32I=36227]="RGB32I",_[_.RGBA16I=36232]="RGBA16I",_[_.RGB16I=36233]="RGB16I",_[_.RGBA8I=36238]="RGBA8I",_[_.RGB8I=36239]="RGB8I",_[_.R8_SNORM=36756]="R8_SNORM",_[_.RG8_SNORM=36757]="RG8_SNORM",_[_.RGB8_SNORM=36758]="RGB8_SNORM",_[_.RGBA8_SNORM=36759]="RGBA8_SNORM",_[_.RGB10_A2=32857]="RGB10_A2",_[_.RGB10_A2UI=36975]="RGB10_A2UI"}(U||(U={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",_[_.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",_[_.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",_[_.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.INT=5124]="INT",_[_.HALF_FLOAT=5131]="HALF_FLOAT",_[_.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",_[_.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",_[_.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",_[_.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(G||(G={})),function(_){_[_.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",_[_.STENCIL_INDEX8=36168]="STENCIL_INDEX8",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL",_[_.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",_[_.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",_[_.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",_[_.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(B||(B={})),function(_){_[_.STATIC_DRAW=35044]="STATIC_DRAW",_[_.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",_[_.STREAM_DRAW=35040]="STREAM_DRAW",_[_.STATIC_READ=35045]="STATIC_READ",_[_.DYNAMIC_READ=35049]="DYNAMIC_READ",_[_.STREAM_READ=35041]="STREAM_READ",_[_.STATIC_COPY=35046]="STATIC_COPY",_[_.DYNAMIC_COPY=35050]="DYNAMIC_COPY",_[_.STREAM_COPY=35042]="STREAM_COPY"}(F||(F={})),function(_){_[_.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",_[_.VERTEX_SHADER=35633]="VERTEX_SHADER"}(H||(H={})),function(_){_[_.FRAMEBUFFER=36160]="FRAMEBUFFER",_[_.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",_[_.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(n||(n={})),function(_){_[_.TEXTURE=0]="TEXTURE",_[_.RENDER_BUFFER=1]="RENDER_BUFFER",_[_.CUBEMAP=2]="CUBEMAP"}(Y||(Y={})),function(_){_[_.NONE=0]="NONE",_[_.DEPTH_RENDER_BUFFER=1]="DEPTH_RENDER_BUFFER",_[_.STENCIL_RENDER_BUFFER=2]="STENCIL_RENDER_BUFFER",_[_.DEPTH_STENCIL_RENDER_BUFFER=3]="DEPTH_STENCIL_RENDER_BUFFER",_[_.DEPTH_STENCIL_TEXTURE=4]="DEPTH_STENCIL_TEXTURE"}(V||(V={}));const X=33984;var f,u;!function(_){_[_.Texture=0]="Texture",_[_.Buffer=1]="Buffer",_[_.VAO=2]="VAO",_[_.Shader=3]="Shader",_[_.Program=4]="Program",_[_.Framebuffer=5]="Framebuffer",_[_.Renderbuffer=6]="Renderbuffer",_[_.COUNT=7]="COUNT"}(f||(f={})),function(_){_[_.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",_[_.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",_[_.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",_[_.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",_[_.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",_[_.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",_[_.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",_[_.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",_[_.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",_[_.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",_[_.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",_[_.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",_[_.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",_[_.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",_[_.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",_[_.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(u||(u={}));const o=33306;var t,c,i,W,r,e,x;!function(_){_[_.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",_[_.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",_[_.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",_[_.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",_[_.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",_[_.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",_[_.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",_[_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",_[_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(t||(t={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.FLOAT_VEC2=35664]="FLOAT_VEC2",_[_.FLOAT_VEC3=35665]="FLOAT_VEC3",_[_.FLOAT_VEC4=35666]="FLOAT_VEC4",_[_.INT=5124]="INT",_[_.INT_VEC2=35667]="INT_VEC2",_[_.INT_VEC3=35668]="INT_VEC3",_[_.INT_VEC4=35669]="INT_VEC4",_[_.BOOL=35670]="BOOL",_[_.BOOL_VEC2=35671]="BOOL_VEC2",_[_.BOOL_VEC3=35672]="BOOL_VEC3",_[_.BOOL_VEC4=35673]="BOOL_VEC4",_[_.FLOAT_MAT2=35674]="FLOAT_MAT2",_[_.FLOAT_MAT3=35675]="FLOAT_MAT3",_[_.FLOAT_MAT4=35676]="FLOAT_MAT4",_[_.SAMPLER_2D=35678]="SAMPLER_2D",_[_.SAMPLER_CUBE=35680]="SAMPLER_CUBE",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",_[_.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",_[_.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",_[_.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",_[_.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",_[_.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",_[_.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",_[_.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",_[_.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",_[_.SAMPLER_3D=35679]="SAMPLER_3D",_[_.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",_[_.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",_[_.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",_[_.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",_[_.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",_[_.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",_[_.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",_[_.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",_[_.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",_[_.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",_[_.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",_[_.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(c||(c={})),function(_){_[_.OBJECT_TYPE=37138]="OBJECT_TYPE",_[_.SYNC_CONDITION=37139]="SYNC_CONDITION",_[_.SYNC_STATUS=37140]="SYNC_STATUS",_[_.SYNC_FLAGS=37141]="SYNC_FLAGS"}(i||(i={})),function(_){_[_.UNSIGNALED=37144]="UNSIGNALED",_[_.SIGNALED=37145]="SIGNALED"}(W||(W={})),function(_){_[_.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",_[_.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",_[_.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",_[_.WAIT_FAILED=37149]="WAIT_FAILED"}(r||(r={})),function(_){_[_.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(e||(e={})),function(_){_[_.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(x||(x={}));export{X as BASE_TEXTURE_UNIT,R as BlendFactor,T as BlendOperation,A as BufferType,_ as ClearBufferBit,r as ClientWaitSyncStatus,u as ColorAttachment,I as CompareFunction,t as CompressedTextureFormat,S as CullMode,C as DataType,o as DepthStencilAttachment,V as DepthStencilTargetType,N as Face,n as FramebufferTarget,P as PixelFormat,G as PixelType,E as PrimitiveType,B as RenderbufferFormat,f as ResourceType,H as ShaderType,U as SizedPixelFormat,O as StencilOperation,e as SyncCondition,x as SyncFlag,i as SyncParameter,W as SyncStatus,Y as TargetType,L as TextureSamplingMode,M as TextureType,D as TextureWrapMode,c as UniformType,F as Usage};