agmon 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +7 -0
  3. package/.next/build/chunks/[root-of-the-server]__05i36w1t4lzaf._.js +502 -0
  4. package/.next/build/chunks/[root-of-the-server]__05i36w1t4lzaf._.js.map +11 -0
  5. package/.next/build/chunks/[root-of-the-server]__1kki86fknkq7y._.js +190 -0
  6. package/.next/build/chunks/[root-of-the-server]__1kki86fknkq7y._.js.map +8 -0
  7. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_1gfkiq9iz8yb8._.js +13 -0
  8. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_1gfkiq9iz8yb8._.js.map +5 -0
  9. package/.next/build/chunks/[turbopack]_runtime.js +1056 -0
  10. package/.next/build/chunks/[turbopack]_runtime.js.map +11 -0
  11. package/.next/build/chunks/node_modules_20v-8wlfss9m1._.js +7314 -0
  12. package/.next/build/chunks/node_modules_20v-8wlfss9m1._.js.map +47 -0
  13. package/.next/build/chunks/pool_entry-[turbopack-node]_transforms_postcss_ts_0tp-k2vy8nj6i._.js +6 -0
  14. package/.next/build/chunks/pool_entry-[turbopack-node]_transforms_postcss_ts_0tp-k2vy8nj6i._.js.map +5 -0
  15. package/.next/build/package.json +1 -0
  16. package/.next/build-manifest.json +54 -0
  17. package/.next/export-marker.json +6 -0
  18. package/.next/fallback-build-manifest.json +15 -0
  19. package/.next/images-manifest.json +68 -0
  20. package/.next/next-minimal-server.js.nft.json +1 -0
  21. package/.next/next-server.js.nft.json +1 -0
  22. package/.next/package.json +1 -0
  23. package/.next/prerender-manifest.json +97 -0
  24. package/.next/required-server-files.js +366 -0
  25. package/.next/required-server-files.json +366 -0
  26. package/.next/routes-manifest.json +75 -0
  27. package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  28. package/.next/server/app/_global-error/page/build-manifest.json +21 -0
  29. package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  30. package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  31. package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  32. package/.next/server/app/_global-error/page.js +10 -0
  33. package/.next/server/app/_global-error/page.js.map +5 -0
  34. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  35. package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
  36. package/.next/server/app/_global-error.html +1 -0
  37. package/.next/server/app/_global-error.meta +30 -0
  38. package/.next/server/app/_global-error.rsc +18 -0
  39. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +23 -0
  40. package/.next/server/app/_global-error.segments/_full.segment.rsc +18 -0
  41. package/.next/server/app/_global-error.segments/_tree.segment.rsc +2 -0
  42. package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  43. package/.next/server/app/_not-found/page/build-manifest.json +21 -0
  44. package/.next/server/app/_not-found/page/next-font-manifest.json +6 -0
  45. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  46. package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  47. package/.next/server/app/_not-found/page.js +12 -0
  48. package/.next/server/app/_not-found/page.js.map +5 -0
  49. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  50. package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
  51. package/.next/server/app/_not-found.html +1 -0
  52. package/.next/server/app/_not-found.meta +35 -0
  53. package/.next/server/app/_not-found.rsc +22 -0
  54. package/.next/server/app/_not-found.segments/_full.segment.rsc +22 -0
  55. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +28 -0
  56. package/.next/server/app/_not-found.segments/_tree.segment.rsc +4 -0
  57. package/.next/server/app/api/traces/stream/route/app-paths-manifest.json +3 -0
  58. package/.next/server/app/api/traces/stream/route/build-manifest.json +12 -0
  59. package/.next/server/app/api/traces/stream/route/server-reference-manifest.json +4 -0
  60. package/.next/server/app/api/traces/stream/route.js +7 -0
  61. package/.next/server/app/api/traces/stream/route.js.map +5 -0
  62. package/.next/server/app/api/traces/stream/route.js.nft.json +1 -0
  63. package/.next/server/app/api/traces/stream/route_client-reference-manifest.js +3 -0
  64. package/.next/server/app/api/version/route/app-paths-manifest.json +3 -0
  65. package/.next/server/app/api/version/route/build-manifest.json +12 -0
  66. package/.next/server/app/api/version/route/server-reference-manifest.json +4 -0
  67. package/.next/server/app/api/version/route.js +7 -0
  68. package/.next/server/app/api/version/route.js.map +5 -0
  69. package/.next/server/app/api/version/route.js.nft.json +1 -0
  70. package/.next/server/app/api/version/route_client-reference-manifest.js +3 -0
  71. package/.next/server/app/index.html +1 -0
  72. package/.next/server/app/index.meta +29 -0
  73. package/.next/server/app/index.rsc +29 -0
  74. package/.next/server/app/index.segments/__PAGE__.segment.rsc +34 -0
  75. package/.next/server/app/index.segments/_full.segment.rsc +29 -0
  76. package/.next/server/app/index.segments/_tree.segment.rsc +3 -0
  77. package/.next/server/app/page/app-paths-manifest.json +3 -0
  78. package/.next/server/app/page/build-manifest.json +21 -0
  79. package/.next/server/app/page/next-font-manifest.json +6 -0
  80. package/.next/server/app/page/react-loadable-manifest.json +1 -0
  81. package/.next/server/app/page/server-reference-manifest.json +4 -0
  82. package/.next/server/app/page.js +13 -0
  83. package/.next/server/app/page.js.map +5 -0
  84. package/.next/server/app/page.js.nft.json +1 -0
  85. package/.next/server/app/page_client-reference-manifest.js +3 -0
  86. package/.next/server/app-paths-manifest.json +7 -0
  87. package/.next/server/chunks/[externals]__0bwf06g0pqv3h._.js +3 -0
  88. package/.next/server/chunks/[externals]__0bwf06g0pqv3h._.js.map +1 -0
  89. package/.next/server/chunks/[externals]__1p2j9_5g429uh._.js +3 -0
  90. package/.next/server/chunks/[externals]__1p2j9_5g429uh._.js.map +1 -0
  91. package/.next/server/chunks/[root-of-the-server]__04an4kw4xcc5l._.js +5 -0
  92. package/.next/server/chunks/[root-of-the-server]__04an4kw4xcc5l._.js.map +1 -0
  93. package/.next/server/chunks/[root-of-the-server]__1s6v8mz-nanm-._.js +5 -0
  94. package/.next/server/chunks/[root-of-the-server]__1s6v8mz-nanm-._.js.map +1 -0
  95. package/.next/server/chunks/[root-of-the-server]__20xfs4y2ipcvv._.js +320 -0
  96. package/.next/server/chunks/[root-of-the-server]__20xfs4y2ipcvv._.js.map +1 -0
  97. package/.next/server/chunks/[turbopack]_runtime.js +937 -0
  98. package/.next/server/chunks/[turbopack]_runtime.js.map +10 -0
  99. package/.next/server/chunks/_next-internal_server_app_api_traces_stream_route_actions_07rmicxgds803.js +3 -0
  100. package/.next/server/chunks/_next-internal_server_app_api_traces_stream_route_actions_07rmicxgds803.js.map +1 -0
  101. package/.next/server/chunks/_next-internal_server_app_api_version_route_actions_0kbx30hro8e93.js +3 -0
  102. package/.next/server/chunks/_next-internal_server_app_api_version_route_actions_0kbx30hro8e93.js.map +1 -0
  103. package/.next/server/chunks/ssr/1q96_modules_pixi_js_lib_rendering_renderers_canvas_CanvasRenderer_mjs_1xntzghggpb51._.js +3 -0
  104. package/.next/server/chunks/ssr/1q96_modules_pixi_js_lib_rendering_renderers_canvas_CanvasRenderer_mjs_1xntzghggpb51._.js.map +1 -0
  105. package/.next/server/chunks/ssr/1q96_modules_pixi_js_lib_rendering_renderers_gpu_WebGPURenderer_mjs_00tc9jrf-ft1_._.js +76 -0
  106. package/.next/server/chunks/ssr/1q96_modules_pixi_js_lib_rendering_renderers_gpu_WebGPURenderer_mjs_00tc9jrf-ft1_._.js.map +1 -0
  107. package/.next/server/chunks/ssr/[root-of-the-server]__08zgqq_38tv57._.js +3 -0
  108. package/.next/server/chunks/ssr/[root-of-the-server]__08zgqq_38tv57._.js.map +1 -0
  109. package/.next/server/chunks/ssr/[root-of-the-server]__0aa2929udndo-._.js +3 -0
  110. package/.next/server/chunks/ssr/[root-of-the-server]__0aa2929udndo-._.js.map +1 -0
  111. package/.next/server/chunks/ssr/[root-of-the-server]__0ayw3c9e93kvf._.js +3 -0
  112. package/.next/server/chunks/ssr/[root-of-the-server]__0ayw3c9e93kvf._.js.map +1 -0
  113. package/.next/server/chunks/ssr/[root-of-the-server]__0ojpb-dtuk3-q._.js +3 -0
  114. package/.next/server/chunks/ssr/[root-of-the-server]__0ojpb-dtuk3-q._.js.map +1 -0
  115. package/.next/server/chunks/ssr/[root-of-the-server]__0py1t7q9ntzgc._.js +3 -0
  116. package/.next/server/chunks/ssr/[root-of-the-server]__0py1t7q9ntzgc._.js.map +1 -0
  117. package/.next/server/chunks/ssr/[root-of-the-server]__1cf6qt9agg_9-._.js +14 -0
  118. package/.next/server/chunks/ssr/[root-of-the-server]__1cf6qt9agg_9-._.js.map +1 -0
  119. package/.next/server/chunks/ssr/[root-of-the-server]__1e1_fmeab1ca7._.js +3 -0
  120. package/.next/server/chunks/ssr/[root-of-the-server]__1e1_fmeab1ca7._.js.map +1 -0
  121. package/.next/server/chunks/ssr/[root-of-the-server]__1w2vu9hh0h02y._.js +3 -0
  122. package/.next/server/chunks/ssr/[root-of-the-server]__1w2vu9hh0h02y._.js.map +1 -0
  123. package/.next/server/chunks/ssr/[turbopack]_runtime.js +937 -0
  124. package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +10 -0
  125. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-psc_d2.js +3 -0
  126. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-psc_d2.js.map +1 -0
  127. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yrisjoev.js +3 -0
  128. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yrisjoev.js.map +1 -0
  129. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_0hhsz1jew5ls7.js +3 -0
  130. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_0hhsz1jew5ls7.js.map +1 -0
  131. package/.next/server/chunks/ssr/node_modules_01xbj_9zg44kw._.js +33 -0
  132. package/.next/server/chunks/ssr/node_modules_01xbj_9zg44kw._.js.map +1 -0
  133. package/.next/server/chunks/ssr/node_modules_0a548_llmwce7._.js +23 -0
  134. package/.next/server/chunks/ssr/node_modules_0a548_llmwce7._.js.map +1 -0
  135. package/.next/server/chunks/ssr/node_modules_0gxlxpuufujz9._.js +33 -0
  136. package/.next/server/chunks/ssr/node_modules_0gxlxpuufujz9._.js.map +1 -0
  137. package/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js +6 -0
  138. package/.next/server/chunks/ssr/node_modules_next_dist_0janj0i6dqko7._.js.map +1 -0
  139. package/.next/server/chunks/ssr/node_modules_next_dist_1hgv5i-pr1hza._.js +3 -0
  140. package/.next/server/chunks/ssr/node_modules_next_dist_1hgv5i-pr1hza._.js.map +1 -0
  141. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j32_ibz4._.js +3 -0
  142. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j32_ibz4._.js.map +1 -0
  143. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9mbf-fh.js +3 -0
  144. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9mbf-fh.js.map +1 -0
  145. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892nagajq.js +3 -0
  146. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892nagajq.js.map +1 -0
  147. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0xky89qu.js +3 -0
  148. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0xky89qu.js.map +1 -0
  149. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0aymk_x8-bu4q.js +3 -0
  150. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0aymk_x8-bu4q.js.map +1 -0
  151. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z4y02i7.js +3 -0
  152. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z4y02i7.js.map +1 -0
  153. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1qjycfedgh109.js +3 -0
  154. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1qjycfedgh109.js.map +1 -0
  155. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0hcyh9uzlz7ci._.js +3 -0
  156. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0hcyh9uzlz7ci._.js.map +1 -0
  157. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0k3f3soanqdoq._.js +3 -0
  158. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0k3f3soanqdoq._.js.map +1 -0
  159. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0ovgsftn-uvbz._.js +3 -0
  160. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0ovgsftn-uvbz._.js.map +1 -0
  161. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0xa24fqr5c5qi._.js +5 -0
  162. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0xa24fqr5c5qi._.js.map +1 -0
  163. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0zrftay3kjup7._.js +5 -0
  164. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_0zrftay3kjup7._.js.map +1 -0
  165. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_1z4lgkg_w-7fr._.js +208 -0
  166. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_1z4lgkg_w-7fr._.js.map +1 -0
  167. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_1zjkoj2kc4hm-._.js +3 -0
  168. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_1zjkoj2kc4hm-._.js.map +1 -0
  169. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_environment-browser_browserAll_mjs_0xb_t3dj4ad1f._.js +16 -0
  170. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_environment-browser_browserAll_mjs_0xb_t3dj4ad1f._.js.map +1 -0
  171. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_filters_Filter_mjs_0luksfw8ekifi._.js +3 -0
  172. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_filters_Filter_mjs_0luksfw8ekifi._.js.map +1 -0
  173. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_filters_init_mjs_1o5fmm_m60v_s._.js +3 -0
  174. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_filters_init_mjs_1o5fmm_m60v_s._.js.map +1 -0
  175. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_rendering_1fkio2phhfvow._.js +196 -0
  176. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_rendering_1fkio2phhfvow._.js.map +1 -0
  177. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_rendering_1n1q7aum4i7zo._.js +196 -0
  178. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_rendering_1n1q7aum4i7zo._.js.map +1 -0
  179. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_rendering_renderers_10vpvx1o7svnk._.js +3 -0
  180. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_rendering_renderers_10vpvx1o7svnk._.js.map +1 -0
  181. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_rendering_renderers_gl_WebGLRenderer_mjs_1hlux44jh7dk-._.js +153 -0
  182. package/.next/server/chunks/ssr/node_modules_pixi_js_lib_rendering_renderers_gl_WebGLRenderer_mjs_1hlux44jh7dk-._.js.map +1 -0
  183. package/.next/server/chunks/ssr/src_app_page_1vqfk0-j72fp6.js +3 -0
  184. package/.next/server/chunks/ssr/src_app_page_1vqfk0-j72fp6.js.map +1 -0
  185. package/.next/server/functions-config-manifest.json +4 -0
  186. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  187. package/.next/server/middleware-build-manifest.js +54 -0
  188. package/.next/server/middleware-manifest.json +6 -0
  189. package/.next/server/next-font-manifest.js +1 -0
  190. package/.next/server/next-font-manifest.json +6 -0
  191. package/.next/server/pages/404.html +1 -0
  192. package/.next/server/pages/500.html +1 -0
  193. package/.next/server/pages-manifest.json +4 -0
  194. package/.next/server/prefetch-hints.json +34 -0
  195. package/.next/server/preview-props.json +5 -0
  196. package/.next/server/server-reference-manifest.js +1 -0
  197. package/.next/server/server-reference-manifest.json +5 -0
  198. package/.next/static/chunks/0_9x2udu0iodw.js +1 -0
  199. package/.next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  200. package/.next/static/chunks/0umf92h1sb77c.js +1 -0
  201. package/.next/static/chunks/10om7oix6wjze.js +1 -0
  202. package/.next/static/chunks/1780fh11o7pze.js +1 -0
  203. package/.next/static/chunks/1cldmiyw3ya18.js +21 -0
  204. package/.next/static/chunks/1unuqfq-vfqtp.js +1 -0
  205. package/.next/static/chunks/2-vsu_pt58kse.js +3 -0
  206. package/.next/static/chunks/2drjv1ti9t4pg.js +1 -0
  207. package/.next/static/chunks/2hgsvrrwu57--.css +1 -0
  208. package/.next/static/chunks/2ogvir8krwwhf.js +1 -0
  209. package/.next/static/chunks/2tc54fmsk8v8q.js +1 -0
  210. package/.next/static/chunks/304ue7hvto0o0.js +206 -0
  211. package/.next/static/chunks/31gve42sn75--.js +1 -0
  212. package/.next/static/chunks/32kizm_7q94vd.js +194 -0
  213. package/.next/static/chunks/33bap0u4zwgab.js +74 -0
  214. package/.next/static/chunks/3c4xol65z2da2.js +22 -0
  215. package/.next/static/chunks/3cfn99dbrcvvp.js +31 -0
  216. package/.next/static/chunks/3d6xc1eemxy82.js +1 -0
  217. package/.next/static/chunks/3ycr8gfnsg-xv.js +151 -0
  218. package/.next/static/chunks/3ytt3vrdhke9u.js +14 -0
  219. package/.next/static/chunks/turbopack-3-ry682tkyiqk.js +1 -0
  220. package/.next/static/cy2F4S28h_-YWqCOuE_ul/_buildManifest.js +11 -0
  221. package/.next/static/cy2F4S28h_-YWqCOuE_ul/_clientMiddlewareManifest.js +1 -0
  222. package/.next/static/cy2F4S28h_-YWqCOuE_ul/_ssgManifest.js +1 -0
  223. package/.next/trace +1 -0
  224. package/.next/trace-build +1 -0
  225. package/.next/types/cache-life.d.ts +114 -0
  226. package/.next/types/root-params.d.ts +3 -0
  227. package/.next/types/routes.d.ts +74 -0
  228. package/.next/types/validator.ts +17 -0
  229. package/bin/cli.js +24 -6
  230. package/package.json +6 -6
  231. package/src/app/api/traces/stream/route.js +2 -2
  232. package/src/app/layout.js +1 -1
  233. package/src/app/page.js +6 -19
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/mapType.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/getUboData.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/GlProgramData.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/defaultValue.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/compileShader.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/utils/createUboElementsSTD40.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/utils/mapFormatToGlType.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/uploaders/glUploadImageResource.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/utils/generateUniformsSyncTypes.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/const.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/utils/mapViewDimensionToGlTarget.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/logProgramError.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/buffer/const.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/uploaders/glUploadCompressedTextureResource.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/utils/mapFormatToGlInternalFormat.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/buffer/GlBuffer.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/utils/applyStyleParams.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/state/mapWebGLBlendModesToPixi.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/uploaders/glUploadCubeTextureResource.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/utils/generateArraySyncSTD40.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/extractAttributesFromGlProgram.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/GlEncoderSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/getUniformData.ts","../../../../node_modules/pixi.js/src/rendering/renderers/shared/texture/TextureView.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/uploaders/glUploadVideoResource.ts","../../../../node_modules/pixi.js/src/utils/browser/isSafari.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/uploaders/glUploadBufferImageResource.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/context/GlContextSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/GlColorMaskSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/state/GlStateSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/utils/generateUniformsSync.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/GenerateShaderSyncCode.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/geometry/utils/getGlTypeFromFormat.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/buffer/GlBufferSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/GlRenderTarget.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/geometry/GlGeometrySystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/renderTarget/GlRenderTargetSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/GlUboSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/GlLimitsSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/renderTarget/GlRenderTargetAdaptor.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/GlBackBufferSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/utils/pixiToGlMaps.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/utils/mapFormatToGlFormat.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/GlShaderSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/program/generateProgram.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/GlStencilSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/shader/GlUniformGroupSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/GlTexture.ts","../../../../node_modules/pixi.js/src/scene/graphics/gl/GlGraphicsAdaptor.ts","../../../../node_modules/pixi.js/src/scene/mesh/gl/GlMeshAdaptor.ts","../../../../node_modules/pixi.js/src/rendering/batcher/gl/GlBatchAdaptor.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/texture/GlTextureSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gl/WebGLRenderer.ts"],"sourcesContent":["import type { Dict } from '../../../../../utils/types';\nimport type { VertexFormat } from '../../../shared/geometry/const';\n\nlet GL_TABLE: Dict<string> = null;\n\nconst GL_TO_GLSL_TYPES: Dict<string> = {\n FLOAT: 'float',\n FLOAT_VEC2: 'vec2',\n FLOAT_VEC3: 'vec3',\n FLOAT_VEC4: 'vec4',\n\n INT: 'int',\n INT_VEC2: 'ivec2',\n INT_VEC3: 'ivec3',\n INT_VEC4: 'ivec4',\n\n UNSIGNED_INT: 'uint',\n UNSIGNED_INT_VEC2: 'uvec2',\n UNSIGNED_INT_VEC3: 'uvec3',\n UNSIGNED_INT_VEC4: 'uvec4',\n\n BOOL: 'bool',\n BOOL_VEC2: 'bvec2',\n BOOL_VEC3: 'bvec3',\n BOOL_VEC4: 'bvec4',\n\n FLOAT_MAT2: 'mat2',\n FLOAT_MAT3: 'mat3',\n FLOAT_MAT4: 'mat4',\n\n SAMPLER_2D: 'sampler2D',\n INT_SAMPLER_2D: 'sampler2D',\n UNSIGNED_INT_SAMPLER_2D: 'sampler2D',\n SAMPLER_2D_SHADOW: 'sampler2DShadow',\n SAMPLER_CUBE: 'samplerCube',\n INT_SAMPLER_CUBE: 'samplerCube',\n UNSIGNED_INT_SAMPLER_CUBE: 'samplerCube',\n SAMPLER_CUBE_SHADOW: 'samplerCubeShadow',\n SAMPLER_2D_ARRAY: 'sampler2DArray',\n INT_SAMPLER_2D_ARRAY: 'sampler2DArray',\n UNSIGNED_INT_SAMPLER_2D_ARRAY: 'sampler2DArray',\n SAMPLER_2D_ARRAY_SHADOW: 'sampler2DArrayShadow',\n SAMPLER_3D: 'sampler3D',\n INT_SAMPLER_3D: 'sampler3D',\n UNSIGNED_INT_SAMPLER_3D: 'sampler3D',\n};\n\nconst GLSL_TO_VERTEX_TYPES: Record<string, VertexFormat> = {\n\n float: 'float32',\n vec2: 'float32x2',\n vec3: 'float32x3',\n vec4: 'float32x4',\n\n int: 'sint32',\n ivec2: 'sint32x2',\n ivec3: 'sint32x3',\n ivec4: 'sint32x4',\n\n uint: 'uint32',\n uvec2: 'uint32x2',\n uvec3: 'uint32x3',\n uvec4: 'uint32x4',\n\n bool: 'uint32',\n bvec2: 'uint32x2',\n bvec3: 'uint32x3',\n bvec4: 'uint32x4',\n};\n\n/**\n * @param gl\n * @param type\n * @internal\n */\nexport function mapType(gl: any, type: number): string\n{\n if (!GL_TABLE)\n {\n const typeNames = Object.keys(GL_TO_GLSL_TYPES);\n\n GL_TABLE = {};\n\n for (let i = 0; i < typeNames.length; ++i)\n {\n const tn = typeNames[i];\n\n GL_TABLE[gl[tn]] = GL_TO_GLSL_TYPES[tn];\n }\n }\n\n return GL_TABLE[type];\n}\n\n/**\n * @param gl\n * @param type\n * @internal\n */\nexport function mapGlToVertexFormat(gl: any, type: number): VertexFormat\n{\n const typeValue = mapType(gl, type);\n\n return GLSL_TO_VERTEX_TYPES[typeValue] || 'float32';\n}\n","import type { GlUniformBlockData } from '../GlProgram';\n\n/**\n * returns the uniform block data from the program\n * @private\n * @param program - the webgl program\n * @param gl - the WebGL context\n * @returns {object} the uniform data for this program\n */\nexport function getUboData(program: WebGLProgram, gl: WebGL2RenderingContext): Record<string, GlUniformBlockData>\n{\n // if uniform buffer data is not supported, early out\n if (!gl.ACTIVE_UNIFORM_BLOCKS) return {};\n\n const uniformBlocks: Record<string, GlUniformBlockData> = {};\n\n // const totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n const totalUniformsBlocks = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS);\n\n for (let i = 0; i < totalUniformsBlocks; i++)\n {\n const name = gl.getActiveUniformBlockName(program, i);\n const uniformBlockIndex = gl.getUniformBlockIndex(program, name);\n\n const size = gl.getActiveUniformBlockParameter(program, i, gl.UNIFORM_BLOCK_DATA_SIZE);\n\n uniformBlocks[name] = {\n name,\n index: uniformBlockIndex,\n size,\n };\n }\n\n return uniformBlocks;\n}\n","/** @private */\nexport class IGLUniformData\n{\n public location: WebGLUniformLocation;\n public value: number | boolean | Float32Array | Int32Array | Uint32Array | boolean[];\n}\n\n/**\n * Helper class to create a WebGL Program\n * @private\n */\nexport class GlProgramData\n{\n /** The shader program. */\n public program: WebGLProgram;\n\n /**\n * Holds the uniform data which contains uniform locations\n * and current uniform values used for caching and preventing unneeded GPU commands.\n */\n public uniformData: Record<string, any>;\n\n /**\n * UniformGroups holds the various upload functions for the shader. Each uniform group\n * and program have a unique upload function generated.\n */\n public uniformGroups: Record<string, any>;\n\n /** A hash that stores where UBOs are bound to on the program. */\n public uniformBlockBindings: Record<string, any>;\n\n /** A hash for lazily-generated uniform uploading functions. */\n public uniformSync: Record<string, any>;\n\n /**\n * A place where dirty ticks are stored for groups\n * If a tick here does not match with the Higher level Programs tick, it means\n * we should re upload the data.\n */\n public uniformDirtyGroups: Record<string, any>;\n\n /**\n * Makes a new Pixi program.\n * @param program - webgl program\n * @param uniformData - uniforms\n */\n constructor(program: WebGLProgram, uniformData: {[key: string]: IGLUniformData})\n {\n this.program = program;\n this.uniformData = uniformData;\n this.uniformGroups = {};\n this.uniformDirtyGroups = {};\n this.uniformBlockBindings = {};\n }\n\n /** Destroys this program. */\n public destroy(): void\n {\n this.uniformData = null;\n this.uniformGroups = null;\n this.uniformDirtyGroups = null;\n this.uniformBlockBindings = null;\n this.program = null;\n }\n}\n","function booleanArray(size: number): Array<boolean>\n{\n const array = new Array(size);\n\n for (let i = 0; i < array.length; i++)\n {\n array[i] = false;\n }\n\n return array;\n}\n\n/**\n * @param {string} type - Type of value\n * @param {number} size\n * @private\n */\nexport function defaultValue(\n type: string,\n size: number\n): number | Float32Array | Int32Array | Uint32Array | boolean | boolean[]\n{\n switch (type)\n {\n case 'float':\n return 0;\n\n case 'vec2':\n return new Float32Array(2 * size);\n\n case 'vec3':\n return new Float32Array(3 * size);\n\n case 'vec4':\n return new Float32Array(4 * size);\n\n case 'int':\n case 'uint':\n case 'sampler2D':\n case 'sampler2DArray':\n case 'sampler3D':\n return 0;\n\n case 'ivec2':\n return new Int32Array(2 * size);\n\n case 'ivec3':\n return new Int32Array(3 * size);\n\n case 'ivec4':\n return new Int32Array(4 * size);\n\n case 'uvec2':\n return new Uint32Array(2 * size);\n\n case 'uvec3':\n return new Uint32Array(3 * size);\n\n case 'uvec4':\n return new Uint32Array(4 * size);\n\n case 'bool':\n return false;\n\n case 'bvec2':\n\n return booleanArray(2 * size);\n\n case 'bvec3':\n return booleanArray(3 * size);\n\n case 'bvec4':\n return booleanArray(4 * size);\n\n case 'mat2':\n return new Float32Array([1, 0,\n 0, 1]);\n\n case 'mat3':\n return new Float32Array([1, 0, 0,\n 0, 1, 0,\n 0, 0, 1]);\n\n case 'mat4':\n return new Float32Array([1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1]);\n }\n\n return null;\n}\n","/**\n * @private\n * @param {WebGLRenderingContext} gl - The current WebGL context {WebGLProgram}\n * @param {number} type - the type, can be either VERTEX_SHADER or FRAGMENT_SHADER\n * @param {string} src - The vertex shader source as an array of strings.\n * @returns {WebGLShader} the shader\n */\nexport function compileShader(gl: WebGLRenderingContextBase, type: number, src: string): WebGLShader\n{\n const shader = gl.createShader(type);\n\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n\n return shader;\n}\n","import type { UboElement, UboLayout, UniformData } from '../../../shared/shader/types';\n\n/** @internal */\nexport const WGSL_TO_STD40_SIZE: Record<string, number> = {\n f32: 4,\n i32: 4,\n 'vec2<f32>': 8,\n 'vec3<f32>': 12,\n 'vec4<f32>': 16,\n\n 'vec2<i32>': 8,\n 'vec3<i32>': 12,\n 'vec4<i32>': 16,\n\n u32: 4,\n 'vec2<u32>': 8,\n 'vec3<u32>': 12,\n 'vec4<u32>': 16,\n\n 'mat2x2<f32>': 16 * 2,\n 'mat3x3<f32>': 16 * 3,\n 'mat4x4<f32>': 16 * 4,\n\n // TODO - not essential for now but support these in the future\n // int: 4,\n // ivec2: 8,\n // ivec3: 12,\n // ivec4: 16,\n\n // uint: 4,\n // uvec2: 8,\n // uvec3: 12,\n // uvec4: 16,\n\n // bool: 4,\n // bvec2: 8,\n // bvec3: 12,\n // bvec4: 16,\n\n // mat2: 16 * 2,\n // mat3: 16 * 3,\n // mat4: 16 * 4,\n};\n\n/**\n * @param uniformData\n * @internal\n */\nexport function createUboElementsSTD40(uniformData: UniformData[]): UboLayout\n{\n const uboElements: UboElement[] = uniformData.map((data: UniformData) =>\n ({\n data,\n offset: 0,\n size: 0,\n }));\n\n const chunkSize = 16;\n\n let size = 0;\n let offset = 0;\n\n for (let i = 0; i < uboElements.length; i++)\n {\n const uboElement = uboElements[i];\n\n size = WGSL_TO_STD40_SIZE[uboElement.data.type];\n\n if (!size)\n {\n throw new Error(`Unknown type ${uboElement.data.type}`);\n }\n\n if (uboElement.data.size > 1)\n {\n size = Math.max(size, chunkSize) * uboElement.data.size;\n }\n\n const boundary = size === 12 ? 16 : size;\n\n uboElement.size = size;\n\n const curOffset = offset % chunkSize;\n\n if (curOffset > 0 && chunkSize - curOffset < boundary)\n {\n offset += (chunkSize - curOffset) % 16;\n }\n else\n {\n offset += (size - (curOffset % size)) % size;\n }\n\n uboElement.offset = offset;\n offset += size;\n }\n\n offset = Math.ceil(offset / 16) * 16;\n\n return { uboElements, size: offset };\n}\n\n","import type { GlRenderingContext } from '../../context/GlRenderingContext';\n\n/**\n * Returns a lookup table that maps each type-format pair to a compatible internal format.\n * @function mapTypeAndFormatToInternalFormat\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @returns Lookup table.\n */\nexport function mapFormatToGlType(gl: GlRenderingContext): Record<string, number>\n{\n return {\n // 8-bit formats\n r8unorm: gl.UNSIGNED_BYTE,\n r8snorm: gl.BYTE,\n r8uint: gl.UNSIGNED_BYTE,\n r8sint: gl.BYTE,\n\n // 16-bit formats\n r16uint: gl.UNSIGNED_SHORT,\n r16sint: gl.SHORT,\n r16float: gl.HALF_FLOAT,\n rg8unorm: gl.UNSIGNED_BYTE,\n rg8snorm: gl.BYTE,\n rg8uint: gl.UNSIGNED_BYTE,\n rg8sint: gl.BYTE,\n\n // 32-bit formats\n r32uint: gl.UNSIGNED_INT,\n r32sint: gl.INT,\n r32float: gl.FLOAT,\n rg16uint: gl.UNSIGNED_SHORT,\n rg16sint: gl.SHORT,\n rg16float: gl.HALF_FLOAT,\n rgba8unorm: gl.UNSIGNED_BYTE,\n 'rgba8unorm-srgb': gl.UNSIGNED_BYTE,\n\n // Packed 32-bit formats\n rgba8snorm: gl.BYTE,\n rgba8uint: gl.UNSIGNED_BYTE,\n rgba8sint: gl.BYTE,\n bgra8unorm: gl.UNSIGNED_BYTE,\n 'bgra8unorm-srgb': gl.UNSIGNED_BYTE,\n rgb9e5ufloat: gl.UNSIGNED_INT_5_9_9_9_REV,\n rgb10a2unorm: gl.UNSIGNED_INT_2_10_10_10_REV,\n rg11b10ufloat: gl.UNSIGNED_INT_10F_11F_11F_REV,\n\n // 64-bit formats\n rg32uint: gl.UNSIGNED_INT,\n rg32sint: gl.INT,\n rg32float: gl.FLOAT,\n rgba16uint: gl.UNSIGNED_SHORT,\n rgba16sint: gl.SHORT,\n rgba16float: gl.HALF_FLOAT,\n\n // 128-bit formats\n rgba32uint: gl.UNSIGNED_INT,\n rgba32sint: gl.INT,\n rgba32float: gl.FLOAT,\n\n // Depth/stencil formats\n stencil8: gl.UNSIGNED_BYTE,\n depth16unorm: gl.UNSIGNED_SHORT,\n depth24plus: gl.UNSIGNED_INT,\n 'depth24plus-stencil8': gl.UNSIGNED_INT_24_8,\n depth32float: gl.FLOAT,\n 'depth32float-stencil8': gl.FLOAT_32_UNSIGNED_INT_24_8_REV,\n\n };\n}\n","import type { CanvasSource } from '../../../shared/texture/sources/CanvasSource';\nimport type { ImageSource } from '../../../shared/texture/sources/ImageSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\n/** @internal */\nexport const glUploadImageResource = {\n\n id: 'image',\n\n upload(\n source: ImageSource | CanvasSource,\n glTexture: GlTexture,\n gl: GlRenderingContext,\n webGLVersion: number,\n targetOverride?: number,\n forceAllocation = false\n )\n {\n const target = targetOverride || glTexture.target;\n\n const textureWidth = source.pixelWidth;\n const textureHeight = source.pixelHeight;\n\n const resourceWidth = source.resourceWidth;\n const resourceHeight = source.resourceHeight;\n\n const isWebGL2 = webGLVersion === 2;\n const needsAllocation = forceAllocation || glTexture.width !== textureWidth || glTexture.height !== textureHeight;\n const resourceFitsTexture = resourceWidth >= textureWidth && resourceHeight >= textureHeight;\n const resource = source.resource as TexImageSource;\n\n const uploadFunction = isWebGL2 ? uploadImageWebGL2 : uploadImageWebGL1;\n\n uploadFunction(\n gl,\n target,\n glTexture,\n textureWidth,\n textureHeight,\n resourceWidth,\n resourceHeight,\n resource,\n needsAllocation,\n resourceFitsTexture\n );\n\n glTexture.width = textureWidth;\n glTexture.height = textureHeight;\n }\n} as GLTextureUploader;\n\nfunction uploadImageWebGL2(\n gl: GlRenderingContext,\n target: number,\n glTexture: GlTexture,\n textureWidth: number,\n textureHeight: number,\n resourceWidth: number,\n resourceHeight: number,\n resource: TexImageSource,\n needsAllocation: boolean,\n resourceFitsTexture: boolean\n): void\n{\n if (!resourceFitsTexture)\n {\n // Allocate the full texture and upload the (smaller) resource into it.\n if (needsAllocation)\n {\n gl.texImage2D(\n target,\n 0,\n glTexture.internalFormat,\n textureWidth,\n textureHeight,\n 0,\n glTexture.format,\n glTexture.type,\n null\n );\n }\n\n gl.texSubImage2D(\n target,\n 0,\n 0,\n 0,\n resourceWidth,\n resourceHeight,\n glTexture.format,\n glTexture.type,\n resource\n );\n\n return;\n }\n\n if (!needsAllocation)\n {\n // Texture already allocated at the correct size; update in-place.\n gl.texSubImage2D(\n target,\n 0,\n 0,\n 0,\n glTexture.format,\n glTexture.type,\n resource\n );\n\n return;\n }\n\n // WebGL2 supports the sized texImage2D overload with TexImageSource.\n gl.texImage2D(\n target,\n 0,\n glTexture.internalFormat,\n textureWidth,\n textureHeight,\n 0,\n glTexture.format,\n glTexture.type,\n resource\n );\n}\n\nfunction uploadImageWebGL1(\n gl: GlRenderingContext,\n target: number,\n glTexture: GlTexture,\n textureWidth: number,\n textureHeight: number,\n _resourceWidth: number,\n _resourceHeight: number,\n resource: TexImageSource,\n needsAllocation: boolean,\n resourceFitsTexture: boolean\n): void\n{\n if (!resourceFitsTexture)\n {\n // Allocate the full texture and upload the (smaller) resource into it.\n if (needsAllocation)\n {\n gl.texImage2D(\n target,\n 0,\n glTexture.internalFormat,\n textureWidth,\n textureHeight,\n 0,\n glTexture.format,\n glTexture.type,\n null\n );\n }\n\n gl.texSubImage2D(\n target,\n 0,\n 0,\n 0,\n glTexture.format,\n glTexture.type,\n resource\n );\n\n return;\n }\n\n if (!needsAllocation)\n {\n // Texture already allocated at the correct size; update in-place.\n gl.texSubImage2D(\n target,\n 0,\n 0,\n 0,\n glTexture.format,\n glTexture.type,\n resource\n );\n\n return;\n }\n\n // WebGL1 uses the unsized TexImageSource overload.\n gl.texImage2D(\n target,\n 0,\n glTexture.internalFormat,\n glTexture.format,\n glTexture.type,\n resource\n );\n}\n","// cu = Cached value's uniform data field\n// cv = Cached value\n// v = value to upload\n// ud = uniformData\n// uv = uniformValue\n\nimport type { UNIFORM_TYPES } from '../../../shared/shader/types';\n\n/** @internal */\nexport const UNIFORM_TO_SINGLE_SETTERS: Record<UNIFORM_TYPES | string, string> = {\n f32: `if (cv !== v) {\n cu.value = v;\n gl.uniform1f(location, v);\n }`,\n 'vec2<f32>': `if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1]);\n }`,\n 'vec3<f32>': `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3f(location, v[0], v[1], v[2]);\n }`,\n 'vec4<f32>': `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }`,\n i32: `if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }`,\n 'vec2<i32>': `if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }`,\n 'vec3<i32>': `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }`,\n 'vec4<i32>': `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }`,\n u32: `if (cv !== v) {\n cu.value = v;\n gl.uniform1ui(location, v);\n }`,\n 'vec2<u32>': `if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2ui(location, v[0], v[1]);\n }`,\n 'vec3<u32>': `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }`,\n 'vec4<u32>': `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }`,\n bool: `if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }`,\n 'vec2<bool>': `if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }`,\n 'vec3<bool>': `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }`,\n 'vec4<bool>': `if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }`,\n 'mat2x2<f32>': `gl.uniformMatrix2fv(location, false, v);`,\n 'mat3x3<f32>': `gl.uniformMatrix3fv(location, false, v);`,\n 'mat4x4<f32>': `gl.uniformMatrix4fv(location, false, v);`,\n};\n\n/** @internal */\nexport const UNIFORM_TO_ARRAY_SETTERS: Record<UNIFORM_TYPES | string, string> = {\n f32: `gl.uniform1fv(location, v);`,\n 'vec2<f32>': `gl.uniform2fv(location, v);`,\n 'vec3<f32>': `gl.uniform3fv(location, v);`,\n 'vec4<f32>': `gl.uniform4fv(location, v);`,\n 'mat2x2<f32>': `gl.uniformMatrix2fv(location, false, v);`,\n 'mat3x3<f32>': `gl.uniformMatrix3fv(location, false, v);`,\n 'mat4x4<f32>': `gl.uniformMatrix4fv(location, false, v);`,\n i32: `gl.uniform1iv(location, v);`,\n 'vec2<i32>': `gl.uniform2iv(location, v);`,\n 'vec3<i32>': `gl.uniform3iv(location, v);`,\n 'vec4<i32>': `gl.uniform4iv(location, v);`,\n u32: `gl.uniform1iv(location, v);`,\n 'vec2<u32>': `gl.uniform2iv(location, v);`,\n 'vec3<u32>': `gl.uniform3iv(location, v);`,\n 'vec4<u32>': `gl.uniform4iv(location, v);`,\n bool: `gl.uniform1iv(location, v);`,\n 'vec2<bool>': `gl.uniform2iv(location, v);`,\n 'vec3<bool>': `gl.uniform3iv(location, v);`,\n 'vec4<bool>': `gl.uniform4iv(location, v);`,\n};\n","/**\n * Various GL texture/resources formats.\n * @category rendering\n * @advanced\n */\nexport enum GL_FORMATS\n{\n RGBA = 6408,\n RGB = 6407,\n RG = 33319,\n RED = 6403,\n RGBA_INTEGER = 36249,\n RGB_INTEGER = 36248,\n RG_INTEGER = 33320,\n RED_INTEGER = 36244,\n ALPHA = 6406,\n LUMINANCE = 6409,\n LUMINANCE_ALPHA = 6410,\n DEPTH_COMPONENT = 6402,\n DEPTH_STENCIL = 34041,\n}\n\n/**\n * Various GL target types.\n * @category rendering\n * @advanced\n */\nexport enum GL_TARGETS\n{\n TEXTURE_2D = 3553,\n TEXTURE_CUBE_MAP = 34067,\n TEXTURE_2D_ARRAY = 35866,\n TEXTURE_3D = 32879,\n TEXTURE_CUBE_MAP_POSITIVE_X = 34069,\n TEXTURE_CUBE_MAP_NEGATIVE_X = 34070,\n TEXTURE_CUBE_MAP_POSITIVE_Y = 34071,\n TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072,\n TEXTURE_CUBE_MAP_POSITIVE_Z = 34073,\n TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074,\n}\n\n/**\n * The wrap modes that are supported by pixi.\n *\n * The {@link WRAP_MODE} wrap mode affects the default wrapping mode of future operations.\n * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.\n * If the texture is non power of two then clamp will be used regardless as WebGL can\n * only use REPEAT if the texture is po2.\n *\n * This property only affects WebGL.\n * @category rendering\n * @advanced\n */\nexport enum GL_WRAP_MODES\n{\n /**\n * The textures uvs are clamped\n * @default 33071\n */\n CLAMP = 33071,\n /**\n * The texture uvs tile and repeat\n * @default 10497\n */\n REPEAT = 10497,\n /**\n * The texture uvs tile and repeat with mirroring\n * @default 33648\n */\n MIRRORED_REPEAT = 33648,\n}\n\n/** @internal */\nexport enum GL_TYPES\n{\n /**\n * 8 bits per channel for gl.RGBA\n * @default 5121\n */\n UNSIGNED_BYTE = 5121,\n /** @default 5123 */\n UNSIGNED_SHORT = 5123,\n /**\n * 5 red bits, 6 green bits, 5 blue bits.\n * @default 33635\n */\n UNSIGNED_SHORT_5_6_5 = 33635,\n /**\n * 4 red bits, 4 green bits, 4 blue bits, 4 alpha bits.\n * @default 32819\n */\n UNSIGNED_SHORT_4_4_4_4 = 32819,\n /**\n * 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit.\n * @default 32820\n */\n UNSIGNED_SHORT_5_5_5_1 = 32820,\n /** @default 5125 */\n UNSIGNED_INT = 5125,\n /** @default 35899 */\n UNSIGNED_INT_10F_11F_11F_REV = 35899,\n /** @default 33640 */\n UNSIGNED_INT_2_10_10_10_REV = 33640,\n /** @default 34042 */\n UNSIGNED_INT_24_8 = 34042,\n /** @default 35902 */\n UNSIGNED_INT_5_9_9_9_REV = 35902,\n /** @default 5120 */\n BYTE = 5120,\n /** @default 5122 */\n SHORT = 5122,\n /** @default 5124 */\n INT = 5124,\n /** @default 5126 */\n FLOAT = 5126,\n /** @default 36269 */\n FLOAT_32_UNSIGNED_INT_24_8_REV = 36269,\n /** @default 36193 */\n HALF_FLOAT = 36193,\n}\n\n","import type { TextureSource } from '../../../shared/texture/sources/TextureSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\n\n/**\n * Builds a lookup table that maps Pixi's texture view dimension to the appropriate WebGL texture target.\n *\n * This is about how the texture is *bound/viewed* in shaders, not about how pixel data is uploaded.\n * @param gl - WebGL context.\n * @internal\n */\nexport function mapViewDimensionToGlTarget(\n gl: GlRenderingContext,\n): Record<TextureSource['viewDimension'], number | null>\n{\n return {\n '2d': gl.TEXTURE_2D,\n cube: gl.TEXTURE_CUBE_MAP,\n '1d': null,\n // WebGL2 only\n '3d': (gl as any)?.TEXTURE_3D || null,\n '2d-array': (gl as any)?.TEXTURE_2D_ARRAY || null,\n 'cube-array': (gl as any)?.TEXTURE_CUBE_MAP_ARRAY || null,\n };\n}\n\n","/**\n * will log a shader error highlighting the lines with the error\n * also will add numbers along the side.\n * @param gl - the WebGLContext\n * @param shader - the shader to log errors for\n */\nfunction logPrettyShaderError(gl: WebGLRenderingContext, shader: WebGLShader): void\n{\n // getShaderSource returns null on GL errors (e.g. lost context); see\n // https://registry.khronos.org/webgl/specs/latest/1.0/#5.14.9\n const rawSource = gl.getShaderSource(shader);\n\n if (rawSource === null)\n {\n console.error('PixiJS Error: Could not retrieve shader source (WebGL context may be lost).');\n\n return;\n }\n\n const shaderSrc = rawSource\n .split('\\n')\n .map((line, index) => `${index}: ${line}`);\n\n const shaderLog = gl.getShaderInfoLog(shader) ?? '';\n const splitShader = shaderLog.split('\\n');\n\n const dedupe: Record<number, boolean> = {};\n\n const lineNumbers = splitShader.map((line) => parseFloat(line.replace(/^ERROR\\: 0\\:([\\d]+)\\:.*$/, '$1')))\n .filter((n) =>\n {\n if (n && !dedupe[n])\n {\n dedupe[n] = true;\n\n return true;\n }\n\n return false;\n });\n\n const logArgs = [''];\n\n lineNumbers.forEach((number) =>\n {\n shaderSrc[number - 1] = `%c${shaderSrc[number - 1]}%c`;\n logArgs.push('background: #FF0000; color:#FFFFFF; font-size: 10px', 'font-size: 10px');\n });\n\n const fragmentSourceToLog = shaderSrc\n .join('\\n');\n\n logArgs[0] = fragmentSourceToLog;\n\n console.error(shaderLog);\n\n // eslint-disable-next-line no-console\n console.groupCollapsed('click to view full shader code');\n console.warn(...logArgs);\n // eslint-disable-next-line no-console\n console.groupEnd();\n}\n\n/**\n *\n * logs out any program errors\n * @param gl - The current WebGL context\n * @param program - the WebGL program to display errors for\n * @param vertexShader - the fragment WebGL shader program\n * @param fragmentShader - the vertex WebGL shader program\n * @private\n */\nexport function logProgramError(\n gl: WebGLRenderingContext,\n program: WebGLProgram,\n vertexShader: WebGLShader,\n fragmentShader: WebGLShader\n): void\n{\n // if linking fails, then log and cleanup\n if (!gl.getProgramParameter(program, gl.LINK_STATUS))\n {\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS))\n {\n logPrettyShaderError(gl, vertexShader);\n }\n\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS))\n {\n logPrettyShaderError(gl, fragmentShader);\n }\n\n console.error('PixiJS Error: Could not initialize shader.');\n\n // if there is a program info log, log it\n if (gl.getProgramInfoLog(program) !== '')\n {\n console.warn('PixiJS Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));\n }\n }\n}\n","/**\n * Constants for various buffer types in Pixi\n * @category rendering\n * @advanced\n */\nexport enum BUFFER_TYPE\n{\n /** buffer type for using as an index buffer */\n ELEMENT_ARRAY_BUFFER = 34963,\n /** buffer type for using attribute data */\n ARRAY_BUFFER = 34962,\n /** the buffer type is for uniform buffer objects */\n UNIFORM_BUFFER = 35345,\n}\n\n","import type { CompressedSource } from '../../../shared/texture/sources/CompressedSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\nconst compressedFormatMap: Record<string, boolean> = {\n 'bc1-rgba-unorm': true,\n 'bc1-rgba-unorm-srgb': true,\n 'bc2-rgba-unorm': true,\n 'bc2-rgba-unorm-srgb': true,\n 'bc3-rgba-unorm': true,\n 'bc3-rgba-unorm-srgb': true,\n 'bc4-r-unorm': true,\n 'bc4-r-snorm': true,\n 'bc5-rg-unorm': true,\n 'bc5-rg-snorm': true,\n 'bc6h-rgb-ufloat': true,\n 'bc6h-rgb-float': true,\n 'bc7-rgba-unorm': true,\n 'bc7-rgba-unorm-srgb': true,\n\n // ETC2 compressed formats usable if \"texture-compression-etc2\" is both\n // supported by the device/user agent and enabled in requestDevice.\n 'etc2-rgb8unorm': true,\n 'etc2-rgb8unorm-srgb': true,\n 'etc2-rgb8a1unorm': true,\n 'etc2-rgb8a1unorm-srgb': true,\n 'etc2-rgba8unorm': true,\n 'etc2-rgba8unorm-srgb': true,\n 'eac-r11unorm': true,\n 'eac-r11snorm': true,\n 'eac-rg11unorm': true,\n 'eac-rg11snorm': true,\n\n // ASTC compressed formats usable if \"texture-compression-astc\" is both\n // supported by the device/user agent and enabled in requestDevice.\n 'astc-4x4-unorm': true,\n 'astc-4x4-unorm-srgb': true,\n 'astc-5x4-unorm': true,\n 'astc-5x4-unorm-srgb': true,\n 'astc-5x5-unorm': true,\n 'astc-5x5-unorm-srgb': true,\n 'astc-6x5-unorm': true,\n 'astc-6x5-unorm-srgb': true,\n 'astc-6x6-unorm': true,\n 'astc-6x6-unorm-srgb': true,\n 'astc-8x5-unorm': true,\n 'astc-8x5-unorm-srgb': true,\n 'astc-8x6-unorm': true,\n 'astc-8x6-unorm-srgb': true,\n 'astc-8x8-unorm': true,\n 'astc-8x8-unorm-srgb': true,\n 'astc-10x5-unorm': true,\n 'astc-10x5-unorm-srgb': true,\n 'astc-10x6-unorm': true,\n 'astc-10x6-unorm-srgb': true,\n 'astc-10x8-unorm': true,\n 'astc-10x8-unorm-srgb': true,\n 'astc-10x10-unorm': true,\n 'astc-10x10-unorm-srgb': true,\n 'astc-12x10-unorm': true,\n 'astc-12x10-unorm-srgb': true,\n 'astc-12x12-unorm': true,\n 'astc-12x12-unorm-srgb': true,\n};\n\n/** @internal */\nexport const glUploadCompressedTextureResource = {\n\n id: 'compressed',\n\n upload(\n source: CompressedSource,\n glTexture: GlTexture,\n gl: GlRenderingContext,\n _webGLVersion: number,\n targetOverride?: number,\n _forceAllocation?: boolean\n )\n {\n const target = targetOverride ?? glTexture.target;\n\n gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);\n\n let mipWidth = source.pixelWidth;\n let mipHeight = source.pixelHeight;\n\n const compressed = !!compressedFormatMap[source.format];\n\n for (let i = 0; i < source.resource.length; i++)\n {\n const levelBuffer = source.resource[i];\n\n if (compressed)\n {\n gl.compressedTexImage2D(\n target, i, glTexture.internalFormat,\n mipWidth, mipHeight, 0,\n levelBuffer\n );\n }\n else\n {\n gl.texImage2D(\n target, i, glTexture.internalFormat,\n mipWidth, mipHeight, 0,\n glTexture.format, glTexture.type,\n levelBuffer);\n }\n\n mipWidth = Math.max(mipWidth >> 1, 1);\n mipHeight = Math.max(mipHeight >> 1, 1);\n }\n }\n} as GLTextureUploader;\n\n","import { DOMAdapter } from '../../../../../environment/adapter';\n\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { WebGLExtensions } from '../../context/WebGLExtensions';\n\n/**\n * Returns a lookup table that maps each type-format pair to a compatible internal format.\n * @function mapTypeAndFormatToInternalFormat\n * @private\n * @param gl - The rendering context.\n * @param extensions - The WebGL extensions.\n * @returns Lookup table.\n */\nexport function mapFormatToGlInternalFormat(\n gl: GlRenderingContext,\n extensions: WebGLExtensions,\n): Record<string, number>\n{\n let srgb = {};\n let bgra8unorm: number = gl.RGBA;\n\n if (!(gl instanceof DOMAdapter.get().getWebGLRenderingContext()))\n {\n srgb = {\n 'rgba8unorm-srgb': gl.SRGB8_ALPHA8,\n 'bgra8unorm-srgb': gl.SRGB8_ALPHA8,\n };\n\n bgra8unorm = gl.RGBA8;\n }\n else if (extensions.srgb)\n {\n srgb = {\n 'rgba8unorm-srgb': extensions.srgb.SRGB8_ALPHA8_EXT,\n 'bgra8unorm-srgb': extensions.srgb.SRGB8_ALPHA8_EXT,\n };\n }\n\n return {\n // 8-bit formats\n r8unorm: gl.R8,\n r8snorm: gl.R8_SNORM,\n r8uint: gl.R8UI,\n r8sint: gl.R8I,\n\n // 16-bit formats\n r16uint: gl.R16UI,\n r16sint: gl.R16I,\n r16float: gl.R16F,\n rg8unorm: gl.RG8,\n rg8snorm: gl.RG8_SNORM,\n rg8uint: gl.RG8UI,\n rg8sint: gl.RG8I,\n\n // 32-bit formats\n r32uint: gl.R32UI,\n r32sint: gl.R32I,\n r32float: gl.R32F,\n rg16uint: gl.RG16UI,\n rg16sint: gl.RG16I,\n rg16float: gl.RG16F,\n rgba8unorm: gl.RGBA,\n\n ...srgb,\n\n // Packed 32-bit formats\n rgba8snorm: gl.RGBA8_SNORM,\n rgba8uint: gl.RGBA8UI,\n rgba8sint: gl.RGBA8I,\n bgra8unorm,\n rgb9e5ufloat: gl.RGB9_E5,\n rgb10a2unorm: gl.RGB10_A2,\n rg11b10ufloat: gl.R11F_G11F_B10F,\n\n // 64-bit formats\n rg32uint: gl.RG32UI,\n rg32sint: gl.RG32I,\n rg32float: gl.RG32F,\n rgba16uint: gl.RGBA16UI,\n rgba16sint: gl.RGBA16I,\n rgba16float: gl.RGBA16F,\n\n // 128-bit formats\n rgba32uint: gl.RGBA32UI,\n rgba32sint: gl.RGBA32I,\n rgba32float: gl.RGBA32F,\n\n // Depth/stencil formats\n stencil8: gl.STENCIL_INDEX8,\n depth16unorm: gl.DEPTH_COMPONENT16,\n depth24plus: gl.DEPTH_COMPONENT24,\n 'depth24plus-stencil8': gl.DEPTH24_STENCIL8,\n depth32float: gl.DEPTH_COMPONENT32F,\n 'depth32float-stencil8': gl.DEPTH32F_STENCIL8,\n\n // Compressed formats\n ...extensions.s3tc ? {\n 'bc1-rgba-unorm': extensions.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n 'bc2-rgba-unorm': extensions.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n 'bc3-rgba-unorm': extensions.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n } : {},\n ...extensions.s3tc_sRGB ? {\n 'bc1-rgba-unorm-srgb': extensions.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,\n 'bc2-rgba-unorm-srgb': extensions.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,\n 'bc3-rgba-unorm-srgb': extensions.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,\n } : {},\n ...extensions.rgtc ? {\n 'bc4-r-unorm': extensions.rgtc.COMPRESSED_RED_RGTC1_EXT,\n 'bc4-r-snorm': extensions.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,\n 'bc5-rg-unorm': extensions.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,\n 'bc5-rg-snorm': extensions.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,\n } : {},\n ...extensions.bptc ? {\n 'bc6h-rgb-float': extensions.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,\n 'bc6h-rgb-ufloat': extensions.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,\n 'bc7-rgba-unorm': extensions.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,\n 'bc7-rgba-unorm-srgb': extensions.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,\n } : {},\n ...extensions.etc ? {\n 'etc2-rgb8unorm': extensions.etc.COMPRESSED_RGB8_ETC2,\n 'etc2-rgb8unorm-srgb': extensions.etc.COMPRESSED_SRGB8_ETC2,\n 'etc2-rgb8a1unorm': extensions.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,\n 'etc2-rgb8a1unorm-srgb': extensions.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,\n 'etc2-rgba8unorm': extensions.etc.COMPRESSED_RGBA8_ETC2_EAC,\n 'etc2-rgba8unorm-srgb': extensions.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,\n 'eac-r11unorm': extensions.etc.COMPRESSED_R11_EAC,\n // 'eac-r11snorm'\n 'eac-rg11unorm': extensions.etc.COMPRESSED_SIGNED_RG11_EAC,\n // 'eac-rg11snorm'\n } : {},\n ...extensions.astc ? {\n 'astc-4x4-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,\n 'astc-4x4-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,\n 'astc-5x4-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,\n 'astc-5x4-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,\n 'astc-5x5-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,\n 'astc-5x5-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,\n 'astc-6x5-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,\n 'astc-6x5-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,\n 'astc-6x6-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,\n 'astc-6x6-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,\n 'astc-8x5-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,\n 'astc-8x5-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,\n 'astc-8x6-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,\n 'astc-8x6-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,\n 'astc-8x8-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,\n 'astc-8x8-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,\n 'astc-10x5-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,\n 'astc-10x5-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,\n 'astc-10x6-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,\n 'astc-10x6-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,\n 'astc-10x8-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,\n 'astc-10x8-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,\n 'astc-10x10-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,\n 'astc-10x10-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,\n 'astc-12x10-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,\n 'astc-12x10-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,\n 'astc-12x12-unorm': extensions.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,\n 'astc-12x12-unorm-srgb': extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,\n } : {},\n };\n}\n","import { type GPUData } from '../../../../scene/view/ViewContainer';\n\nimport type { BUFFER_TYPE } from './const';\n\n/** @internal */\nexport class GlBuffer implements GPUData\n{\n public buffer: WebGLBuffer;\n public updateID: number;\n public byteLength: number;\n public type: number;\n public _lastBindBaseLocation: number = -1;\n public _lastBindCallId: number = -1;\n\n constructor(buffer: WebGLBuffer, type: BUFFER_TYPE)\n {\n this.buffer = buffer || null;\n this.updateID = -1;\n this.byteLength = -1;\n this.type = type;\n }\n\n public destroy()\n {\n this.buffer = null;\n this.updateID = -1;\n this.byteLength = -1;\n this.type = -1;\n this._lastBindBaseLocation = -1;\n this._lastBindCallId = -1;\n }\n}\n","import {\n compareModeToGlCompare,\n mipmapScaleModeToGlFilter,\n scaleModeToGlFilter,\n wrapModeToGlAddress\n} from './pixiToGlMaps';\n\nimport type { TextureStyle } from '../../../shared/texture/TextureStyle';\n\n/**\n * @param style\n * @param gl\n * @param mipmaps\n * @param anisotropicExt\n * @param glFunctionName\n * @param firstParam\n * @param forceClamp\n * @param firstCreation\n * @internal\n */\nexport function applyStyleParams(\n style: TextureStyle,\n gl: WebGL2RenderingContext,\n mipmaps: boolean,\n // eslint-disable-next-line camelcase\n anisotropicExt: EXT_texture_filter_anisotropic,\n glFunctionName: 'samplerParameteri' | 'texParameteri',\n firstParam: 3553 | WebGLSampler,\n forceClamp: boolean,\n /** if true we can skip setting certain values if the values is the same as the default gl values */\n firstCreation: boolean\n)\n{\n const castParam = firstParam as 3553;\n\n if (!firstCreation\n || style.addressModeU !== 'repeat'\n || style.addressModeV !== 'repeat'\n || style.addressModeW !== 'repeat'\n )\n {\n // 1. set the wrapping mode\n const wrapModeS = wrapModeToGlAddress[forceClamp ? 'clamp-to-edge' : style.addressModeU];\n const wrapModeT = wrapModeToGlAddress[forceClamp ? 'clamp-to-edge' : style.addressModeV];\n const wrapModeR = wrapModeToGlAddress[forceClamp ? 'clamp-to-edge' : style.addressModeW];\n\n gl[glFunctionName](castParam, gl.TEXTURE_WRAP_S, wrapModeS);\n gl[glFunctionName](castParam, gl.TEXTURE_WRAP_T, wrapModeT);\n\n // does not exist in webGL1\n if (gl.TEXTURE_WRAP_R) gl[glFunctionName](castParam, gl.TEXTURE_WRAP_R, wrapModeR);\n }\n\n if (!firstCreation || style.magFilter !== 'linear')\n {\n // 2. set the filtering mode\n gl[glFunctionName](castParam, gl.TEXTURE_MAG_FILTER, scaleModeToGlFilter[style.magFilter]);\n }\n\n // assuming the currently bound texture is the one we want to set the filter for\n // the only smelly part of this code, WebGPU is much better here :P\n if (mipmaps)\n {\n if (!firstCreation || style.mipmapFilter !== 'linear')\n {\n const glFilterMode = mipmapScaleModeToGlFilter[style.minFilter][style.mipmapFilter];\n\n gl[glFunctionName](castParam, gl.TEXTURE_MIN_FILTER, glFilterMode);\n }\n }\n\n else\n {\n gl[glFunctionName](castParam, gl.TEXTURE_MIN_FILTER, scaleModeToGlFilter[style.minFilter]);\n }\n\n // 3. set the anisotropy\n if (anisotropicExt && style.maxAnisotropy > 1)\n {\n const level = Math.min(style.maxAnisotropy, gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT));\n\n gl[glFunctionName](castParam, anisotropicExt.TEXTURE_MAX_ANISOTROPY_EXT, level);\n }\n\n // 4. set the compare mode\n if (style.compare)\n {\n gl[glFunctionName](castParam, gl.TEXTURE_COMPARE_FUNC, compareModeToGlCompare[style.compare]);\n gl[glFunctionName](castParam, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\n }\n else if (!firstCreation)\n {\n gl[glFunctionName](castParam, gl.TEXTURE_COMPARE_MODE, gl.NONE);\n }\n}\n","import { DOMAdapter } from '../../../../environment/adapter';\n\nimport type { BLEND_MODES } from '../../shared/state/const';\nimport type { GlRenderingContext } from '../context/GlRenderingContext';\n\n/**\n * Maps gl blend combinations to WebGL.\n * @param gl\n * @returns {object} Map of gl blend combinations to WebGL.\n * @internal\n */\nexport function mapWebGLBlendModesToPixi(gl: GlRenderingContext): Record<BLEND_MODES, number[]>\n{\n const blendMap: Partial<Record<BLEND_MODES, number[]>> = {};\n\n // TODO - premultiply alpha would be different.\n // add a boolean for that!\n blendMap.normal = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n blendMap.add = [gl.ONE, gl.ONE];\n blendMap.multiply = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n blendMap.screen = [gl.ONE, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n blendMap.none = [0, 0];\n\n // not-premultiplied blend modes\n blendMap['normal-npm'] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n blendMap['add-npm'] = [gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE];\n blendMap['screen-npm'] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n\n blendMap.erase = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA];\n\n const isWebGl2 = !(gl instanceof DOMAdapter.get().getWebGLRenderingContext());\n\n if (isWebGl2)\n {\n blendMap.min = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.MIN, gl.MIN];\n blendMap.max = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.MAX, gl.MAX];\n }\n else\n {\n const ext = gl.getExtension('EXT_blend_minmax');\n\n if (ext)\n {\n blendMap.min = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, ext.MIN_EXT, ext.MIN_EXT];\n blendMap.max = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, ext.MAX_EXT, ext.MAX_EXT];\n }\n }\n\n // TODO - implement if requested!\n // composite operations\n // array[BLEND_MODES.SRC_IN] = [gl.DST_ALPHA, gl.ZERO];\n // array[BLEND_MODES.SRC_OUT] = [gl.ONE_MINUS_DST_ALPHA, gl.ZERO];\n // array[BLEND_MODES.SRC_ATOP] = [gl.DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA];\n // array[BLEND_MODES.DST_OVER] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE];\n // array[BLEND_MODES.DST_IN] = [gl.ZERO, gl.SRC_ALPHA];\n // array[BLEND_MODES.DST_OUT] = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA];\n // array[BLEND_MODES.DST_ATOP] = [gl.ONE_MINUS_DST_ALPHA, gl.SRC_ALPHA];\n // array[BLEND_MODES.XOR] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA];\n // SUBTRACT from flash\n // array[BLEND_MODES.SUBTRACT] = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD];\n\n return blendMap as Record<BLEND_MODES, number[]>;\n}\n","import { GL_TARGETS } from '../const';\n\nimport type { CubeTextureSource } from '../../../shared/texture/sources/CubeTextureSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\nconst FACE_ORDER: (keyof CubeTextureSource['faces'])[] = ['right', 'left', 'top', 'bottom', 'front', 'back'];\n\n/**\n * Creates a cube uploader that delegates to the given uploader registry.\n * This keeps the uploader map owned by the texture system (better discoverability),\n * while allowing cube uploads to reuse the same 2D upload implementations.\n * @param uploaders - Uploader registry keyed by `uploadMethodId` (must include `image`).\n * @internal\n */\nexport function createGlUploadCubeTextureResource(\n uploaders: Record<string, GLTextureUploader> & { image: GLTextureUploader }\n): GLTextureUploader\n{\n return {\n id: 'cube',\n upload(source: CubeTextureSource, glTexture: GlTexture, gl: GlRenderingContext, webGLVersion: number)\n {\n const faces = source.faces;\n\n // Upload each face by delegating to the standard 2D uploaders with a face-target override.\n for (let faceIndex = 0; faceIndex < FACE_ORDER.length; faceIndex++)\n {\n const key = FACE_ORDER[faceIndex];\n const face = faces[key];\n\n // Skip empty faces (e.g. when using Texture.EMPTY as a placeholder).\n if (!face.resource) continue;\n\n const uploader = uploaders[face.uploadMethodId] || uploaders.image;\n\n // Each cube face target must be initialized (texImage2D) at least once before using texSubImage2D.\n // Tell 2D uploaders to force allocation for the first upload of each face.\n uploader.upload(\n face,\n glTexture,\n gl,\n webGLVersion,\n // Use the face target for the current face. cube faces ids go up 1 so\n // GL_TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + i addresses the i'th face target.\n GL_TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex,\n // Force allocation for the first upload of each face.\n (glTexture._layerInitMask & (1 << faceIndex)) === 0\n );\n\n glTexture._layerInitMask |= (1 << faceIndex);\n }\n\n // Track size for GC / re-upload decisions.\n glTexture.width = source.pixelWidth;\n glTexture.height = source.pixelHeight;\n }\n };\n}\n","import { WGSL_TO_STD40_SIZE } from './createUboElementsSTD40';\n\nimport type { UboElement } from '../../../shared/shader/types';\n\n/**\n * This generates a function that will sync an array to the uniform buffer\n * following the std140 layout\n * @param uboElement - the element to generate the array sync for\n * @param offsetToAdd - the offset to append at the start of the code\n * @returns - the generated code\n * @internal\n */\nexport function generateArraySyncSTD40(uboElement: UboElement, offsetToAdd: number): string\n{\n const rowSize = Math.max(WGSL_TO_STD40_SIZE[uboElement.data.type] / 16, 1);\n const elementSize = (uboElement.data.value as Array<number>).length / uboElement.data.size;// size / rowSize;\n\n const remainder = (4 - (elementSize % 4)) % 4;\n const data = uboElement.data.type.indexOf('i32') >= 0 ? 'dataInt32' : 'data';\n\n return `\n v = uv.${uboElement.data.name};\n offset += ${offsetToAdd};\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ${uboElement.data.size * rowSize}; i++)\n {\n for(var j = 0; j < ${elementSize}; j++)\n {\n ${data}[arrayOffset++] = v[t++];\n }\n ${remainder !== 0 ? `arrayOffset += ${remainder};` : ''}\n }\n `;\n}\n","import { getAttributeInfoFromFormat } from '../../../shared/geometry/utils/getAttributeInfoFromFormat';\nimport { mapGlToVertexFormat } from './mapType';\n\nimport type { Attribute } from '../../../shared/geometry/Geometry';\n\n/**\n * This interface represents the extracted attribute data from a WebGL program.\n * It extends the `Attribute` interface but omits the `buffer` property.\n * It includes an optional `location` property that indicates where the shader location is for this attribute.\n * @category rendering\n * @advanced\n */\nexport interface ExtractedAttributeData extends Omit<Attribute, 'buffer'>\n{\n /** set where the shader location is for this attribute */\n location?: number;\n}\n\n/**\n * returns the attribute data from the program\n * @private\n * @param {WebGLProgram} [program] - the WebGL program\n * @param {WebGLRenderingContext} [gl] - the WebGL context\n * @param sortAttributes\n * @returns {object} the attribute data for this program\n */\nexport function extractAttributesFromGlProgram(\n program: WebGLProgram,\n gl: WebGLRenderingContextBase,\n sortAttributes = false\n): Record<string, ExtractedAttributeData>\n{\n const attributes: {[key: string]: ExtractedAttributeData} = {};\n\n const totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n for (let i = 0; i < totalAttributes; i++)\n {\n const attribData = gl.getActiveAttrib(program, i);\n\n // ignore the default ones!\n if (attribData.name.startsWith('gl_'))\n {\n continue;\n }\n\n const format = mapGlToVertexFormat(gl, attribData.type);\n\n attributes[attribData.name] = {\n location: 0, // set further down..\n format,\n stride: getAttributeInfoFromFormat(format).stride,\n offset: 0,\n instance: false,\n start: 0,\n };\n }\n\n const keys = Object.keys(attributes);\n\n if (sortAttributes)\n {\n keys.sort((a, b) => (a > b) ? 1 : -1); // eslint-disable-line no-confusing-arrow\n\n for (let i = 0; i < keys.length; i++)\n {\n attributes[keys[i]].location = i;\n\n gl.bindAttribLocation(program, i, keys[i]);\n }\n\n gl.linkProgram(program);\n }\n else\n {\n for (let i = 0; i < keys.length; i++)\n {\n attributes[keys[i]].location = gl.getAttribLocation(program, keys[i]);\n }\n }\n\n return attributes;\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\n\nimport type { Topology } from '../shared/geometry/const';\nimport type { Geometry } from '../shared/geometry/Geometry';\nimport type { Shader } from '../shared/shader/Shader';\nimport type { State } from '../shared/state/State';\nimport type { System } from '../shared/system/System';\nimport type { WebGLRenderer } from './WebGLRenderer';\n\n/**\n * The system that handles encoding commands for the WebGL.\n * @category rendering\n * @advanced\n */\nexport class GlEncoderSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'encoder',\n } as const;\n\n public readonly commandFinished = Promise.resolve();\n private readonly _renderer: WebGLRenderer;\n\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n }\n\n public setGeometry(geometry: Geometry, shader?: Shader)\n {\n this._renderer.geometry.bind(geometry, shader.glProgram);\n }\n\n public finishRenderPass()\n {\n // noop\n }\n\n public draw(options: {\n geometry: Geometry,\n shader: Shader,\n state?: State,\n topology?: Topology,\n size?: number,\n start?: number,\n instanceCount?: number\n skipSync?: boolean,\n firstInstance?: number,\n })\n {\n const renderer = this._renderer;\n const { geometry, shader, state, skipSync, topology: type, size, start, instanceCount } = options;\n\n renderer.shader.bind(shader, skipSync);\n\n renderer.geometry.bind(geometry, renderer.shader._activeProgram);\n\n if (state)\n {\n renderer.state.set(state);\n }\n\n renderer.geometry.draw(type, size, start, instanceCount ?? geometry.instanceCount);\n }\n\n public destroy()\n {\n (this._renderer as null) = null;\n }\n}\n","import { defaultValue } from './defaultValue';\nimport { mapType } from './mapType';\n\nimport type { GlUniformData } from '../GlProgram';\n\n/**\n * returns the uniform data from the program\n * @private\n * @param program - the webgl program\n * @param gl - the WebGL context\n * @returns {object} the uniform data for this program\n */\nexport function getUniformData(program: WebGLProgram, gl: WebGLRenderingContextBase): {[key: string]: GlUniformData}\n{\n const uniforms: {[key: string]: GlUniformData} = {};\n\n const totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n for (let i = 0; i < totalUniforms; i++)\n {\n const uniformData = gl.getActiveUniform(program, i);\n const name = uniformData.name.replace(/\\[.*?\\]$/, '');\n\n const isArray = !!(uniformData.name.match(/\\[.*?\\]$/));\n\n const type = mapType(gl, uniformData.type);\n\n uniforms[name] = {\n name,\n index: i,\n type,\n size: uniformData.size,\n isArray,\n value: defaultValue(type, uniformData.size),\n };\n }\n\n return uniforms;\n}\n","import EventEmitter from 'eventemitter3';\nimport { uid } from '../../../../utils/data/uid';\n\nimport type { BindResource } from '../../gpu/shader/BindResource';\nimport type { TextureSource } from './sources/TextureSource';\n\n/**\n * A TextureView allows you to specify exactly how a `TextureSource` should be interpreted by the GPU.\n * This is particularly useful for advanced 3D rendering where you might need to view a depth/stencil\n * texture as purely a 'depth-only' or 'stencil-only' view.\n *\n * It implements `BindResource` so it can be passed directly into a `BindGroup` or `Shader`.\n * @category rendering\n * @advanced\n */\nexport class TextureView extends EventEmitter<{\n change: TextureView;\n destroy: TextureView;\n}> implements BindResource\n{\n /** The type of resource this is (for BindGroup compatibility). */\n public readonly _resourceType = 'textureView';\n /** Unique ID for this resource. */\n public readonly _resourceId: number = uid('resource');\n\n /** The underlying texture source. */\n public readonly source: TextureSource;\n /** The WebGPU texture view descriptor. */\n public readonly viewDescriptor: GPUTextureViewDescriptor;\n\n /**\n * @param source - The texture source to view.\n * @param viewDescriptor - The WebGPU texture view descriptor.\n */\n constructor(source: TextureSource, viewDescriptor: GPUTextureViewDescriptor)\n {\n super();\n\n this.source = source;\n this.viewDescriptor = viewDescriptor;\n\n this._onChange = this._onChange.bind(this);\n this._onDestroy = this._onDestroy.bind(this);\n\n // Proxy the source's change event so BindGroups know when to update\n this.source.on('change', this._onChange);\n this.source.on('destroy', this._onDestroy);\n }\n\n private _onChange(): void\n {\n this.emit('change', this);\n }\n\n private _onDestroy(): void\n {\n this.destroy();\n }\n\n /** Returns whether the underlying source is destroyed. */\n get destroyed(): boolean\n {\n return this.source.destroyed;\n }\n\n /** Destroys the view and cleans up event listeners. */\n public destroy(): void\n {\n if (this.source)\n {\n this.source.off('change', this._onChange);\n this.source.off('destroy', this._onDestroy);\n }\n\n this.emit('destroy', this);\n this.removeAllListeners();\n }\n}\n","import { isSafari } from '../../../../../utils/browser/isSafari';\nimport { glUploadImageResource } from './glUploadImageResource';\n\nimport type { VideoSource } from '../../../shared/texture/sources/VideoSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\n// In Safari, texImage2D is significantly faster than texSubImage2D for video sources\n// (see https://github.com/pixijs/pixijs/pull/10383)\nconst defaultForceAllocation = isSafari();\n\n/** @internal */\nexport const glUploadVideoResource = {\n\n id: 'video',\n\n upload(\n source: VideoSource,\n glTexture: GlTexture,\n gl: GlRenderingContext,\n webGLVersion: number,\n targetOverride?: number,\n forceAllocation = defaultForceAllocation\n )\n {\n if (!source.isValid)\n {\n const target = targetOverride ?? glTexture.target;\n\n gl.texImage2D(\n target,\n 0,\n glTexture.internalFormat,\n 1,\n 1,\n 0,\n glTexture.format,\n glTexture.type,\n null\n );\n\n return;\n }\n\n glUploadImageResource.upload(source as any, glTexture, gl, webGLVersion, targetOverride, forceAllocation);\n }\n} as GLTextureUploader;\n\n","import { DOMAdapter } from '../../environment/adapter';\n\n/**\n * Checks if the current browser is Safari.\n * @returns {boolean} True if the browser is Safari, false otherwise.\n * @internal\n */\nexport function isSafari(): boolean\n{\n const { userAgent } = DOMAdapter.get().getNavigator();\n\n return (/^((?!chrome|android).)*safari/i).test(userAgent);\n}\n","import { Rectangle } from '../../../../../maths/shapes/Rectangle';\nimport { getTexelRangeRects } from '../../../shared/texture/utils/getTexelRangeRects';\nimport { GL_TARGETS } from '../const';\n\nimport type { TypedArray } from '../../../shared/buffer/Buffer';\nimport type { BufferImageSource } from '../../../shared/texture/sources/BufferImageSource';\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlTexture } from '../GlTexture';\nimport type { GLTextureUploader } from './GLTextureUploader';\n\nconst tempRects = [new Rectangle(), new Rectangle(), new Rectangle()];\n\n/** @internal */\nexport const glUploadBufferImageResource = {\n\n id: 'buffer',\n\n upload(\n source: BufferImageSource,\n glTexture: GlTexture,\n gl: GlRenderingContext,\n _webGLVersion: number,\n targetOverride?: number,\n forceAllocation = false\n )\n {\n const target = targetOverride || glTexture.target;\n const resource = source.resource as TypedArray;\n\n // a 3D texture or 2D array uploads as one box; BufferImageSource.update rejects partial ranges for these\n if (target === GL_TARGETS.TEXTURE_3D || target === GL_TARGETS.TEXTURE_2D_ARRAY)\n {\n if (forceAllocation || glTexture.width !== source.width || glTexture.height !== source.height)\n {\n gl.texImage3D(\n target,\n 0,\n glTexture.internalFormat,\n source.width,\n source.height,\n source.depthOrArrayLayers,\n 0,\n glTexture.format,\n glTexture.type,\n resource\n );\n }\n else\n {\n gl.texSubImage3D(\n target,\n 0,\n 0,\n 0,\n 0,\n source.width,\n source.height,\n source.depthOrArrayLayers,\n glTexture.format,\n glTexture.type,\n resource\n );\n }\n\n glTexture.width = source.width;\n glTexture.height = source.height;\n\n return;\n }\n\n const texelCount = source.width * source.height;\n const needsAllocation = forceAllocation || glTexture.width !== source.width || glTexture.height !== source.height;\n const isPartial = source._updateStart > 0 || source._updateEnd < texelCount;\n\n if (needsAllocation)\n {\n gl.texImage2D(\n target,\n 0,\n glTexture.internalFormat,\n source.width,\n source.height,\n 0,\n glTexture.format,\n glTexture.type,\n resource\n );\n }\n else if (isPartial)\n {\n const elementsPerTexel = resource.length / texelCount;\n\n const count = getTexelRangeRects(\n source._updateStart,\n source._updateEnd,\n source.width,\n source.height,\n tempRects\n );\n\n // each rect is contiguous in the buffer, so texSubImage2D can read it from a subarray\n for (let i = 0; i < count; i++)\n {\n const rect = tempRects[i];\n const offset = ((rect.y * source.width) + rect.x) * elementsPerTexel;\n\n gl.texSubImage2D(\n target,\n 0,\n rect.x,\n rect.y,\n rect.width,\n rect.height,\n glTexture.format,\n glTexture.type,\n resource.subarray(offset, offset + (rect.width * rect.height * elementsPerTexel))\n );\n }\n }\n else\n {\n gl.texSubImage2D(\n target,\n 0,\n 0,\n 0,\n source.width,\n source.height,\n glTexture.format,\n glTexture.type,\n resource\n );\n }\n\n glTexture.width = source.width;\n glTexture.height = source.height;\n }\n} as GLTextureUploader;\n","import { DOMAdapter } from '../../../../environment/adapter';\nimport { ExtensionType } from '../../../../extensions/Extensions';\nimport { warn } from '../../../../utils/logging/warn';\nimport { type GpuPowerPreference } from '../../types';\n\nimport type { ICanvas } from '../../../../environment/canvas/ICanvas';\nimport type { System } from '../../shared/system/System';\nimport type { WebGLRenderer } from '../WebGLRenderer';\nimport type { WebGLExtensions } from './WebGLExtensions';\n\n/**\n * Options for the context system.\n * @category rendering\n * @advanced\n * @property {WebGL2RenderingContext | null} [context=null] - User-provided WebGL rendering context object.\n * @property {GpuPowerPreference} [powerPreference='default'] - An optional hint indicating what configuration\n * of GPU is suitable for the WebGL context, can be `'high-performance'` or `'low-power'`. Setting to `'high-performance'`\n * will prioritize rendering performance over power consumption, while setting to `'low-power'` will prioritize power saving\n * over rendering performance.\n * @property {boolean} [premultipliedAlpha=true] - Whether the compositor will assume the drawing buffer contains\n * colors with premultiplied alpha.\n * @property {boolean} [preserveDrawingBuffer=false] - Whether to enable drawing buffer preservation.\n * If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @property {boolean} [antialias] - Whether to enable antialiasing.\n * @property {1 | 2} [preferWebGLVersion=2] - The preferred WebGL version to use.\n */\nexport interface ContextSystemOptions\n{\n /**\n * User-provided WebGL rendering context object.\n * @default null\n */\n context: WebGL2RenderingContext | null;\n /**\n * An optional hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @default undefined\n */\n powerPreference?: GpuPowerPreference;\n\n /**\n * Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @default true\n */\n premultipliedAlpha: boolean;\n /**\n * Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @default false\n */\n preserveDrawingBuffer: boolean;\n\n antialias?: boolean;\n\n /**\n * The preferred WebGL version to use.\n * @default 2\n */\n preferWebGLVersion?: 1 | 2;\n\n /**\n * Whether to enable multi-view rendering. Set to true when rendering to multiple\n * canvases on the dom.\n * @default false\n */\n multiView: boolean;\n}\n\n/**\n * System plugin to the renderer to manage the context\n * @category rendering\n * @advanced\n */\nexport class GlContextSystem implements System<ContextSystemOptions>\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'context',\n } as const;\n\n /** The default options for the system. */\n public static defaultOptions: ContextSystemOptions = {\n /**\n * {@link WebGLOptions.context}\n * @default null\n */\n context: null,\n /**\n * {@link WebGLOptions.premultipliedAlpha}\n * @default true\n */\n premultipliedAlpha: true,\n /**\n * {@link WebGLOptions.preserveDrawingBuffer}\n * @default false\n */\n preserveDrawingBuffer: false,\n /**\n * {@link WebGLOptions.powerPreference}\n * @default default\n */\n powerPreference: undefined,\n /**\n * {@link WebGLOptions.webGLVersion}\n * @default 2\n */\n preferWebGLVersion: 2,\n /**\n * {@link WebGLOptions.multiView}\n * @default false\n */\n multiView: false\n };\n\n protected CONTEXT_UID: number;\n protected gl: WebGL2RenderingContext;\n\n /**\n * Features supported by current renderer.\n * @type {object}\n * @readonly\n */\n public supports = {\n /** Support for 32-bit indices buffer. */\n uint32Indices: true,\n /** Support for UniformBufferObjects */\n uniformBufferObject: true,\n /** Support for VertexArrayObjects */\n vertexArrayObject: true,\n /** Support for SRGB texture format */\n srgbTextures: true,\n /** Support for wrapping modes if a texture is non-power of two */\n nonPowOf2wrapping: true,\n /** Support for MSAA (antialiasing of dynamic textures) */\n msaa: true,\n /** Support for mipmaps if a texture is non-power of two */\n nonPowOf2mipmaps: true,\n };\n\n /**\n * Extensions available.\n * @type {object}\n * @readonly\n * @property {WEBGL_draw_buffers} drawBuffers - WebGL v1 extension\n * @property {WEBGL_depth_texture} depthTexture - WebGL v1 extension\n * @property {OES_texture_float} floatTexture - WebGL v1 extension\n * @property {WEBGL_lose_context} loseContext - WebGL v1 extension\n * @property {OES_vertex_array_object} vertexArrayObject - WebGL v1 extension\n * @property {EXT_texture_filter_anisotropic} anisotropicFiltering - WebGL v1 and v2 extension\n */\n public extensions: WebGLExtensions;\n\n public webGLVersion: 1 | 2;\n\n /**\n * Whether to enable multi-view rendering. Set to true when rendering to multiple\n * canvases on the dom.\n * @default false\n */\n public multiView: boolean;\n\n /**\n * The canvas that the WebGL Context is rendering to.\n * This will be the view canvas. But if multiView is enabled, this canvas will not be attached to the DOM.\n * It will be rendered to and then copied to the target canvas.\n * @readonly\n */\n public canvas: ICanvas;\n\n private _renderer: WebGLRenderer;\n private _contextLossForced: boolean;\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n\n this.extensions = Object.create(null);\n\n // Bind functions\n this.handleContextLost = this.handleContextLost.bind(this);\n this.handleContextRestored = this.handleContextRestored.bind(this);\n }\n\n /**\n * `true` if the context is lost\n * @readonly\n */\n get isLost(): boolean\n {\n return (!this.gl || this.gl.isContextLost());\n }\n\n /**\n * Handles the context change event.\n * @param {WebGLRenderingContext} gl - New WebGL context.\n */\n protected contextChange(gl: WebGL2RenderingContext): void\n {\n this.gl = gl;\n this._renderer.gl = gl;\n }\n\n public init(options: ContextSystemOptions): void\n {\n options = { ...GlContextSystem.defaultOptions, ...options };\n\n // TODO add to options\n let multiView = this.multiView = options.multiView;\n\n if (options.context && multiView)\n {\n // eslint-disable-next-line max-len\n warn('Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together.');\n\n multiView = false;\n }\n\n if (multiView)\n {\n this.canvas = DOMAdapter.get()\n .createCanvas(this._renderer.canvas.width, this._renderer.canvas.height);\n }\n else\n {\n this.canvas = this._renderer.view.canvas;\n }\n /*\n * The options passed in to create a new WebGL context.\n */\n if (options.context)\n {\n this.initFromContext(options.context);\n }\n else\n {\n const alpha = this._renderer.background.alpha < 1;\n const premultipliedAlpha = options.premultipliedAlpha ?? true;\n const antialias = options.antialias && !this._renderer.backBuffer.useBackBuffer;\n\n this.createContext(options.preferWebGLVersion, {\n alpha,\n premultipliedAlpha,\n antialias,\n stencil: true,\n preserveDrawingBuffer: options.preserveDrawingBuffer,\n powerPreference: options.powerPreference ?? 'default',\n });\n }\n }\n\n public ensureCanvasSize(targetCanvas: ICanvas): void\n {\n if (!this.multiView)\n {\n if (targetCanvas !== this.canvas)\n {\n warn('multiView is disabled, but targetCanvas is not the main canvas');\n }\n\n return;\n }\n\n const { canvas } = this;\n\n if (canvas.width < targetCanvas.width || canvas.height < targetCanvas.height)\n {\n canvas.width = Math.max(targetCanvas.width, targetCanvas.width);\n canvas.height = Math.max(targetCanvas.height, targetCanvas.height);\n }\n }\n\n /**\n * Initializes the context.\n * @protected\n * @param {WebGLRenderingContext} gl - WebGL context\n */\n protected initFromContext(gl: WebGL2RenderingContext): void\n {\n this.gl = gl;\n\n this.webGLVersion = gl instanceof DOMAdapter.get().getWebGLRenderingContext() ? 1 : 2;\n\n this.getExtensions();\n\n this.validateContext(gl);\n\n this._renderer.runners.contextChange.emit(gl);\n\n const element = this._renderer.view.canvas;\n\n (element as any).addEventListener('webglcontextlost', this.handleContextLost, false);\n element.addEventListener('webglcontextrestored', this.handleContextRestored, false);\n }\n\n /**\n * Initialize from context options\n * @protected\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext\n * @param preferWebGLVersion\n * @param {object} options - context attributes\n */\n protected createContext(preferWebGLVersion: 1 | 2, options: WebGLContextAttributes): void\n {\n let gl: WebGL2RenderingContext | WebGLRenderingContext;\n\n const canvas = this.canvas;\n\n if (preferWebGLVersion === 2)\n {\n gl = canvas.getContext('webgl2', options);\n }\n\n if (!gl)\n {\n gl = canvas.getContext('webgl', options);\n\n if (!gl)\n {\n // fail, not able to get a context\n throw new Error('This browser does not support WebGL. Try using the canvas renderer');\n }\n }\n\n this.gl = gl as WebGL2RenderingContext;\n\n this.initFromContext(this.gl);\n }\n\n /** Auto-populate the {@link GlContextSystem.extensions extensions}. */\n protected getExtensions(): void\n {\n // time to set up default extensions that Pixi uses.\n const { gl } = this;\n\n const common = {\n anisotropicFiltering: gl.getExtension('EXT_texture_filter_anisotropic'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n\n s3tc: gl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: gl.getExtension('WEBGL_compressed_texture_s3tc_srgb'), // eslint-disable-line camelcase\n etc: gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: gl.getExtension('WEBGL_compressed_texture_astc'),\n bptc: gl.getExtension('EXT_texture_compression_bptc'),\n rgtc: gl.getExtension('EXT_texture_compression_rgtc'),\n loseContext: gl.getExtension('WEBGL_lose_context'),\n };\n\n if (this.webGLVersion === 1)\n {\n this.extensions = {\n ...common,\n\n drawBuffers: gl.getExtension('WEBGL_draw_buffers'),\n depthTexture: gl.getExtension('WEBGL_depth_texture'),\n vertexArrayObject: gl.getExtension('OES_vertex_array_object')\n || gl.getExtension('MOZ_OES_vertex_array_object')\n || gl.getExtension('WEBKIT_OES_vertex_array_object'),\n uint32ElementIndex: gl.getExtension('OES_element_index_uint'),\n // Floats and half-floats\n floatTexture: gl.getExtension('OES_texture_float'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n textureHalfFloat: gl.getExtension('OES_texture_half_float'),\n textureHalfFloatLinear: gl.getExtension('OES_texture_half_float_linear'),\n vertexAttribDivisorANGLE: gl.getExtension('ANGLE_instanced_arrays'),\n srgb: gl.getExtension('EXT_sRGB'),\n };\n }\n else\n {\n this.extensions = {\n ...common,\n colorBufferFloat: gl.getExtension('EXT_color_buffer_float'),\n };\n\n const provokeExt = gl.getExtension('WEBGL_provoking_vertex');\n\n if (provokeExt)\n {\n provokeExt.provokingVertexWEBGL(provokeExt.FIRST_VERTEX_CONVENTION_WEBGL);\n }\n }\n }\n\n /**\n * Handles a lost webgl context\n * @param {WebGLContextEvent} event - The context lost event.\n */\n protected handleContextLost(event: WebGLContextEvent): void\n {\n event.preventDefault();\n\n // only restore if we purposefully nuked it\n if (this._contextLossForced)\n {\n this._contextLossForced = false;\n // Restore the context after this event has exited\n setTimeout(() =>\n {\n if (this.gl.isContextLost())\n {\n this.extensions.loseContext?.restoreContext();\n }\n }, 0);\n }\n }\n\n /** Handles a restored webgl context. */\n protected handleContextRestored(): void\n {\n this.getExtensions(); // restore extensions state\n this._renderer.runners.contextChange.emit(this.gl);\n }\n\n public destroy(): void\n {\n const element = this._renderer.view.canvas;\n\n this._renderer = null;\n\n // remove listeners\n (element as any).removeEventListener('webglcontextlost', this.handleContextLost);\n element.removeEventListener('webglcontextrestored', this.handleContextRestored);\n\n this.gl.useProgram(null);\n\n this.extensions.loseContext?.loseContext();\n }\n\n /**\n * this function can be called to force a webGL context loss\n * this will release all resources on the GPU.\n * Useful if you need to put Pixi to sleep, and save some GPU memory\n *\n * As soon as render is called - all resources will be created again.\n */\n public forceContextLoss(): void\n {\n this.extensions.loseContext?.loseContext();\n this._contextLossForced = true;\n }\n /**\n * Validate context.\n * @param {WebGLRenderingContext} gl - Render context.\n */\n protected validateContext(gl: WebGL2RenderingContext): void\n {\n const attributes = gl.getContextAttributes();\n\n // this is going to be fairly simple for now.. but at least we have room to grow!\n if (attributes && !attributes.stencil)\n {\n // #if _DEBUG\n warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n // #endif\n }\n\n // support\n const supports = this.supports;\n\n const isWebGl2 = this.webGLVersion === 2;\n const extensions = this.extensions;\n\n supports.uint32Indices = isWebGl2 || !!extensions.uint32ElementIndex;\n supports.uniformBufferObject = isWebGl2;\n supports.vertexArrayObject = isWebGl2 || !!extensions.vertexArrayObject;\n supports.srgbTextures = isWebGl2 || !!extensions.srgb;\n supports.nonPowOf2wrapping = isWebGl2;\n supports.nonPowOf2mipmaps = isWebGl2;\n supports.msaa = isWebGl2;\n\n if (!supports.uint32Indices)\n {\n // #if _DEBUG\n warn('Provided WebGL context does not support 32 index buffer, large scenes may not render correctly');\n // #endif\n }\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\n\nimport type { System } from '../shared/system/System';\nimport type { WebGLRenderer } from './WebGLRenderer';\n\n/**\n * The system that handles color masking for the WebGL.\n * @category rendering\n * @advanced\n */\nexport class GlColorMaskSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'colorMask',\n } as const;\n\n private readonly _renderer: WebGLRenderer;\n private _colorMaskCache = 0b1111;\n\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n }\n\n public setMask(colorMask: number)\n {\n if (this._colorMaskCache === colorMask) return;\n this._colorMaskCache = colorMask;\n\n this._renderer.gl.colorMask(\n !!(colorMask & 0b1000),\n !!(colorMask & 0b0100),\n !!(colorMask & 0b0010),\n !!(colorMask & 0b0001)\n );\n }\n\n public destroy?: () => void;\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { type RenderTarget } from '../../shared/renderTarget/RenderTarget';\nimport { State, STATE_BITS } from '../../shared/state/State';\nimport { type WebGLRenderer } from '../WebGLRenderer';\nimport { mapWebGLBlendModesToPixi } from './mapWebGLBlendModesToPixi';\n\nimport type { BLEND_MODES } from '../../shared/state/const';\nimport type { System } from '../../shared/system/System';\nimport type { GlRenderingContext } from '../context/GlRenderingContext';\n\nconst { BLEND, OFFSET, CULLING, DEPTH_TEST, WINDING, DEPTH_MASK } = STATE_BITS;\n\n/**\n * System plugin to the renderer to manage WebGL state machines\n * @category rendering\n * @advanced\n */\nexport class GlStateSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'state',\n } as const;\n\n /**\n * State ID\n * @readonly\n */\n public stateId: number;\n\n /**\n * Polygon offset\n * @readonly\n */\n public polygonOffset: number;\n\n /**\n * Blend mode\n * @default 'none'\n * @readonly\n */\n public blendMode: BLEND_MODES;\n\n /** Whether current blend equation is different */\n protected _blendEq: boolean;\n\n /**\n * GL context\n * @type {WebGLRenderingContext}\n * @readonly\n */\n protected gl: GlRenderingContext;\n\n protected blendModesMap: Record<BLEND_MODES, number[]>;\n\n /**\n * Collection of calls\n * @type {Function[]}\n */\n protected readonly map: ((value: boolean) => void)[];\n\n /**\n * Collection of check calls\n * @type {Function[]}\n */\n protected readonly checks: ((system: this, state: State) => void)[];\n\n /**\n * Default WebGL State\n * @readonly\n */\n protected defaultState: State;\n\n /**\n * Whether to invert the front face when rendering\n * This is used for render textures where the Y-coordinate is flipped\n * @default false\n */\n private _invertFrontFace: boolean = false;\n private _glFrontFace: boolean;\n private _cullFace: boolean;\n private _frontFaceDirty: boolean;\n private _frontFace: boolean;\n private readonly _renderer: WebGLRenderer;\n\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n this.gl = null;\n\n this.stateId = 0;\n this.polygonOffset = 0;\n this.blendMode = 'none';\n\n this._blendEq = false;\n\n // map functions for when we set state..\n this.map = [];\n this.map[BLEND] = this.setBlend;\n this.map[OFFSET] = this.setOffset;\n this.map[CULLING] = this.setCullFace;\n this.map[DEPTH_TEST] = this.setDepthTest;\n this.map[WINDING] = this.setFrontFace;\n this.map[DEPTH_MASK] = this.setDepthMask;\n\n this.checks = [];\n\n this.defaultState = State.for2d();\n\n // listen for when the renderTarget changes\n // as rendering to textures means we need to invert the front face\n renderer.renderTarget.onRenderTargetChange.add(this);\n }\n\n protected onRenderTargetChange(renderTarget: RenderTarget)\n {\n // the one spelling of the rule lives on the render target system; on WebGL it resolves to\n // `!isRoot !== flipY`, keeping the winding inversion welded to the projection Y-flip so\n // back-face culling stays correct\n this._invertFrontFace = this._renderer.renderTarget.isFrontFaceInverted(renderTarget, renderTarget.flipY);\n\n // mini optimization to avoid setting the front face if culling is disabled\n if (this._cullFace)\n {\n // need to set the front face to the requested value as it matters because of the culling is active!\n this.setFrontFace(this._frontFace);\n }\n else\n {\n // if culling is disabled, we need to set the front face dirty\n this._frontFaceDirty = true;\n }\n }\n\n protected contextChange(gl: GlRenderingContext): void\n {\n this.gl = gl;\n\n this.blendModesMap = mapWebGLBlendModesToPixi(gl);\n\n // Reset face culling variables\n\n this.resetState();\n }\n\n /**\n * Sets the current state\n * @param {*} state - The state to set.\n */\n public set(state: State): void\n {\n state ||= this.defaultState;\n\n // TODO maybe to an object check? ( this.state === state )?\n if (this.stateId !== state.data)\n {\n let diff = this.stateId ^ state.data;\n let i = 0;\n\n // order from least to most common\n while (diff)\n {\n if (diff & 1)\n {\n // state change!\n this.map[i].call(this, !!(state.data & (1 << i)));\n }\n\n diff >>= 1;\n i++;\n }\n\n this.stateId = state.data;\n }\n\n // based on the above settings we check for specific modes..\n // for example if blend is active we check and set the blend modes\n // or of polygon offset is active we check the poly depth.\n for (let i = 0; i < this.checks.length; i++)\n {\n this.checks[i](this, state);\n }\n }\n\n /**\n * Sets the state, when previous state is unknown.\n * @param {*} state - The state to set\n */\n public forceState(state: State): void\n {\n state ||= this.defaultState;\n for (let i = 0; i < this.map.length; i++)\n {\n this.map[i].call(this, !!(state.data & (1 << i)));\n }\n for (let i = 0; i < this.checks.length; i++)\n {\n this.checks[i](this, state);\n }\n\n this.stateId = state.data;\n }\n\n /**\n * Sets whether to enable or disable blending.\n * @param value - Turn on or off WebGl blending.\n */\n public setBlend(value: boolean): void\n {\n this._updateCheck(GlStateSystem._checkBlendMode, value);\n\n this.gl[value ? 'enable' : 'disable'](this.gl.BLEND);\n }\n\n /**\n * Sets whether to enable or disable polygon offset fill.\n * @param value - Turn on or off webgl polygon offset testing.\n */\n public setOffset(value: boolean): void\n {\n this._updateCheck(GlStateSystem._checkPolygonOffset, value);\n\n this.gl[value ? 'enable' : 'disable'](this.gl.POLYGON_OFFSET_FILL);\n }\n\n /**\n * Sets whether to enable or disable depth test.\n * @param value - Turn on or off webgl depth testing.\n */\n public setDepthTest(value: boolean): void\n {\n this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST);\n }\n\n /**\n * Sets whether to enable or disable depth mask.\n * @param value - Turn on or off webgl depth mask.\n */\n public setDepthMask(value: boolean): void\n {\n this.gl.depthMask(value);\n }\n\n /**\n * Whether depth writes are currently enabled on the GL context, as last applied by this\n * system. `gl.clear` is masked by this state, so depth clears must consult it.\n * @internal\n */\n public get depthMaskEnabled(): boolean\n {\n return !!(this.stateId & (1 << DEPTH_MASK));\n }\n\n /**\n * Sets whether to enable or disable cull face.\n * @param {boolean} value - Turn on or off webgl cull face.\n */\n public setCullFace(value: boolean): void\n {\n this._cullFace = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE);\n\n if (this._cullFace && this._frontFaceDirty)\n {\n // need to set the front face to the requested value as it matters because of the culling is active!\n this.setFrontFace(this._frontFace);\n }\n }\n\n /**\n * Sets the gl front face.\n * @param {boolean} value - true is clockwise and false is counter-clockwise\n */\n public setFrontFace(value: boolean): void\n {\n this._frontFace = value;\n this._frontFaceDirty = false;\n // If invertFrontFace is true, we invert the face direction\n const faceMode = this._invertFrontFace ? !value : value;\n\n if (this._glFrontFace !== faceMode)\n {\n this._glFrontFace = faceMode;\n this.gl.frontFace(this.gl[faceMode ? 'CW' : 'CCW']);\n }\n }\n\n /**\n * Sets the blend mode.\n * @param {number} value - The blend mode to set to.\n */\n public setBlendMode(value: BLEND_MODES): void\n {\n if (!this.blendModesMap[value])\n {\n value = 'normal';\n }\n\n if (value === this.blendMode)\n {\n return;\n }\n\n this.blendMode = value;\n\n const mode = this.blendModesMap[value];\n const gl = this.gl;\n\n if (mode.length === 2)\n {\n gl.blendFunc(mode[0], mode[1]);\n }\n else\n {\n gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]);\n }\n\n if (mode.length === 6)\n {\n this._blendEq = true;\n gl.blendEquationSeparate(mode[4], mode[5]);\n }\n else if (this._blendEq)\n {\n this._blendEq = false;\n gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD);\n }\n }\n\n /**\n * Sets the polygon offset.\n * @param {number} value - the polygon offset\n * @param {number} scale - the polygon offset scale\n */\n public setPolygonOffset(value: number, scale: number): void\n {\n this.gl.polygonOffset(value, scale);\n }\n\n /** Resets all the logic and disables the VAOs. */\n public resetState(): void\n {\n this._glFrontFace = false;\n this._frontFace = false;\n this._cullFace = false;\n this._frontFaceDirty = false;\n this._invertFrontFace = false;\n\n this.gl.frontFace(this.gl.CCW);\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n\n this.forceState(this.defaultState);\n\n this._blendEq = true;\n // setting to '' means the blend mode will be set as soon as we set the first blend mode when rendering!\n this.blendMode = '' as BLEND_MODES;\n this.setBlendMode('normal');\n }\n\n /**\n * Checks to see which updates should be checked based on which settings have been activated.\n *\n * For example, if blend is enabled then we should check the blend modes each time the state is changed\n * or if polygon fill is activated then we need to check if the polygon offset changes.\n * The idea is that we only check what we have too.\n * @param func - the checking function to add or remove\n * @param value - should the check function be added or removed.\n */\n private _updateCheck(func: (system: this, state: State) => void, value: boolean): void\n {\n const index = this.checks.indexOf(func);\n\n if (value && index === -1)\n {\n this.checks.push(func);\n }\n else if (!value && index !== -1)\n {\n this.checks.splice(index, 1);\n }\n }\n\n /**\n * A private little wrapper function that we call to check the blend mode.\n * @param system - the System to perform the state check on\n * @param state - the state that the blendMode will pulled from\n */\n private static _checkBlendMode(system: GlStateSystem, state: State): void\n {\n system.setBlendMode(state.blendMode);\n }\n\n /**\n * A private little wrapper function that we call to check the polygon offset.\n * @param system - the System to perform the state check on\n * @param state - the state that the blendMode will pulled from\n */\n private static _checkPolygonOffset(system: GlStateSystem, state: State): void\n {\n system.setPolygonOffset(1, state.polygonOffset);\n }\n\n /** @ignore */\n public destroy(): void\n {\n this.gl = null;\n this.checks.length = 0;\n (this._renderer as null) = null;\n }\n}\n","// cu = Cached value's uniform data field\n// cv = Cached value\n// v = value to upload\n// ud = uniformData\n// uv = uniformValue\n\nimport { BufferResource } from '../../../shared/buffer/BufferResource';\nimport { UniformGroup } from '../../../shared/shader/UniformGroup';\nimport { uniformParsers } from '../../../shared/shader/utils/uniformParsers';\nimport { UNIFORM_TO_ARRAY_SETTERS, UNIFORM_TO_SINGLE_SETTERS } from './generateUniformsSyncTypes';\n\nimport type { UniformsSyncCallback } from '../../../shared/shader/types';\n\n/**\n * @param group\n * @param uniformData\n * @internal\n */\nexport function generateUniformsSync(group: UniformGroup, uniformData: Record<string, any>): UniformsSyncCallback\n{\n const funcFragments = [`\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n var name = null;\n `];\n\n for (const i in group.uniforms)\n {\n if (!uniformData[i])\n {\n if (group.uniforms[i] instanceof UniformGroup)\n {\n if ((group.uniforms[i] as UniformGroup).ubo)\n {\n funcFragments.push(`\n renderer.shader.bindUniformBlock(uv.${i}, \"${i}\");\n `);\n }\n else\n {\n funcFragments.push(`\n renderer.shader.updateUniformGroup(uv.${i});\n `);\n }\n }\n else if (group.uniforms[i] instanceof BufferResource)\n {\n funcFragments.push(`\n renderer.shader.bindBufferResource(uv.${i}, \"${i}\");\n `);\n }\n\n continue;\n }\n\n const uniform = group.uniformStructures[i];\n\n let parsed = false;\n\n for (let j = 0; j < uniformParsers.length; j++)\n {\n const parser = uniformParsers[j];\n\n if (uniform.type === parser.type && parser.test(uniform))\n {\n funcFragments.push(`name = \"${i}\";`, uniformParsers[j].uniform);\n parsed = true;\n\n break;\n }\n }\n\n if (!parsed)\n {\n const templateType = uniform.size === 1 ? UNIFORM_TO_SINGLE_SETTERS : UNIFORM_TO_ARRAY_SETTERS;\n\n const template = templateType[uniform.type].replace('location', `ud[\"${i}\"].location`);\n\n funcFragments.push(`\n cu = ud[\"${i}\"];\n cv = cu.value;\n v = uv[\"${i}\"];\n ${template};`);\n }\n }\n\n /*\n * the introduction of syncData is to solve an issue where textures in uniform groups are not set correctly\n * the texture count was always starting from 0 in each group. This needs to increment each time a texture is used\n * no matter which group is being used\n *\n */\n // eslint-disable-next-line no-new-func\n return new Function('ud', 'uv', 'renderer', 'syncData', funcFragments.join('\\n')) as UniformsSyncCallback;\n}\n","import { BufferResource } from '../../shared/buffer/BufferResource';\nimport { UniformGroup } from '../../shared/shader/UniformGroup';\nimport { TextureSource } from '../../shared/texture/sources/TextureSource';\nimport { TextureView } from '../../shared/texture/TextureView';\n\nimport type { Shader } from '../../shared/shader/Shader';\nimport type { GlShaderSystem, ShaderSyncFunction } from './GlShaderSystem';\n\n/**\n * Generates the a function that will efficiently sync shader resources with the GPU.\n * @param shader - The shader to generate the code for\n * @param shaderSystem - An instance of the shader system\n * @internal\n */\nexport function generateShaderSyncCode(shader: Shader, shaderSystem: GlShaderSystem): ShaderSyncFunction\n{\n const funcFragments: string[] = [];\n\n /**\n * rS = renderer.shader\n * sS = shaderSystem\n * sD = shaderData\n * g = shader.groups\n * s = shader\n * r = renderer\n * ugS = renderer.uniformGroupSystem\n */\n const headerFragments: string[] = [`\n var g = s.groups;\n var sS = r.shader;\n var p = s.glProgram;\n var ugS = r.uniformGroup;\n var resources;\n `];\n\n let addedTextureSystem = false;\n let textureCount = 0;\n\n const programData = shaderSystem._getProgramData(shader.glProgram);\n\n for (const i in shader.groups)\n {\n const group = shader.groups[i];\n\n funcFragments.push(`\n resources = g[${i}].resources;\n `);\n\n for (const j in group.resources)\n {\n const resource = group.resources[j];\n\n if (resource instanceof UniformGroup)\n {\n if (resource.ubo)\n {\n const resName = shader._uniformBindMap[i][Number(j)];\n\n funcFragments.push(`\n sS.bindUniformBlock(\n resources[${j}],\n '${resName}',\n ${shader.glProgram._uniformBlockData[resName].index}\n );\n `);\n }\n else\n {\n funcFragments.push(`\n ugS.updateUniformGroup(resources[${j}], p, sD);\n `);\n }\n }\n else if (resource instanceof BufferResource)\n {\n const resName = shader._uniformBindMap[i][Number(j)];\n\n funcFragments.push(`\n sS.bindUniformBlock(\n resources[${j}],\n '${resName}',\n ${shader.glProgram._uniformBlockData[resName].index}\n );\n `);\n }\n else if (resource instanceof TextureSource || resource instanceof TextureView)\n {\n const uniformName = shader._uniformBindMap[i as unknown as number][j as unknown as number];\n\n const uniformData = programData.uniformData[uniformName];\n\n if (uniformData)\n {\n if (!addedTextureSystem)\n {\n addedTextureSystem = true;\n headerFragments.push(`\n var tS = r.texture;\n `);\n }\n\n shaderSystem._gl.uniform1i(uniformData.location, textureCount);\n\n funcFragments.push(`\n tS.bind(resources[${j}], ${textureCount});\n `);\n\n textureCount++;\n }\n }\n }\n }\n\n const functionSource = [...headerFragments, ...funcFragments].join('\\n');\n\n // eslint-disable-next-line no-new-func\n return new Function('r', 's', 'sD', functionSource) as ShaderSyncFunction;\n}\n","import { GL_TYPES } from '../../texture/const';\n\nimport type { VertexFormat } from '../../../shared/geometry/const';\n\nconst infoMap = {\n uint8x2: GL_TYPES.UNSIGNED_BYTE,\n uint8x4: GL_TYPES.UNSIGNED_BYTE,\n sint8x2: GL_TYPES.BYTE,\n sint8x4: GL_TYPES.BYTE,\n unorm8x2: GL_TYPES.UNSIGNED_BYTE,\n unorm8x4: GL_TYPES.UNSIGNED_BYTE,\n snorm8x2: GL_TYPES.BYTE,\n snorm8x4: GL_TYPES.BYTE,\n uint16x2: GL_TYPES.UNSIGNED_SHORT,\n uint16x4: GL_TYPES.UNSIGNED_SHORT,\n sint16x2: GL_TYPES.SHORT,\n sint16x4: GL_TYPES.SHORT,\n unorm16x2: GL_TYPES.UNSIGNED_SHORT,\n unorm16x4: GL_TYPES.UNSIGNED_SHORT,\n snorm16x2: GL_TYPES.SHORT,\n snorm16x4: GL_TYPES.SHORT,\n float16x2: GL_TYPES.HALF_FLOAT,\n float16x4: GL_TYPES.HALF_FLOAT,\n float32: GL_TYPES.FLOAT,\n float32x2: GL_TYPES.FLOAT,\n float32x3: GL_TYPES.FLOAT,\n float32x4: GL_TYPES.FLOAT,\n uint32: GL_TYPES.UNSIGNED_INT,\n uint32x2: GL_TYPES.UNSIGNED_INT,\n uint32x3: GL_TYPES.UNSIGNED_INT,\n uint32x4: GL_TYPES.UNSIGNED_INT,\n sint32: GL_TYPES.INT,\n sint32x2: GL_TYPES.INT,\n sint32x3: GL_TYPES.INT,\n sint32x4: GL_TYPES.INT\n};\n\n/**\n * @param format\n * @internal\n */\nexport function getGlTypeFromFormat(format: VertexFormat): number\n{\n return infoMap[format] ?? infoMap.float32;\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { GCManagedHash } from '../../../../utils/data/GCManagedHash';\nimport { BufferUsage } from '../../shared/buffer/const';\nimport { BUFFER_TYPE } from './const';\nimport { GlBuffer } from './GlBuffer';\n\nimport type { Buffer } from '../../shared/buffer/Buffer';\nimport type { System } from '../../shared/system/System';\nimport type { GlRenderingContext } from '../context/GlRenderingContext';\nimport type { WebGLRenderer } from '../WebGLRenderer';\n\n/**\n * System plugin to the renderer to manage buffers.\n *\n * WebGL uses Buffers as a way to store objects to the GPU.\n * This system makes working with them a lot easier.\n *\n * Buffers are used in three main places in WebGL\n * - geometry information\n * - Uniform information (via uniform buffer objects - a WebGL 2 only feature)\n * - Transform feedback information. (WebGL 2 only feature)\n *\n * This system will handle the binding of buffers to the GPU as well as uploading\n * them. With this system, you never need to work directly with GPU buffers, but instead work with\n * the Buffer class.\n * @class\n * @category rendering\n * @advanced\n */\nexport class GlBufferSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'buffer',\n } as const;\n\n /** @internal */\n public _gl: GlRenderingContext;\n protected _managedBuffers: GCManagedHash<Buffer>;\n\n /** Cache keeping track of the base bound buffer bases */\n private _boundBufferBases: {[key: number]: GlBuffer} = Object.create(null);\n\n private _renderer: WebGLRenderer;\n\n private _minBaseLocation = 0;\n private _maxBindings: number;\n private _nextBindBaseIndex = this._minBaseLocation;\n private _bindCallId = 0;\n\n /**\n * @param {Renderer} renderer - The renderer this System works for.\n */\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n this._managedBuffers = new GCManagedHash({\n renderer,\n type: 'resource',\n onUnload: this.onBufferUnload.bind(this),\n name: 'glBuffer'\n });\n }\n\n /** @ignore */\n public destroy(): void\n {\n this._managedBuffers.destroy();\n this._renderer = null;\n this._gl = null;\n this._boundBufferBases = {};\n }\n\n /** Sets up the renderer context and necessary buffers. */\n protected contextChange(): void\n {\n this._gl = this._renderer.gl;\n\n this.destroyAll(true);\n this._maxBindings = this._renderer.limits.maxUniformBindings;\n }\n\n public getGlBuffer(buffer: Buffer): GlBuffer\n {\n buffer._gcLastUsed = this._renderer.gc.now;\n\n return (buffer._gpuData[this._renderer.uid] as GlBuffer) || this.createGLBuffer(buffer);\n }\n\n /**\n * This binds specified buffer. On first run, it will create the webGL buffers for the context too\n * @param buffer - the buffer to bind to the renderer\n */\n public bind(buffer: Buffer): void\n {\n const { _gl: gl } = this;\n\n const glBuffer = this.getGlBuffer(buffer);\n\n gl.bindBuffer(glBuffer.type, glBuffer.buffer);\n }\n\n /**\n * Binds an uniform buffer to at the given index.\n *\n * A cache is used so a buffer will not be bound again if already bound.\n * @param glBuffer - the buffer to bind\n * @param index - the base index to bind it to.\n */\n public bindBufferBase(glBuffer: GlBuffer, index: number): void\n {\n const { _gl: gl } = this;\n\n if (this._boundBufferBases[index] !== glBuffer)\n {\n this._boundBufferBases[index] = glBuffer;\n glBuffer._lastBindBaseLocation = index;\n\n gl.bindBufferBase(gl.UNIFORM_BUFFER, index, glBuffer.buffer);\n }\n }\n\n public nextBindBase(hasTransformFeedback: boolean)\n {\n this._bindCallId++;\n this._minBaseLocation = 0;\n if (hasTransformFeedback)\n {\n this._boundBufferBases[0] = null;\n this._minBaseLocation = 1;\n if (this._nextBindBaseIndex < 1)\n {\n this._nextBindBaseIndex = 1;\n }\n }\n }\n\n public freeLocationForBufferBase(glBuffer: GlBuffer): number\n {\n let freeIndex = this.getLastBindBaseLocation(glBuffer);\n\n // check if it is already bound..\n if (freeIndex >= this._minBaseLocation)\n {\n glBuffer._lastBindCallId = this._bindCallId;\n\n return freeIndex;\n }\n\n let loop = 0;\n let nextIndex = this._nextBindBaseIndex;\n\n while (loop < 2)\n {\n if (nextIndex >= this._maxBindings)\n {\n nextIndex = this._minBaseLocation;\n loop++;\n }\n\n const curBuf = this._boundBufferBases[nextIndex];\n\n if (curBuf && curBuf._lastBindCallId === this._bindCallId)\n {\n nextIndex++;\n continue;\n }\n break;\n }\n\n freeIndex = nextIndex;\n this._nextBindBaseIndex = nextIndex + 1;\n\n if (loop >= 2)\n {\n // TODO: error\n return -1;\n }\n\n glBuffer._lastBindCallId = this._bindCallId;\n this._boundBufferBases[freeIndex] = null;\n\n return freeIndex;\n }\n\n public getLastBindBaseLocation(glBuffer: GlBuffer): number\n {\n const index = glBuffer._lastBindBaseLocation;\n\n if (this._boundBufferBases[index] === glBuffer)\n {\n return index;\n }\n\n return -1;\n }\n\n /**\n * Binds a buffer whilst also binding its range.\n * This will make the buffer start from the offset supplied rather than 0 when it is read.\n * @param glBuffer - the buffer to bind\n * @param index - the base index to bind at, defaults to 0\n * @param offset - the offset to bind at (this is blocks of 256). 0 = 0, 1 = 256, 2 = 512 etc\n * @param size - the size to bind at (this is blocks of 256).\n */\n public bindBufferRange(glBuffer: GlBuffer, index?: number, offset?: number, size?: number): void\n {\n const { _gl: gl } = this;\n\n offset ||= 0;\n index ||= 0;\n\n this._boundBufferBases[index] = null;\n\n gl.bindBufferRange(gl.UNIFORM_BUFFER, index || 0, glBuffer.buffer, offset * 256, size || 256);\n }\n\n /**\n * Will ensure the data in the buffer is uploaded to the GPU.\n * @param {Buffer} buffer - the buffer to update\n */\n public updateBuffer(buffer: Buffer): GlBuffer\n {\n const { _gl: gl } = this;\n\n const glBuffer = this.getGlBuffer(buffer);\n\n if (buffer._updateID === glBuffer.updateID)\n {\n return glBuffer;\n }\n\n glBuffer.updateID = buffer._updateID;\n\n gl.bindBuffer(glBuffer.type, glBuffer.buffer);\n\n const data = buffer.data;\n\n const drawType = (buffer.descriptor.usage & BufferUsage.STATIC) ? gl.STATIC_DRAW : gl.DYNAMIC_DRAW;\n\n if (data)\n {\n if (glBuffer.byteLength >= data.byteLength)\n {\n // assuming our buffers are aligned to 4 bits...\n gl.bufferSubData(\n glBuffer.type,\n buffer._updateOffset,\n data,\n buffer._updateOffset / data.BYTES_PER_ELEMENT,\n (buffer._updateSize || data.byteLength) / data.BYTES_PER_ELEMENT\n );\n }\n else\n {\n glBuffer.byteLength = data.byteLength;\n // assuming our buffers are aligned to 4 bits...\n gl.bufferData(glBuffer.type, data, drawType);\n }\n }\n else\n {\n glBuffer.byteLength = buffer.descriptor.size;\n gl.bufferData(glBuffer.type, glBuffer.byteLength, drawType);\n }\n\n return glBuffer;\n }\n\n /**\n * dispose all WebGL resources of all managed buffers\n * @param contextLost\n */\n public destroyAll(contextLost: boolean = false): void\n {\n this._managedBuffers.removeAll(contextLost);\n }\n\n protected onBufferUnload(buffer: Buffer, contextLost: boolean = false): void\n {\n const glBuffer = buffer._gpuData[this._renderer.uid] as GlBuffer;\n\n if (!glBuffer) return;\n if (!contextLost) this._gl.deleteBuffer(glBuffer.buffer);\n }\n\n /**\n * creates and attaches a GLBuffer object tied to the current context.\n * @param buffer\n * @protected\n */\n protected createGLBuffer(buffer: Buffer): GlBuffer\n {\n const { _gl: gl } = this;\n\n let type = BUFFER_TYPE.ARRAY_BUFFER;\n\n if ((buffer.descriptor.usage & BufferUsage.INDEX))\n {\n type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n }\n else if ((buffer.descriptor.usage & BufferUsage.UNIFORM))\n {\n type = BUFFER_TYPE.UNIFORM_BUFFER;\n }\n\n const glBuffer = new GlBuffer(gl.createBuffer(), type);\n\n buffer._gpuData[this._renderer.uid] = glBuffer;\n this._managedBuffers.add(buffer);\n\n return glBuffer;\n }\n\n public resetState(): void\n {\n this._boundBufferBases = Object.create(null);\n }\n}\n","import { STENCIL_MODES } from '../shared/state/const';\n\n/**\n * Represents a render target.\n * @category rendering\n * @ignore\n */\nexport class GlRenderTarget\n{\n public width = -1;\n public height = -1;\n public msaa = false;\n /**\n * Tracks which mip level is currently attached to this render target's framebuffer.\n * This lets us skip redundant framebufferTexture2D calls on the common path.\n * @internal\n */\n public _attachedMipLevel = 0;\n /**\n * Tracks which array layer (or cube face index) is currently attached to this render target's framebuffer.\n * For non-array 2D textures this will always be 0.\n * @internal\n */\n public _attachedLayer = 0;\n public framebuffer: WebGLFramebuffer;\n public resolveTargetFramebuffer: WebGLFramebuffer;\n public msaaRenderBuffer: WebGLRenderbuffer[] = [];\n public depthStencilRenderBuffer: WebGLRenderbuffer;\n /**\n * The stencil state the stencil system and the mask pipe track for this target on this renderer.\n * It lives here rather than in a uid-keyed record so it is restored when the target is bound again\n * and freed with the backend object when the target dies.\n */\n public stencilMode: STENCIL_MODES = STENCIL_MODES.DISABLED;\n /** the stencil reference value that goes with `stencilMode` */\n public stencilReference = 0;\n /** how many stencil masks are currently pushed on this target */\n public maskStackIndex = 0;\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { type GPUData } from '../../../../scene/view/ViewContainer';\nimport { GCManagedHash } from '../../../../utils/data/GCManagedHash';\nimport { getAttributeInfoFromFormat } from '../../shared/geometry/utils/getAttributeInfoFromFormat';\nimport { ensureAttributes } from '../shader/program/ensureAttributes';\nimport { getGlTypeFromFormat } from './utils/getGlTypeFromFormat';\n\nimport type { Topology } from '../../shared/geometry/const';\nimport type { Geometry } from '../../shared/geometry/Geometry';\nimport type { System } from '../../shared/system/System';\nimport type { GlRenderingContext } from '../context/GlRenderingContext';\nimport type { GlProgram } from '../shader/GlProgram';\nimport type { WebGLRenderer } from '../WebGLRenderer';\n\nconst topologyToGlMap = {\n 'point-list': 0x0000,\n 'line-list': 0x0001,\n 'line-strip': 0x0003,\n 'triangle-list': 0x0004,\n 'triangle-strip': 0x0005\n};\n\n/**\n * Stores GPU-specific data for a Geometry instance in WebGL context.\n *\n * This class manages Vertex Array Object (VAO) caching for geometries,\n * allowing efficient reuse of VAOs across different shader programs.\n * Each geometry can have multiple VAOs cached, one for each unique\n * shader program signature it's used with.\n * @internal\n */\nexport class GlGeometryGpuData implements GPUData\n{\n public vaoCache: Record<string, WebGLVertexArrayObject>;\n\n constructor()\n {\n this.vaoCache = Object.create(null);\n }\n\n public destroy(): void\n {\n this.vaoCache = Object.create(null);\n }\n}\n\n/**\n * System plugin to the renderer to manage geometry.\n * @category rendering\n * @advanced\n */\nexport class GlGeometrySystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'geometry',\n } as const;\n\n /**\n * `true` if we has `*_vertex_array_object` extension.\n * @readonly\n */\n public hasVao: boolean;\n\n /**\n * `true` if has `ANGLE_instanced_arrays` extension.\n * @readonly\n */\n public hasInstance: boolean;\n\n protected gl: GlRenderingContext;\n protected _activeGeometry: Geometry;\n /** @internal */\n public _activeVao: WebGLVertexArrayObject;\n /** @internal */\n public _managedGeometries: GCManagedHash<Geometry>;\n\n /** Renderer that owns this {@link GeometrySystem}. */\n private _renderer: WebGLRenderer;\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n this._activeGeometry = null;\n this._activeVao = null;\n\n this.hasVao = true;\n this.hasInstance = true;\n\n this._managedGeometries = new GCManagedHash({\n renderer,\n type: 'resource',\n onUnload: this.onGeometryUnload.bind(this),\n name: 'glGeometry'\n });\n }\n\n /** Sets up the renderer context and necessary buffers. */\n protected contextChange(): void\n {\n const gl = this.gl = this._renderer.gl;\n\n if (!this._renderer.context.supports.vertexArrayObject)\n {\n throw new Error('[PixiJS] Vertex Array Objects are not supported on this device');\n }\n\n this.destroyAll(true);\n const nativeVaoExtension = this._renderer.context.extensions.vertexArrayObject;\n\n if (nativeVaoExtension)\n {\n gl.createVertexArray = (): WebGLVertexArrayObject =>\n nativeVaoExtension.createVertexArrayOES();\n\n gl.bindVertexArray = (vao): void =>\n nativeVaoExtension.bindVertexArrayOES(vao);\n\n gl.deleteVertexArray = (vao): void =>\n nativeVaoExtension.deleteVertexArrayOES(vao);\n }\n\n const nativeInstancedExtension = this._renderer.context.extensions.vertexAttribDivisorANGLE;\n\n if (nativeInstancedExtension)\n {\n gl.drawArraysInstanced = (a, b, c, d): void =>\n {\n nativeInstancedExtension.drawArraysInstancedANGLE(a, b, c, d);\n };\n\n gl.drawElementsInstanced = (a, b, c, d, e): void =>\n {\n nativeInstancedExtension.drawElementsInstancedANGLE(a, b, c, d, e);\n };\n\n gl.vertexAttribDivisor = (a, b): void =>\n nativeInstancedExtension.vertexAttribDivisorANGLE(a, b);\n }\n\n this._activeGeometry = null;\n this._activeVao = null;\n }\n\n /**\n * Binds geometry so that is can be drawn. Creating a Vao if required\n * @param geometry - Instance of geometry to bind.\n * @param program - Instance of program to use vao for.\n */\n public bind(geometry?: Geometry, program?: GlProgram): void\n {\n // shader ||= this.renderer.shader.shader;\n\n const gl = this.gl;\n\n this._activeGeometry = geometry;\n\n const vao = this.getVao(geometry, program);\n\n if (this._activeVao !== vao)\n {\n this._activeVao = vao;\n\n gl.bindVertexArray(vao);\n }\n\n this.updateBuffers();\n }\n\n /** Reset and unbind any active VAO and geometry. */\n public resetState(): void\n {\n this.unbind();\n }\n\n /** Update buffers of the currently bound geometry. */\n public updateBuffers(): void\n {\n const geometry = this._activeGeometry;\n\n const bufferSystem = this._renderer.buffer;\n\n for (let i = 0; i < geometry.buffers.length; i++)\n {\n const buffer = geometry.buffers[i];\n\n bufferSystem.updateBuffer(buffer);\n }\n\n geometry._gcLastUsed = this._renderer.gc.now;\n }\n\n /**\n * Check compatibility between a geometry and a program\n * @param geometry - Geometry instance.\n * @param program - Program instance.\n */\n protected checkCompatibility(geometry: Geometry, program: GlProgram): void\n {\n // geometry must have at least all the attributes that the shader requires.\n const geometryAttributes = geometry.attributes;\n const shaderAttributes = program._attributeData;\n\n for (const j in shaderAttributes)\n {\n if (!geometryAttributes[j])\n {\n throw new Error(`shader and geometry incompatible, geometry missing the \"${j}\" attribute`);\n }\n }\n }\n\n /**\n * Takes a geometry and program and generates a unique signature for them.\n * @param geometry - To get signature from.\n * @param program - To test geometry against.\n * @returns - Unique signature of the geometry and program\n */\n protected getSignature(geometry: Geometry, program: GlProgram): string\n {\n const attribs = geometry.attributes;\n const shaderAttributes = program._attributeData;\n\n const strings = ['g', geometry.uid];\n\n for (const i in attribs)\n {\n if (shaderAttributes[i])\n {\n strings.push(i, shaderAttributes[i].location);\n }\n }\n\n return strings.join('-');\n }\n\n protected getVao(geometry: Geometry, program: GlProgram): WebGLVertexArrayObject\n {\n return geometry._gpuData[this._renderer.uid]?.vaoCache[program._key] || this.initGeometryVao(geometry, program);\n }\n\n /**\n * Creates or gets Vao with the same structure as the geometry and stores it on the geometry.\n * If vao is created, it is bound automatically. We use a shader to infer what and how to set up the\n * attribute locations.\n * @param geometry - Instance of geometry to to generate Vao for.\n * @param program\n * @param _incRefCount - Increment refCount of all geometry buffers.\n */\n protected initGeometryVao(geometry: Geometry, program: GlProgram, _incRefCount = true): WebGLVertexArrayObject\n {\n const gl = this._renderer.gl;\n // const CONTEXT_UID = this.CONTEXT_UID;\n const bufferSystem = this._renderer.buffer;\n\n this._renderer.shader._getProgramData(program);\n\n this.checkCompatibility(geometry, program);\n\n const signature = this.getSignature(geometry, program);\n\n let gpuData = geometry._gpuData[this._renderer.uid];\n\n if (!gpuData)\n {\n gpuData = new GlGeometryGpuData();\n geometry._gpuData[this._renderer.uid] = gpuData;\n this._managedGeometries.add(geometry);\n }\n\n const vaoObjectHash = gpuData.vaoCache;\n let vao = vaoObjectHash[signature];\n\n if (vao)\n {\n // this will give us easy access to the vao\n vaoObjectHash[program._key] = vao;\n\n return vao;\n }\n\n ensureAttributes(geometry, program._attributeData);\n\n const buffers = geometry.buffers;\n\n // @TODO: We don't know if VAO is supported.\n vao = gl.createVertexArray();\n\n gl.bindVertexArray(vao);\n\n // first update - and create the buffers!\n // only create a gl buffer if it actually gets\n for (let i = 0; i < buffers.length; i++)\n {\n const buffer = buffers[i];\n\n bufferSystem.bind(buffer);\n }\n\n // TODO - maybe make this a data object?\n // lets wait to see if we need to first!\n\n this.activateVao(geometry, program);\n\n // add it to the cache!\n vaoObjectHash[program._key] = vao;\n vaoObjectHash[signature] = vao;\n\n gl.bindVertexArray(null);\n\n return vao;\n }\n\n protected onGeometryUnload(geometry: Geometry, contextLost = false): void\n {\n const gpuData = geometry._gpuData[this._renderer.uid];\n\n if (!gpuData) return;\n\n const vaoCache = gpuData.vaoCache;\n\n if (!contextLost)\n {\n for (const i in vaoCache)\n {\n if (this._activeVao === vaoCache[i])\n {\n this.resetState();\n }\n this.gl.deleteVertexArray(vaoCache[i]);\n }\n }\n }\n\n /**\n * Dispose all WebGL resources of all managed geometries.\n * @param [contextLost=false] - If context was lost, we suppress `gl.delete` calls\n */\n public destroyAll(contextLost = false): void\n {\n this._managedGeometries.removeAll(contextLost);\n }\n\n /**\n * Activate vertex array object.\n * @param geometry - Geometry instance.\n * @param program - Shader program instance.\n */\n protected activateVao(geometry: Geometry, program: GlProgram): void\n {\n const gl = this._renderer.gl;\n\n const bufferSystem = this._renderer.buffer;\n const attributes = geometry.attributes;\n\n if (geometry.indexBuffer)\n {\n // first update the index buffer if we have one..\n bufferSystem.bind(geometry.indexBuffer);\n }\n\n let lastBuffer = null;\n\n // add a new one!\n for (const j in attributes)\n {\n const attribute = attributes[j];\n const buffer = attribute.buffer;\n const glBuffer = bufferSystem.getGlBuffer(buffer);\n const programAttrib = program._attributeData[j];\n\n if (programAttrib)\n {\n if (lastBuffer !== glBuffer)\n {\n bufferSystem.bind(buffer);\n\n lastBuffer = glBuffer;\n }\n\n const location = programAttrib.location;\n\n // TODO introduce state again\n // we can optimise this for older devices that have no VAOs\n gl.enableVertexAttribArray(location);\n\n const attributeInfo = getAttributeInfoFromFormat(attribute.format);\n\n const type = getGlTypeFromFormat(attribute.format);\n\n if (programAttrib.format?.substring(1, 4) === 'int')\n {\n gl.vertexAttribIPointer(location,\n attributeInfo.size,\n type,\n attribute.stride,\n attribute.offset);\n }\n else\n {\n gl.vertexAttribPointer(location,\n attributeInfo.size,\n type,\n attributeInfo.normalised,\n attribute.stride,\n attribute.offset);\n }\n\n if (attribute.instance)\n {\n // TODO calculate instance count based of this...\n if (this.hasInstance)\n {\n // Can't use truthiness check to determine if divisor is set,\n // since 0 is a valid value for divisor\n const divisor = attribute.divisor ?? 1;\n\n gl.vertexAttribDivisor(location, divisor);\n }\n else\n {\n throw new Error('geometry error, GPU Instancing is not supported on this device');\n }\n }\n }\n }\n }\n\n /**\n * Draws the currently bound geometry.\n * @param topology - The type primitive to render.\n * @param size - The number of elements to be rendered. If not specified, an indexed geometry\n * falls back to {@link Geometry.indexCount} and then to its whole index buffer, and a\n * non-indexed one to {@link Geometry.vertexCount}.\n * @param start - The starting vertex in the geometry to start drawing from. If not specified,\n * drawing will start from the first vertex.\n * @param instanceCount - The number of instances of the set of elements to execute. If not specified,\n * all instances will be drawn.\n * @returns This instance of the geometry system.\n */\n public draw(topology?: Topology, size?: number, start?: number, instanceCount?: number): this\n {\n const { gl } = this._renderer;\n const geometry = this._activeGeometry;\n\n const glTopology = topologyToGlMap[topology || geometry.topology];\n\n instanceCount ??= geometry.instanceCount;\n\n if (geometry.indexBuffer)\n {\n const byteSize = geometry.indexBuffer.data.BYTES_PER_ELEMENT;\n const glType = byteSize === 2 ? gl.UNSIGNED_SHORT : gl.UNSIGNED_INT;\n const count = size || geometry.indexCount || geometry.indexBuffer.data.length;\n const byteOffset = (start || 0) * byteSize;\n\n if (instanceCount !== 1)\n {\n gl.drawElementsInstanced(glTopology, count, glType, byteOffset, instanceCount);\n }\n else\n {\n gl.drawElements(glTopology, count, glType, byteOffset);\n }\n }\n else if (instanceCount !== 1)\n {\n gl.drawArraysInstanced(glTopology, start || 0, size || geometry.vertexCount, instanceCount);\n }\n else\n {\n gl.drawArrays(glTopology, start || 0, size || geometry.vertexCount);\n }\n\n return this;\n }\n\n /** Unbind/reset everything. */\n protected unbind(): void\n {\n this.gl.bindVertexArray(null);\n this._activeVao = null;\n this._activeGeometry = null;\n }\n\n public destroy(): void\n {\n this._managedGeometries.destroy();\n this._renderer = null;\n this.gl = null;\n this._activeVao = null;\n this._activeGeometry = null;\n }\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { RenderTargetSystem } from '../../shared/renderTarget/RenderTargetSystem';\nimport { GlRenderTargetAdaptor } from './GlRenderTargetAdaptor';\n\nimport type { GlRenderTarget } from '../GlRenderTarget';\nimport type { WebGLRenderer } from '../WebGLRenderer';\n\n/**\n * The WebGL adaptor for the render target system. Allows the Render Target System to be used with the WebGl renderer\n * @category rendering\n * @advanced\n */\nexport class GlRenderTargetSystem extends RenderTargetSystem<GlRenderTarget>\n{\n /** @ignore */\n public static extension = {\n type: [ExtensionType.WebGLSystem],\n name: 'renderTarget',\n } as const;\n\n public adaptor = new GlRenderTargetAdaptor();\n\n constructor(renderer: WebGLRenderer)\n {\n super(renderer);\n\n this.adaptor.init(renderer, this);\n }\n\n /** Called via the renderer's `resetState` runner when mixing Pixi with external GL code. */\n public resetState(): void\n {\n this.adaptor.resetState();\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { UboSystem } from '../shared/shader/UboSystem';\nimport { createUboElementsSTD40 } from './shader/utils/createUboElementsSTD40';\nimport { createUboSyncFunctionSTD40 } from './shader/utils/createUboSyncSTD40';\n\n/**\n * System plugin to the renderer to manage uniform buffers. But with an WGSL adaptor.\n * @category rendering\n * @advanced\n */\nexport class GlUboSystem extends UboSystem\n{\n /** @ignore */\n public static extension = {\n type: [ExtensionType.WebGLSystem],\n name: 'ubo',\n } as const;\n\n constructor()\n {\n super({\n createUboElements: createUboElementsSTD40,\n generateUboSync: createUboSyncFunctionSTD40,\n });\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { checkMaxIfStatementsInShader } from '../../batcher/gl/utils/checkMaxIfStatementsInShader';\nimport { type System } from '../shared/system/System';\n\nimport type { WebGLRenderer } from './WebGLRenderer';\n/**\n * The GpuLimitsSystem provides information about the capabilities and limitations of the underlying GPU.\n * These limits, such as the maximum number of textures that can be used in a shader\n * (`maxTextures`) or the maximum number of textures that can be batched together (`maxBatchableTextures`),\n * are determined by the specific graphics hardware and driver.\n *\n * The values for these limits are not available immediately upon instantiation of the class.\n * They are populated when the GL rendering context is successfully initialized and ready,\n * which occurs after the `renderer.init()` method has completed.\n * Attempting to access these properties before the context is ready will result in undefined or default values.\n *\n * This system allows the renderer to adapt its behavior and resource allocation strategies\n * to stay within the supported boundaries of the GPU, ensuring optimal performance and stability.\n * @example\n * ```ts\n * const renderer = new WebGlRenderer();\n * await renderer.init();\n *\n * console.log(renderer.limits.maxTextures);\n * ```\n * @category rendering\n * @advanced\n */\nexport class GlLimitsSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'limits',\n } as const;\n\n /** The maximum number of textures that can be used by a shader */\n public maxTextures: number;\n /** The maximum number of batchable textures */\n public maxBatchableTextures: number;\n\n /** The maximum number of uniform bindings */\n public maxUniformBindings: number;\n\n private readonly _renderer: WebGLRenderer;\n\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n }\n\n public contextChange(): void\n {\n const gl = this._renderer.gl;\n\n // step 1: first check max textures the GPU can handle.\n this.maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\n // step 2: check the maximum number of if statements the shader can have too..\n this.maxBatchableTextures = checkMaxIfStatementsInShader(this.maxTextures, gl);\n\n // step 3: check the limit of uniform buffer bindings.\n // UBs are available only in WebGL2 context, requesting within WebGL1 produces a warning.\n const isWebGl2 = this._renderer.context.webGLVersion === 2;\n\n this.maxUniformBindings = isWebGl2\n ? gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS)\n : 0;\n }\n\n public destroy(): void\n {\n // boom!\n }\n}\n","import { Rectangle } from '../../../../maths/shapes/Rectangle';\nimport { warn } from '../../../../utils/logging/warn';\nimport { CanvasSource } from '../../shared/texture/sources/CanvasSource';\nimport { CLEAR } from '../const';\nimport { GlRenderTarget } from '../GlRenderTarget';\n\nimport type { RgbaArray } from '../../../../color/Color';\nimport type { RenderTarget } from '../../shared/renderTarget/RenderTarget';\nimport type { RenderTargetAdaptor, RenderTargetSystem } from '../../shared/renderTarget/RenderTargetSystem';\nimport type { Texture } from '../../shared/texture/Texture';\nimport type { CLEAR_OR_BOOL } from '../const';\nimport type { GlRenderingContext } from '../context/GlRenderingContext';\nimport type { WebGLRenderer } from '../WebGLRenderer';\n\n/**\n * The WebGL adaptor for the render target system. Allows the Render Target System to be used with the WebGL renderer\n * @category rendering\n * @ignore\n */\nexport class GlRenderTargetAdaptor implements RenderTargetAdaptor<GlRenderTarget>\n{\n private _renderTargetSystem: RenderTargetSystem<GlRenderTarget>;\n private _renderer: WebGLRenderer<HTMLCanvasElement>;\n private _clearColorCache: RgbaArray = [0, 0, 0, 0];\n private _viewPortCache: Rectangle = new Rectangle();\n /** Pre-computed draw buffers arrays for MRT, indexed by color attachment count */\n private _drawBuffersCache: number[][];\n /**\n * The framebuffer currently bound to `gl.FRAMEBUFFER`, used to skip a redundant `bindFramebuffer`\n * when re-binding the same target. `undefined` means \"unknown\" (force a real bind). All framebuffer\n * binding must go through {@link bindFramebuffer} to keep this coherent; {@link resetState} marks\n * it unknown when external GL code may have changed the binding.\n */\n private _boundFramebuffer: WebGLFramebuffer | null | undefined = undefined;\n\n public init(renderer: WebGLRenderer, renderTargetSystem: RenderTargetSystem<GlRenderTarget>): void\n {\n this._renderer = renderer;\n this._renderTargetSystem = renderTargetSystem;\n\n renderer.runners.contextChange.add(this);\n }\n\n public contextChange(): void\n {\n this._clearColorCache = [0, 0, 0, 0];\n this._viewPortCache = new Rectangle();\n this._boundFramebuffer = undefined;\n\n // Pre-compute draw buffers arrays for all possible MRT configurations\n const gl = this._renderer.gl;\n\n this._drawBuffersCache = [];\n\n for (let i = 1; i <= 16; i++)\n {\n this._drawBuffersCache[i] = Array.from({ length: i }, (_, j) => gl.COLOR_ATTACHMENT0 + j);\n }\n }\n\n public copyToTexture(\n sourceRenderSurfaceTexture: RenderTarget,\n destinationTexture: Texture,\n originSrc: { x: number; y: number; },\n size: { width: number; height: number; },\n originDest: { x: number; y: number; },\n )\n {\n const renderTargetSystem = this._renderTargetSystem;\n\n const renderer = this._renderer;\n const glRenderTarget = renderTargetSystem.getGpuRenderTarget(sourceRenderSurfaceTexture);\n const gl = renderer.gl;\n\n this.finishRenderPass(sourceRenderSurfaceTexture);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, glRenderTarget.resolveTargetFramebuffer);\n this._boundFramebuffer = glRenderTarget.resolveTargetFramebuffer;\n\n renderer.texture.bind(destinationTexture, 0);\n\n gl.copyTexSubImage2D(gl.TEXTURE_2D, 0,\n originDest.x, originDest.y,\n originSrc.x,\n originSrc.y,\n size.width,\n size.height\n );\n\n return destinationTexture;\n }\n\n public copyDepthTexture(\n source: RenderTarget,\n destination: Texture,\n originSrc: { x: number; y: number; },\n size: { width: number; height: number; },\n originDest: { x: number; y: number; },\n ): void\n {\n const renderTargetSystem = this._renderTargetSystem;\n const gl = this._renderer.gl;\n\n this.finishRenderPass(source);\n\n // blitFramebuffer moves depth between framebuffers, so the destination texture is\n // resolved to its (depth-only) render target to provide one to blit into\n const destinationRenderTarget = renderTargetSystem.getRenderTarget(destination);\n\n const srcGl = renderTargetSystem.getGpuRenderTarget(source);\n const dstGl = renderTargetSystem.getGpuRenderTarget(destinationRenderTarget);\n\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, srcGl.framebuffer);\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, dstGl.framebuffer);\n // READ/DRAW were bound independently, leaving the unified FRAMEBUFFER state ambiguous\n this._boundFramebuffer = undefined;\n\n // Depth blits must use NEAREST, so the source sub-rect must match the destination\n // sub-rect in size (no scaling). We copy `size` pixels from originSrc to originDest.\n gl.blitFramebuffer(\n originSrc.x, originSrc.y, originSrc.x + size.width, originSrc.y + size.height,\n originDest.x, originDest.y, originDest.x + size.width, originDest.y + size.height,\n gl.DEPTH_BUFFER_BIT, gl.NEAREST,\n );\n }\n\n public startRenderPass(\n renderTarget: RenderTarget,\n clear: CLEAR_OR_BOOL = true,\n clearColor?: RgbaArray,\n viewport?: Rectangle,\n mipLevel = 0,\n layer = 0\n )\n {\n const renderTargetSystem = this._renderTargetSystem;\n\n const gpuRenderTarget = renderTargetSystem.getGpuRenderTarget(renderTarget);\n\n // validation..\n if (layer !== 0 && this._renderer.context.webGLVersion < 2)\n {\n throw new Error('[RenderTargetSystem] Rendering to array layers requires WebGL2.');\n }\n\n if (mipLevel > 0)\n {\n if (gpuRenderTarget.msaa)\n {\n throw new Error('[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets.');\n }\n\n if (this._renderer.context.webGLVersion < 2)\n {\n throw new Error('[RenderTargetSystem] Rendering to mip levels requires WebGL2.');\n }\n }\n\n // do the work..\n\n renderTarget.colorAttachments.forEach((attachment) =>\n {\n this._renderer.texture.unbind(attachment.texture);\n });\n\n const gl = this._renderer.gl;\n\n // Skip a redundant glBindFramebuffer when this FBO is already bound (idempotent bind).\n // The attachment (mip/layer) and viewport caches below still re-run their own \"math\".\n this.bindFramebuffer(gpuRenderTarget.framebuffer);\n\n if (\n !renderTarget.isRoot\n && renderTarget.colorAttachments.length > 0\n && (gpuRenderTarget._attachedMipLevel !== mipLevel\n || gpuRenderTarget._attachedLayer !== layer)\n )\n {\n renderTarget.colorAttachments.forEach((attachment, i) =>\n {\n const colorTexture = attachment.texture;\n const glSource = this._renderer.texture.getGlSource(colorTexture);\n\n if (glSource.target === gl.TEXTURE_2D)\n {\n if (layer !== 0)\n {\n throw new Error('[RenderTargetSystem] layer must be 0 when rendering to 2D textures in WebGL.');\n }\n\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0 + i,\n gl.TEXTURE_2D,\n glSource.texture,\n mipLevel\n );\n }\n else if (glSource.target === gl.TEXTURE_2D_ARRAY || glSource.target === gl.TEXTURE_3D)\n {\n gl.framebufferTextureLayer(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0 + i,\n glSource.texture,\n mipLevel,\n layer\n );\n }\n else if (glSource.target === gl.TEXTURE_CUBE_MAP)\n {\n if (layer < 0 || layer > 5)\n {\n throw new Error('[RenderTargetSystem] Cube map layer must be between 0 and 5.');\n }\n\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0 + i,\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + layer,\n glSource.texture,\n mipLevel\n );\n }\n else\n {\n throw new Error('[RenderTargetSystem] Unsupported texture target for render-to-layer in WebGL.');\n }\n });\n\n gpuRenderTarget._attachedMipLevel = mipLevel;\n gpuRenderTarget._attachedLayer = layer;\n }\n\n // the root target renders to the canvas, whose context owns its depth/stencil buffers\n if (gpuRenderTarget.framebuffer)\n {\n if (renderTarget.depthStencilAttachment)\n {\n this._attachDepthStencilTexture(renderTarget, mipLevel, layer);\n }\n // depth/stencil requested without an explicit texture — a renderbuffer is cheaper\n // and (unlike a texture) can be multisampled to match an MSAA color attachment\n else if (!gpuRenderTarget.depthStencilRenderBuffer && (renderTarget.stencil || renderTarget.depth))\n {\n this._initStencil(gpuRenderTarget);\n }\n }\n\n // Set draw buffers for multiple render targets (MRT)\n if (renderTarget.colorAttachments.length > 1)\n {\n this._setDrawBuffers(renderTarget, gl);\n }\n\n let viewPortY = viewport.y;\n\n if (renderTarget.isRoot)\n {\n viewPortY = renderTarget.pixelHeight - viewport.height - viewport.y;\n }\n\n const viewPortCache = this._viewPortCache;\n\n if (viewPortCache.x !== viewport.x\n || viewPortCache.y !== viewPortY\n || viewPortCache.width !== viewport.width\n || viewPortCache.height !== viewport.height)\n {\n viewPortCache.x = viewport.x;\n viewPortCache.y = viewPortY;\n viewPortCache.width = viewport.width;\n viewPortCache.height = viewport.height;\n\n gl.viewport(\n viewport.x,\n viewPortY,\n viewport.width,\n viewport.height,\n );\n }\n\n this.clear(renderTarget, clear, clearColor);\n }\n\n public finishRenderPass(renderTarget?: RenderTarget)\n {\n const renderTargetSystem = this._renderTargetSystem;\n\n const glRenderTarget = renderTargetSystem.getGpuRenderTarget(renderTarget);\n\n // Depth-only targets have no color buffer to resolve\n if (!glRenderTarget.msaa || renderTarget.colorAttachments.length === 0) return;\n\n const gl = this._renderer.gl;\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, glRenderTarget.resolveTargetFramebuffer);\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, glRenderTarget.framebuffer);\n\n gl.blitFramebuffer(\n 0, 0, glRenderTarget.width, glRenderTarget.height,\n 0, 0, glRenderTarget.width, glRenderTarget.height,\n gl.COLOR_BUFFER_BIT, gl.NEAREST,\n );\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, glRenderTarget.framebuffer);\n // we explicitly drove FRAMEBUFFER (both read+draw) back to the multisample framebuffer\n this._boundFramebuffer = glRenderTarget.framebuffer;\n }\n\n public initGpuRenderTarget(renderTarget: RenderTarget): GlRenderTarget\n {\n const renderer = this._renderer;\n\n const gl = renderer.gl;\n\n const glRenderTarget = new GlRenderTarget();\n\n glRenderTarget._attachedMipLevel = 0;\n glRenderTarget._attachedLayer = 0;\n\n const colorTexture = renderTarget.colorTexture;\n\n if (colorTexture instanceof CanvasSource)\n {\n this._renderer.context.ensureCanvasSize(colorTexture.resource);\n\n glRenderTarget.framebuffer = null;\n\n return glRenderTarget;\n }\n\n glRenderTarget.width = renderTarget.pixelWidth;\n glRenderTarget.height = renderTarget.pixelHeight;\n\n if (renderTarget.colorAttachments.length === 0)\n {\n this._initDepth(renderTarget, glRenderTarget);\n }\n else\n {\n this._initColor(renderTarget, glRenderTarget);\n }\n\n if (renderTarget.depthStencilAttachment)\n {\n this._attachDepthStencilTexture(renderTarget, 0, 0);\n }\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n // init drove the binding through several raw framebuffers and ended on the default one\n this._boundFramebuffer = null;\n\n return glRenderTarget;\n }\n\n public destroyGpuRenderTarget(gpuRenderTarget: GlRenderTarget)\n {\n const gl = this._renderer.gl;\n\n if (gpuRenderTarget.framebuffer)\n {\n gl.deleteFramebuffer(gpuRenderTarget.framebuffer);\n gpuRenderTarget.framebuffer = null;\n }\n\n if (gpuRenderTarget.resolveTargetFramebuffer)\n {\n gl.deleteFramebuffer(gpuRenderTarget.resolveTargetFramebuffer);\n gpuRenderTarget.resolveTargetFramebuffer = null;\n }\n\n if (gpuRenderTarget.depthStencilRenderBuffer)\n {\n gl.deleteRenderbuffer(gpuRenderTarget.depthStencilRenderBuffer);\n gpuRenderTarget.depthStencilRenderBuffer = null;\n }\n\n gpuRenderTarget.msaaRenderBuffer.forEach((renderBuffer) =>\n {\n gl.deleteRenderbuffer(renderBuffer);\n });\n\n // stays an array so destroying the same target again finds nothing to delete\n gpuRenderTarget.msaaRenderBuffer.length = 0;\n }\n\n public clear(\n renderTarget: RenderTarget,\n clear: CLEAR_OR_BOOL,\n clearColor?: RgbaArray,\n _viewport?: Rectangle,\n _mipLevel = 0,\n layer = 0\n )\n {\n if (!clear) return;\n\n if (layer !== 0)\n {\n throw new Error('[RenderTargetSystem] Clearing array layers is not supported in WebGL renderer.');\n }\n\n const renderTargetSystem = this._renderTargetSystem;\n\n // if clear is boolean..\n if (typeof clear === 'boolean')\n {\n clear = clear ? CLEAR.ALL : CLEAR.NONE;\n }\n\n // Strip the COLOR bit for depth-only targets – there is no color buffer to clear.\n if (renderTarget.colorAttachments.length === 0)\n {\n clear &= ~CLEAR.COLOR;\n\n if (!clear) return;\n }\n\n const gl = this._renderer.gl;\n\n // gl.clear's depth write is masked by gl.depthMask, which 2D rendering\n // (State.for2d) leaves disabled — force it on for the clear, then restore\n const forceDepthMask = !!(clear & CLEAR.DEPTH) && !this._renderer.state.depthMaskEnabled;\n\n if (clear & CLEAR.COLOR)\n {\n clearColor ??= renderTargetSystem.defaultClearColor;\n\n const clearColorCache = this._clearColorCache;\n const clearColorArray = clearColor as number[];\n\n if (clearColorCache[0] !== clearColorArray[0]\n || clearColorCache[1] !== clearColorArray[1]\n || clearColorCache[2] !== clearColorArray[2]\n || clearColorCache[3] !== clearColorArray[3])\n {\n clearColorCache[0] = clearColorArray[0];\n clearColorCache[1] = clearColorArray[1];\n clearColorCache[2] = clearColorArray[2];\n clearColorCache[3] = clearColorArray[3];\n\n gl.clearColor(clearColorArray[0], clearColorArray[1], clearColorArray[2], clearColorArray[3]);\n }\n }\n\n if (forceDepthMask) gl.depthMask(true);\n\n gl.clear(clear);\n\n if (forceDepthMask) gl.depthMask(false);\n }\n\n public resizeGpuRenderTarget(renderTarget: RenderTarget)\n {\n if (renderTarget.isRoot) return;\n\n const glRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget);\n\n glRenderTarget.width = renderTarget.pixelWidth;\n glRenderTarget.height = renderTarget.pixelHeight;\n\n if (renderTarget.colorAttachments.length > 0)\n {\n this._resizeColor(renderTarget, glRenderTarget);\n }\n\n if (glRenderTarget.depthStencilRenderBuffer)\n {\n this._resizeStencil(glRenderTarget);\n }\n\n // _resizeColor (MSAA) rebinds framebuffers; force the next startRenderPass to bind explicitly\n this._boundFramebuffer = undefined;\n }\n\n private _initColor(renderTarget: RenderTarget, glRenderTarget: GlRenderTarget)\n {\n const renderer = this._renderer;\n\n const gl = renderer.gl;\n // deal with our outputs..\n const resolveTargetFramebuffer = gl.createFramebuffer();\n\n glRenderTarget.resolveTargetFramebuffer = resolveTargetFramebuffer;\n\n // set up the texture..\n gl.bindFramebuffer(gl.FRAMEBUFFER, resolveTargetFramebuffer);\n\n const colorAttachments = renderTarget.colorAttachments;\n\n colorAttachments.forEach((colorAttachment, i) =>\n {\n const source = colorAttachment.texture;\n\n if (source.antialias)\n {\n if (renderer.context.supports.msaa)\n {\n glRenderTarget.msaa = true;\n }\n else\n {\n warn('[RenderTexture] Antialiasing on textures is not supported in WebGL1');\n }\n }\n\n // TODO bindSource could return the glTexture\n renderer.texture.bindSource(source, 0);\n const glSource = renderer.texture.getGlSource(source);\n\n const glTexture = glSource.texture;\n\n // Initial attachment is mip 0, layer 0.\n if (glSource.target === gl.TEXTURE_2D)\n {\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0 + i,\n gl.TEXTURE_2D,\n glTexture,\n 0\n );\n }\n else if (glSource.target === gl.TEXTURE_2D_ARRAY || glSource.target === gl.TEXTURE_3D)\n {\n gl.framebufferTextureLayer(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0 + i,\n glTexture,\n 0,\n 0\n );\n }\n else if (glSource.target === gl.TEXTURE_CUBE_MAP)\n {\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0 + i,\n gl.TEXTURE_CUBE_MAP_POSITIVE_X,\n glTexture,\n 0\n );\n }\n else\n {\n throw new Error('[RenderTargetSystem] Unsupported texture target for framebuffer attachment.');\n }\n });\n\n if (glRenderTarget.msaa)\n {\n const viewFramebuffer = gl.createFramebuffer();\n\n glRenderTarget.framebuffer = viewFramebuffer;\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, viewFramebuffer);\n\n renderTarget.colorAttachments.forEach((_, i) =>\n {\n const msaaRenderBuffer = gl.createRenderbuffer();\n\n glRenderTarget.msaaRenderBuffer[i] = msaaRenderBuffer;\n });\n }\n else\n {\n glRenderTarget.framebuffer = resolveTargetFramebuffer;\n }\n\n this._resizeColor(renderTarget, glRenderTarget);\n }\n\n private _initDepth(_renderTarget: RenderTarget, glRenderTarget: GlRenderTarget)\n {\n const renderer = this._renderer;\n\n if (renderer.context.webGLVersion < 2)\n {\n throw new Error('[RenderTargetSystem] Depth-only render targets require WebGL2.');\n }\n\n const gl = renderer.gl;\n const framebuffer = gl.createFramebuffer();\n\n glRenderTarget.resolveTargetFramebuffer = framebuffer;\n glRenderTarget.framebuffer = framebuffer;\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n\n gl.drawBuffers([gl.NONE]);\n gl.readBuffer(gl.NONE);\n }\n\n private _resizeColor(renderTarget: RenderTarget, glRenderTarget: GlRenderTarget)\n {\n const source = renderTarget.colorAttachments[0].texture;\n\n // After a resize, attachments are implicitly at mip 0 again (and non-zero mip allocations may have changed).\n // Force a re-attach on next mip render.\n glRenderTarget._attachedMipLevel = 0;\n glRenderTarget._attachedLayer = 0;\n\n renderTarget.colorAttachments.forEach((colorAttachment, i) =>\n {\n // no need to resize the first texture..\n if (i === 0) return;\n\n colorAttachment.texture.resize(source.width, source.height, source._resolution);\n });\n\n if (glRenderTarget.msaa)\n {\n const renderer = this._renderer;\n const gl = renderer.gl;\n\n const viewFramebuffer = glRenderTarget.framebuffer;\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, viewFramebuffer);\n\n renderTarget.colorAttachments.forEach((colorAttachment, i) =>\n {\n const source = colorAttachment.texture;\n\n renderer.texture.bindSource(source, 0);\n const glSource = renderer.texture.getGlSource(source);\n\n const glInternalFormat = glSource.internalFormat;\n\n const msaaRenderBuffer = glRenderTarget.msaaRenderBuffer[i];\n\n gl.bindRenderbuffer(\n gl.RENDERBUFFER,\n msaaRenderBuffer\n );\n\n gl.renderbufferStorageMultisample(\n gl.RENDERBUFFER,\n 4,\n glInternalFormat,\n source.pixelWidth,\n source.pixelHeight\n );\n\n gl.framebufferRenderbuffer(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0 + i,\n gl.RENDERBUFFER,\n msaaRenderBuffer\n );\n });\n }\n }\n\n private _attachDepthStencilTexture(\n renderTarget: RenderTarget,\n mipLevel: number,\n layer: number\n )\n {\n const renderer = this._renderer;\n const gl = renderer.gl;\n const source = renderTarget.depthStencilAttachment.texture;\n\n const glSource = renderer.texture.getGlSource(source);\n const glTexture = glSource.texture;\n const format = source.format;\n\n // the attachment point must match the texture's aspects, or the framebuffer is incomplete\n let attachment: number;\n\n if (format === 'depth24plus-stencil8' || format === 'depth32float-stencil8')\n {\n attachment = gl.DEPTH_STENCIL_ATTACHMENT;\n }\n else if (format === 'stencil8')\n {\n attachment = gl.STENCIL_ATTACHMENT;\n }\n else\n {\n attachment = gl.DEPTH_ATTACHMENT;\n }\n\n if (glSource.target === gl.TEXTURE_2D)\n {\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n attachment,\n gl.TEXTURE_2D,\n glTexture,\n mipLevel\n );\n }\n else if (glSource.target === gl.TEXTURE_2D_ARRAY || glSource.target === gl.TEXTURE_3D)\n {\n gl.framebufferTextureLayer(\n gl.FRAMEBUFFER,\n attachment,\n glTexture,\n mipLevel,\n layer\n );\n }\n else if (glSource.target === gl.TEXTURE_CUBE_MAP)\n {\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n attachment,\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + layer,\n glTexture,\n mipLevel\n );\n }\n }\n\n private _initStencil(glRenderTarget: GlRenderTarget)\n {\n // this already exists on the default screen\n if (glRenderTarget.framebuffer === null) return;\n\n const gl = this._renderer.gl;\n\n const depthStencilRenderBuffer = gl.createRenderbuffer();\n\n glRenderTarget.depthStencilRenderBuffer = depthStencilRenderBuffer;\n\n gl.bindRenderbuffer(\n gl.RENDERBUFFER,\n depthStencilRenderBuffer\n );\n\n gl.framebufferRenderbuffer(\n gl.FRAMEBUFFER,\n gl.DEPTH_STENCIL_ATTACHMENT,\n gl.RENDERBUFFER,\n depthStencilRenderBuffer\n );\n\n // TODO\n this._resizeStencil(glRenderTarget);\n }\n\n private _resizeStencil(glRenderTarget: GlRenderTarget)\n {\n const gl = this._renderer.gl;\n\n gl.bindRenderbuffer(\n gl.RENDERBUFFER,\n glRenderTarget.depthStencilRenderBuffer\n );\n\n if (glRenderTarget.msaa)\n {\n gl.renderbufferStorageMultisample(\n gl.RENDERBUFFER,\n 4,\n gl.DEPTH24_STENCIL8,\n glRenderTarget.width,\n glRenderTarget.height\n );\n }\n else\n {\n gl.renderbufferStorage(\n gl.RENDERBUFFER,\n this._renderer.context.webGLVersion === 2\n ? gl.DEPTH24_STENCIL8\n : gl.DEPTH_STENCIL,\n glRenderTarget.width,\n glRenderTarget.height\n );\n }\n }\n\n public prerender(renderTarget: RenderTarget)\n {\n if (renderTarget.colorAttachments.length === 0) return;\n\n const resource = renderTarget.colorAttachments[0].texture.resource;\n\n if (this._renderer.context.multiView && CanvasSource.test(resource))\n {\n this._renderer.context.ensureCanvasSize(resource);\n }\n }\n\n public postrender(renderTarget: RenderTarget)\n {\n if (!this._renderer.context.multiView || renderTarget.colorAttachments.length === 0) return;\n\n const colorTexture = renderTarget.colorAttachments[0].texture;\n\n if (CanvasSource.test(colorTexture.resource))\n {\n const contextCanvas = this._renderer.context.canvas;\n const canvasSource = colorTexture as unknown as CanvasSource;\n\n canvasSource.context2D.drawImage(\n contextCanvas as CanvasImageSource,\n 0, canvasSource.pixelHeight - contextCanvas.height\n );\n }\n }\n\n private _setDrawBuffers(renderTarget: RenderTarget, gl: GlRenderingContext): void\n {\n const count = renderTarget.colorAttachments.length;\n const bufferArray = this._drawBuffersCache[count];\n\n if (this._renderer.context.webGLVersion === 1)\n {\n const ext = this._renderer.context.extensions.drawBuffers;\n\n if (!ext)\n {\n warn('[RenderTexture] This WebGL1 context does not support rendering to multiple targets');\n }\n else\n {\n ext.drawBuffersWEBGL(bufferArray);\n }\n }\n else\n {\n // WebGL2 has built in support\n gl.drawBuffers(bufferArray);\n }\n }\n\n /**\n * Forget the GL-call caches (framebuffer binding, viewport, clear color) so the next pass\n * re-applies them. Called via the renderer's `resetState` runner when external GL code may\n * have changed state behind our back.\n */\n public resetState(): void\n {\n this._boundFramebuffer = undefined;\n this._viewPortCache = new Rectangle();\n this._clearColorCache = [0, 0, 0, 0];\n }\n\n /**\n * Binds a framebuffer to `gl.FRAMEBUFFER`, skipping the call when it is already bound.\n * The single blessed way to bind a framebuffer — keeps {@link _boundFramebuffer} coherent.\n * @param framebuffer - the framebuffer to bind\n * @internal\n */\n public bindFramebuffer(framebuffer: WebGLFramebuffer | null): void\n {\n if (this._boundFramebuffer === framebuffer) return;\n\n this._boundFramebuffer = framebuffer;\n this._renderer.gl.bindFramebuffer(this._renderer.gl.FRAMEBUFFER, framebuffer);\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { warn } from '../../../utils/logging/warn';\nimport { Geometry } from '../shared/geometry/Geometry';\nimport { Shader } from '../shared/shader/Shader';\nimport { State } from '../shared/state/State';\nimport { TextureSource } from '../shared/texture/sources/TextureSource';\nimport { Texture } from '../shared/texture/Texture';\nimport { GlProgram } from './shader/GlProgram';\n\nimport type { RenderOptions } from '../shared/system/AbstractRenderer';\nimport type { System } from '../shared/system/System';\nimport type { WebGLRenderer } from './WebGLRenderer';\n\nconst bigTriangleGeometry = new Geometry({\n attributes: {\n aPosition: [\n -1.0, -1.0, // Bottom left corner\n 3.0, -1.0, // Bottom right corner, extending beyond right edge\n -1.0, 3.0 // Top left corner, extending beyond top edge\n ],\n },\n});\n\n/**\n * The options for the back buffer system.\n * @category rendering\n * @property {boolean} [useBackBuffer=false] - if true will use the back buffer where required\n * @property {boolean} [antialias=false] - if true will ensure the texture is antialiased\n * @advanced\n */\nexport interface GlBackBufferOptions\n{\n /**\n * if true will use the back buffer where required\n * @default false\n */\n useBackBuffer?: boolean;\n /** if true will ensure the texture is antialiased */\n antialias?: boolean;\n}\n\n/**\n * For blend modes you need to know what pixels you are actually drawing to. For this to be possible in WebGL\n * we need to render to a texture and then present that texture to the screen. This system manages that process.\n *\n * As the main scene is rendered to a texture, it means we can sample it and copy its pixels,\n * something not possible on the main canvas.\n *\n * If antialiasing is set to to true and useBackBuffer is set to true, then the back buffer will be antialiased.\n * and the main gl context will not.\n *\n * You only need to activate this back buffer if you are using a blend mode that requires it.\n *\n * to activate is simple, you pass `useBackBuffer:true` to your render options\n * @category rendering\n * @advanced\n */\nexport class GlBackBufferSystem implements System<GlBackBufferOptions>\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'backBuffer',\n priority: 1\n } as const;\n\n /** default options for the back buffer system */\n public static defaultOptions: GlBackBufferOptions = {\n /** if true will use the back buffer where required */\n useBackBuffer: false,\n };\n\n /** if true, the back buffer is used */\n public useBackBuffer = false;\n\n private _backBufferTexture: Texture;\n private readonly _renderer: WebGLRenderer;\n private _targetTexture: TextureSource;\n private _useBackBufferThisRender = false;\n private _antialias: boolean;\n private _state: State;\n private _bigTriangleShader: Shader;\n\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n }\n\n public init(options: GlBackBufferOptions = {})\n {\n const { useBackBuffer, antialias } = { ...GlBackBufferSystem.defaultOptions, ...options };\n\n this.useBackBuffer = useBackBuffer;\n\n this._antialias = antialias;\n\n if (!this._renderer.context.supports.msaa)\n {\n warn('antialiasing, is not supported on when using the back buffer');\n\n this._antialias = false;\n }\n\n this._state = State.for2d();\n\n const bigTriangleProgram = new GlProgram({\n vertex: `\n attribute vec2 aPosition;\n out vec2 vUv;\n\n void main() {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n\n vUv = (aPosition + 1.0) / 2.0;\n\n // flip dem UVs\n vUv.y = 1.0 - vUv.y;\n }`,\n fragment: `\n in vec2 vUv;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n void main() {\n finalColor = texture(uTexture, vUv);\n }`,\n name: 'big-triangle',\n });\n\n this._bigTriangleShader = new Shader({\n glProgram: bigTriangleProgram,\n resources: {\n uTexture: Texture.WHITE.source,\n },\n });\n }\n\n /**\n * This is called before the RenderTargetSystem is started. This is where\n * we replace the target with the back buffer if required.\n * @param options - The options for this render.\n */\n protected renderStart(options: RenderOptions)\n {\n const renderTarget = this._renderer.renderTarget.getRenderTarget(options.target);\n\n this._useBackBufferThisRender = this.useBackBuffer && !!renderTarget.isRoot;\n\n if (this._useBackBufferThisRender)\n {\n const renderTarget = this._renderer.renderTarget.getRenderTarget(options.target);\n\n this._targetTexture = renderTarget.colorTexture;\n\n options.target = this._getBackBufferTexture(renderTarget.colorTexture);\n }\n }\n\n protected renderEnd()\n {\n this._presentBackBuffer();\n }\n\n private _presentBackBuffer()\n {\n const renderer = this._renderer;\n\n renderer.renderTarget.finishRenderPass();\n\n if (!this._useBackBufferThisRender) return;\n\n renderer.renderTarget.bind({ target: this._targetTexture, clear: false });\n\n this._bigTriangleShader.resources.uTexture = this._backBufferTexture.source;\n\n renderer.encoder.draw({\n geometry: bigTriangleGeometry,\n shader: this._bigTriangleShader,\n state: this._state,\n });\n }\n\n private _getBackBufferTexture(targetSourceTexture: TextureSource)\n {\n this._backBufferTexture = this._backBufferTexture || new Texture({\n source: new TextureSource({\n width: targetSourceTexture.width,\n height: targetSourceTexture.height,\n resolution: targetSourceTexture._resolution,\n antialias: this._antialias,\n }),\n });\n\n // this will not resize if its the same size already! No extra check required\n this._backBufferTexture.source.resize(\n targetSourceTexture.width,\n targetSourceTexture.height,\n targetSourceTexture._resolution,\n );\n\n return this._backBufferTexture;\n }\n\n /** destroys the back buffer */\n public destroy()\n {\n if (this._backBufferTexture)\n {\n this._backBufferTexture.destroy();\n this._backBufferTexture = null;\n }\n }\n}\n","/** @internal */\nexport const scaleModeToGlFilter = {\n linear: 9729,\n nearest: 9728,\n};\n\n/** @internal */\nexport const mipmapScaleModeToGlFilter = {\n linear: {\n linear: 9987,\n nearest: 9985,\n },\n nearest: {\n linear: 9986,\n nearest: 9984,\n }\n};\n\n/** @internal */\nexport const wrapModeToGlAddress = {\n 'clamp-to-edge': 33071,\n repeat: 10497,\n 'mirror-repeat': 33648,\n};\n\n/** @internal */\nexport const compareModeToGlCompare = {\n never: 512,\n less: 513,\n equal: 514,\n 'less-equal': 515,\n greater: 516,\n 'not-equal': 517,\n 'greater-equal': 518,\n always: 519,\n};\n\n","import type { GlRenderingContext } from '../../context/GlRenderingContext';\n\n/**\n * Returns a lookup table that maps each type-format pair to a compatible internal format.\n * @function mapTypeAndFormatToInternalFormat\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @returns Lookup table.\n */\nexport function mapFormatToGlFormat(gl: GlRenderingContext): Record<string, number>\n{\n return {\n // 8-bit formats\n r8unorm: gl.RED,\n r8snorm: gl.RED,\n r8uint: gl.RED_INTEGER,\n r8sint: gl.RED_INTEGER,\n\n // 16-bit formats\n r16uint: gl.RED_INTEGER,\n r16sint: gl.RED_INTEGER,\n r16float: gl.RED,\n rg8unorm: gl.RG,\n rg8snorm: gl.RG,\n rg8uint: gl.RG_INTEGER,\n rg8sint: gl.RG_INTEGER,\n\n // 32-bit formats\n r32uint: gl.RED_INTEGER,\n r32sint: gl.RED_INTEGER,\n r32float: gl.RED,\n rg16uint: gl.RG_INTEGER,\n rg16sint: gl.RG_INTEGER,\n rg16float: gl.RG,\n rgba8unorm: gl.RGBA,\n 'rgba8unorm-srgb': gl.RGBA,\n\n // Packed 32-bit formats\n rgba8snorm: gl.RGBA,\n rgba8uint: gl.RGBA_INTEGER,\n rgba8sint: gl.RGBA_INTEGER,\n bgra8unorm: gl.RGBA,\n 'bgra8unorm-srgb': gl.RGBA,\n rgb9e5ufloat: gl.RGB,\n rgb10a2unorm: gl.RGBA,\n rg11b10ufloat: gl.RGB,\n\n // 64-bit formats\n rg32uint: gl.RG_INTEGER,\n rg32sint: gl.RG_INTEGER,\n rg32float: gl.RG,\n rgba16uint: gl.RGBA_INTEGER,\n rgba16sint: gl.RGBA_INTEGER,\n rgba16float: gl.RGBA,\n\n // 128-bit formats\n rgba32uint: gl.RGBA_INTEGER,\n rgba32sint: gl.RGBA_INTEGER,\n rgba32float: gl.RGBA,\n\n // Depth/stencil formats\n stencil8: gl.STENCIL_INDEX8,\n depth16unorm: gl.DEPTH_COMPONENT,\n depth24plus: gl.DEPTH_COMPONENT,\n 'depth24plus-stencil8': gl.DEPTH_STENCIL,\n depth32float: gl.DEPTH_COMPONENT,\n 'depth32float-stencil8': gl.DEPTH_STENCIL,\n\n };\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { generateShaderSyncCode } from './GenerateShaderSyncCode';\nimport { generateProgram } from './program/generateProgram';\n\nimport type { BufferResource } from '../../shared/buffer/BufferResource';\nimport type { Shader } from '../../shared/shader/Shader';\nimport type { UniformGroup } from '../../shared/shader/UniformGroup';\nimport type { GlRenderingContext } from '../context/GlRenderingContext';\nimport type { WebGLRenderer } from '../WebGLRenderer';\nimport type { GlProgram } from './GlProgram';\nimport type { GlProgramData } from './GlProgramData';\n\n/** @internal */\nexport interface ShaderSyncData\n{\n textureCount: number;\n blockIndex: number;\n}\n\n/** @internal */\nexport type ShaderSyncFunction = (renderer: WebGLRenderer, shader: Shader, syncData: ShaderSyncData) => void;\n\n// default sync data so we don't create a new one each time!\nconst defaultSyncData: ShaderSyncData = {\n textureCount: 0,\n blockIndex: 0,\n};\n\n/**\n * System plugin to the renderer to manage the shaders for WebGL.\n * @category rendering\n * @advanced\n */\nexport class GlShaderSystem\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'shader',\n } as const;\n\n /** @internal */\n public _activeProgram: GlProgram = null;\n\n private _programDataHash: Record<string, GlProgramData> = Object.create(null);\n private readonly _renderer: WebGLRenderer;\n /** @internal */\n public _gl: WebGL2RenderingContext;\n private _shaderSyncFunctions: Record<string, ShaderSyncFunction> = Object.create(null);\n\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n }\n\n protected contextChange(gl: GlRenderingContext): void\n {\n this._gl = gl;\n\n this._programDataHash = Object.create(null);\n /**\n * these need to also be cleared as internally some uniforms are set as an optimisation as the sync\n * function is generated. Specifically the texture ints.\n */\n this._shaderSyncFunctions = Object.create(null);\n this._activeProgram = null;\n }\n\n /**\n * Changes the current shader to the one given in parameter.\n * @param shader - the new shader\n * @param skipSync - false if the shader should automatically sync its uniforms.\n * @returns the glProgram that belongs to the shader.\n */\n public bind(shader: Shader, skipSync?: boolean): void\n {\n this._setProgram(shader.glProgram);\n\n if (skipSync) return;\n\n defaultSyncData.textureCount = 0;\n defaultSyncData.blockIndex = 0;\n\n let syncFunction = this._shaderSyncFunctions[shader.glProgram._key];\n\n if (!syncFunction)\n {\n syncFunction = this._shaderSyncFunctions[shader.glProgram._key] = this._generateShaderSync(shader, this);\n }\n\n // TODO: take into account number of TF buffers. Currently works only with interleaved\n this._renderer.buffer.nextBindBase(!!shader.glProgram.transformFeedbackVaryings);\n syncFunction(this._renderer, shader, defaultSyncData);\n }\n\n /**\n * Updates the uniform group.\n * @param uniformGroup - the uniform group to update\n */\n public updateUniformGroup(uniformGroup: UniformGroup): void\n {\n this._renderer.uniformGroup.updateUniformGroup(uniformGroup, this._activeProgram, defaultSyncData);\n }\n\n /**\n * Binds a uniform block to the shader.\n * @param uniformGroup - the uniform group to bind\n * @param name - the name of the uniform block\n * @param index - the index of the uniform block\n */\n public bindUniformBlock(uniformGroup: UniformGroup | BufferResource, name: string, index = 0): void\n {\n const bufferSystem = this._renderer.buffer;\n const programData = this._getProgramData(this._activeProgram);\n\n const isBufferResource = (uniformGroup as BufferResource)._bufferResource;\n\n if (!isBufferResource)\n {\n this._renderer.ubo.updateUniformGroup(uniformGroup as UniformGroup);\n }\n\n const buffer = uniformGroup.buffer;\n\n const glBuffer = bufferSystem.updateBuffer(buffer);\n\n const boundLocation = bufferSystem.freeLocationForBufferBase(glBuffer);\n\n if (isBufferResource)\n {\n const { offset, size } = (uniformGroup as BufferResource);\n\n // trivial case of buffer resource, can be cached\n if (offset === 0 && size === buffer.data.byteLength)\n {\n bufferSystem.bindBufferBase(glBuffer, boundLocation);\n }\n else\n {\n bufferSystem.bindBufferRange(glBuffer, boundLocation, offset);\n }\n }\n else if (bufferSystem.getLastBindBaseLocation(glBuffer) !== boundLocation)\n {\n // confirmation that buffer isn't there yet\n bufferSystem.bindBufferBase(glBuffer, boundLocation);\n }\n\n const uniformBlockIndex = this._activeProgram._uniformBlockData[name].index;\n\n if (programData.uniformBlockBindings[index] === boundLocation) return;\n programData.uniformBlockBindings[index] = boundLocation;\n\n this._renderer.gl.uniformBlockBinding(programData.program, uniformBlockIndex, boundLocation);\n }\n\n private _setProgram(program: GlProgram)\n {\n if (this._activeProgram === program) return;\n\n this._activeProgram = program;\n\n const programData = this._getProgramData(program);\n\n this._gl.useProgram(programData.program);\n }\n\n /**\n * @param program - the program to get the data for\n * @internal\n */\n public _getProgramData(program: GlProgram): GlProgramData\n {\n return this._programDataHash[program._key] || this._createProgramData(program);\n }\n\n private _createProgramData(program: GlProgram): GlProgramData\n {\n const key = program._key;\n\n this._programDataHash[key] = generateProgram(this._gl, program);\n\n return this._programDataHash[key];\n }\n\n public destroy(): void\n {\n for (const key of Object.keys(this._programDataHash))\n {\n this._programDataHash[key].destroy();\n }\n\n this._programDataHash = null;\n this._shaderSyncFunctions = null;\n this._activeProgram = null;\n (this._renderer as null) = null;\n this._gl = null;\n }\n\n /**\n * Creates a function that can be executed that will sync the shader as efficiently as possible.\n * Overridden by the unsafe eval package if you don't want eval used in your project.\n * @param shader - the shader to generate the sync function for\n * @param shaderSystem - the shader system to use\n * @returns - the generated sync function\n * @ignore\n */\n public _generateShaderSync(shader: Shader, shaderSystem: GlShaderSystem): ShaderSyncFunction\n {\n return generateShaderSyncCode(shader, shaderSystem);\n }\n\n public resetState(): void\n {\n this._activeProgram = null;\n }\n}\n","import { warn } from '../../../../../utils/logging/warn';\nimport { GlProgramData } from '../GlProgramData';\nimport { compileShader } from './compileShader';\nimport { defaultValue } from './defaultValue';\nimport { extractAttributesFromGlProgram } from './extractAttributesFromGlProgram';\nimport { getUboData } from './getUboData';\nimport { getUniformData } from './getUniformData';\nimport { logProgramError } from './logProgramError';\n\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\nimport type { GlProgram } from '../GlProgram';\nimport type { IGLUniformData } from '../GlProgramData';\n\n/**\n * generates a WebGL Program object from a high level Pixi Program.\n * @param gl - a rendering context on which to generate the program\n * @param program - the high level Pixi Program.\n * @private\n */\nexport function generateProgram(gl: GlRenderingContext, program: GlProgram): GlProgramData\n{\n const glVertShader = compileShader(gl, gl.VERTEX_SHADER, program.vertex);\n const glFragShader = compileShader(gl, gl.FRAGMENT_SHADER, program.fragment);\n\n const webGLProgram = gl.createProgram();\n\n gl.attachShader(webGLProgram, glVertShader);\n gl.attachShader(webGLProgram, glFragShader);\n\n const transformFeedbackVaryings = program.transformFeedbackVaryings;\n\n if (transformFeedbackVaryings)\n {\n if (typeof gl.transformFeedbackVaryings !== 'function')\n {\n // #if _DEBUG\n warn(`TransformFeedback is not supported but TransformFeedbackVaryings are given.`);\n // #endif\n }\n else\n {\n gl.transformFeedbackVaryings(\n webGLProgram,\n transformFeedbackVaryings.names,\n transformFeedbackVaryings.bufferMode === 'separate'\n ? gl.SEPARATE_ATTRIBS\n : gl.INTERLEAVED_ATTRIBS\n );\n }\n }\n\n gl.linkProgram(webGLProgram);\n\n if (!gl.getProgramParameter(webGLProgram, gl.LINK_STATUS))\n {\n logProgramError(gl, webGLProgram, glVertShader, glFragShader);\n }\n\n // GLSL 1.00: bind attributes sorted by name in ascending order\n // GLSL 3.00: don't change the attribute locations that where chosen by the compiler\n // or assigned by the layout specifier in the shader source code\n program._attributeData = extractAttributesFromGlProgram(\n webGLProgram,\n gl,\n !(/^[ \\t]*#[ \\t]*version[ \\t]+300[ \\t]+es[ \\t]*$/m).test(program.vertex)\n );\n\n program._uniformData = getUniformData(webGLProgram, gl);\n program._uniformBlockData = getUboData(webGLProgram, gl);\n\n gl.deleteShader(glVertShader);\n gl.deleteShader(glFragShader);\n\n const uniformData: {[key: string]: IGLUniformData} = {};\n\n for (const i in program._uniformData)\n {\n const data = program._uniformData[i];\n\n uniformData[i] = {\n location: gl.getUniformLocation(webGLProgram, i),\n value: defaultValue(data.type, data.size),\n };\n }\n\n const glProgram = new GlProgramData(webGLProgram, uniformData);\n\n return glProgram;\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { GpuStencilModesToPixi } from '../gpu/state/GpuStencilModesToPixi';\nimport { STENCIL_MODES } from '../shared/state/const';\n\nimport type { RenderTarget } from '../shared/renderTarget/RenderTarget';\nimport type { System } from '../shared/system/System';\nimport type { GlRenderTarget } from './GlRenderTarget';\nimport type { WebGLRenderer } from './WebGLRenderer';\n\n/**\n * This manages the stencil buffer. Used primarily for masking\n * @category rendering\n * @advanced\n */\nexport class GlStencilSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'stencil',\n } as const;\n\n private readonly _renderer: WebGLRenderer;\n private _gl: WebGLRenderingContext;\n\n private readonly _stencilCache = {\n enabled: false,\n stencilReference: 0,\n stencilMode: STENCIL_MODES.NONE,\n };\n\n private _stencilOpsMapping: {\n keep: number;\n zero: number;\n replace: number;\n invert: number;\n 'increment-clamp': number;\n 'decrement-clamp': number;\n 'increment-wrap': number;\n 'decrement-wrap': number;\n };\n\n private _comparisonFuncMapping: {\n always: number;\n never: number;\n equal: number;\n 'not-equal': number;\n less: number;\n 'less-equal': number;\n greater: number;\n 'greater-equal': number;\n };\n\n private _activeRenderTarget: RenderTarget;\n /** the backend counterpart of the active render target, which carries the stencil state being tracked */\n private _activeGpuRenderTarget: GlRenderTarget;\n\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n\n renderer.renderTarget.onRenderTargetChange.add(this);\n }\n\n protected contextChange(gl: WebGLRenderingContext)\n {\n // TODO - this could be declared in a gl const\n // we know the numbers don't tend to change!\n this._gl = gl;\n\n this._comparisonFuncMapping = {\n always: gl.ALWAYS,\n never: gl.NEVER,\n equal: gl.EQUAL,\n 'not-equal': gl.NOTEQUAL,\n less: gl.LESS,\n 'less-equal': gl.LEQUAL,\n greater: gl.GREATER,\n 'greater-equal': gl.GEQUAL,\n };\n\n this._stencilOpsMapping = {\n keep: gl.KEEP,\n zero: gl.ZERO,\n replace: gl.REPLACE,\n invert: gl.INVERT,\n 'increment-clamp': gl.INCR,\n 'decrement-clamp': gl.DECR,\n 'increment-wrap': gl.INCR_WRAP,\n 'decrement-wrap': gl.DECR_WRAP,\n };\n\n // the backend render targets were rebuilt with the context, so the stencil state starts over;\n // the next setStencilMode picks up the rebuilt object, as no change event announces it\n this._activeGpuRenderTarget = null;\n\n this.resetState();\n }\n\n protected onRenderTargetChange(renderTarget: RenderTarget)\n {\n if (this._activeRenderTarget === renderTarget) return;\n\n this._activeRenderTarget = renderTarget;\n\n const gpuRenderTarget = this._renderer.renderTarget.getGpuRenderTarget(renderTarget);\n\n this._activeGpuRenderTarget = gpuRenderTarget;\n\n // restore the current render targets stencil state..\n this.setStencilMode(gpuRenderTarget.stencilMode, gpuRenderTarget.stencilReference);\n }\n\n public resetState()\n {\n // reset stencil cache\n this._stencilCache.enabled = false;\n this._stencilCache.stencilMode = STENCIL_MODES.NONE;\n this._stencilCache.stencilReference = 0;\n }\n\n public setStencilMode(stencilMode: STENCIL_MODES, stencilReference: number)\n {\n const gpuRenderTarget = this._activeGpuRenderTarget\n ??= this._renderer.renderTarget.getGpuRenderTarget(this._activeRenderTarget);\n\n const gl = this._gl;\n const mode = GpuStencilModesToPixi[stencilMode];\n\n const _stencilCache = this._stencilCache;\n\n // store the stencil state for restoration later, if a render target changes\n gpuRenderTarget.stencilMode = stencilMode;\n gpuRenderTarget.stencilReference = stencilReference;\n\n if (stencilMode === STENCIL_MODES.DISABLED)\n {\n if (this._stencilCache.enabled)\n {\n this._stencilCache.enabled = false;\n\n gl.disable(gl.STENCIL_TEST);\n }\n\n return;\n }\n\n if (!this._stencilCache.enabled)\n {\n this._stencilCache.enabled = true;\n gl.enable(gl.STENCIL_TEST);\n }\n\n if (stencilMode !== _stencilCache.stencilMode || _stencilCache.stencilReference !== stencilReference)\n {\n _stencilCache.stencilMode = stencilMode;\n _stencilCache.stencilReference = stencilReference;\n\n // this is pretty simple mapping.\n // will work for pixi's simple mask cases.\n // although a true mapping of the GPU state to webGL state should be done\n gl.stencilFunc(this._comparisonFuncMapping[mode.stencilBack.compare], stencilReference, 0xFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, this._stencilOpsMapping[mode.stencilBack.passOp]);\n }\n }\n\n public destroy()\n {\n this._renderer.renderTarget.onRenderTargetChange.remove(this);\n\n (this._renderer as null) = null;\n this._gl = null;\n\n this._activeRenderTarget = null;\n this._activeGpuRenderTarget = null;\n }\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { generateUniformsSync } from './utils/generateUniformsSync';\n\nimport type { UniformsSyncCallback } from '../../shared/shader/types';\nimport type { UniformGroup } from '../../shared/shader/UniformGroup';\nimport type { System } from '../../shared/system/System';\nimport type { GlRenderingContext } from '../context/GlRenderingContext';\nimport type { WebGLRenderer } from '../WebGLRenderer';\nimport type { GlProgram, GlUniformData } from './GlProgram';\n\n/**\n * System plugin to the renderer to manage shaders.\n * @category rendering\n * @advanced\n */\nexport class GlUniformGroupSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'uniformGroup',\n } as const;\n\n /**\n * The current WebGL rendering context.\n * @type {WebGLRenderingContext}\n */\n protected gl: GlRenderingContext;\n\n /** Cache to holds the generated functions. Stored against UniformObjects unique signature. */\n private _cache: Record<string, UniformsSyncCallback> = {};\n private _renderer: WebGLRenderer;\n\n private _uniformGroupSyncHash: Record<string, Record<string, UniformsSyncCallback>> = {};\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n\n this.gl = null;\n this._cache = {};\n }\n\n protected contextChange(gl: GlRenderingContext): void\n {\n this.gl = gl;\n }\n\n /**\n * Uploads the uniforms values to the currently bound shader.\n * @param group - the uniforms values that be applied to the current shader\n * @param program\n * @param syncData\n * @param syncData.textureCount\n */\n public updateUniformGroup(group: UniformGroup, program: GlProgram, syncData: { textureCount: number }): void\n {\n const programData = this._renderer.shader._getProgramData(program);\n\n if (!group.isStatic || group._dirtyId !== programData.uniformDirtyGroups[group.uid])\n {\n programData.uniformDirtyGroups[group.uid] = group._dirtyId;\n\n const syncFunc = this._getUniformSyncFunction(group, program);\n\n syncFunc(programData.uniformData, group.uniforms, this._renderer, syncData);\n }\n }\n\n /**\n * Overridable by the pixi.js/unsafe-eval package to use static syncUniforms instead.\n * @param group\n * @param program\n */\n private _getUniformSyncFunction(group: UniformGroup, program: GlProgram): UniformsSyncCallback\n {\n return this._uniformGroupSyncHash[group._signature]?.[program._key]\n || this._createUniformSyncFunction(group, program);\n }\n\n private _createUniformSyncFunction(group: UniformGroup, program: GlProgram): UniformsSyncCallback\n {\n const uniformGroupSyncHash = this._uniformGroupSyncHash[group._signature]\n || (this._uniformGroupSyncHash[group._signature] = {});\n\n const id = this._getSignature(group, program._uniformData, 'u');\n\n if (!this._cache[id])\n {\n this._cache[id] = this._generateUniformsSync(group, program._uniformData);\n }\n\n uniformGroupSyncHash[program._key] = this._cache[id];\n\n return uniformGroupSyncHash[program._key];\n }\n\n private _generateUniformsSync(group: UniformGroup, uniformData: Record<string, GlUniformData>): UniformsSyncCallback\n {\n return generateUniformsSync(group, uniformData);\n }\n\n /**\n * Takes a uniform group and data and generates a unique signature for them.\n * @param group - The uniform group to get signature of\n * @param group.uniforms\n * @param uniformData - Uniform information generated by the shader\n * @param preFix\n * @returns Unique signature of the uniform group\n */\n private _getSignature(group: UniformGroup, uniformData: Record<string, any>, preFix: string): string\n {\n const uniforms = group.uniforms;\n\n const strings = [`${preFix}-`];\n\n for (const i in uniforms)\n {\n strings.push(i);\n\n if (uniformData[i])\n {\n strings.push(uniformData[i].type);\n }\n }\n\n return strings.join('-');\n }\n\n /** Destroys this System and removes all its textures. */\n public destroy(): void\n {\n this._renderer = null;\n this._cache = null;\n }\n}\n","import { type GPUData } from '../../../../scene/view/ViewContainer';\nimport { GL_FORMATS, GL_TARGETS, GL_TYPES } from './const';\n\n/**\n * Internal texture for WebGL context\n * @category rendering\n * @ignore\n */\nexport class GlTexture implements GPUData\n{\n public target: GL_TARGETS = GL_TARGETS.TEXTURE_2D;\n\n /** The WebGL texture. */\n public texture: WebGLTexture;\n\n /**\n * Bitmask tracking which array layers / sub-targets have been initialized at mip level 0.\n * Used by uploaders that need per-layer allocation semantics (e.g. cube faces).\n * @internal\n */\n public _layerInitMask = 0;\n\n /** Width of texture that was used in texImage2D. */\n public width: number;\n\n /** Height of texture that was used in texImage2D. */\n public height: number;\n\n /** Whether mip levels has to be generated. */\n public mipmap: boolean;\n\n /** Type copied from texture source. */\n public type: number;\n\n /** Type copied from texture source. */\n public internalFormat: number;\n\n /** Type of sampler corresponding to this texture. See {@link SAMPLER_TYPES} */\n public samplerType: number;\n\n public format: GL_FORMATS;\n\n constructor(texture: WebGLTexture)\n {\n this.texture = texture;\n this.width = -1;\n this.height = -1;\n this.type = GL_TYPES.UNSIGNED_BYTE;\n this.internalFormat = GL_FORMATS.RGBA;\n this.format = GL_FORMATS.RGBA;\n this.samplerType = 0;\n }\n\n public destroy(): void\n {\n // BOOM\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { Matrix } from '../../../maths/matrix/Matrix';\nimport { compileHighShaderGlProgram } from '../../../rendering/high-shader/compileHighShaderToProgram';\nimport { colorBitGl } from '../../../rendering/high-shader/shader-bits/colorBit';\nimport { generateTextureBatchBitGl } from '../../../rendering/high-shader/shader-bits/generateTextureBatchBit';\nimport { localUniformBitGl } from '../../../rendering/high-shader/shader-bits/localUniformBit';\nimport { roundPixelsBitGl } from '../../../rendering/high-shader/shader-bits/roundPixelsBit';\nimport { getBatchSamplersUniformGroup } from '../../../rendering/renderers/gl/shader/getBatchSamplersUniformGroup';\nimport { Shader } from '../../../rendering/renderers/shared/shader/Shader';\nimport { UniformGroup } from '../../../rendering/renderers/shared/shader/UniformGroup';\nimport { type Renderer } from '../../../rendering/renderers/types';\n\nimport type { Batch } from '../../../rendering/batcher/shared/Batcher';\nimport type { WebGLRenderer } from '../../../rendering/renderers/gl/WebGLRenderer';\nimport type { Graphics } from '../shared/Graphics';\nimport type { GraphicsContextSystem } from '../shared/GraphicsContextSystem';\nimport type { GraphicsAdaptor, GraphicsPipeLike } from '../shared/GraphicsPipe';\n\n/**\n * A GraphicsAdaptor that uses WebGL to render graphics.\n * @category rendering\n * @ignore\n */\nexport class GlGraphicsAdaptor implements GraphicsAdaptor\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLPipesAdaptor,\n ],\n name: 'graphics',\n } as const;\n\n public shader: Shader;\n\n public contextChange(renderer: Renderer): void\n {\n const uniforms = new UniformGroup({\n uColor: { value: new Float32Array([1, 1, 1, 1]), type: 'vec4<f32>' },\n uTransformMatrix: { value: new Matrix(), type: 'mat3x3<f32>' },\n uRound: { value: 0, type: 'f32' },\n });\n\n const maxTextures = renderer.limits.maxBatchableTextures;\n\n const glProgram = compileHighShaderGlProgram({\n name: 'graphics',\n bits: [\n colorBitGl,\n generateTextureBatchBitGl(maxTextures),\n localUniformBitGl,\n roundPixelsBitGl,\n ]\n });\n\n this.shader = new Shader({\n glProgram,\n resources: {\n localUniforms: uniforms,\n batchSamplers: getBatchSamplersUniformGroup(maxTextures),\n }\n });\n }\n\n public execute(graphicsPipe: GraphicsPipeLike, renderable: Graphics): void\n {\n const context = renderable.context;\n const shader = context.customShader || this.shader;\n const renderer = graphicsPipe.renderer as WebGLRenderer;\n const contextSystem = renderer.graphicsContext as GraphicsContextSystem;\n\n const {\n batcher, instructions,\n } = contextSystem.getContextRenderData(context);\n\n // WebGL specific..\n shader.groups[0] = renderer.globalUniforms.bindGroup;\n\n renderer.state.set(graphicsPipe.state);\n\n renderer.shader.bind(shader);\n\n renderer.geometry.bind(batcher.geometry, shader.glProgram);\n\n const batches = instructions.instructions as Batch[];\n\n for (let i = 0; i < instructions.instructionSize; i++)\n {\n const batch = batches[i];\n\n if (batch.size)\n {\n for (let j = 0; j < batch.textures.count; j++)\n {\n renderer.texture.bind(batch.textures.textures[j], j);\n }\n\n // the batch shader declares float samplers on every unit, so none may be left holding an integer texture\n renderer.texture.unbindIntegerTextures(batch.textures.count);\n\n renderer.geometry.draw(batch.topology, batch.size, batch.start);\n }\n }\n }\n\n public destroy(): void\n {\n this.shader.destroy(true);\n this.shader = null;\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { Matrix } from '../../../maths/matrix/Matrix';\nimport { compileHighShaderGlProgram } from '../../../rendering/high-shader/compileHighShaderToProgram';\nimport { localUniformBitGl } from '../../../rendering/high-shader/shader-bits/localUniformBit';\nimport { roundPixelsBitGl } from '../../../rendering/high-shader/shader-bits/roundPixelsBit';\nimport { textureBitGl } from '../../../rendering/high-shader/shader-bits/textureBit';\nimport { Shader } from '../../../rendering/renderers/shared/shader/Shader';\nimport { Texture } from '../../../rendering/renderers/shared/texture/Texture';\nimport { warn } from '../../../utils/logging/warn';\n\nimport type { WebGLRenderer } from '../../../rendering/renderers/gl/WebGLRenderer';\nimport type { Mesh } from '../shared/Mesh';\nimport type { MeshAdaptor, MeshPipe } from '../shared/MeshPipe';\n\n/**\n * A MeshAdaptor that uses the WebGL to render meshes.\n * @category rendering\n * @ignore\n */\nexport class GlMeshAdaptor implements MeshAdaptor\n{\n public static extension = {\n type: [\n ExtensionType.WebGLPipesAdaptor,\n ],\n name: 'mesh',\n } as const;\n\n private _shader: Shader;\n\n public init(): void\n {\n const glProgram = compileHighShaderGlProgram({\n name: 'mesh',\n bits: [\n localUniformBitGl,\n textureBitGl,\n roundPixelsBitGl,\n ]\n });\n\n this._shader = new Shader({\n glProgram,\n resources: {\n uTexture: Texture.EMPTY.source,\n textureUniforms: {\n uTextureMatrix: { type: 'mat3x3<f32>', value: new Matrix() },\n }\n }\n });\n }\n\n public execute(meshPipe: MeshPipe, mesh: Mesh): void\n {\n const renderer = meshPipe.renderer as WebGLRenderer;\n\n let shader: Shader = mesh._shader;\n\n if (!shader)\n {\n shader = this._shader;\n\n const texture = mesh.texture;\n const source = texture.source;\n\n shader.resources.uTexture = source;\n shader.resources.uSampler = source.style;\n shader.resources.textureUniforms.uniforms.uTextureMatrix = texture.textureMatrix.mapCoord;\n }\n else if (!shader.glProgram)\n {\n // #if _DEBUG\n warn('Mesh shader has no glProgram', mesh.shader);\n // #endif\n\n return;\n }\n\n // setting the groups to be high to be compatible and not\n // overlap any other groups\n shader.groups[100] = renderer.globalUniforms.bindGroup;\n shader.groups[101] = meshPipe.localUniformsBindGroup;\n\n renderer.encoder.draw({\n geometry: mesh._geometry,\n shader,\n state: mesh.state,\n });\n }\n\n public destroy(): void\n {\n this._shader.destroy(true);\n this._shader = null;\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { State } from '../../renderers/shared/state/State';\n\nimport type { WebGLRenderer } from '../../renderers/gl/WebGLRenderer';\nimport type { Geometry } from '../../renderers/shared/geometry/Geometry';\nimport type { Shader } from '../../renderers/shared/shader/Shader';\nimport type { Batch } from '../shared/Batcher';\nimport type { BatcherAdaptor, BatcherPipe } from '../shared/BatcherPipe';\n\n/**\n * A BatcherAdaptor that uses WebGL to render batches.\n * @category rendering\n * @ignore\n */\nexport class GlBatchAdaptor implements BatcherAdaptor\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLPipesAdaptor,\n ],\n name: 'batch',\n } as const;\n\n private readonly _tempState = State.for2d();\n\n /**\n * We only want to sync the a batched shaders uniforms once on first use\n * this is a hash of shader uids to a boolean value. When the shader is first bound\n * we set the value to true. When the shader is bound again we check the value and\n * if it is true we know that the uniforms have already been synced and we skip it.\n */\n private _didUploadHash: Record<string, boolean> = {};\n public init(batcherPipe: BatcherPipe): void\n {\n batcherPipe.renderer.runners.contextChange.add(this);\n }\n\n public contextChange(): void\n {\n this._didUploadHash = {};\n }\n\n public start(batchPipe: BatcherPipe, geometry: Geometry, shader: Shader): void\n {\n const renderer = batchPipe.renderer as WebGLRenderer;\n\n const didUpload = this._didUploadHash[shader.uid];\n\n // only want to sync the shade ron its first bind!\n renderer.shader.bind(shader, didUpload);\n\n if (!didUpload)\n {\n this._didUploadHash[shader.uid] = true;\n }\n\n renderer.shader.updateUniformGroup(renderer.globalUniforms.uniformGroup);\n\n renderer.geometry.bind(geometry, shader.glProgram);\n }\n\n public execute(batchPipe: BatcherPipe, batch: Batch): void\n {\n const renderer = batchPipe.renderer as WebGLRenderer;\n\n this._tempState.blendMode = batch.blendMode;\n\n renderer.state.set(this._tempState);\n\n const textures = batch.textures.textures;\n\n for (let i = 0; i < batch.textures.count; i++)\n {\n renderer.texture.bind(textures[i], i);\n }\n\n // the batch shader declares float samplers on every unit, so none may be left holding an integer texture\n renderer.texture.unbindIntegerTextures(batch.textures.count);\n\n renderer.geometry.draw(batch.topology, batch.size, batch.start);\n }\n}\n","import { DOMAdapter } from '../../../../environment/adapter';\nimport { extensions, ExtensionType } from '../../../../extensions/Extensions';\nimport { GCManagedHash } from '../../../../utils/data/GCManagedHash';\nimport { Texture } from '../../shared/texture/Texture';\nimport { isIntegerFormat } from '../../shared/texture/utils/isIntegerFormat';\nimport { GlTexture } from './GlTexture';\nimport { glUploadBufferImageResource } from './uploaders/glUploadBufferImageResource';\nimport { glUploadCompressedTextureResource } from './uploaders/glUploadCompressedTextureResource';\nimport { createGlUploadCubeTextureResource } from './uploaders/glUploadCubeTextureResource';\nimport { glUploadImageResource } from './uploaders/glUploadImageResource';\nimport { glUploadVideoResource } from './uploaders/glUploadVideoResource';\nimport { applyStyleParams } from './utils/applyStyleParams';\nimport { mapFormatToGlFormat } from './utils/mapFormatToGlFormat';\nimport { mapFormatToGlInternalFormat } from './utils/mapFormatToGlInternalFormat';\nimport { mapFormatToGlType } from './utils/mapFormatToGlType';\nimport { mapViewDimensionToGlTarget } from './utils/mapViewDimensionToGlTarget';\nimport { unpremultiplyAlpha } from './utils/unpremultiplyAlpha';\n\nimport type { ICanvas } from '../../../../environment/canvas/ICanvas';\nimport type { System } from '../../shared/system/System';\nimport type { CanvasGenerator, GetPixelsOutput } from '../../shared/texture/GenerateCanvas';\nimport type { TextureSource } from '../../shared/texture/sources/TextureSource';\nimport type { BindableTexture } from '../../shared/texture/Texture';\nimport type { TextureStyle } from '../../shared/texture/TextureStyle';\nimport type { GlRenderingContext } from '../context/GlRenderingContext';\nimport type { WebGLRenderer } from '../WebGLRenderer';\nimport type { GLTextureUploader } from './uploaders/GLTextureUploader';\n\nconst BYTES_PER_PIXEL = 4;\n\n/**\n * The system for managing textures in WebGL.\n * @category rendering\n * @advanced\n */\nexport class GlTextureSystem implements System, CanvasGenerator\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'texture',\n } as const;\n\n /**\n * Optional uploaders registered via {@link ExtensionType.TextureUploaderWebGL}. Each entry is\n * merged into {@link _uploads} at construction time, so import order matters: register the\n * extension before creating the renderer.\n * @internal\n */\n public static readonly uploadExtensions: Record<string, GLTextureUploader> = Object.create(null);\n\n private readonly _renderer: WebGLRenderer;\n private readonly _managedTextures: GCManagedHash<TextureSource>;\n /**\n * @deprecated since 8.15.0\n */\n public get managedTextures(): Readonly<TextureSource[]> { return Object.values(this._managedTextures.items); }\n\n private _glSamplers: Record<string, WebGLSampler> = Object.create(null);\n\n private _boundTextures: TextureSource[] = [];\n /** Bit `n` is set while unit `n` may hold an integer-format texture; `resetState` sets every unit. */\n private _integerUnits = 0;\n private _activeTextureLocation = -1;\n\n private _boundSamplers: Record<number, WebGLSampler> = Object.create(null);\n\n private readonly _uploads: Record<string, GLTextureUploader>;\n\n private _gl: GlRenderingContext;\n private _mapFormatToInternalFormat: Record<string, number>;\n private _mapFormatToType: Record<string, number>;\n private _mapFormatToFormat: Record<string, number>;\n private _mapViewDimensionToGlTarget: Record<TextureSource['viewDimension'], number | null>;\n\n private _premultiplyAlpha = false;\n\n // TODO - separate samplers will be a cool thing to add, but not right now!\n private readonly _useSeparateSamplers = false;\n\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n\n this._managedTextures = new GCManagedHash({\n renderer,\n type: 'resource',\n onUnload: this.onSourceUnload.bind(this),\n name: 'glTexture'\n });\n\n // our 2D uploaders..\n const baseUploaders = {\n image: glUploadImageResource,\n buffer: glUploadBufferImageResource,\n video: glUploadVideoResource,\n compressed: glUploadCompressedTextureResource,\n ...GlTextureSystem.uploadExtensions,\n };\n\n this._uploads = {\n ...baseUploaders,\n cube: createGlUploadCubeTextureResource(baseUploaders),\n };\n }\n\n protected contextChange(gl: GlRenderingContext): void\n {\n this._gl = gl;\n\n if (!this._mapFormatToInternalFormat)\n {\n // rebuild all our maps if they don't exist yet\n this._mapFormatToInternalFormat = mapFormatToGlInternalFormat(gl, this._renderer.context.extensions);\n\n this._mapFormatToType = mapFormatToGlType(gl);\n this._mapFormatToFormat = mapFormatToGlFormat(gl);\n this._mapViewDimensionToGlTarget = mapViewDimensionToGlTarget(gl);\n }\n\n this._managedTextures.removeAll(true);\n\n this._glSamplers = Object.create(null);\n this._boundSamplers = Object.create(null);\n this._premultiplyAlpha = false;\n\n for (let i = 0; i < 16; i++)\n {\n this.bind(Texture.EMPTY, i);\n }\n }\n\n /**\n * Initializes a texture source, if it has already been initialized nothing will happen.\n * @param source - The texture source to initialize.\n * @returns The initialized texture source.\n */\n public initSource(source: TextureSource)\n {\n this.bind(source);\n }\n\n public bind(texture: BindableTexture, location = 0)\n {\n const source = texture.source;\n\n if (texture)\n {\n this.bindSource(source, location);\n\n if (this._useSeparateSamplers)\n {\n this._bindSampler(source.style, location);\n }\n }\n else\n {\n this.bindSource(null, location);\n\n if (this._useSeparateSamplers)\n {\n this._bindSampler(null, location);\n }\n }\n }\n\n public bindSource(source: TextureSource, location = 0): void\n {\n const gl = this._gl;\n\n source._gcLastUsed = this._renderer.gc.now;\n\n if (this._boundTextures[location] !== source)\n {\n this._setBoundTexture(location, source);\n this._activateLocation(location);\n\n source ||= Texture.EMPTY.source;\n\n // bind texture and source!\n const glTexture = this.getGlSource(source);\n\n gl.bindTexture(glTexture.target, glTexture.texture);\n }\n }\n\n /**\n * Binds the empty texture over every integer texture on unit `location` and above\n *\n * WebGL fails a draw when a float sampler's unit holds an integer texture, even if the shader\n * never samples it. Call this after binding a batch's textures when the shader declares more\n * samplers than the batch binds.\n * @param location - The first texture unit to check.\n */\n public unbindIntegerTextures(location: number): void\n {\n // the mask covers units 0-31\n if (location >= 32) return;\n\n let units = (this._integerUnits >>> location) << location;\n\n while (units)\n {\n const unit = 31 - Math.clz32(units);\n\n units &= ~(1 << unit);\n\n // clears the unit's bit through _setBoundTexture\n this.bind(Texture.EMPTY, unit);\n }\n }\n\n /**\n * Records the source bound to a unit, keeping `_integerUnits` in step. Every per-unit write to\n * `_boundTextures` goes through here so the two can't drift apart.\n *\n * A unit has a separate binding per target (2D, 2D array, cube), and the batch shaders sample\n * the 2D target, so only a 2D source changes the unit's bit. Anything else, including null,\n * leaves it as it was: a bit left set after the integer texture is gone only costs one extra\n * `bind(Texture.EMPTY)` in `unbindIntegerTextures`, while a cleared bit over an integer texture\n * fails the next batch.\n * @param location - The texture unit.\n * @param source - The source now bound there, or null.\n */\n private _setBoundTexture(location: number, source: TextureSource | null): void\n {\n this._boundTextures[location] = source;\n\n // the mask covers units 0-31, every unit the batchers use; -1 is the active location before any bind\n if (location < 0 || location > 31) return;\n\n if (!source || source.viewDimension !== '2d') return;\n\n if (isIntegerFormat(source.format))\n {\n this._integerUnits |= 1 << location;\n }\n else\n {\n this._integerUnits &= ~(1 << location);\n }\n }\n\n private _bindSampler(style: TextureStyle, location = 0): void\n {\n const gl = this._gl;\n\n if (!style)\n {\n this._boundSamplers[location] = null;\n gl.bindSampler(location, null);\n\n return;\n }\n\n const sampler = this._getGlSampler(style);\n\n if (this._boundSamplers[location] !== sampler)\n {\n this._boundSamplers[location] = sampler;\n gl.bindSampler(location, sampler);\n }\n }\n\n public unbind(texture: BindableTexture): void\n {\n const source = texture.source;\n const boundTextures = this._boundTextures;\n const gl = this._gl;\n\n for (let i = 0; i < boundTextures.length; i++)\n {\n if (boundTextures[i] === source)\n {\n this._activateLocation(i);\n\n const glTexture = this.getGlSource(source);\n\n gl.bindTexture(glTexture.target, null);\n this._setBoundTexture(i, null);\n }\n }\n }\n\n private _activateLocation(location: number): void\n {\n if (this._activeTextureLocation !== location)\n {\n this._activeTextureLocation = location;\n this._gl.activeTexture(this._gl.TEXTURE0 + location);\n }\n }\n\n private _initSource(source: TextureSource): GlTexture\n {\n const gl = this._gl;\n\n const glTexture = new GlTexture(gl.createTexture());\n\n glTexture.type = this._mapFormatToType[source.format];\n glTexture.internalFormat = this._mapFormatToInternalFormat[source.format];\n glTexture.format = this._mapFormatToFormat[source.format];\n glTexture.target = this._mapViewDimensionToGlTarget[source.viewDimension];\n\n if (glTexture.target === null)\n {\n // eslint-disable-next-line max-len\n throw new Error(`Unsupported view dimension: ${source.viewDimension} with this webgl version: ${this._renderer.context.webGLVersion}`);\n }\n\n if (source.autoGenerateMipmaps && (this._renderer.context.supports.nonPowOf2mipmaps || source.isPowerOfTwo))\n {\n const biggestDimension = Math.max(source.width, source.height, source.depth);\n\n source.mipLevelCount = Math.floor(Math.log2(biggestDimension)) + 1;\n }\n\n source._gpuData[this._renderer.uid] = glTexture;\n\n const added = this._managedTextures.add(source);\n\n if (added)\n {\n source.on('update', this.onSourceUpdate, this);\n source.on('resize', this.onSourceUpdate, this);\n source.on('styleChange', this.onStyleChange, this);\n source.on('updateMipmaps', this.onUpdateMipmaps, this);\n }\n\n this.onSourceUpdate(source);\n this.updateStyle(source, false);\n\n return glTexture;\n }\n\n protected onStyleChange(source: TextureSource): void\n {\n this.updateStyle(source, false);\n }\n\n protected updateStyle(source: TextureSource, firstCreation: boolean): void\n {\n const gl = this._gl;\n\n const glTexture = this.getGlSource(source);\n\n gl.bindTexture(glTexture.target, glTexture.texture);\n\n this._setBoundTexture(this._activeTextureLocation, source);\n\n applyStyleParams(\n source.style,\n gl,\n source.mipLevelCount > 1,\n this._renderer.context.extensions.anisotropicFiltering,\n 'texParameteri',\n glTexture.target,\n // will force a clamp to edge if the texture is not a power of two\n !this._renderer.context.supports.nonPowOf2wrapping && !source.isPowerOfTwo,\n firstCreation,\n );\n }\n\n protected onSourceUnload(source: TextureSource, contextLost = false): void\n {\n const glTexture = source._gpuData[this._renderer.uid] as GlTexture;\n\n if (!glTexture) return;\n\n if (!contextLost)\n {\n this.unbind(source);\n this._gl.deleteTexture(glTexture.texture);\n }\n source.off('update', this.onSourceUpdate, this);\n source.off('resize', this.onSourceUpdate, this);\n source.off('styleChange', this.onStyleChange, this);\n source.off('updateMipmaps', this.onUpdateMipmaps, this);\n }\n\n protected onSourceUpdate(source: TextureSource): void\n {\n const gl = this._gl;\n\n const glTexture = this.getGlSource(source);\n\n gl.bindTexture(glTexture.target, glTexture.texture);\n\n this._setBoundTexture(this._activeTextureLocation, source);\n\n // integer texels have no alpha to premultiply, and a premultiplied 32-bit integer upload never returns in Chromium.\n // 3D and array textures upload from buffers with texImage3D, which rejects premultiply (INVALID_OPERATION)\n const premultipliedAlpha = source.alphaMode === 'premultiply-alpha-on-upload'\n && !isIntegerFormat(source.format)\n && glTexture.target !== gl.TEXTURE_3D\n && glTexture.target !== gl.TEXTURE_2D_ARRAY;\n\n if (this._premultiplyAlpha !== premultipliedAlpha)\n {\n this._premultiplyAlpha = premultipliedAlpha;\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultipliedAlpha);\n }\n\n if (this._uploads[source.uploadMethodId])\n {\n this._uploads[source.uploadMethodId].upload(source, glTexture, gl, this._renderer.context.webGLVersion);\n }\n else if (glTexture.target === gl.TEXTURE_2D)\n {\n // Allocate an \"empty\" texture (typical for RenderTexture) for the appropriate target.\n // This allocates level 0 and, if needed, the full mip chain so any mip can be attached/rendered into (WebGL2).\n this._initEmptyTexture2D(glTexture, source);\n }\n else if (glTexture.target === gl.TEXTURE_2D_ARRAY || glTexture.target === gl.TEXTURE_3D)\n {\n this._initEmptyTexture3D(glTexture, source);\n }\n else if (glTexture.target === gl.TEXTURE_CUBE_MAP)\n {\n this._initEmptyTextureCube(glTexture, source);\n }\n else\n {\n throw new Error('[GlTextureSystem] Unsupported texture target for empty allocation.');\n }\n\n // Keep the texture's mip range in sync with the declared mipLevelCount.\n // This is required in WebGL2 for FBO attachments at mipLevel > 0 when using partial mip chains.\n this._applyMipRange(glTexture, source);\n\n if (source.autoGenerateMipmaps && source.mipLevelCount > 1)\n {\n this.onUpdateMipmaps(source, false);\n }\n }\n\n protected onUpdateMipmaps(source: TextureSource, bind = true): void\n {\n if (bind) this.bindSource(source, 0);\n\n const glTexture = this.getGlSource(source);\n\n this._gl.generateMipmap(glTexture.target);\n }\n\n private _initEmptyTexture2D(glTexture: GlTexture, source: TextureSource): void\n {\n const gl = this._gl;\n\n // Level 0\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n glTexture.internalFormat,\n source.pixelWidth,\n source.pixelHeight,\n 0,\n glTexture.format,\n glTexture.type,\n null,\n );\n\n // Mips (if requested)\n let w = Math.max(source.pixelWidth >> 1, 1);\n let h = Math.max(source.pixelHeight >> 1, 1);\n\n for (let level = 1; level < source.mipLevelCount; level++)\n {\n gl.texImage2D(\n gl.TEXTURE_2D,\n level,\n glTexture.internalFormat,\n w,\n h,\n 0,\n glTexture.format,\n glTexture.type,\n null,\n );\n\n w = Math.max(w >> 1, 1);\n h = Math.max(h >> 1, 1);\n }\n }\n\n /**\n * Allocates a texture with a depth: the layers of a 2D array or the slices of a 3D texture.\n * Layer counts stay the same at every mip level; 3D depth halves like width and height.\n * @param glTexture - The GL texture wrapper.\n * @param source - The texture source describing the size.\n */\n private _initEmptyTexture3D(glTexture: GlTexture, source: TextureSource): void\n {\n const gl = this._gl;\n const is3D = glTexture.target === gl.TEXTURE_3D;\n\n let w = source.pixelWidth;\n let h = source.pixelHeight;\n let d = source.depthOrArrayLayers;\n\n for (let level = 0; level < source.mipLevelCount; level++)\n {\n gl.texImage3D(\n glTexture.target,\n level,\n glTexture.internalFormat,\n w,\n h,\n d,\n 0,\n glTexture.format,\n glTexture.type,\n null,\n );\n\n w = Math.max(w >> 1, 1);\n h = Math.max(h >> 1, 1);\n if (is3D) d = Math.max(d >> 1, 1);\n }\n }\n\n private _initEmptyTextureCube(glTexture: GlTexture, source: TextureSource): void\n {\n const gl = this._gl;\n\n const totalCubeFaces = 6;\n\n // Level 0 (all faces)\n for (let face = 0; face < totalCubeFaces; face++)\n {\n gl.texImage2D(\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + face,\n 0,\n glTexture.internalFormat,\n source.pixelWidth,\n source.pixelHeight,\n 0,\n glTexture.format,\n glTexture.type,\n null,\n );\n }\n\n // Mips (if requested)\n let w = Math.max(source.pixelWidth >> 1, 1);\n let h = Math.max(source.pixelHeight >> 1, 1);\n\n for (let level = 1; level < source.mipLevelCount; level++)\n {\n for (let face = 0; face < totalCubeFaces; face++)\n {\n gl.texImage2D(\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + face,\n level,\n glTexture.internalFormat,\n w,\n h,\n 0,\n glTexture.format,\n glTexture.type,\n null,\n );\n }\n\n w = Math.max(w >> 1, 1);\n h = Math.max(h >> 1, 1);\n }\n }\n\n /**\n * Applies a mip range to the currently-bound texture so WebGL2 considers the texture \"mipmap complete\"\n * for the declared `mipLevelCount` (especially important for partial mip chains rendered via FBO).\n * @param glTexture - The GL texture wrapper.\n * @param source - The texture source describing mipLevelCount.\n */\n private _applyMipRange(glTexture: GlTexture, source: TextureSource): void\n {\n if (this._renderer.context.webGLVersion !== 2) return;\n\n // Skip for single-mip textures: setting MAX_LEVEL=0 triggers an ANGLE Metal bug\n // on iOS 18.0–18.1 (https://github.com/pixijs/pixijs/issues/11984).\n if (source.mipLevelCount <= 1) return;\n\n const gl = this._gl;\n const maxLevel = Math.max((source.mipLevelCount | 0) - 1, 0);\n\n gl.texParameteri(glTexture.target, gl.TEXTURE_BASE_LEVEL, 0);\n gl.texParameteri(glTexture.target, gl.TEXTURE_MAX_LEVEL, maxLevel);\n }\n\n private _initSampler(style: TextureStyle): WebGLSampler\n {\n const gl = this._gl;\n\n const glSampler = this._gl.createSampler();\n\n this._glSamplers[style._resourceId] = glSampler;\n\n applyStyleParams(\n style,\n gl,\n this._boundTextures[this._activeTextureLocation].mipLevelCount > 1,\n this._renderer.context.extensions.anisotropicFiltering,\n 'samplerParameteri',\n glSampler,\n false,\n true,\n );\n\n return this._glSamplers[style._resourceId];\n }\n\n private _getGlSampler(sampler: TextureStyle): WebGLSampler\n {\n return this._glSamplers[sampler._resourceId] || this._initSampler(sampler);\n }\n\n public getGlSource(source: TextureSource): GlTexture\n {\n source._gcLastUsed = this._renderer.gc.now;\n\n return source._gpuData[this._renderer.uid] as GlTexture || this._initSource(source);\n }\n\n public generateCanvas(texture: Texture): ICanvas\n {\n const { pixels, width, height } = this.getPixels(texture);\n\n const canvas = DOMAdapter.get().createCanvas();\n\n canvas.width = width;\n canvas.height = height;\n\n const ctx = canvas.getContext('2d');\n\n if (ctx)\n {\n const imageData = ctx.createImageData(width, height);\n\n imageData.data.set(pixels);\n ctx.putImageData(imageData, 0, 0);\n }\n\n return canvas;\n }\n\n public getPixels(texture: Texture): GetPixelsOutput\n {\n const resolution = texture.source.resolution;\n const frame = texture.frame;\n\n const width = Math.max(Math.round(frame.width * resolution), 1);\n const height = Math.max(Math.round(frame.height * resolution), 1);\n const pixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n const renderer = this._renderer;\n\n const renderTarget = renderer.renderTarget.getRenderTarget(texture);\n const glRenterTarget = renderer.renderTarget.getGpuRenderTarget(renderTarget);\n\n const gl = renderer.gl;\n\n renderer.renderTarget.adaptor.bindFramebuffer(glRenterTarget.resolveTargetFramebuffer);\n\n gl.readPixels(\n Math.round(frame.x * resolution),\n Math.round(frame.y * resolution),\n width,\n height,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n pixels\n );\n\n // if (texture.source.premultiplyAlpha > 0)\n // TODO - premultiplied alpha does not exist right now, need to add that back in!\n // eslint-disable-next-line no-constant-condition\n if (false)\n {\n unpremultiplyAlpha(pixels);\n }\n\n return { pixels: new Uint8ClampedArray(pixels.buffer), width, height };\n }\n\n public destroy(): void\n {\n // we copy the array as the array with a slice as onSourceDestroy\n // will remove the source from the real managedTextures array\n this._managedTextures.destroy();\n this._glSamplers = null;\n this._boundTextures = null;\n this._boundSamplers = null;\n this._mapFormatToInternalFormat = null;\n this._mapFormatToType = null;\n this._mapFormatToFormat = null;\n (this._uploads as null) = null;\n (this._renderer as null) = null;\n }\n\n public resetState(): void\n {\n const maxTextures = this._renderer.limits.maxTextures;\n\n this._activeTextureLocation = -1;\n // the context was used outside pixi, so nothing is known about what any unit holds. Forget the\n // slots so the next bind is never skipped, and treat every unit as possibly integer until\n // unbindIntegerTextures clears it\n this._boundTextures.fill(null);\n this._integerUnits = maxTextures >= 32 ? -1 : (1 << maxTextures) - 1;\n this._boundSamplers = Object.create(null);\n\n const gl = this._gl;\n\n this._premultiplyAlpha = false;\n\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);\n }\n}\n\nextensions.handleByMap(ExtensionType.TextureUploaderWebGL, GlTextureSystem.uploadExtensions);\n\n","import { extensions, ExtensionType } from '../../../extensions/Extensions';\nimport { GlGraphicsAdaptor } from '../../../scene/graphics/gl/GlGraphicsAdaptor';\nimport { GlMeshAdaptor } from '../../../scene/mesh/gl/GlMeshAdaptor';\nimport { GlBatchAdaptor } from '../../batcher/gl/GlBatchAdaptor';\nimport { AbstractRenderer } from '../shared/system/AbstractRenderer';\nimport { SharedRenderPipes, SharedSystems } from '../shared/system/SharedSystems';\nimport { RendererType } from '../types';\nimport { GlBufferSystem } from './buffer/GlBufferSystem';\nimport { GlContextSystem } from './context/GlContextSystem';\nimport { GlGeometrySystem } from './geometry/GlGeometrySystem';\nimport { GlBackBufferSystem } from './GlBackBufferSystem';\nimport { GlColorMaskSystem } from './GlColorMaskSystem';\nimport { GlEncoderSystem } from './GlEncoderSystem';\nimport { GlLimitsSystem } from './GlLimitsSystem';\nimport { GlStencilSystem } from './GlStencilSystem';\nimport { GlUboSystem } from './GlUboSystem';\nimport { GlRenderTargetSystem } from './renderTarget/GlRenderTargetSystem';\nimport { GlShaderSystem } from './shader/GlShaderSystem';\nimport { GlUniformGroupSystem } from './shader/GlUniformGroupSystem';\nimport { GlStateSystem } from './state/GlStateSystem';\nimport { GlTextureSystem } from './texture/GlTextureSystem';\n\nimport type { ICanvas } from '../../../environment/canvas/ICanvas';\nimport type { PipeConstructor } from '../shared/instructions/RenderPipe';\nimport type { RendererLoader } from '../shared/system/AbstractRenderer';\nimport type { SharedRendererOptions } from '../shared/system/SharedSystems';\nimport type { SystemConstructor } from '../shared/system/System';\nimport type { ExtractRendererOptions, ExtractSystemTypes } from '../shared/system/utils/typeUtils';\nimport type { GlRenderingContext } from './context/GlRenderingContext';\n\nconst DefaultWebGLSystems = [\n ...SharedSystems,\n GlUboSystem,\n GlBackBufferSystem,\n GlContextSystem,\n GlLimitsSystem,\n GlBufferSystem,\n GlTextureSystem,\n GlRenderTargetSystem,\n GlGeometrySystem,\n GlUniformGroupSystem,\n GlShaderSystem,\n GlEncoderSystem,\n GlStateSystem,\n GlStencilSystem,\n GlColorMaskSystem,\n];\nconst DefaultWebGLPipes = [...SharedRenderPipes];\nconst DefaultWebGLAdapters = [GlBatchAdaptor, GlMeshAdaptor, GlGraphicsAdaptor];\n\n// installed systems will bbe added to this array by the extensions manager..\nconst systems: { name: string; value: SystemConstructor }[] = [];\nconst renderPipes: { name: string; value: PipeConstructor }[] = [];\nconst renderPipeAdaptors: { name: string; value: any }[] = [];\nconst loaders: { name: string; value: RendererLoader }[] = [];\n\nextensions.handleByNamedList(ExtensionType.WebGLSystem, systems);\nextensions.handleByNamedList(ExtensionType.WebGLPipes, renderPipes);\nextensions.handleByNamedList(ExtensionType.WebGLPipesAdaptor, renderPipeAdaptors);\nextensions.handleByNamedList(ExtensionType.WebGLLoader, loaders);\n\n// add all the default systems as well as any user defined ones from the extensions\nextensions.add(...DefaultWebGLSystems, ...DefaultWebGLPipes, ...DefaultWebGLAdapters);\n\n/**\n * The default WebGL renderer, uses WebGL2 contexts.\n * @category rendering\n * @standard\n * @interface\n */\nexport type WebGLSystems = ExtractSystemTypes<typeof DefaultWebGLSystems>\n& PixiMixins.RendererSystems & PixiMixins.WebGLSystems;\n\n/**\n * The default WebGL renderer, uses WebGL2 contexts.\n * @internal\n */\nexport type WebGLPipes = ExtractSystemTypes<typeof DefaultWebGLPipes> & PixiMixins.RendererPipes & PixiMixins.WebGLPipes;\n\n/**\n * Options for WebGLRenderer.\n * @category rendering\n * @standard\n */\nexport interface WebGLOptions\n extends\n SharedRendererOptions,\n ExtractRendererOptions<typeof DefaultWebGLSystems>,\n PixiMixins.WebGLOptions {}\n\n// eslint-disable-next-line requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface WebGLRenderer<T extends ICanvas = HTMLCanvasElement>\n extends AbstractRenderer<WebGLPipes, WebGLOptions, T>,\n WebGLSystems {}\n\n/* eslint-disable max-len */\n/**\n * The WebGL PixiJS Renderer. This renderer allows you to use the most common graphics API, WebGL (and WebGL2).\n *\n * ```ts\n * // Create a new renderer\n * const renderer = new WebGLRenderer();\n * await renderer.init();\n *\n * // Add the renderer to the stage\n * document.body.appendChild(renderer.canvas);\n *\n * // Create a new stage\n * const stage = new Container();\n *\n * // Render the stage\n * renderer.render(stage);\n * ```\n *\n * You can use {@link autoDetectRenderer} to create a renderer that will automatically detect the best\n * renderer for the environment.\n *\n *\n * ```ts\n * // Create a new renderer\n * const renderer = await rendering.autoDetectRenderer({\n * preference:'webgl',\n * });\n * ```\n *\n * The renderer is composed of systems that manage specific tasks. The following systems are added by default\n * whenever you create a WebGL renderer:\n *\n * | WebGL Core Systems | Systems that are specific to the WebGL renderer |\n * | ------------------------------------------- | ----------------------------------------------------------------------------- |\n * | {@link GlUboSystem} | This manages WebGL2 uniform buffer objects feature for shaders |\n * | {@link GlBackBufferSystem} | manages the back buffer, used so that we can pixi can pixels from the screen |\n * | {@link GlContextSystem} | This manages the WebGL context and its extensions |\n * | {@link GlBufferSystem} | This manages buffers and their GPU resources, keeps everything in sync |\n * | {@link GlTextureSystem} | This manages textures and their GPU resources, keeps everything in sync |\n * | {@link GlRenderTargetSystem} | This manages what we render too. For example the screen, or another texture |\n * | {@link GlGeometrySystem} | This manages geometry, used for drawing meshes via the GPU |\n * | {@link GlUniformGroupSystem} | This manages uniform groups. Syncing shader properties with the GPU |\n * | {@link GlShaderSystem} | This manages shaders, programs that run on the GPU to output lovely pixels |\n * | {@link GlEncoderSystem} | This manages encoders, a WebGPU Paradigm, use it to draw a mesh + shader |\n * | {@link GlStateSystem} | This manages the state of the WebGL context. eg the various flags that can be set blend modes / depthTesting etc |\n * | {@link GlStencilSystem} | This manages the stencil buffer. Used primarily for masking |\n * | {@link GlColorMaskSystem} | This manages the color mask. Used for color masking |\n *\n * The breadth of the API surface provided by the renderer is contained within these systems.\n * @category rendering\n * @property {GlUboSystem} ubo - UboSystem instance.\n * @property {GlBackBufferSystem} backBuffer - BackBufferSystem instance.\n * @property {GlContextSystem} context - ContextSystem instance.\n * @property {GlBufferSystem} buffer - BufferSystem instance.\n * @property {GlTextureSystem} texture - TextureSystem instance.\n * @property {GlRenderTargetSystem} renderTarget - RenderTargetSystem instance.\n * @property {GlGeometrySystem} geometry - GeometrySystem instance.\n * @property {GlUniformGroupSystem} uniformGroup - UniformGroupSystem instance.\n * @property {GlShaderSystem} shader - ShaderSystem instance.\n * @property {GlEncoderSystem} encoder - EncoderSystem instance.\n * @property {GlStateSystem} state - StateSystem instance.\n * @property {GlStencilSystem} stencil - StencilSystem instance.\n * @property {GlColorMaskSystem} colorMask - ColorMaskSystem instance.\n * @extends AbstractRenderer\n * @standard\n */\nexport class WebGLRenderer<T extends ICanvas = HTMLCanvasElement>\n extends AbstractRenderer<WebGLPipes, WebGLOptions, T>\n implements WebGLSystems\n{\n public gl: GlRenderingContext;\n\n constructor()\n {\n const systemConfig = {\n name: 'webgl',\n type: RendererType.WEBGL,\n systems,\n renderPipes,\n renderPipeAdaptors,\n loaders,\n };\n\n super(systemConfig);\n }\n}\n"],"names":["GL_FORMATS","BUFFER_TYPE","GL_TARGETS","GL_WRAP_MODES","GL_TYPES","renderTarget","source"],"mappings":"6CSKYA,+JuC8Ba,CAAA,cAEI,CAAa,mCACQ,EAAG,CAAA,CAAG,EAAE,CAAA,CAAG,KAAM,WAAA,uCACR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