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/gpu/texture/utils/GpuMipmapGenerator.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/buffer/UboBatch.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/RenderBundle.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/texture/uploaders/gpuUploadCompressedTextureResource.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/texture/uploaders/gpuUploadCubeTextureResource.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/texture/utils/Gpu3dMipmapGenerator.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/state/GpuBlendModesToPixi.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/utils/createUboElementsWGSL.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/texture/uploaders/gpuUploadVideoSource.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/utils/generateArraySyncWGSL.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/BindGroupSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/texture/uploaders/gpuUploadImageSource.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/texture/uploaders/gpuUploadBufferImageResource.ts","../../../../node_modules/pixi.js/src/rendering/batcher/gpu/GpuBatchAdaptor.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/GpuShaderSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/shader/utils/createUboSyncFunctionWGSL.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/GpuDeviceSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/GpuUboSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/renderTarget/GpuRenderTargetSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/GpuColorMaskSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/renderTarget/GpuMsaaRestore.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/buffer/GpuBufferSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/GpuStencilSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/pipeline/PipelineSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/renderTarget/GpuRenderTargetAdaptor.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/GpuLimitsSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/state/GpuStateSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/GpuUniformBatchPipe.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/GpuEncoderSystem.ts","../../../../node_modules/pixi.js/src/scene/mesh/gpu/GpuMeshAdapter.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/texture/GpuTextureSystem.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/renderTarget/GpuRenderTarget.ts","../../../../node_modules/pixi.js/src/scene/graphics/gpu/GpuGraphicsAdaptor.ts","../../../../node_modules/pixi.js/src/rendering/renderers/gpu/WebGPURenderer.ts"],"sourcesContent":["/**\n * A class which generates mipmaps for a GPUTexture.\n * Thanks to toji for the original implementation\n * https://github.com/toji/web-texture-tool/blob/main/src/webgpu-mipmap-generator.js\n * @category rendering\n * @ignore\n */\nexport class GpuMipmapGenerator\n{\n private readonly _device: GPUDevice;\n private readonly _sampler: GPUSampler;\n // a pipeline for every texture format used\n private readonly _pipelines: Record<string, GPURenderPipeline> = {};\n private _mipmapShaderModule: GPUShaderModule;\n\n constructor(device: GPUDevice)\n {\n this._device = device;\n this._sampler = device.createSampler({ minFilter: 'linear' });\n }\n\n private _getMipmapPipeline(format: GPUTextureFormat)\n {\n let pipeline = this._pipelines[format];\n\n if (!pipeline)\n {\n // Shader modules is shared between all pipelines, so only create once.\n if (!this._mipmapShaderModule)\n {\n this._mipmapShaderModule = this._device.createShaderModule({\n code: /* wgsl */ `\n var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));\n\n struct VertexOutput {\n @builtin(position) position : vec4<f32>,\n @location(0) texCoord : vec2<f32>,\n };\n\n @vertex\n fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {\n var output : VertexOutput;\n output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);\n output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);\n return output;\n }\n\n @group(0) @binding(0) var imgSampler : sampler;\n @group(0) @binding(1) var img : texture_2d<f32>;\n\n @fragment\n fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {\n return textureSample(img, imgSampler, texCoord);\n }\n `,\n });\n }\n\n pipeline = this._device.createRenderPipeline({\n layout: 'auto',\n vertex: {\n module: this._mipmapShaderModule,\n entryPoint: 'vertexMain',\n },\n fragment: {\n module: this._mipmapShaderModule,\n entryPoint: 'fragmentMain',\n targets: [{ format }],\n }\n });\n\n this._pipelines[format] = pipeline;\n }\n\n return pipeline;\n }\n\n /**\n * Generates mipmaps for the given GPUTexture from the data in level 0.\n * @param {module:External.GPUTexture} texture - Texture to generate mipmaps for.\n * @returns {module:External.GPUTexture} - The originally passed texture\n */\n public generateMipmap(texture: GPUTexture)\n {\n if (texture.dimension === '3d')\n {\n throw new Error('[GpuMipmapGenerator] a 3D texture uses Gpu3dMipmapGenerator.');\n }\n\n if (texture.dimension === '1d')\n {\n throw new Error('Generating mipmaps for 1d textures is currently unsupported!');\n }\n\n const pipeline = this._getMipmapPipeline(texture.format);\n\n let mipTexture = texture;\n const arrayLayerCount = texture.depthOrArrayLayers || 1; // Only valid for 2D textures.\n\n // If the texture was created with RENDER_ATTACHMENT usage we can render directly between mip levels.\n const renderToSource = texture.usage & GPUTextureUsage.RENDER_ATTACHMENT;\n\n if (!renderToSource)\n {\n // Otherwise we have to use a separate texture to render into. It can be one mip level smaller than the source\n // texture, since we already have the top level.\n const mipTextureDescriptor = {\n size: {\n width: Math.ceil(texture.width / 2),\n height: Math.ceil(texture.height / 2),\n depthOrArrayLayers: arrayLayerCount,\n },\n format: texture.format,\n usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC | GPUTextureUsage.RENDER_ATTACHMENT,\n mipLevelCount: texture.mipLevelCount - 1,\n };\n\n mipTexture = this._device.createTexture(mipTextureDescriptor);\n }\n\n const commandEncoder = this._device.createCommandEncoder({});\n // TODO: Consider making this static.\n const bindGroupLayout = pipeline.getBindGroupLayout(0);\n\n for (let arrayLayer = 0; arrayLayer < arrayLayerCount; ++arrayLayer)\n {\n let srcView = texture.createView({\n baseMipLevel: 0,\n mipLevelCount: 1,\n dimension: '2d',\n baseArrayLayer: arrayLayer,\n arrayLayerCount: 1,\n });\n\n let dstMipLevel = renderToSource ? 1 : 0;\n\n for (let i = 1; i < texture.mipLevelCount; ++i)\n {\n const dstView = mipTexture.createView({\n baseMipLevel: dstMipLevel++,\n mipLevelCount: 1,\n dimension: '2d',\n baseArrayLayer: arrayLayer,\n arrayLayerCount: 1,\n });\n\n const passEncoder = commandEncoder.beginRenderPass({\n colorAttachments: [{\n view: dstView,\n storeOp: 'store',\n loadOp: 'clear',\n clearValue: { r: 0, g: 0, b: 0, a: 0 },\n }],\n });\n\n const bindGroup = this._device.createBindGroup({\n layout: bindGroupLayout,\n entries: [{\n binding: 0,\n resource: this._sampler,\n }, {\n binding: 1,\n resource: srcView,\n }],\n });\n\n passEncoder.setPipeline(pipeline);\n passEncoder.setBindGroup(0, bindGroup);\n passEncoder.draw(3, 1, 0, 0);\n\n passEncoder.end();\n\n srcView = dstView;\n }\n }\n\n // If we didn't render to the source texture, finish by copying the mip results from the temporary mipmap texture\n // to the source.\n if (!renderToSource)\n {\n const mipLevelSize = {\n width: Math.ceil(texture.width / 2),\n height: Math.ceil(texture.height / 2),\n depthOrArrayLayers: arrayLayerCount,\n };\n\n for (let i = 1; i < texture.mipLevelCount; ++i)\n {\n commandEncoder.copyTextureToTexture({\n texture: mipTexture,\n mipLevel: i - 1,\n }, {\n texture,\n mipLevel: i,\n }, mipLevelSize);\n\n mipLevelSize.width = Math.ceil(mipLevelSize.width / 2);\n mipLevelSize.height = Math.ceil(mipLevelSize.height / 2);\n }\n }\n\n this._device.queue.submit([commandEncoder.finish()]);\n\n if (!renderToSource)\n {\n mipTexture.destroy();\n }\n\n return texture;\n }\n}\n","/** @internal */\nexport class UboBatch\n{\n public data: Float32Array;\n private readonly _minUniformOffsetAlignment: number = 256;\n\n public byteIndex = 0;\n\n constructor({ minUniformOffsetAlignment }: {minUniformOffsetAlignment: number})\n {\n this._minUniformOffsetAlignment = minUniformOffsetAlignment;\n this.data = new Float32Array(65535);\n }\n\n public clear(): void\n {\n this.byteIndex = 0;\n }\n\n public addEmptyGroup(size: number): number\n {\n // update the buffer.. only float32 for now!\n if (size > this._minUniformOffsetAlignment / 4)\n {\n throw new Error(`UniformBufferBatch: array is too large: ${size * 4}`);\n }\n\n const start = this.byteIndex;\n\n let newSize = start + (size * 4);\n\n newSize = Math.ceil(newSize / this._minUniformOffsetAlignment) * this._minUniformOffsetAlignment;\n\n if (newSize > this.data.length * 4)\n {\n // TODO push a new buffer\n throw new Error('UniformBufferBatch: ubo batch got too big');\n }\n\n this.byteIndex = newSize;\n\n return start;\n }\n\n public addGroup(array: Float32Array): number\n {\n const offset = this.addEmptyGroup(array.length);\n\n for (let i = 0; i < array.length; i++)\n {\n this.data[(offset / 4) + i] = array[i];\n }\n\n return offset;\n }\n\n public destroy()\n {\n this.data = null;\n }\n}\n","/**\n * A recorded WebGPU render bundle, together with a stamp of the pipeline state it baked when it\n * was recorded.\n *\n * Recording captures the render target permanently, in two ways:\n *\n * - the attachment state (color format(s), depth/stencil format, sample count). WebGPU validates\n * this when the bundle is executed — replaying it in a pass whose attachments differ rejects the\n * whole command buffer.\n * - the front-face winding baked into every pipeline inside it. WebGPU does *not* validate this —\n * replaying after the target's {@link RenderTarget.flipY} parity changed silently renders\n * geometry inside out.\n *\n * {@link RenderBundle.stateKey} stamps both, so {@link GpuEncoderSystem.isBundleValid} can answer\n * whether a cached bundle is still safe to replay against the target that is bound now.\n *\n * Created by {@link GpuEncoderSystem.endBundle} — there is no reason to construct one yourself.\n * @example\n * ```ts\n * const record = () =>\n * {\n * encoder.beginBundle('my-cached-pass');\n * encoder.draw({ geometry, shader });\n *\n * return encoder.endBundle();\n * };\n *\n * // record once, then replay on later frames — re-recording whenever the target it baked\n * // no longer matches the one bound now\n * if (!encoder.isBundleValid(bundle)) bundle = record();\n * encoder.executeBundle(bundle);\n * ```\n * @category rendering\n * @advanced\n */\nexport class RenderBundle\n{\n /** The recorded native bundle, as handed to `GPURenderPassEncoder.executeBundles`. */\n public readonly gpuBundle: GPURenderBundle;\n /**\n * The value {@link PipelineSystem.bundleStateKey} had when recording began. Comparing it\n * against the pipeline's current key tells you whether this bundle still matches the bound\n * render target — which is exactly what {@link GpuEncoderSystem.isBundleValid} does.\n */\n public readonly stateKey: number;\n /** The device the bundle was recorded on. A bundle cannot be replayed on the device that replaces it after a loss. */\n public readonly device: GPUDevice;\n /** Optional debug label — names the bundle in GPU captures and in WebGPU validation errors. */\n public readonly label?: string;\n\n /**\n * @param gpuBundle - The recorded native render bundle.\n * @param stateKey - The pipeline state key captured when recording began.\n * @param device - The device the bundle was recorded on.\n * @param label - Optional debug label for the bundle.\n */\n constructor(gpuBundle: GPURenderBundle, stateKey: number, device: GPUDevice, label?: string)\n {\n this.gpuBundle = gpuBundle;\n this.stateKey = stateKey;\n this.device = device;\n this.label = label;\n }\n}\n","import type { CompressedSource } from '../../../shared/texture/sources/CompressedSource';\nimport type { GPU } from '../../GpuDeviceSystem';\nimport type { GpuTextureUploader } from './GpuTextureUploader';\n\n/** @internal */\nexport const blockDataMap: Record<string, {blockBytes: number, blockWidth: number, blockHeight: number}> = {\n 'bc1-rgba-unorm': { blockBytes: 8, blockWidth: 4, blockHeight: 4 },\n 'bc2-rgba-unorm': { blockBytes: 16, blockWidth: 4, blockHeight: 4 },\n 'bc3-rgba-unorm': { blockBytes: 16, blockWidth: 4, blockHeight: 4 },\n 'bc7-rgba-unorm': { blockBytes: 16, blockWidth: 4, blockHeight: 4 },\n 'etc1-rgb-unorm': { blockBytes: 8, blockWidth: 4, blockHeight: 4 },\n 'etc2-rgba8unorm': { blockBytes: 16, blockWidth: 4, blockHeight: 4 },\n 'astc-4x4-unorm': { blockBytes: 16, blockWidth: 4, blockHeight: 4 },\n};\n\nconst defaultBlockData = { blockBytes: 4, blockWidth: 1, blockHeight: 1 };\n\n/** @internal */\nexport const gpuUploadCompressedTextureResource = {\n\n type: 'compressed',\n\n upload(source: CompressedSource, gpuTexture: GPUTexture, gpu: GPU, originZOverride = 0)\n {\n let mipWidth = source.pixelWidth;\n let mipHeight = source.pixelHeight;\n\n const blockData = blockDataMap[source.format] || defaultBlockData;\n\n for (let i = 0; i < source.resource.length; i++)\n {\n const levelBuffer = source.resource[i];\n\n const bytesPerRow = Math.ceil(mipWidth / blockData.blockWidth) * blockData.blockBytes;\n\n gpu.device.queue.writeTexture(\n {\n texture: gpuTexture,\n mipLevel: i,\n origin: { x: 0, y: 0, z: originZOverride },\n },\n levelBuffer as BufferSource,\n {\n offset: 0,\n bytesPerRow,\n },\n {\n width: Math.ceil(mipWidth / blockData.blockWidth) * blockData.blockWidth,\n height: Math.ceil(mipHeight / blockData.blockHeight) * blockData.blockHeight,\n depthOrArrayLayers: 1,\n }\n );\n\n mipWidth = Math.max(mipWidth >> 1, 1);\n mipHeight = Math.max(mipHeight >> 1, 1);\n }\n }\n} as GpuTextureUploader<CompressedSource>;\n","import type { CubeTextureSource } from '../../../shared/texture/sources/CubeTextureSource';\nimport type { GPU } from '../../GpuDeviceSystem';\nimport type { GpuTextureUploader } from './GpuTextureUploader';\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 * @param uploaders - Uploader registry keyed by `uploadMethodId` (must include `image`).\n * @internal\n */\nexport function createGpuUploadCubeTextureResource(\n uploaders: Record<string, GpuTextureUploader> & { image: GpuTextureUploader }\n): GpuTextureUploader<CubeTextureSource>\n{\n return {\n type: 'cube',\n upload(source: CubeTextureSource, gpuTexture: GPUTexture, gpu: GPU)\n {\n const faces = source.faces;\n\n for (let i = 0; i < FACE_ORDER.length; i++)\n {\n const key = FACE_ORDER[i];\n const face = faces[key];\n\n const uploader = uploaders[face.uploadMethodId] || uploaders.image;\n\n uploader.upload(face as any, gpuTexture, gpu, i);\n }\n }\n };\n}\n\n","/** Formats a 3D mip chain can be written to: filterable and storage-capable on every WebGPU device */\nconst MIPMAP_3D_FORMATS: readonly GPUTextureFormat[] = ['rgba8unorm', 'rgba16float'];\n\nconst WORKGROUP_SIZE = 4;\n\n/**\n * Throws unless a 3D texture can have its mipmaps generated. WebGPU writes them with a compute shader,\n * so the texture needs `storage: true` and a format the shader can both sample linearly and store.\n * @param format - the texture's format\n * @param storage - whether the texture can be bound as a storage texture\n * @internal\n */\nexport function assertMipmap3dTexture(format: GPUTextureFormat, storage: boolean): void\n{\n if (!storage)\n {\n throw new Error('[Gpu3dMipmapGenerator] generating mipmaps for a 3D texture needs storage: true.');\n }\n\n if (!MIPMAP_3D_FORMATS.includes(format))\n {\n throw new Error(`[Gpu3dMipmapGenerator] format '${format}' can't be downsampled. `\n + `Use ${MIPMAP_3D_FORMATS.join(', ')}.`);\n }\n}\n\n/**\n * Generates mipmaps for a 3D GPUTexture with a compute shader.\n *\n * One compute pass with one dispatch per mip, one thread per output voxel. Each dispatch takes a\n * linear sample at the centre of every 2×2×2 box of the previous mip and stores it in the next.\n *\n * The texture must have been created with `storage: true` and a full mip chain.\n * @category rendering\n * @ignore\n */\nexport class Gpu3dMipmapGenerator\n{\n private readonly _device: GPUDevice;\n private readonly _sampler: GPUSampler;\n private readonly _pipelines: Record<string, GPUComputePipeline> = {};\n\n constructor(device: GPUDevice)\n {\n this._device = device;\n this._sampler = device.createSampler({\n magFilter: 'linear',\n minFilter: 'linear',\n });\n }\n\n private _getMipmapPipeline(format: GPUTextureFormat): GPUComputePipeline\n {\n this._pipelines[format] ??= this._device.createComputePipeline({\n layout: 'auto',\n compute: {\n module: this._device.createShaderModule({\n code: /* wgsl */ `\n @group(0) @binding(0) var srcSampler : sampler;\n @group(0) @binding(1) var src : texture_3d<f32>;\n @group(0) @binding(2) var dst : texture_storage_3d<${format}, write>;\n\n @compute @workgroup_size(${WORKGROUP_SIZE}, ${WORKGROUP_SIZE}, ${WORKGROUP_SIZE})\n fn main(@builtin(global_invocation_id) gid : vec3<u32>) {\n let dstSize = textureDimensions(dst);\n\n if (gid.x >= dstSize.x || gid.y >= dstSize.y || gid.z >= dstSize.z) {\n return;\n }\n\n // centre of the 2x2x2 footprint in the previous mip. When a dimension is\n // odd its last texel, row or slice is never sampled, as in the 2D generator\n let uv = (vec3<f32>(gid) * 2.0 + 1.0) / vec3<f32>(textureDimensions(src));\n\n textureStore(dst, gid, textureSampleLevel(src, srcSampler, uv, 0.0));\n }\n `,\n }),\n entryPoint: 'main',\n },\n });\n\n return this._pipelines[format];\n }\n\n /**\n * Fills mip levels 1..n of a 3D texture from level 0.\n * @param texture - a 3D texture with `STORAGE_BINDING` and more than one mip level\n */\n public generateMipmap(texture: GPUTexture): void\n {\n if (texture.dimension !== '3d')\n {\n throw new Error('[Gpu3dMipmapGenerator] generateMipmap expects a 3D texture.');\n }\n\n if (texture.mipLevelCount < 2) return;\n\n assertMipmap3dTexture(texture.format, (texture.usage & GPUTextureUsage.STORAGE_BINDING) !== 0);\n\n const pipeline = this._getMipmapPipeline(texture.format);\n const layout = pipeline.getBindGroupLayout(0);\n const encoder = this._device.createCommandEncoder({ label: 'Gpu3dMipmapGenerator' });\n const pass = encoder.beginComputePass();\n\n pass.setPipeline(pipeline);\n\n let width = texture.width;\n let height = texture.height;\n let depth = texture.depthOrArrayLayers;\n let srcView = texture.createView({ dimension: '3d', baseMipLevel: 0, mipLevelCount: 1 });\n\n for (let level = 1; level < texture.mipLevelCount; level++)\n {\n width = Math.max(1, width >> 1);\n height = Math.max(1, height >> 1);\n depth = Math.max(1, depth >> 1);\n\n const dstView = texture.createView({ dimension: '3d', baseMipLevel: level, mipLevelCount: 1 });\n\n pass.setBindGroup(0, this._device.createBindGroup({\n layout,\n entries: [\n { binding: 0, resource: this._sampler },\n { binding: 1, resource: srcView },\n { binding: 2, resource: dstView },\n ],\n }));\n pass.dispatchWorkgroups(\n Math.ceil(width / WORKGROUP_SIZE),\n Math.ceil(height / WORKGROUP_SIZE),\n Math.ceil(depth / WORKGROUP_SIZE),\n );\n\n srcView = dstView;\n }\n\n pass.end();\n this._device.queue.submit([encoder.finish()]);\n }\n}\n","import type { BLEND_MODES } from '../../shared/state/const';\n\n/** @internal */\nexport const GpuBlendModesToPixi: Partial<Record<BLEND_MODES, GPUBlendState>> = {};\n\nGpuBlendModesToPixi.normal = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi.add = {\n alpha: {\n srcFactor: 'src-alpha',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'one',\n dstFactor: 'one',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi.multiply = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'dst',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi.screen = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi.overlay = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi.none = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'zero',\n dstFactor: 'zero',\n operation: 'add',\n },\n};\n\n// not-premultiplied blend modes\nGpuBlendModesToPixi['normal-npm'] = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'src-alpha',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi['add-npm'] = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one',\n operation: 'add',\n },\n color: {\n srcFactor: 'src-alpha',\n dstFactor: 'one',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi['screen-npm'] = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'src-alpha',\n dstFactor: 'one-minus-src',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi.erase = {\n alpha: {\n srcFactor: 'zero',\n dstFactor: 'one-minus-src-alpha',\n operation: 'add',\n },\n color: {\n srcFactor: 'zero',\n dstFactor: 'one-minus-src',\n operation: 'add',\n },\n};\n\nGpuBlendModesToPixi.min = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one',\n operation: 'min',\n },\n color: {\n srcFactor: 'one',\n dstFactor: 'one',\n operation: 'min',\n },\n};\n\nGpuBlendModesToPixi.max = {\n alpha: {\n srcFactor: 'one',\n dstFactor: 'one',\n operation: 'max',\n },\n color: {\n srcFactor: 'one',\n dstFactor: 'one',\n operation: 'max',\n },\n};\n\n// composite operations\n// GpuBlendModesToPixi[BLEND_MODES.SRC_IN] = {\n// alpha: {\n// srcFactor: 'src-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'dst-alpha',\n// dstFactor: 'zero',\n// operation: 'add',\n// },\n// };\n\n// GpuBlendModesToPixi[BLEND_MODES.SRC_OUT] = {\n// alpha: {\n// srcFactor: 'src-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'one-minus-dst-alpha',\n// dstFactor: 'zero',\n// operation: 'add',\n// },\n// };\n\n// GpuBlendModesToPixi[BLEND_MODES.SRC_ATOP] = {\n// alpha: {\n// srcFactor: 'src-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'dst-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// };\n\n// GpuBlendModesToPixi[BLEND_MODES.DST_OVER] = {\n// alpha: {\n// srcFactor: 'src-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'one-minus-dst-alpha',\n// dstFactor: 'one',\n// operation: 'add',\n// },\n// };\n\n// GpuBlendModesToPixi[BLEND_MODES.DST_IN] = {\n// alpha: {\n// srcFactor: 'src-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'zero',\n// dstFactor: 'src-alpha',\n// operation: 'add',\n// },\n// };\n\n// GpuBlendModesToPixi[BLEND_MODES.DST_OUT] = {\n// alpha: {\n// srcFactor: 'src-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'zero',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// };\n\n// GpuBlendModesToPixi[BLEND_MODES.DST_ATOP] = {\n// alpha: {\n// srcFactor: 'src-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'one-minus-dst-alpha',\n// dstFactor: 'src-alpha',\n// operation: 'add',\n// },\n// };\n\n// GpuBlendModesToPixi[BLEND_MODES.XOR] = {\n// alpha: {\n// srcFactor: 'src-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'one-minus-dst-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// };\n\n// TODO - fix me\n// GLBlendModesToPixi[BLEND_MODES.SUBTRACT] = {\n// alpha: {\n// srcFactor: 'one',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// color: {\n// srcFactor: 'one-minus-dst-alpha',\n// dstFactor: 'one-minus-src-alpha',\n// operation: 'add',\n// },\n// };\n","import type { UboElement, UboLayout, UNIFORM_TYPES, UniformData } from '../../../shared/shader/types';\n\n/** @internal */\nexport const WGSL_ALIGN_SIZE_DATA: Record<UNIFORM_TYPES | string, {align: number, size: number}> = {\n i32: { align: 4, size: 4 },\n u32: { align: 4, size: 4 },\n f32: { align: 4, size: 4 },\n f16: { align: 2, size: 2 },\n 'vec2<i32>': { align: 8, size: 8 },\n 'vec2<u32>': { align: 8, size: 8 },\n 'vec2<f32>': { align: 8, size: 8 },\n 'vec2<f16>': { align: 4, size: 4 },\n 'vec3<i32>': { align: 16, size: 12 },\n 'vec3<u32>': { align: 16, size: 12 },\n 'vec3<f32>': { align: 16, size: 12 },\n 'vec3<f16>': { align: 8, size: 6 },\n 'vec4<i32>': { align: 16, size: 16 },\n 'vec4<u32>': { align: 16, size: 16 },\n 'vec4<f32>': { align: 16, size: 16 },\n 'vec4<f16>': { align: 8, size: 8 },\n 'mat2x2<f32>': { align: 8, size: 16 },\n 'mat2x2<f16>': { align: 4, size: 8 },\n 'mat3x2<f32>': { align: 8, size: 24 },\n 'mat3x2<f16>': { align: 4, size: 12 },\n 'mat4x2<f32>': { align: 8, size: 32 },\n 'mat4x2<f16>': { align: 4, size: 16 },\n 'mat2x3<f32>': { align: 16, size: 32 },\n 'mat2x3<f16>': { align: 8, size: 16 },\n 'mat3x3<f32>': { align: 16, size: 48 },\n 'mat3x3<f16>': { align: 8, size: 24 },\n 'mat4x3<f32>': { align: 16, size: 64 },\n 'mat4x3<f16>': { align: 8, size: 32 },\n 'mat2x4<f32>': { align: 16, size: 32 },\n 'mat2x4<f16>': { align: 8, size: 16 },\n 'mat3x4<f32>': { align: 16, size: 48 },\n 'mat3x4<f16>': { align: 8, size: 24 },\n 'mat4x4<f32>': { align: 16, size: 64 },\n 'mat4x4<f16>': { align: 8, size: 32 },\n};\n\n/**\n * @param uniformData\n * @internal\n */\nexport function createUboElementsWGSL(uniformData: UniformData[]): UboLayout\n{\n const uboElements: UboElement[] = uniformData.map((data: UniformData) =>\n ({\n data,\n offset: 0,\n size: 0,\n }));\n\n let offset = 0;\n\n for (let i = 0; i < uboElements.length; i++)\n {\n const uboElement = uboElements[i];\n\n let size = WGSL_ALIGN_SIZE_DATA[uboElement.data.type].size;\n const align = WGSL_ALIGN_SIZE_DATA[uboElement.data.type].align;\n\n if (!WGSL_ALIGN_SIZE_DATA[uboElement.data.type])\n {\n throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${uboElement.data.type}`);\n }\n\n if (uboElement.data.size > 1)\n {\n size = Math.max(size, align) * uboElement.data.size;\n }\n\n offset = Math.ceil((offset) / align) * align;\n\n // TODO deal with Arrays\n uboElement.size = size;\n\n uboElement.offset = offset;\n\n offset += size;\n }\n\n // must align to 16 bits!\n offset = Math.ceil(offset / 16) * 16;\n\n return { uboElements, size: offset };\n}\n\n","import { gpuUploadImageResource } from './gpuUploadImageSource';\n\nimport type { VideoSource } from '../../../shared/texture/sources/VideoSource';\nimport type { GPU } from '../../GpuDeviceSystem';\nimport type { GpuTextureUploader } from './GpuTextureUploader';\n\n/** @internal */\nexport const gpuUploadVideoResource = {\n\n type: 'video',\n\n upload(source: VideoSource, gpuTexture: GPUTexture, gpu: GPU, originZOverride?: number)\n {\n gpuUploadImageResource.upload(source, gpuTexture, gpu, originZOverride);\n }\n} as GpuTextureUploader<VideoSource>;\n\n","import { WGSL_ALIGN_SIZE_DATA } from './createUboElementsWGSL';\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 wgsl 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 generateArraySyncWGSL(uboElement: UboElement, offsetToAdd: number): string\n{\n // this is in byte..\n const { size, align } = WGSL_ALIGN_SIZE_DATA[uboElement.data.type];\n\n const remainder = (Math.max(size, align) - size) / 4;\n const data = uboElement.data.type.indexOf('i32') >= 0 ? 'dataInt32' : 'data';\n\n return `\n v = uv.${uboElement.data.name};\n ${offsetToAdd !== 0 ? `offset += ${offsetToAdd};` : ''}\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ${uboElement.data.size}; i++)\n {\n for(var j = 0; j < ${size / 4}; j++)\n {\n ${data}[arrayOffset++] = v[t++];\n }\n ${remainder !== 0 ? `arrayOffset += ${remainder};` : ''}\n }\n `;\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\n\nimport type { Buffer } from '../shared/buffer/Buffer';\nimport type { BufferResource } from '../shared/buffer/BufferResource';\nimport type { GCable } from '../shared/GCSystem';\nimport type { UniformGroup } from '../shared/shader/UniformGroup';\nimport type { System } from '../shared/system/System';\nimport type { TextureSource } from '../shared/texture/sources/TextureSource';\nimport type { TextureStyle } from '../shared/texture/TextureStyle';\nimport type { TextureView } from '../shared/texture/TextureView';\nimport type { GPU } from './GpuDeviceSystem';\nimport type { BindGroup } from './shader/BindGroup';\nimport type { BindResource } from './shader/BindResource';\nimport type { GpuProgram } from './shader/GpuProgram';\nimport type { WebGPURenderer } from './WebGPURenderer';\n\n/**\n * A cached native bind group, shaped so the renderer's GC can sweep it. Cache keys are built from\n * resource ids that change whenever a resource is unloaded, resized or destroyed, so an entry that\n * stops being requested can never be hit again and would otherwise live as long as the device.\n * @internal\n */\nclass GpuBindGroupEntry implements GCable\n{\n public gpuBindGroup: GPUBindGroup;\n public _gcLastUsed: number;\n public readonly autoGarbageCollect = true;\n /** Part of the {@link GCable} contract; a cached bind group owns no per-renderer GPU data. */\n public readonly _gpuData: GCable['_gpuData'] = null;\n\n constructor(gpuBindGroup: GPUBindGroup, now: number)\n {\n this.gpuBindGroup = gpuBindGroup;\n this._gcLastUsed = now;\n }\n\n /**\n * Native bind groups have no destroy; dropping the reference is the whole release. Anything\n * still holding the group (a recorded render bundle, a graphics batch) keeps it alive, and the\n * next immediate-mode bind simply recreates the cache entry.\n */\n public unload(): void\n {\n this.gpuBindGroup = null;\n }\n}\n\n/**\n * This manages the WebGPU bind groups. this is how data is bound to a shader when rendering\n * @category rendering\n * @advanced\n */\nexport class BindGroupSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\n ],\n name: 'bindGroup',\n } as const;\n\n private readonly _renderer: WebGPURenderer;\n\n private _hash: Record<string, GpuBindGroupEntry> = Object.create(null);\n private _gpu: GPU;\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n\n // the sweep nulls idle slots and the periodic clean pass compacts the nulls away; both read\n // the hash off this system by name, so replacing the object in contextChange or nulling it\n // in destroy needs no re-registration\n renderer.gc.addResourceHash(this, '_hash', 'resource');\n renderer.gc.addCollection(this, '_hash', 'hash');\n }\n\n protected contextChange(gpu: GPU): void\n {\n this._gpu = gpu;\n this._hash = Object.create(null);\n }\n\n public getBindGroup(bindGroup: BindGroup, program: GpuProgram, groupIndex: number): GPUBindGroup\n {\n // The cache key must include both the resources AND the program layout,\n // because a GPUBindGroup must exactly match its GPUBindGroupLayout.\n // Two programs with different layouts cannot share a GPUBindGroup,\n // even if they use the same resources.\n // Bit shift combines layoutKey and groupIndex into single number (groupIndex < 16)\n const key = `${bindGroup._key}:${(program._layoutKey << 4) | groupIndex}`;\n const entry = this._hash[key];\n\n // a swept slot holds null rather than being deleted, so this covers both kinds of miss\n if (entry)\n {\n entry._gcLastUsed = this._renderer.gc.now;\n\n return entry.gpuBindGroup;\n }\n\n return this._createBindGroup(key, bindGroup, program, groupIndex);\n }\n\n private _createBindGroup(key: string, group: BindGroup, program: GpuProgram, groupIndex: number): GPUBindGroup\n {\n const device = this._gpu.device;\n const groupLayout = program.layout[groupIndex];\n const entries: GPUBindGroupEntry[] = [];\n const renderer = this._renderer;\n\n for (const j in groupLayout)\n {\n // resources may be keyed by resource name or by binding index — try the name first\n const resource: BindResource = group.resources[j] ?? group.resources[groupLayout[j]];\n\n // a destroyed resource leaves a null slot (see BindGroup.onResourceChange) or may\n // have been handed in already destroyed — either way this group cannot render\n if (!resource || resource.destroyed)\n {\n throw new Error(`[BindGroup] the resource bound as '${j}' was destroyed while a shader still uses it. `\n + 'Remove it from the shader before destroying it.');\n }\n\n let gpuResource: GPUSampler | GPUTextureView | GPUExternalTexture | GPUBufferBinding;\n // TODO make this dynamic..\n\n if (resource._resourceType === 'uniformGroup')\n {\n const uniformGroup = resource as UniformGroup;\n\n renderer.ubo.updateUniformGroup(uniformGroup as UniformGroup);\n\n const buffer = uniformGroup.buffer;\n\n gpuResource = {\n buffer: renderer.buffer.getGPUBuffer(buffer),\n offset: 0,\n size: buffer.descriptor.size,\n };\n }\n else if (resource._resourceType === 'buffer')\n {\n const buffer = resource as Buffer;\n\n gpuResource = {\n buffer: renderer.buffer.getGPUBuffer(buffer),\n offset: 0,\n size: buffer.descriptor.size,\n };\n }\n else if (resource._resourceType === 'bufferResource')\n {\n const bufferResource = resource as BufferResource;\n\n gpuResource = {\n buffer: renderer.buffer.getGPUBuffer(bufferResource.buffer),\n offset: bufferResource.offset,\n size: bufferResource.size ?? bufferResource.buffer.descriptor.size,\n };\n }\n else if (resource._resourceType === 'textureSampler')\n {\n const sampler = resource as TextureStyle;\n\n gpuResource = renderer.texture.getGpuSampler(sampler);\n }\n else if (resource._resourceType === 'textureSource')\n {\n const texture = resource as TextureSource;\n\n gpuResource = renderer.texture.getTextureView(texture);\n }\n else if (resource._resourceType === 'textureView')\n {\n const textureView = resource as TextureView;\n\n gpuResource = renderer.texture.getTextureView(textureView.source, textureView.viewDescriptor);\n }\n\n entries.push({\n binding: groupLayout[j],\n resource: gpuResource,\n });\n }\n\n const layout = renderer.shader.getProgramData(program).bindGroups[groupIndex];\n\n const gpuBindGroup = device.createBindGroup({\n layout,\n entries,\n });\n\n this._hash[key] = new GpuBindGroupEntry(gpuBindGroup, renderer.gc.now);\n\n return gpuBindGroup;\n }\n\n public destroy(): void\n {\n this._hash = null;\n (this._renderer as null) = null;\n }\n}\n","import { DOMAdapter } from '../../../../../environment/adapter';\nimport { warn } from '../../../../../utils/logging/warn';\n\nimport type { TextureSource } from '../../../shared/texture/sources/TextureSource';\nimport type { GPU } from '../../GpuDeviceSystem';\nimport type { GpuTextureUploader } from './GpuTextureUploader';\n\n/** @internal */\nexport const gpuUploadImageResource = {\n\n type: 'image',\n\n upload(source: TextureSource, gpuTexture: GPUTexture, gpu: GPU, originZOverride = 0)\n {\n const resource = source.resource as ImageBitmap | HTMLCanvasElement | OffscreenCanvas | HTMLImageElement;\n\n if (!resource) return;\n\n // WebGPU does not support HTMLImageElement\n // so we need to convert it to a canvas\n if (globalThis.HTMLImageElement && resource instanceof HTMLImageElement)\n {\n const canvas = DOMAdapter.get().createCanvas(resource.width, resource.height);\n const context = canvas.getContext('2d');\n\n context.drawImage(resource, 0, 0, resource.width, resource.height);\n\n // replace with the canvas - for future uploads\n source.resource = canvas;\n\n // #if _DEBUG\n warn('ImageSource: Image element passed, converting to canvas and replacing resource.');\n // #endif\n }\n\n const width = Math.min(gpuTexture.width, source.resourceWidth || source.pixelWidth);\n const height = Math.min(gpuTexture.height, source.resourceHeight || source.pixelHeight);\n\n const premultipliedAlpha = source.alphaMode === 'premultiply-alpha-on-upload';\n\n gpu.device.queue.copyExternalImageToTexture(\n { source: resource },\n { texture: gpuTexture, origin: { x: 0, y: 0, z: originZOverride }, premultipliedAlpha },\n {\n width,\n height,\n }\n );\n }\n} as GpuTextureUploader<TextureSource>;\n\n","import { Rectangle } from '../../../../../maths/shapes/Rectangle';\nimport { getTexelRangeRects } from '../../../shared/texture/utils/getTexelRangeRects';\n\nimport type { BufferImageSource } from '../../../shared/texture/sources/BufferImageSource';\nimport type { GPU } from '../../GpuDeviceSystem';\nimport type { GpuTextureUploader } from './GpuTextureUploader';\n\nconst tempRects = [new Rectangle(), new Rectangle(), new Rectangle()];\n\n/** @internal */\nexport const gpuUploadBufferImageResource = {\n\n type: 'image',\n\n upload(source: BufferImageSource, gpuTexture: GPUTexture, gpu: GPU, originZOverride = 0)\n {\n const resource = source.resource;\n\n const width = source.pixelWidth | 0;\n const height = source.pixelHeight | 0;\n\n // a 3D texture's slices or a 2D array's layers, copied as one box; partial ranges only reach 2D textures\n const depth = source.depthOrArrayLayers;\n\n const bytesPerPixel = resource.byteLength / (width * height * depth);\n\n if (depth > 1)\n {\n gpu.device.queue.writeTexture(\n { texture: gpuTexture, origin: { x: 0, y: 0, z: originZOverride } },\n resource as ArrayBuffer,\n { offset: 0, rowsPerImage: height, bytesPerRow: width * bytesPerPixel },\n { width, height, depthOrArrayLayers: depth }\n );\n\n return;\n }\n\n const count = getTexelRangeRects(source._updateStart, source._updateEnd, width, height, tempRects);\n\n for (let i = 0; i < count; i++)\n {\n const rect = tempRects[i];\n\n gpu.device.queue.writeTexture(\n { texture: gpuTexture, origin: { x: rect.x, y: rect.y, z: originZOverride } },\n resource as ArrayBuffer,\n {\n offset: ((rect.y * width) + rect.x) * bytesPerPixel,\n rowsPerImage: rect.height,\n bytesPerRow: width * bytesPerPixel,\n },\n {\n width: rect.width,\n height: rect.height,\n depthOrArrayLayers: 1,\n }\n );\n }\n }\n} as GpuTextureUploader<BufferImageSource>;\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { State } from '../../renderers/shared/state/State';\nimport { getTextureBatchBindGroup } from './getTextureBatchBindGroup';\n\nimport type { GpuEncoderSystem } from '../../renderers/gpu/GpuEncoderSystem';\nimport type { WebGPURenderer } from '../../renderers/gpu/WebGPURenderer';\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\nconst tempState = State.for2d();\n\n/**\n * A BatcherAdaptor that uses the GPU to render batches.\n * @category rendering\n * @ignore\n */\nexport class GpuBatchAdaptor implements BatcherAdaptor\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUPipesAdaptor,\n ],\n name: 'batch',\n } as const;\n\n private _shader: Shader;\n private _geometry: Geometry;\n\n public start(batchPipe: BatcherPipe, geometry: Geometry, shader: Shader): void\n {\n const renderer = batchPipe.renderer as WebGPURenderer;\n const encoder = renderer.encoder as GpuEncoderSystem;\n const program = shader.gpuProgram;\n\n this._shader = shader;\n this._geometry = geometry;\n\n encoder.setGeometry(geometry, program);\n\n tempState.blendMode = 'normal';\n\n // this just initiates the pipeline, so we can then set bind groups on it\n renderer.pipeline.getPipeline(\n geometry,\n program,\n tempState,\n undefined,\n shader._overrides,\n );\n\n const globalUniformsBindGroup = renderer.globalUniforms.bindGroup;\n\n // low level - we need to reset the bind group at location 1 to null\n // this is because we directly manipulate the bound buffer in the execute function for\n // performance reasons.\n // setting it to null ensures that the next bind group we set at location 1 will\n // be the one we want.\n encoder.resetBindGroup(1);\n\n encoder.setBindGroup(0, globalUniformsBindGroup, program);\n }\n\n public execute(batchPipe: BatcherPipe, batch: Batch): void\n {\n const program = this._shader.gpuProgram;\n const renderer = batchPipe.renderer as WebGPURenderer;\n const encoder = renderer.encoder as GpuEncoderSystem;\n\n if (!batch.bindGroup)\n {\n const textureBatch = batch.textures;\n\n batch.bindGroup = getTextureBatchBindGroup(\n textureBatch.textures,\n textureBatch.count,\n renderer.limits.maxBatchableTextures\n );\n }\n\n tempState.blendMode = batch.blendMode;\n\n const gpuBindGroup = renderer.bindGroup.getBindGroup(\n batch.bindGroup, program, 1\n );\n\n const pipeline = renderer.pipeline.getPipeline(\n this._geometry,\n program,\n tempState,\n batch.topology,\n this._shader._overrides,\n );\n\n batch.bindGroup._touch(renderer.gc.now);\n\n encoder.setPipeline(pipeline);\n\n encoder.renderPassEncoder.setBindGroup(1, gpuBindGroup);\n encoder.renderPassEncoder.drawIndexed(batch.size, 1, batch.start);\n }\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\n\nimport type { GPU } from '../GpuDeviceSystem';\nimport type { GpuProgram } from './GpuProgram';\n\n/**\n * Data structure for GPU program layout.\n * Contains bind group layouts and pipeline layout.\n * @category rendering\n * @advanced\n */\nexport interface GPUProgramData\n{\n bindGroups: GPUBindGroupLayout[]\n pipeline: GPUPipelineLayout\n}\n\n/**\n * A system that manages the rendering of GpuPrograms.\n * @category rendering\n * @advanced\n */\nexport class GpuShaderSystem\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\n ],\n name: 'shader',\n } as const;\n\n private _gpu: GPU;\n\n private _gpuProgramData: Record<number, GPUProgramData> = Object.create(null);\n\n protected contextChange(gpu: GPU): void\n {\n this._gpu = gpu;\n this._gpuProgramData = Object.create(null);\n }\n\n public getProgramData(program: GpuProgram)\n {\n return this._gpuProgramData[program._layoutKey] || this._createGPUProgramData(program);\n }\n\n private _createGPUProgramData(program: GpuProgram)\n {\n const device = this._gpu.device;\n\n const bindGroups = program.gpuLayout.map((group) => device.createBindGroupLayout({ entries: group }));\n\n const pipelineLayoutDesc = { bindGroupLayouts: bindGroups };\n\n this._gpuProgramData[program._layoutKey] = {\n bindGroups,\n pipeline: device.createPipelineLayout(pipelineLayoutDesc),\n };\n\n // generally we avoid having to make this automatically\n // keeping this for a reminder, if any issues popup\n // program._gpuLayout = {\n // bindGroups: null,\n // pipeline: 'auto',\n // };\n\n return this._gpuProgramData[program._layoutKey];\n }\n\n public destroy(): void\n {\n // TODO destroy the _gpuProgramData\n this._gpu = null;\n (this._gpuProgramData as null) = null;\n }\n}\n","import { compileBufferSync } from '../../../shared/shader/utils/compileBufferSync';\nimport { uboSyncFunctionsWGSL } from '../../../shared/shader/utils/uboSyncFunctions';\nimport { generateArraySyncWGSL } from './generateArraySyncWGSL';\n\nimport type { UboElement, UniformsSyncCallback } from '../../../shared/shader/types';\n\n/**\n * @param uboElements\n * @internal\n */\nexport function createUboSyncFunctionWGSL(\n uboElements: UboElement[],\n): UniformsSyncCallback\n{\n return compileBufferSync(\n uboElements,\n uboSyncFunctionsWGSL,\n generateArraySyncWGSL,\n );\n}\n","import { DOMAdapter } from '../../../environment/adapter';\nimport { ExtensionType } from '../../../extensions/Extensions';\nimport { warn } from '../../../utils/logging/warn';\n\nimport type { System } from '../shared/system/System';\nimport type { GpuPowerPreference } from '../types';\nimport type { GpuExtensions } from './GpuExtensions';\nimport type { WebGPURenderer } from './WebGPURenderer';\n\n/**\n * `adapter.info.vendor` of the tile-based GPUs measured to gain from never storing MSAA colour: Apple, Arm Mali,\n * Qualcomm Adreno and Imagination PowerVR. Intel (and by the same design NVIDIA and AMD) measured slower, as\n * restoring on reopen costs more there than loading from video memory.\n */\nconst tileBasedVendors = new Set(['apple', 'arm', 'qualcomm', 'img-tec']);\n\n/**\n * The GPU object.\n * Contains the GPU adapter and device.\n * @category rendering\n * @advanced\n */\nexport interface GPU\n{\n /** The GPU adapter */\n adapter: GPUAdapter;\n /** The GPU device */\n device: GPUDevice;\n}\n\n/**\n * Options for the WebGPU context.\n * @property {GpuPowerPreference} [powerPreference=default] - An optional hint indicating what configuration of GPU\n * is suitable for the WebGPU context, 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 * @property {boolean} [forceFallbackAdapter=false] - Force the use of the fallback adapter\n * @category rendering\n * @advanced\n */\nexport interface GpuContextOptions\n{\n /**\n * An optional hint indicating what configuration of GPU is suitable for the WebGPU 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 * Force the use of the fallback adapter\n * @default false\n */\n forceFallbackAdapter: boolean;\n /** Using shared device and adaptor from other engine */\n gpu?: GPU;\n}\n\n/**\n * System plugin to the renderer to manage the context.\n * @class\n * @category rendering\n * @advanced\n */\nexport class GpuDeviceSystem implements System<GpuContextOptions>\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\n ],\n name: 'device',\n } as const;\n\n /** The default options for the GpuDeviceSystem. */\n public static defaultOptions: GpuContextOptions = {\n /**\n * {@link WebGPUOptions.powerPreference}\n * @default default\n */\n powerPreference: undefined,\n /**\n * Force the use of the fallback adapter\n * @default false\n */\n forceFallbackAdapter: false,\n };\n\n /** The GPU device */\n public gpu: GPU;\n\n /** Optional WebGPU capabilities probed at init. Mirrors `renderer.context.extensions` on the WebGL side. */\n public extensions: GpuExtensions;\n\n private _renderer: WebGPURenderer;\n private _initPromise: Promise<void>;\n private _options: GpuContextOptions;\n\n /**\n * @param {WebGPURenderer} renderer - The renderer this System works for.\n */\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n }\n\n public async init(options: GpuContextOptions): Promise<void>\n {\n if (this._initPromise) return this._initPromise;\n\n this._options = options;\n this._initPromise = (options.gpu ? Promise.resolve(options.gpu) : this._createDeviceAndAdaptor(options))\n .then((gpu) => this._setGpu(gpu));\n\n return this._initPromise;\n }\n\n private _setGpu(gpu: GPU): void\n {\n this.gpu = gpu;\n\n this.extensions = {\n transientAttachment:\n typeof (GPUTextureUsage as { TRANSIENT_ATTACHMENT?: number }).TRANSIENT_ATTACHMENT === 'number',\n tileBased: tileBasedVendors.has(gpu.adapter?.info?.vendor),\n };\n\n // a shared device belongs to the engine that created it, so only restore our own\n if (!this._options.gpu)\n {\n void gpu.device.lost\n .then(() => this._restoreDevice())\n .catch((e) => warn('WebGPU device was lost and could not be restored', e));\n }\n\n this._renderer.runners.contextChange.emit(this.gpu);\n }\n\n private async _restoreDevice(): Promise<void>\n {\n // the renderer was destroyed, so there is nothing to restore\n if (!this._renderer) return;\n\n const gpu = await this._createDeviceAndAdaptor(this._options);\n\n // destroyed while the new device was being requested\n if (!this._renderer)\n {\n gpu.device.destroy();\n\n return;\n }\n\n this._setGpu(gpu);\n }\n\n /**\n * Handle the context change event\n * @param gpu\n */\n protected contextChange(gpu: GPU): void\n {\n this._renderer.gpu = gpu;\n }\n\n /**\n * Helper class to create a WebGL Context\n * @param {object} options - An options object that gets passed in to the canvas element containing the\n * context attributes\n * @see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext\n * @returns {WebGLRenderingContext} the WebGL context\n */\n private async _createDeviceAndAdaptor(options: GpuContextOptions): Promise<GPU>\n {\n // TODO we only need one of these..\n const adapter = await DOMAdapter.get().getNavigator().gpu.requestAdapter({\n powerPreference: options.powerPreference,\n forceFallbackAdapter: options.forceFallbackAdapter,\n });\n\n if (!adapter)\n {\n throw new Error('WebGPU not supported. No GPU adapter was returned by navigator.gpu.requestAdapter().');\n }\n\n const requiredFeatures = [\n 'texture-compression-bc',\n 'texture-compression-astc',\n 'texture-compression-etc2',\n 'indirect-first-instance',\n // more formats for TextureSource `storage`\n 'bgra8unorm-storage',\n 'texture-formats-tier1',\n ].filter((feature) => adapter.features.has(feature)) as GPUFeatureName[];\n\n const device = await adapter.requestDevice({\n requiredFeatures,\n requiredLimits: {\n maxSampledTexturesPerShaderStage: adapter.limits.maxSampledTexturesPerShaderStage,\n maxSamplersPerShaderStage: adapter.limits.maxSamplersPerShaderStage,\n },\n });\n\n return { adapter, device };\n }\n\n public destroy(): void\n {\n if (!this._options?.gpu)\n {\n this.gpu?.device.destroy();\n }\n\n this.gpu = null;\n this.extensions = null;\n this._renderer = null;\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { UboSystem } from '../shared/shader/UboSystem';\nimport { createUboElementsWGSL } from './shader/utils/createUboElementsWGSL';\nimport { createUboSyncFunctionWGSL } from './shader/utils/createUboSyncFunctionWGSL';\n\n/**\n * System plugin to the renderer to manage uniform buffers. With a WGSL twist!\n * @category rendering\n * @advanced\n */\nexport class GpuUboSystem extends UboSystem\n{\n /** @ignore */\n public static extension = {\n type: [ExtensionType.WebGPUSystem],\n name: 'ubo',\n } as const;\n\n constructor()\n {\n super({\n createUboElements: createUboElementsWGSL,\n generateUboSync: createUboSyncFunctionWGSL,\n });\n }\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { RenderTargetSystem } from '../../shared/renderTarget/RenderTargetSystem';\nimport { GpuRenderTargetAdaptor } from './GpuRenderTargetAdaptor';\n\nimport type { WebGPURenderer } from '../WebGPURenderer';\nimport type { GpuRenderTarget } from './GpuRenderTarget';\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 GpuRenderTargetSystem extends RenderTargetSystem<GpuRenderTarget>\n{\n /** @ignore */\n public static extension = {\n type: [ExtensionType.WebGPUSystem],\n name: 'renderTarget',\n } as const;\n\n public adaptor = new GpuRenderTargetAdaptor();\n\n constructor(renderer: WebGPURenderer)\n {\n super(renderer);\n\n this.adaptor.init(renderer, this);\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\n\nimport type { System } from '../shared/system/System';\nimport type { WebGPURenderer } from './WebGPURenderer';\n\n/**\n * The system that handles color masking for the GPU.\n * @category rendering\n * @advanced\n */\nexport class GpuColorMaskSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\n ],\n name: 'colorMask',\n } as const;\n\n private readonly _renderer: WebGPURenderer;\n\n private _colorMaskCache = 0b1111;\n\n constructor(renderer: WebGPURenderer)\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.pipeline.setColorMask(colorMask);\n }\n\n public destroy()\n {\n (this._renderer as null) = null;\n this._colorMaskCache = null;\n }\n}\n","import { TextureSource } from '../../shared/texture/sources/TextureSource';\n\nimport type { RenderTarget } from '../../shared/renderTarget/RenderTarget';\nimport type { WebGPURenderer } from '../WebGPURenderer';\n\n/**\n * Restores a multisampled colour buffer from its resolved image.\n *\n * A transient MSAA colour buffer (every one on a tile-based GPU, and ones the user marks `transient`\n * elsewhere) is cleared on load and discarded on store, which skips writing the 4-sample buffer back to\n * memory. The resolved single-sample texture is still stored, so a pass that reopens the target (a filter\n * popping back, a mask adding stencil, `clear: false`) copies the resolved texture into the target's back\n * texture and draws it back in as the pass's first draw, instead of loading samples that were never written.\n * On tile-based GPUs this beats storing and loading the 4-sample buffer even when a target is reopened every\n * frame; on GPUs that keep MSAA in video memory it doesn't, which is why they store it by default.\n *\n * The draw is a full-screen `textureLoad` with no blending, so every pixel gets its resolved colour back.\n * The back textures belong to the targets (`GpuRenderTarget.msaaBackTextures`); this holds only the\n * pipelines and bind groups.\n * @category rendering\n * @ignore\n */\nexport class GpuMsaaRestore\n{\n private readonly _renderer: WebGPURenderer;\n private readonly _device: GPUDevice;\n private readonly _layout: GPUBindGroupLayout;\n private readonly _pipelineLayout: GPUPipelineLayout;\n /** per attachment layout, one pipeline per colour attachment */\n private readonly _pipelines: Record<string, GPURenderPipeline[]> = Object.create(null);\n private readonly _modules: Record<number, GPUShaderModule> = Object.create(null);\n /** one bind group per back texture, dropped with the texture when a resize replaces it */\n private readonly _bindGroups = new WeakMap<GPUTexture, GPUBindGroup>();\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n this._device = renderer.gpu.device;\n this._layout = this._device.createBindGroupLayout({\n entries: [{\n binding: 0,\n visibility: GPUShaderStage.FRAGMENT,\n texture: { sampleType: 'unfilterable-float' },\n }],\n });\n this._pipelineLayout = this._device.createPipelineLayout({ bindGroupLayouts: [this._layout] });\n }\n\n /**\n * Copies one colour attachment's resolved image into the target's back texture, creating it on first use\n * at the attachment's size and format. Must be recorded outside a render pass.\n * @param commandEncoder - the encoder to record the copy on\n * @param renderTarget - the target being reopened\n * @param index - the colour attachment to copy\n * @param resolved - the attachment's resolved texture\n */\n public copy(commandEncoder: GPUCommandEncoder, renderTarget: RenderTarget, index: number, resolved: GPUTexture): void\n {\n const gpuRenderTarget = this._renderer.renderTarget.getGpuRenderTarget(renderTarget);\n const colorTexture = renderTarget.colorAttachments[index].texture;\n\n gpuRenderTarget.msaaBackTextures[index] ??= new TextureSource({\n label: 'msaa-back-texture',\n width: colorTexture.width,\n height: colorTexture.height,\n resolution: colorTexture._resolution,\n format: gpuRenderTarget.msaaTextures[index].format,\n autoGenerateMipmaps: false,\n // every restore copies into it afresh, so an idle one can be freed and re-created on the next restore\n autoGarbageCollect: true,\n });\n\n const backTexture = this._renderer.texture.getGpuSource(gpuRenderTarget.msaaBackTextures[index]);\n\n commandEncoder.copyTextureToTexture(\n { texture: resolved },\n { texture: backTexture },\n { width: Math.min(resolved.width, backTexture.width), height: Math.min(resolved.height, backTexture.height) },\n );\n }\n\n /**\n * Draws one colour attachment's back texture into the multisampled buffer. Must be the first draw of the\n * pass, before any viewport or scissor is set.\n * @param pass - the pass that was just begun\n * @param renderTarget - the target the pass renders to\n * @param index - the colour attachment to restore, copied by {@link GpuMsaaRestore.copy}\n */\n public draw(pass: GPURenderPassEncoder, renderTarget: RenderTarget, index: number): void\n {\n const gpuRenderTarget = this._renderer.renderTarget.getGpuRenderTarget(renderTarget);\n const backTexture = this._renderer.texture.getGpuSource(gpuRenderTarget.msaaBackTextures[index]);\n\n // the pipeline has to match the pass's attachments; a mask can add stencil mid-frame, so read them now\n let key = renderTarget.depthStencilAttachment?.texture.format ?? '';\n\n for (const attachment of renderTarget.colorAttachments)\n {\n key += `|${attachment.texture.format}`;\n }\n\n const pipelines = this._pipelines[key] ??= [];\n let bindGroup = this._bindGroups.get(backTexture);\n\n if (!bindGroup)\n {\n bindGroup = this._device.createBindGroup({\n layout: this._layout,\n entries: [{ binding: 0, resource: backTexture.createView() }],\n });\n this._bindGroups.set(backTexture, bindGroup);\n }\n\n pass.setPipeline(pipelines[index] ??= this._createPipeline(renderTarget, index));\n pass.setBindGroup(0, bindGroup);\n pass.draw(3);\n }\n\n private _getModule(index: number): GPUShaderModule\n {\n this._modules[index] ??= this._device.createShaderModule({\n label: 'msaa-restore',\n code: /* wgsl */ `\n @group(0) @binding(0) var resolved: texture_2d<f32>;\n\n @vertex\n fn vertexMain(@builtin(vertex_index) i: u32) -> @builtin(position) vec4<f32> {\n let pos = array<vec2<f32>, 3>(vec2<f32>(-1.0, -1.0), vec2<f32>(3.0, -1.0), vec2<f32>(-1.0, 3.0));\n\n return vec4<f32>(pos[i], 0.0, 1.0);\n }\n\n @fragment\n fn fragmentMain(@builtin(position) position: vec4<f32>) -> @location(${index}) vec4<f32> {\n return textureLoad(resolved, vec2<i32>(position.xy), 0);\n }\n `,\n });\n\n return this._modules[index];\n }\n\n private _createPipeline(renderTarget: RenderTarget, index: number): GPURenderPipeline\n {\n const depthStencilFormat = renderTarget.depthStencilAttachment?.texture.format;\n let depthStencil: GPUDepthStencilState;\n\n if (depthStencilFormat)\n {\n // matches the pass; the restore never tests or writes depth/stencil\n depthStencil = { format: depthStencilFormat };\n\n if (depthStencilFormat.includes('depth'))\n {\n depthStencil.depthWriteEnabled = false;\n depthStencil.depthCompare = 'always';\n }\n }\n\n const module = this._getModule(index);\n\n return this._device.createRenderPipeline({\n label: 'msaa-restore',\n layout: this._pipelineLayout,\n vertex: { module, entryPoint: 'vertexMain' },\n fragment: {\n module,\n entryPoint: 'fragmentMain',\n // every attachment must be declared to match the pass; only the restored one is written\n targets: renderTarget.colorAttachments.map((attachment, i) => ({\n format: attachment.texture.format,\n writeMask: i === index ? GPUColorWrite.ALL : 0,\n })),\n },\n depthStencil,\n multisample: { count: 4 },\n });\n }\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { type GPUData } from '../../../../scene/view/ViewContainer';\nimport { GCManagedHash } from '../../../../utils/data/GCManagedHash';\nimport { fastCopy } from '../../shared/buffer/utils/fastCopy';\n\nimport type { Buffer } from '../../shared/buffer/Buffer';\nimport type { System } from '../../shared/system/System';\nimport type { GPU } from '../GpuDeviceSystem';\nimport type { WebGPURenderer } from '../WebGPURenderer';\n\n/** @internal */\nexport class GpuBufferData implements GPUData\n{\n public gpuBuffer: GPUBuffer;\n\n constructor(gpuBuffer: GPUBuffer)\n {\n this.gpuBuffer = gpuBuffer;\n }\n\n public destroy()\n {\n this.gpuBuffer.destroy();\n this.gpuBuffer = null;\n }\n}\n\n/**\n * System plugin to the renderer to manage buffers.\n * @category rendering\n * @advanced\n */\nexport class GpuBufferSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\n ],\n name: 'buffer',\n } as const;\n\n protected CONTEXT_UID: number;\n private readonly _renderer: WebGPURenderer;\n private readonly _managedBuffers: GCManagedHash<Buffer>;\n\n private _gpu: GPU;\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n this._managedBuffers = new GCManagedHash({\n renderer,\n type: 'resource',\n onUnload: this.onBufferUnload.bind(this),\n name: 'gpuBuffer'\n });\n }\n\n protected contextChange(gpu: GPU): void\n {\n this._gpu = gpu;\n this.destroyAll();\n }\n\n public getGPUBuffer(buffer: Buffer): GPUBuffer\n {\n buffer._gcLastUsed = this._renderer.gc.now;\n\n return (buffer._gpuData[this._renderer.uid] as GpuBufferData)?.gpuBuffer || this.createGPUBuffer(buffer);\n }\n\n public updateBuffer(buffer: Buffer): GPUBuffer\n {\n const gpuBuffer = this.getGPUBuffer(buffer);\n\n const data = buffer.data;\n\n // TODO this can be better...\n if (buffer._updateID && data)\n {\n buffer._updateID = 0;\n\n // make sure\n this._gpu.device.queue.writeBuffer(\n gpuBuffer,\n buffer._updateOffset,\n data.buffer,\n data.byteOffset + buffer._updateOffset,\n // round to the nearest 4 bytes\n ((buffer._updateSize || data.byteLength) + 3) & ~3\n );\n }\n\n return gpuBuffer;\n }\n\n /** dispose all WebGL resources of all managed buffers */\n public destroyAll(): void\n {\n this._managedBuffers.removeAll();\n }\n\n protected onBufferUnload(buffer: Buffer): void\n {\n buffer.off('update', this.updateBuffer, this);\n buffer.off('change', this.onBufferChange, this);\n }\n\n public createGPUBuffer(buffer: Buffer): GPUBuffer\n {\n const gpuBuffer = this._gpu.device.createBuffer(buffer.descriptor);\n\n buffer._updateID = 0;\n\n if (buffer.data)\n {\n // TODO if data is static, this can be mapped at creation\n fastCopy(\n buffer.data.buffer as ArrayBuffer,\n gpuBuffer.getMappedRange(),\n buffer.data.byteOffset,\n buffer.data.byteLength\n );\n\n gpuBuffer.unmap();\n }\n\n buffer._gpuData[this._renderer.uid] = new GpuBufferData(gpuBuffer);\n if (this._managedBuffers.add(buffer))\n {\n buffer.on('update', this.updateBuffer, this);\n buffer.on('change', this.onBufferChange, this);\n }\n\n return gpuBuffer;\n }\n\n protected onBufferChange(buffer: Buffer)\n {\n this._managedBuffers.remove(buffer);\n buffer._updateID = 0;\n this.createGPUBuffer(buffer);\n }\n\n public destroy(): void\n {\n this._managedBuffers.destroy();\n (this._renderer as null) = null;\n this._gpu = null;\n }\n}\n\n","import { ExtensionType } from '../../../extensions/Extensions';\n\nimport type { RenderTarget } from '../shared/renderTarget/RenderTarget';\nimport type { STENCIL_MODES } from '../shared/state/const';\nimport type { System } from '../shared/system/System';\nimport type { GpuRenderTarget } from './renderTarget/GpuRenderTarget';\nimport type { WebGPURenderer } from './WebGPURenderer';\n\n/**\n * This manages the stencil buffer. Used primarily for masking\n * @category rendering\n * @advanced\n */\nexport class GpuStencilSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\n ],\n name: 'stencil',\n } as const;\n\n private readonly _renderer: WebGPURenderer;\n\n private _activeRenderTarget: RenderTarget;\n /** the backend counterpart of the active render target, which carries the stencil state being tracked */\n private _activeGpuRenderTarget: GpuRenderTarget;\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n\n renderer.renderTarget.onRenderTargetChange.add(this);\n }\n\n protected contextChange(): void\n {\n // the backend render targets were rebuilt with the device, 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\n protected onRenderTargetChange(renderTarget: RenderTarget)\n {\n const gpuRenderTarget = this._renderer.renderTarget.getGpuRenderTarget(renderTarget);\n\n this._activeRenderTarget = renderTarget;\n this._activeGpuRenderTarget = gpuRenderTarget;\n\n this.setStencilMode(gpuRenderTarget.stencilMode, gpuRenderTarget.stencilReference);\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 gpuRenderTarget.stencilMode = stencilMode;\n gpuRenderTarget.stencilReference = stencilReference;\n\n const renderer = this._renderer;\n\n renderer.pipeline.setStencilMode(stencilMode);\n renderer.encoder.setStencilReference(stencilReference);\n }\n\n public destroy()\n {\n this._renderer.renderTarget.onRenderTargetChange.remove(this);\n\n (this._renderer as null) = null;\n\n this._activeRenderTarget = null;\n this._activeGpuRenderTarget = null;\n }\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { warn } from '../../../../utils/logging/warn';\nimport { ensureAttributes } from '../../gl/shader/program/ensureAttributes';\nimport { ShaderOverrides } from '../../shared/shader/ShaderOverrides';\nimport { STENCIL_MODES } from '../../shared/state/const';\nimport { createIdFromString } from '../../shared/utils/createIdFromString';\nimport { GpuStencilModesToPixi } from '../state/GpuStencilModesToPixi';\n\nimport type { Topology } from '../../shared/geometry/const';\nimport type { Geometry } from '../../shared/geometry/Geometry';\nimport type { RenderTarget } from '../../shared/renderTarget/RenderTarget';\nimport type { State } from '../../shared/state/State';\nimport type { System } from '../../shared/system/System';\nimport type { GPU } from '../GpuDeviceSystem';\nimport type { GpuProgram } from '../shader/GpuProgram';\nimport type { StencilState } from '../state/GpuStencilModesToPixi';\nimport type { WebGPURenderer } from '../WebGPURenderer';\n\nconst topologyStringToId = {\n 'point-list': 0,\n 'line-list': 1,\n 'line-strip': 2,\n 'triangle-list': 3,\n 'triangle-strip': 4,\n};\n\nconst emptyOverrides = new ShaderOverrides({});\n\n// `index` is the value baked into the pipeline cache key (see getGlobalStateKey).\n// Index 0 is reserved for \"no depth-stencil attachment\" (emptyDepthStencilFormatData);\n// every real format gets a distinct non-zero index so a depth-less target and a\n// depth-enabled target can never resolve to the same pipeline-cache slot.\nconst depthStencilFormatMap: Record<string, { depth: boolean, stencil: boolean, index: number }> = {\n 'depth24plus-stencil8': { depth: true, stencil: true, index: 1 },\n depth24plus: { depth: true, stencil: false, index: 2 },\n depth32float: { depth: true, stencil: false, index: 3 },\n 'depth32float-stencil8': { depth: true, stencil: true, index: 4 },\n depth16unorm: { depth: true, stencil: false, index: 5 },\n stencil8: { depth: false, stencil: true, index: 6 },\n};\n\nconst emptyDepthStencilFormatData = { depth: false, stencil: false, index: 0 };\n\n/**\n * Rewrites WGSL source by replacing `override` declarations with `const` declarations\n * whose values are baked in from the provided overrides map. Used as a fallback for\n * browsers that don't support the `constants` field in `GPURenderPipelineDescriptor` (e.g. Safari).\n *\n * Values are formatted according to WGSL literal rules:\n * - `u32` → unsigned integer suffix (`42u`)\n * - `i32` → plain integer (`42`)\n * - `f32` → float with decimal point (`42.0`)\n * @param source - The WGSL shader source string containing `override` declarations.\n * @param overrides - A map of override names to their numeric values.\n * @returns The modified WGSL source with matching `override` declarations replaced by `const`.\n * @internal\n */\nexport function bakeOverridesIntoSource(source: string, overrides: Record<string, number>): string\n{\n for (const [name, value] of Object.entries(overrides))\n {\n const re = new RegExp(\n `override\\\\s+${name}\\\\s*:\\\\s*(\\\\w+)\\\\s*(?:=[^;]*)?;`\n );\n\n source = source.replace(re, (_, type) =>\n {\n let lit: string;\n\n if (type === 'u32') lit = `${Math.trunc(value)}u`;\n else if (type === 'i32') lit = `${Math.trunc(value)}`;\n else lit = Number.isInteger(value) ? `${value}.0` : `${value}`;\n\n return `const ${name}: ${type} = ${lit};`;\n });\n }\n\n return source;\n}\n\n// geometryLayouts = 256; // 8 bits // 256 states // value 0-255;\n// shaderKeys = 256; // 8 bits // 256 states // value 0-255;\n// state = 64; // 6 bits // 64 states // value 0-63;\n// blendMode = 32; // 5 bits // 32 states // value 0-31;\n// topology = 8; // 3 bits // 8 states // value 0-7;\nfunction getGraphicsStateKey(\n geometryLayout: number,\n shaderKey: number,\n state: number,\n blendMode: number,\n topology: number,\n overrideId: number\n): number\n{\n return (geometryLayout * 35184372088832) // 2^45 - 8 bits space for geometry (256)\n + (shaderKey * 536870912) // 2^29 - 16 bits space for shader (65,536)\n + (overrideId * 16384) // 2^14 - 15 bits space for overrides (32,768)\n + (state << 8)\n + (blendMode << 3)\n + topology;\n}\n\n// Module-local interner for color attachment formats. Realistic apps will populate\n// 1-3 entries ever (default render-target format + maybe rgba16float for HDR), so the\n// id stays small and fits comfortably in a few bits of the global cache key.\n//\n// Trade-off: only the first attachment's format is encoded. Mixed-format MRT (where\n// different attachments use different formats) would alias the same cache slot. The\n// failure mode is a clean WebGPU validation error at setPipeline time, not silent\n// corruption, so it surfaces immediately if anyone hits it.\nconst colorFormatIds: Record<string, number> = Object.create(null);\nlet nextColorFormatId = 0;\n\nfunction getColorFormatId(format: GPUTextureFormat): number\n{\n let id = colorFormatIds[format];\n\n if (id === undefined) id = colorFormatIds[format] = nextColorFormatId++;\n\n return id;\n}\n\n// multiSampleCount = 1; // bit 0 // 2 states // value 0-1 (normalized from sampleCount 1|4)\n// colorTargetCount = 9; // bits 1-4 // supports 0-8 color targets (WebGPU maxColorAttachments)\n// depthReadOnly = 1; // bit 5 // 2 states // value 0-1;\n// stencilState = 8; // bits 6-8 // 8 states // value 0-7;\n// colorMask = 16; // bits 9-12 // 16 states // value 0-15;\n// depthStencilFormat = 7; // bits 13-15 // 8 states // value 0-7;\n// colorFormatId = 16; // bits 16-19 // 16 interned color attachment formats\n// invertFrontFace = 1; // bit 20 // 2 states // value 0-1 (flipY winding inversion)\nfunction getGlobalStateKey(\n stencilStateId: number,\n multiSampleCount: number,\n colorMask: number,\n colorTargetCount: number,\n depthStencilFormat: number,\n colorFormatId: number,\n depthReadOnly: number,\n invertFrontFace: number,\n): number\n{\n return (invertFrontFace << 20) // 1 bit for invertFrontFace (flipY winding inversion)\n | (colorFormatId << 16) // 4 bits for colorFormatId\n | (depthStencilFormat << 13) // 3 bits for depthStencilFormat\n | (colorMask << 9) // 4 bits for colorMask\n | (stencilStateId << 6) // 3 bits for stencilStateId\n | (depthReadOnly << 5) // 1 bit for depthReadOnly (read-only depth passes can't emit depth writes)\n | (colorTargetCount << 1) // 4 bits for colorTargetCount (0-8, WebGPU's maxColorAttachments)\n | multiSampleCount; // 1 bit for multiSampleCount at the least significant position\n}\n\n// The state a render bundle bakes into itself at record time, packed into one int. Deliberately\n// not getGlobalStateKey: colorMask and stencilMode are ambient draw state that a bundle captures\n// per-pipeline as it records, so folding them in here would invalidate cached bundles whenever\n// unrelated 2D state (a mask elsewhere in the scene) happened to differ at execute time.\n//\n// multiSampleCount = 1; // bit 0 // 2 states // value 0-1 (normalized from sampleCount 1|4)\n// colorTargetCount = 9; // bits 1-4 // supports 0-8 color targets (WebGPU maxColorAttachments)\n// depthStencilFormat = 7; // bits 5-7 // 8 states // value 0-7 (0 = no depth/stencil attachment)\n// depthReadOnly = 1; // bit 8 // 2 states // value 0-1\n// stencilReadOnly = 1; // bit 9 // 2 states // value 0-1\n// invertFrontFace = 1; // bit 10 // 2 states // value 0-1 (flipY winding inversion)\n// colorFormatId = n; // bits 11+ // interned color attachment formats (see getColorFormatId)\nfunction getBundleStateKey(\n multiSampleCount: number,\n colorTargetCount: number,\n depthStencilFormat: number,\n depthReadOnly: number,\n stencilReadOnly: number,\n invertFrontFace: number,\n colorFormatId: number,\n): number\n{\n // colorFormatId takes the open top of the key: a format id is only minted per distinct\n // attachment format ever seen (realistically 1-3), so it cannot approach the 32-bit\n // boundary these bitwise ops work in\n return (colorFormatId << 11)\n | (invertFrontFace << 10)\n | (stencilReadOnly << 9)\n | (depthReadOnly << 8)\n | (depthStencilFormat << 5)\n | (colorTargetCount << 1)\n | multiSampleCount;\n}\n\n// a Map, not a plain object: the combined graphics key exceeds 2^31, and big numeric\n// keys on objects get stringified per lookup (dictionary mode) — Map hashes numbers\n// natively, which benchmarks ~3x faster on this per-draw path\ntype PipeHash = Map<number, GPURenderPipeline>;\n\n/**\n * A system that creates and manages the GPU pipelines.\n *\n * Caching Mechanism: At its core, the system employs a two-tiered caching strategy to minimize\n * the redundant creation of GPU pipelines (or \"pipes\"). This strategy is based on generating unique\n * keys that represent the state of the graphics settings and the specific requirements of the\n * item being rendered. By caching these pipelines, subsequent draw calls with identical configurations\n * can reuse existing pipelines instead of generating new ones.\n *\n * State Management: The system differentiates between \"global\" state properties (like color masks\n * and stencil masks, which do not change frequently) and properties that may vary between draw calls\n * (such as geometry, shaders, and blend modes). Unique keys are generated for both these categories\n * using getStateKey for global state and getGraphicsStateKey for draw-specific settings. These keys are\n * then then used to caching the pipe. The next time we need a pipe we can check\n * the cache by first looking at the state cache and then the pipe cache.\n * @category rendering\n * @advanced\n */\nexport class PipelineSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [ExtensionType.WebGPUSystem],\n name: 'pipeline',\n } as const;\n private readonly _renderer: WebGPURenderer;\n\n protected CONTEXT_UID: number;\n\n private _moduleCache: Record<string, GPUShaderModule> = Object.create(null);\n private _bufferLayoutsCache: Record<number, GPUVertexBufferLayout[]> = Object.create(null);\n private readonly _bindingNamesCache: Record<string, string[]> = Object.create(null);\n\n private _pipeCache: PipeHash = new Map();\n private _pipeStateCaches: Record<number, PipeHash> = Object.create(null);\n\n private _gpu: GPU;\n private _stencilState: StencilState;\n\n private _stencilMode: STENCIL_MODES;\n private _colorMask = 0b1111;\n private _multisampleCount = 1;\n private _colorTargetCount = 1;\n private _colorFormat: GPUTextureFormat = 'bgra8unorm';\n private _colorFormatId = getColorFormatId('bgra8unorm');\n private _depthStencilFormat: GPUTextureFormat = 'depth24plus-stencil8';\n private _depthStencilFormatData = emptyDepthStencilFormatData;\n private _depthReadOnly = false;\n private _stencilReadOnly = false;\n private _invertFrontFace = false;\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n }\n\n protected contextChange(gpu: GPU): void\n {\n this._gpu = gpu;\n this._moduleCache = Object.create(null);\n this._pipeStateCaches = Object.create(null);\n this.setStencilMode(STENCIL_MODES.DISABLED);\n\n this._updatePipeHash();\n }\n\n public setMultisampleCount(multisampleCount: number): void\n {\n if (this._multisampleCount === multisampleCount) return;\n\n this._multisampleCount = multisampleCount;\n\n this._updatePipeHash();\n }\n\n public setRenderTarget(renderTarget: RenderTarget)\n {\n // Depth-only render targets (e.g. shadow maps) have no color attachments.\n // Pipelines built against them will have no fragment color outputs, but we still\n // need stable defaults for the cache key.\n const colorTexture = renderTarget.colorAttachments[0]?.texture;\n\n this._multisampleCount = colorTexture?.source.antialias ? 4 : 1;\n this._colorTargetCount = renderTarget.colorAttachments.length;\n this._colorFormat = colorTexture?.format ?? 'bgra8unorm';\n this._colorFormatId = getColorFormatId(this._colorFormat);\n // the adaptor ensures a depth/stencil request has materialised its texture before\n // calling this (GpuRenderTargetAdaptor.startRenderPass), so the attachment is the truth\n this._depthStencilFormat = renderTarget.depthStencilAttachment?.texture.format;\n this._depthStencilFormatData = depthStencilFormatMap[this._depthStencilFormat] || emptyDepthStencilFormatData;\n this._depthReadOnly = renderTarget.depthStencilAttachment?.depthReadOnly ?? false;\n // same derivation the pass descriptor uses (GpuRenderTargetAdaptor): a read-only depth\n // attachment is usually about sampling the texture, which WebGPU only allows when the\n // entire attachment — stencil included — is read-only\n this._stencilReadOnly = renderTarget.depthStencilAttachment?.stencilReadOnly ?? this._depthReadOnly;\n // WebGPU bakes winding into the (cached) pipeline, not as live state. The one spelling of the\n // rule lives on the render target system; on WebGPU it resolves to plain `flipY`: off → the\n // framebuffer's natural ccw; on → invert to cw so the projection flip and the winding flip\n // cancel and culling is preserved. This bit feeds the cache key (getGlobalStateKey), so a\n // flipY pass gets its own pipeline rather than aliasing — and an off pass keeps today's key.\n this._invertFrontFace = this._renderer.renderTarget.isFrontFaceInverted(renderTarget, renderTarget.flipY);\n this._updatePipeHash();\n }\n\n public setColorMask(colorMask: number): void\n {\n if (this._colorMask === colorMask) return;\n\n this._colorMask = colorMask;\n\n this._updatePipeHash();\n }\n\n public setStencilMode(stencilMode: STENCIL_MODES): void\n {\n if (this._stencilMode === stencilMode) return;\n\n this._stencilMode = stencilMode;\n this._stencilState = GpuStencilModesToPixi[stencilMode];\n\n this._updatePipeHash();\n }\n\n /**\n * A packed key for everything a render bundle recorded right now would bake into itself: the\n * attachment state WebGPU validates when the bundle is executed (color format(s), color target\n * count, depth/stencil format, sample count, read-only aspects), plus the front-face winding\n * its pipelines capture — which WebGPU does *not* validate.\n *\n * Equal keys mean a bundle recorded then is compatible with, and correct for, the pass now;\n * different keys mean it has to be re-recorded before it is replayed. Comparing the two is\n * what {@link GpuEncoderSystem.isBundleValid} does.\n *\n * `colorMask` and `stencilMode` are deliberately left out, unlike the pipeline cache key: they\n * are ambient draw state a bundle bakes per-pipeline as it records, so their value at execute\n * time says nothing about whether the bundle is still good.\n */\n public get bundleStateKey(): number\n {\n const formatData = this._depthStencilFormatData;\n\n return getBundleStateKey(\n // normalize the raw sample count (1 or 4 — WebGPU's only renderable counts) to a\n // true single bit, so it cannot spill into the colorTargetCount field above it\n this._multisampleCount === 1 ? 0 : 1,\n this._colorTargetCount,\n formatData.index,\n // the same two flags getBundleDescriptor sets — keep them in step\n formatData.depth && this._depthReadOnly ? 1 : 0,\n formatData.stencil && this._stencilReadOnly ? 1 : 0,\n this._invertFrontFace ? 1 : 0,\n this._colorFormatId,\n );\n }\n\n /**\n * Builds a `GPURenderBundleEncoderDescriptor` that matches the current render target\n * configuration (color formats, sample count, depth/stencil format, and which of its aspects\n * are read-only).\n * Used by {@link GpuEncoderSystem.beginBundle} to create a compatible render bundle encoder.\n * @returns A descriptor for creating a GPURenderBundleEncoder.\n */\n public getBundleDescriptor(): GPURenderBundleEncoderDescriptor\n {\n const colorFormats: GPUTextureFormat[] = [];\n\n for (let i = 0; i < this._colorTargetCount; i++)\n {\n colorFormats.push(this._colorFormat);\n }\n\n const descriptor: GPURenderBundleEncoderDescriptor = {\n colorFormats,\n sampleCount: this._multisampleCount,\n };\n\n const formatData = this._depthStencilFormatData;\n\n if (formatData.depth || formatData.stencil)\n {\n descriptor.depthStencilFormat = this._depthStencilFormat;\n\n // A read-only pass only accepts bundles that promise the same, so mirror the target's\n // flags — gated by the aspects the format actually has, exactly how\n // GpuRenderTargetAdaptor gates them on the pass. The promise holds: pipelines recorded\n // against a read-only attachment already force depthWriteEnabled off (_createPipeline).\n // bundleStateKey stamps these same two bits, so the two must move together.\n if (formatData.depth && this._depthReadOnly) descriptor.depthReadOnly = true;\n if (formatData.stencil && this._stencilReadOnly) descriptor.stencilReadOnly = true;\n }\n\n return descriptor;\n }\n\n public setPipeline(geometry: Geometry, program: GpuProgram, state: State, passEncoder: GPURenderPassEncoder): void\n {\n const pipeline = this.getPipeline(geometry, program, state);\n\n passEncoder.setPipeline(pipeline);\n }\n\n /**\n * Generates a key for the pipeline.advanced usage only.\n * @param geometry - The geometry to get the key for\n * @param program - The program to get the key for\n * @param state - The state to get the key for\n * @param topology - The topology to get the key for\n * @param overrides - The overrides to get the key for\n * @returns The key for the pipeline\n */\n public getPipelineKey(\n geometry: Geometry,\n program: GpuProgram,\n state: State,\n topology: Topology,\n overrides: ShaderOverrides,\n ): number\n {\n if (!geometry._layoutKey)\n {\n ensureAttributes(geometry, program.attributeData);\n\n // prepare the geometry for the pipeline\n this._generateBufferKey(geometry);\n }\n\n return getGraphicsStateKey(\n geometry._layoutKey,\n program._layoutKey,\n state.data,\n state._blendModeId,\n topologyStringToId[topology],\n overrides.id,\n );\n }\n\n public getPipeline(\n geometry: Geometry,\n program: GpuProgram,\n state: State,\n topology?: Topology,\n overrides?: ShaderOverrides,\n ): GPURenderPipeline\n {\n if (!geometry._layoutKey)\n {\n ensureAttributes(geometry, program.attributeData);\n\n // prepare the geometry for the pipeline\n this._generateBufferKey(geometry);\n }\n\n topology ||= geometry.topology;\n overrides ||= emptyOverrides;\n\n // now we have set the Ids - the key is different...\n const key = getGraphicsStateKey(\n geometry._layoutKey,\n program._layoutKey,\n state.data,\n state._blendModeId,\n topologyStringToId[topology],\n overrides.id,\n );\n\n let pipeline = this._pipeCache.get(key);\n\n if (!pipeline)\n {\n pipeline = this._createPipeline(geometry, program, state, topology, overrides);\n this._pipeCache.set(key, pipeline);\n }\n\n return pipeline;\n }\n\n private _createPipeline(\n geometry: Geometry,\n program: GpuProgram,\n state: State,\n topology: Topology,\n overrides: ShaderOverrides\n ): GPURenderPipeline\n {\n const device = this._gpu.device;\n\n const buffers = this._createVertexBufferLayouts(geometry, program);\n\n const blendModes = this._renderer.state.getColorTargets(state, this._colorTargetCount, this._colorFormat);\n\n // Apply write mask to all color targets\n const writeMask = this._stencilMode === STENCIL_MODES.RENDERING_MASK_ADD ? 0 : this._colorMask;\n\n for (let i = 0; i < blendModes.length; i++)\n {\n blendModes[i].writeMask = writeMask;\n }\n\n const layout = this._renderer.shader.getProgramData(program).pipeline;\n\n const hasOverrides = Object.keys(overrides.data).length > 0;\n\n let vertexSource = program.vertex.source;\n let fragmentSource = program.fragment.source;\n let constants: Record<string, number> | undefined;\n\n if (hasOverrides)\n {\n if (this._renderer.limits.supportsOverrideConstants)\n {\n constants = overrides.data;\n }\n else\n {\n vertexSource = bakeOverridesIntoSource(vertexSource, overrides.data);\n fragmentSource = bakeOverridesIntoSource(fragmentSource, overrides.data);\n }\n }\n\n const descriptor: GPURenderPipelineDescriptor = {\n // TODO later check if its helpful to create..\n // layout,\n vertex: {\n module: this._getModule(vertexSource),\n entryPoint: program.vertex.entryPoint,\n constants,\n buffers,\n },\n fragment: {\n module: this._getModule(fragmentSource),\n entryPoint: program.fragment.entryPoint,\n targets: blendModes,\n constants,\n },\n primitive: {\n topology,\n // Mirror WebGL's split: `gl.cullFace` is left at its `BACK` default, so the back is always\n // the culled side. Taking this from `state.cullMode` instead folds the winding into *which\n // side* is culled — the same triangles survive, but `@builtin(front_facing)` then reports\n // the opposite of `gl_FrontFacing` for clockwise-wound geometry.\n cullMode: state.culling ? 'back' : 'none',\n // The winding is stated once, here, exactly as `gl.frontFace` does it. `flipY` inverts the\n // projection (see setRenderTarget), so inverting the winding alongside it makes the two\n // cancel and a front face stays a front face. Both flags are part of the pipeline cache key.\n frontFace: state.clockwiseFrontFace !== this._invertFrontFace ? 'cw' : 'ccw',\n },\n layout,\n multisample: {\n count: this._multisampleCount,\n },\n // depthStencil,\n label: program.name ? `PIXI Pipeline (${program.name})` : `PIXI Pipeline`,\n };\n\n // only apply if the texture has stencil or depth\n if (this._depthStencilFormatData.depth || this._depthStencilFormatData.stencil)\n {\n const formatData = this._depthStencilFormatData;\n\n // mask states..\n descriptor.depthStencil = {\n ...this._stencilState,\n format: this._depthStencilFormat,\n depthWriteEnabled: formatData.depth ? (state.depthMask && !this._depthReadOnly) : false,\n depthCompare: formatData.depth && state.depthTest ? 'less' : 'always',\n };\n }\n\n const pipeline = device.createRenderPipeline(descriptor);\n\n return pipeline;\n }\n\n private _getModule(code: string): GPUShaderModule\n {\n return this._moduleCache[code] || this._createModule(code);\n }\n\n private _createModule(code: string): GPUShaderModule\n {\n const device = this._gpu.device;\n\n this._moduleCache[code] = device.createShaderModule({\n code,\n });\n\n return this._moduleCache[code];\n }\n\n /**\n * Generates and caches a numeric layout key on the geometry based on its sorted attribute\n * descriptors (offset, format, stride, instancing). Geometries with identical attribute\n * layouts share the same key, enabling pipeline reuse.\n * @param geometry - The geometry to generate a layout key for.\n */\n private _generateBufferKey(geometry: Geometry): number\n {\n const keyGen = [];\n let index = 0;\n\n const attributeKeys = Object.keys(geometry.attributes).sort();\n\n for (let i = 0; i < attributeKeys.length; i++)\n {\n const attribute = geometry.attributes[attributeKeys[i]];\n\n keyGen[index++] = attribute.offset;\n keyGen[index++] = attribute.format;\n keyGen[index++] = attribute.stride;\n keyGen[index++] = attribute.instance;\n }\n\n const stringKey = keyGen.join('|');\n\n geometry._layoutKey = createIdFromString(stringKey, 'geometry');\n\n return geometry._layoutKey;\n }\n\n private _generateAttributeLocationsKey(program: GpuProgram): number\n {\n const keyGen = [];\n let index = 0;\n // generate a key..\n\n const attributeKeys = Object.keys(program.attributeData).sort();\n\n for (let i = 0; i < attributeKeys.length; i++)\n {\n const attribute = program.attributeData[attributeKeys[i]];\n\n keyGen[index++] = attribute.location;\n }\n\n const stringKey = keyGen.join('|');\n\n program._attributeLocationsKey = createIdFromString(stringKey, 'programAttributes');\n\n return program._attributeLocationsKey;\n }\n\n /**\n * Returns the buffer names to bind, one per vertex buffer slot.\n * This is used to bind the correct buffer to the correct location in the shader.\n * @param geometry - The geometry where to get the buffer names\n * @param program - The program where to get the buffer names\n * @returns The buffer names, indexed by vertex buffer slot.\n */\n public getBufferNamesToBind(geometry: Geometry, program: GpuProgram): string[]\n {\n const key = (geometry._layoutKey << 16) | program._attributeLocationsKey;\n\n if (this._bindingNamesCache[key]) return this._bindingNamesCache[key];\n\n const data = this._createVertexBufferLayouts(geometry, program);\n\n // now map the data to the buffers..\n const bufferNamesToBind: string[] = [];\n\n const attributeData = program.attributeData;\n\n for (let i = 0; i < data.length; i++)\n {\n const attributes = Object.values(data[i].attributes);\n\n const shaderLocation = attributes[0].shaderLocation;\n\n for (const j in attributeData)\n {\n if (attributeData[j].location === shaderLocation)\n {\n bufferNamesToBind[i] = j;\n break;\n }\n }\n }\n\n this._bindingNamesCache[key] = bufferNamesToBind;\n\n return bufferNamesToBind;\n }\n\n private _createVertexBufferLayouts(geometry: Geometry, program: GpuProgram): GPUVertexBufferLayout[]\n {\n if (!program._attributeLocationsKey) this._generateAttributeLocationsKey(program);\n\n const key = (geometry._layoutKey << 16) | program._attributeLocationsKey;\n\n if (this._bufferLayoutsCache[key])\n {\n return this._bufferLayoutsCache[key];\n }\n\n const vertexBuffersLayout: GPUVertexBufferLayout[] = [];\n\n geometry.buffers.forEach((buffer) =>\n {\n const bufferEntry: GPUVertexBufferLayout = {\n arrayStride: 0,\n stepMode: 'vertex',\n attributes: [],\n };\n\n const bufferEntryAttributes = bufferEntry.attributes as GPUVertexAttribute[];\n\n for (const i in program.attributeData)\n {\n const attribute = geometry.attributes[i];\n\n if ((attribute.divisor ?? 1) !== 1)\n {\n // TODO: Maybe emulate divisor with storage_buffers/float_textures?\n // For now just issue a warning\n warn(`Attribute ${i} has an invalid divisor value of '${attribute.divisor}'. `\n + 'WebGPU only supports a divisor value of 1');\n }\n\n if (attribute.buffer === buffer)\n {\n bufferEntry.arrayStride = attribute.stride;\n bufferEntry.stepMode = attribute.instance ? 'instance' : 'vertex';\n\n bufferEntryAttributes.push({\n shaderLocation: program.attributeData[i].location,\n offset: attribute.offset,\n format: attribute.format,\n });\n }\n }\n\n if (bufferEntryAttributes.length)\n {\n vertexBuffersLayout.push(bufferEntry);\n }\n });\n\n this._bufferLayoutsCache[key] = vertexBuffersLayout;\n\n return vertexBuffersLayout;\n }\n\n private _updatePipeHash(): void\n {\n const key = getGlobalStateKey(\n this._stencilMode,\n // normalize the raw sample count (1 or 4 — WebGPU's only renderable counts) to a\n // true single bit, so it cannot spill into the colorTargetCount field above it\n this._multisampleCount === 1 ? 0 : 1,\n this._colorMask,\n this._colorTargetCount,\n this._depthStencilFormatData.index,\n this._colorFormatId,\n this._depthReadOnly ? 1 : 0,\n this._invertFrontFace ? 1 : 0,\n );\n\n this._pipeCache = this._pipeStateCaches[key] ??= new Map();\n }\n\n public destroy(): void\n {\n this._bufferLayoutsCache = null;\n this._pipeCache = null;\n this._gpu = null;\n (this._renderer as null) = null;\n (this._bindingNamesCache as null) = null;\n this._pipeStateCaches = null;\n (this._moduleCache as null) = null;\n }\n}\n","import { warn } from '../../../../utils/logging/warn';\nimport { CLEAR } from '../../gl/const';\nimport { CanvasSource } from '../../shared/texture/sources/CanvasSource';\nimport { TextureSource } from '../../shared/texture/sources/TextureSource';\nimport { GpuMsaaRestore } from './GpuMsaaRestore';\nimport { GpuRenderTarget } from './GpuRenderTarget';\n\nimport type { RgbaArray } from '../../../../color/Color';\nimport type { Rectangle } from '../../../../maths/shapes/Rectangle';\nimport type { CLEAR_OR_BOOL } from '../../gl/const';\nimport type { RenderTarget } from '../../shared/renderTarget/RenderTarget';\nimport type { RenderTargetAdaptor, RenderTargetSystem } from '../../shared/renderTarget/RenderTargetSystem';\nimport type { Texture } from '../../shared/texture/Texture';\nimport type { WebGPURenderer } from '../WebGPURenderer';\n\n// WebGPU's `GPUCanvasContext.configure` only accepts these formats. Anything else on a\n// CanvasSource falls back to the platform-preferred format with a warning.\nconst canvasAllowedFormats: Record<string, true> = {\n bgra8unorm: true,\n rgba8unorm: true,\n rgba16float: true,\n};\n\nfunction getCanvasContextFormat(format: GPUTextureFormat): GPUTextureFormat\n{\n if (canvasAllowedFormats[format]) return format;\n\n const preferred = navigator.gpu.getPreferredCanvasFormat();\n\n warn(`[WebGPU] CanvasSource format '${format}' is not a valid GPUCanvasContext format. `\n + `Falling back to '${preferred}'. Allowed formats are: bgra8unorm, rgba8unorm, rgba16float.`);\n\n return preferred;\n}\n\n/**\n * The WebGPU adaptor for the render target system. Allows the Render Target System to\n * be used with the WebGPU renderer\n * @category rendering\n * @ignore\n */\nexport class GpuRenderTargetAdaptor implements RenderTargetAdaptor<GpuRenderTarget>\n{\n private _renderTargetSystem: RenderTargetSystem<GpuRenderTarget>;\n private _renderer: WebGPURenderer<HTMLCanvasElement>;\n /**\n * The render target the currently open render pass is rendering to (plus the subresource it is\n * bound to). Used to make {@link startRenderPass} idempotent: binding the same target/mip/layer\n * again with no clear reuses the open pass instead of tearing it down and beginning a new one.\n * Reset to `null` whenever the pass is closed ({@link finishRenderPass}).\n */\n private _activePass: {\n renderTarget: RenderTarget;\n mipLevel: number;\n layer: number;\n depthStencil: boolean;\n } | null = null;\n\n /** Restores discarded MSAA colour buffers on reopen. Created on first use, per device. */\n private _msaaRestore: GpuMsaaRestore;\n\n public init(renderer: WebGPURenderer, renderTargetSystem: RenderTargetSystem<GpuRenderTarget>): void\n {\n this._renderer = renderer;\n this._renderTargetSystem = renderTargetSystem;\n\n renderer.runners.contextChange.add(this);\n renderer.runners.destroy.add(this);\n }\n\n /** Drops the restore helper, whose pipelines belong to the old device. The next restore makes a new one. */\n public contextChange(): void\n {\n this._msaaRestore = null;\n }\n\n public destroy(): void\n {\n this._msaaRestore = null;\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 renderer = this._renderer;\n\n // a copy cannot be recorded while a render pass holds the shared command encoder —\n // close the pass first (no-op when none is open), matching the GL adaptor\n this.finishRenderPass();\n\n const baseGpuTexture = this._getGpuColorTexture(\n sourceRenderSurfaceTexture\n );\n\n const backGpuTexture = renderer.texture.getGpuSource(\n destinationTexture.source\n );\n\n renderer.encoder.commandEncoder.copyTextureToTexture(\n {\n texture: baseGpuTexture,\n origin: originSrc,\n },\n {\n texture: backGpuTexture,\n origin: originDest,\n },\n size\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 renderer = this._renderer;\n\n // a copy cannot be recorded while a render pass holds the shared command encoder —\n // close the pass first (no-op when none is open), matching the GL adaptor\n this.finishRenderPass();\n\n // depth is just a GPUTexture, so it copies straight into the destination's source\n const srcDepth = source.depthStencilAttachment.texture;\n\n const srcGpu = renderer.texture.getGpuSource(srcDepth);\n const dstGpu = renderer.texture.getGpuSource(destination.source);\n\n const standAlone = renderer.encoder.commandEncoder === null;\n const commandEncoder = standAlone\n ? renderer.gpu.device.createCommandEncoder()\n : renderer.encoder.commandEncoder;\n\n commandEncoder.copyTextureToTexture(\n { texture: srcGpu, origin: originSrc },\n { texture: dstGpu, origin: originDest },\n { width: size.width, height: size.height },\n );\n\n if (standAlone)\n {\n renderer.gpu.device.queue.submit([commandEncoder.finish()]);\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 if (layer !== 0 && gpuRenderTarget.msaaTextures?.length)\n {\n throw new Error('[RenderTargetSystem] Rendering to array layers is not supported with MSAA render targets.');\n }\n\n if (mipLevel > 0 && gpuRenderTarget.msaaTextures?.length)\n {\n throw new Error('[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets.');\n }\n\n // Idempotent (\"smart\") bind: if we are asked to bind the exact target/subresource the open\n // pass is already on, and no clear is requested, reuse the live pass. We only move the\n // viewport. This avoids a redundant pass teardown + state-cache flush (and re-binding every\n // pipeline / bind group / vertex buffer on the next draw). A *partial* clear still forces a\n // real begin because you cannot flip a loadOp to 'clear' mid-pass.\n let clearBits: CLEAR_OR_BOOL = clear;\n\n if (typeof clearBits === 'boolean')\n {\n clearBits = clearBits ? CLEAR.ALL : CLEAR.NONE;\n }\n\n // depth/stencil requested without an explicit texture — WebGPU always backs\n // depth/stencil with a texture, so create the internal one lazily\n if ((renderTarget.stencil || renderTarget.depth) && !renderTarget.depthStencilAttachment)\n {\n renderTarget.ensureDepthStencilTexture();\n }\n\n const hasDepthStencil = !!renderTarget.depthStencilAttachment;\n\n const activePass = this._activePass;\n\n const reuse = activePass !== null\n && activePass.renderTarget === renderTarget\n && activePass.mipLevel === mipLevel\n && activePass.layer === layer\n // a depth/stencil attachment added mid-pass (e.g. mask system's ensureDepthStencil)\n // changes the attachment set, so the pass must genuinely reopen\n && activePass.depthStencil === hasDepthStencil\n && this._renderer.encoder.renderPassEncoder !== null\n && clearBits === CLEAR.NONE;\n\n // even a reused pass can change its winding: the same target rebound with the other `flipY`\n // must key its pipelines to the new front face\n this._renderer.pipeline.setRenderTarget(renderTarget);\n\n if (reuse)\n {\n this._renderer.encoder.setViewport(viewport);\n\n return;\n }\n\n const { descriptor, restore } = this._buildDescriptor(renderTarget, clear, clearColor, mipLevel, layer);\n\n gpuRenderTarget.descriptor = descriptor;\n\n const encoder = this._renderer.encoder;\n\n if (restore)\n {\n // the copy out of the resolved texture has to be recorded between passes\n encoder.endRenderPass();\n\n this._beginRestoredPass(\n renderTarget, restore, encoder.commandEncoder, () => encoder.beginRenderPass(gpuRenderTarget)\n );\n }\n else\n {\n encoder.beginRenderPass(gpuRenderTarget);\n }\n\n encoder.setViewport(viewport);\n\n this._activePass = { renderTarget, mipLevel, layer, depthStencil: hasDepthStencil };\n }\n\n public finishRenderPass()\n {\n this._renderer.encoder.endRenderPass();\n\n // The pass is now closed; a subsequent bind to the same target must genuinely reopen it\n // (e.g. the copyToTexture / copyColor case, which reads the resolved contents).\n this._activePass = null;\n }\n\n /**\n * Begins a pass whose MSAA colour must be restored: copies each resolved texture in `restore` into the\n * target's back textures, begins the pass, and draws them back in before anything else (see GpuMsaaRestore).\n * @param renderTarget - the target being reopened\n * @param restore - the colour attachments to restore\n * @param commandEncoder - the encoder to record the copies on, with no pass open\n * @param beginPass - begins the pass on the same encoder\n * @returns the begun pass\n */\n private _beginRestoredPass(\n renderTarget: RenderTarget,\n restore: number[],\n commandEncoder: GPUCommandEncoder,\n beginPass: () => GPURenderPassEncoder,\n ): GPURenderPassEncoder\n {\n const msaaRestore = this._msaaRestore ??= new GpuMsaaRestore(this._renderer);\n\n for (const index of restore)\n {\n msaaRestore.copy(commandEncoder, renderTarget, index, this._getGpuColorTexture(renderTarget, index));\n }\n\n const pass = beginPass();\n\n for (const index of restore)\n {\n msaaRestore.draw(pass, renderTarget, index);\n }\n\n return pass;\n }\n\n /**\n * returns the gpu texture for a color texture in the render target, the first by default\n * mainly used by the filter manager to copy the texture for blending\n * @param renderTarget\n * @param index - the color attachment to get\n * @returns a gpu texture\n */\n private _getGpuColorTexture(renderTarget: RenderTarget, index = 0): GPUTexture\n {\n if (renderTarget.colorAttachments.length === 0)\n {\n throw new Error('[GpuRenderTargetAdaptor] cannot get gpu color texture from a depth-only render target');\n }\n\n const colorTexture = renderTarget.colorAttachments[index].texture;\n\n if (colorTexture instanceof CanvasSource && colorTexture._gpuContext)\n {\n return colorTexture._gpuContext.getCurrentTexture();\n }\n\n return this._renderer.texture.getGpuSource(colorTexture);\n }\n\n public getDescriptor(\n renderTarget: RenderTarget,\n clear: CLEAR_OR_BOOL,\n clearValue: RgbaArray,\n mipLevel = 0,\n layer = 0\n ): GPURenderPassDescriptor\n {\n return this._buildDescriptor(renderTarget, clear, clearValue, mipLevel, layer).descriptor;\n }\n\n /**\n * Builds the pass descriptor, along with the MSAA colour attachments it opens with `clear` in place of\n * `load`. Those buffers were discarded, so the pass must restore them before drawing.\n * @param renderTarget - the target to render to\n * @param clear - what to clear\n * @param clearValue - the colour to clear to\n * @param mipLevel - the mip level to render to\n * @param layer - the array layer to render to\n */\n private _buildDescriptor(\n renderTarget: RenderTarget,\n clear: CLEAR_OR_BOOL,\n clearValue: RgbaArray,\n mipLevel = 0,\n layer = 0\n ): { descriptor: GPURenderPassDescriptor; restore: number[] | null }\n {\n let restoreList: number[] = null;\n\n if (typeof clear === 'boolean')\n {\n clear = clear ? CLEAR.ALL : CLEAR.NONE;\n }\n\n const renderTargetSystem = this._renderTargetSystem;\n\n const gpuRenderTarget = renderTargetSystem.getGpuRenderTarget(renderTarget);\n\n const colorAttachments = renderTarget.colorAttachments.map(\n (colorAttachment, i) =>\n {\n const colorTexture = colorAttachment.texture;\n const context = (colorTexture instanceof CanvasSource) ? colorTexture._gpuContext : null;\n\n let view: GPUTextureView;\n let resolveTarget: GPUTextureView;\n let newCanvasFrame = false;\n\n if (context)\n {\n if (layer !== 0)\n {\n // eslint-disable-next-line max-len\n throw new Error('[RenderTargetSystem] Rendering to array layers is not supported for canvas targets.');\n }\n\n const currentTexture = context.getCurrentTexture();\n\n newCanvasFrame = gpuRenderTarget.canvasTextures[i] !== currentTexture;\n gpuRenderTarget.canvasTextures[i] = currentTexture;\n\n const canvasTextureView = currentTexture.createView(colorAttachment.viewDescriptor);\n\n view = canvasTextureView;\n }\n else\n {\n view = this._renderer.texture.getTextureRenderTargetView(\n colorAttachment.texture,\n mipLevel,\n layer,\n colorAttachment.viewDescriptor\n );\n }\n\n const msaaTexture = gpuRenderTarget.msaaTextures[i];\n\n if (msaaTexture)\n {\n resolveTarget = view;\n view = this._renderer.texture.getTextureView(msaaTexture);\n }\n\n let loadOp = colorAttachment.loadOp;\n\n if (clear !== undefined)\n {\n loadOp = (clear as CLEAR) & CLEAR.COLOR ? 'clear' : 'load';\n }\n\n clearValue ??= renderTargetSystem.defaultClearColor;\n\n // a transient MSAA buffer is never stored, so a pass that would load it clears and restores it\n // from the resolved texture instead (see GpuMsaaRestore). The first pass of a canvas frame has\n // nothing to restore: its texture is new and empty, so a clear to transparent gives the same result.\n const transient = !!msaaTexture?.transient;\n const load = transient && loadOp !== 'clear';\n const restore = load && !newCanvasFrame;\n\n if (load)\n {\n loadOp = 'clear';\n if (restore) (restoreList ??= []).push(i);\n }\n\n const baseAttachment: GPURenderPassColorAttachment = {\n view,\n resolveTarget,\n storeOp: transient ? 'discard' : (colorAttachment.storeOp ?? 'store'),\n loadOp,\n };\n\n if (colorTexture.dimension === '3d')\n {\n baseAttachment.depthSlice = layer;\n }\n\n if (load)\n {\n // restored over, or a new canvas frame, which starts transparent\n baseAttachment.clearValue = [0, 0, 0, 0];\n }\n else if (loadOp === 'clear')\n {\n clearValue ??= (colorAttachment.clearValue as RgbaArray) ?? renderTargetSystem.defaultClearColor;\n baseAttachment.clearValue = clearValue;\n }\n\n for (const key in colorAttachment)\n {\n if (key !== 'texture' && key !== 'viewDescriptor'\n && key !== 'clearValue' && key !== 'loadOp' && key !== 'storeOp')\n {\n (baseAttachment as any)[key] = (colorAttachment as any)[key];\n }\n }\n\n return baseAttachment;\n }\n ) as GPURenderPassColorAttachment[];\n\n let depthStencilAttachment: GPURenderPassDepthStencilAttachment;\n\n if (renderTarget.depthStencilAttachment)\n {\n // set up before the view below creates its GPU texture, which covers a depth/stencil texture added\n // after the target was built (a mask adding stencil, RenderTarget.ensureDepthStencilTexture)\n this._prepareDepthStencil(renderTarget, gpuRenderTarget);\n\n const attachment = renderTarget.depthStencilAttachment;\n const stencil = attachment.texture.format.includes('stencil');\n const depth = attachment.texture.format.includes('depth');\n // Depth/stencil can't be rebuilt from a resolved image, so it is only discarded when the user\n // marked the target `transient` (single pass, never reopened). Its contents are gone after a\n // discard, so a transient depth/stencil is never loaded either.\n const dsStoreOp: GPUStoreOp = gpuRenderTarget.transient ? 'discard' : 'store';\n const dsLoadOp: GPULoadOp = gpuRenderTarget.transient ? 'clear' : 'load';\n\n depthStencilAttachment = {\n view: this._renderer.texture.getTextureRenderTargetView(\n attachment.texture,\n mipLevel,\n layer,\n attachment.viewDescriptor\n ),\n };\n\n const depthReadOnly = attachment.depthReadOnly ?? false;\n // If depth is read-only, it's highly likely they want to sample the texture,\n // which requires the ENTIRE texture (including stencil) to be read-only in WebGPU.\n const stencilReadOnly = attachment.stencilReadOnly ?? depthReadOnly;\n\n if (stencil && !stencilReadOnly)\n {\n depthStencilAttachment.stencilLoadOp = (clear & CLEAR.STENCIL\n ? 'clear' : (attachment.stencilLoadOp ?? dsLoadOp)) as GPULoadOp;\n depthStencilAttachment.stencilStoreOp = attachment.stencilStoreOp ?? dsStoreOp;\n\n if (depthStencilAttachment.stencilLoadOp === 'clear')\n {\n depthStencilAttachment.stencilClearValue = attachment.stencilClearValue ?? 0;\n }\n }\n else if (stencil && stencilReadOnly)\n {\n depthStencilAttachment.stencilReadOnly = true;\n }\n\n if (depth && !depthReadOnly)\n {\n depthStencilAttachment.depthLoadOp = (clear & CLEAR.DEPTH\n ? 'clear' : (attachment.depthLoadOp ?? dsLoadOp)) as GPULoadOp;\n depthStencilAttachment.depthStoreOp = attachment.depthStoreOp ?? dsStoreOp;\n\n if (depthStencilAttachment.depthLoadOp === 'clear')\n {\n depthStencilAttachment.depthClearValue = attachment.depthClearValue ?? 1.0;\n }\n }\n else if (depth && depthReadOnly)\n {\n depthStencilAttachment.depthReadOnly = true;\n }\n\n // Reapply any other properties from the Pixi attachment that map to WebGPU\n // (excluding Pixi ones and ones we explicitly set above)\n for (const key in attachment)\n {\n if (key !== 'texture' && key !== 'viewDescriptor'\n && key !== 'stencilLoadOp' && key !== 'stencilStoreOp'\n && key !== 'stencilClearValue' && key !== 'stencilReadOnly'\n && key !== 'depthLoadOp' && key !== 'depthStoreOp'\n && key !== 'depthClearValue' && key !== 'depthReadOnly'\n )\n {\n (depthStencilAttachment as any)[key] = (attachment as any)[key];\n }\n }\n }\n\n const descriptor: GPURenderPassDescriptor = {\n colorAttachments,\n depthStencilAttachment,\n label: renderTarget.label,\n };\n\n return { descriptor, restore: restoreList };\n }\n\n public clear(\n renderTarget: RenderTarget,\n clear: CLEAR_OR_BOOL = true,\n clearColor?: RgbaArray,\n viewport?: Rectangle,\n mipLevel = 0,\n layer = 0\n )\n {\n if (!clear) return;\n\n const { gpu, encoder } = this._renderer;\n\n const device = gpu.device;\n\n const standAlone = encoder.commandEncoder === null;\n\n if (standAlone)\n {\n const commandEncoder = device.createCommandEncoder();\n const { descriptor, restore } = this._buildDescriptor(renderTarget, clear, clearColor, mipLevel, layer);\n const beginPass = () => commandEncoder.beginRenderPass(descriptor);\n\n // a partial clear (e.g. depth only) keeps the colour, which for MSAA means restoring it\n const passEncoder = restore\n ? this._beginRestoredPass(renderTarget, restore, commandEncoder, beginPass)\n : beginPass();\n\n passEncoder.setViewport(viewport.x, viewport.y, viewport.width, viewport.height, 0, 1);\n\n passEncoder.end();\n\n const gpuCommands = commandEncoder.finish();\n\n device.queue.submit([gpuCommands]);\n }\n else\n {\n this.startRenderPass(renderTarget, clear, clearColor, viewport, mipLevel, layer);\n }\n }\n\n public initGpuRenderTarget(renderTarget: RenderTarget): GpuRenderTarget\n {\n // always true for WebGPU\n renderTarget.isRoot = true;\n\n const gpuRenderTarget = new GpuRenderTarget();\n\n // the user's single-pass promise, read from the colour texture once, like `msaa`\n gpuRenderTarget.transient = !!renderTarget.colorTexture?.antialias && !!renderTarget.colorTexture.transient;\n\n // create a context...\n // is a canvas...\n renderTarget.colorAttachments.forEach((colorAttachment, i) =>\n {\n const colorTexture = colorAttachment.texture;\n\n if (colorTexture instanceof CanvasSource)\n {\n const context = colorTexture._gpuContext ??= colorTexture.resource.getContext(\n 'webgpu'\n ) as unknown as GPUCanvasContext;\n\n const alphaMode = colorTexture.transparent ? 'premultiplied' : 'opaque';\n const canvasFormat = getCanvasContextFormat(colorTexture.format);\n\n // configured every time, as a device replaced after a loss needs it configured again\n try\n {\n context.configure({\n device: this._renderer.gpu.device,\n usage: GPUTextureUsage.TEXTURE_BINDING\n | GPUTextureUsage.COPY_DST\n | GPUTextureUsage.RENDER_ATTACHMENT\n | GPUTextureUsage.COPY_SRC,\n format: canvasFormat,\n alphaMode,\n ...(canvasFormat === 'rgba16float'\n ? { toneMapping: { mode: 'extended' } }\n : {}),\n });\n }\n catch (e)\n {\n console.error(e);\n }\n\n gpuRenderTarget.contexts[i] = context;\n }\n\n gpuRenderTarget.msaa = colorTexture.source.antialias;\n\n if (colorTexture.antialias)\n {\n // On tile-based GPUs the MSAA colour buffer is always transient: never stored, and restored from\n // the resolved texture when a pass reopens it (see GpuMsaaRestore). Elsewhere storing it is\n // cheaper, so it is transient only when the user marks the target single-pass.\n const msaaTexture = new TextureSource({\n width: 0,\n height: 0,\n sampleCount: 4,\n // WebGPU requires multisampled textures to have exactly 1 mip level, so this must never\n // inherit TextureSource.defaultOptions.autoGenerateMipmaps\n autoGenerateMipmaps: false,\n transient: this._renderer.device.extensions.tileBased || gpuRenderTarget.transient,\n arrayLayerCount: colorTexture.arrayLayerCount,\n format: colorTexture.format,\n });\n\n gpuRenderTarget.msaaTextures[i] = msaaTexture;\n }\n });\n\n if (gpuRenderTarget.msaa)\n {\n gpuRenderTarget.msaaSamples = 4;\n }\n\n return gpuRenderTarget;\n }\n\n /**\n * Sets up a depth/stencil texture for an MSAA target before its GPU texture is created: 4 samples, and\n * the transient usage bit when the user marked the target single-pass. Both are fixed at creation, so this\n * runs when a pass descriptor is built, just before the depth/stencil view is first made.\n * @param renderTarget - the target whose depth/stencil texture to set up\n * @param gpuRenderTarget - its backend target\n */\n private _prepareDepthStencil(renderTarget: RenderTarget, gpuRenderTarget: GpuRenderTarget): void\n {\n const texture = renderTarget.depthStencilAttachment?.texture;\n\n if (!texture || !gpuRenderTarget.msaa) return;\n\n texture.sampleCount = 4;\n texture.transient = gpuRenderTarget.transient;\n }\n\n public destroyGpuRenderTarget(gpuRenderTarget: GpuRenderTarget)\n {\n gpuRenderTarget.contexts.forEach((context) =>\n {\n context.unconfigure();\n });\n\n gpuRenderTarget.msaaTextures.forEach((texture) =>\n {\n texture.destroy();\n });\n\n gpuRenderTarget.msaaBackTextures.forEach((texture) =>\n {\n texture?.destroy();\n });\n\n gpuRenderTarget.msaaTextures.length = 0;\n gpuRenderTarget.msaaBackTextures.length = 0;\n gpuRenderTarget.contexts.length = 0;\n }\n\n public ensureDepthStencilTexture(renderTarget: RenderTarget)\n {\n // TODO This function will be more useful once we cache the descriptors\n this._prepareDepthStencil(renderTarget, this._renderTargetSystem.getGpuRenderTarget(renderTarget));\n }\n\n public resizeGpuRenderTarget(renderTarget: RenderTarget)\n {\n const gpuRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget);\n\n gpuRenderTarget.width = renderTarget.width;\n gpuRenderTarget.height = renderTarget.height;\n\n if (gpuRenderTarget.msaa)\n {\n renderTarget.colorAttachments.forEach((colorAttachment, i) =>\n {\n const colorTexture = colorAttachment.texture;\n\n gpuRenderTarget.msaaTextures[i]?.resize(colorTexture.width, colorTexture.height, colorTexture._resolution);\n gpuRenderTarget.msaaBackTextures[i]?.resize(\n colorTexture.width, colorTexture.height, colorTexture._resolution\n );\n });\n }\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { type System } from '../shared/system/System';\nimport { type WebGPURenderer } from './WebGPURenderer';\n\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 WebGPU Device 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 WebGPURenderer();\n * await renderer.init(); // GPU limits are populated after this call\n *\n * console.log(renderer.limits.maxTextures);\n * console.log(renderer.limits.maxBatchableTextures);\n * ```\n * @category rendering\n * @advanced\n */\nexport class GpuLimitsSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\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 /** Whether the GPU supports pipeline-level `constants` (WGSL `override`). Falls back to source baking when `false`. */\n public supportsOverrideConstants = false;\n\n private readonly _renderer: WebGPURenderer;\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n }\n\n public contextChange(): void\n {\n const device = this._renderer.device.gpu.device;\n\n this.maxTextures = Math.min(\n device.limits.maxSampledTexturesPerShaderStage,\n device.limits.maxSamplersPerShaderStage,\n );\n this.maxBatchableTextures = this.maxTextures;\n\n this._detectOverrideConstantsSupport(device);\n }\n\n private _detectOverrideConstantsSupport(device: GPUDevice): void\n {\n device.pushErrorScope('validation');\n\n const testModule = device.createShaderModule({\n code: 'override TEST_VALUE: f32 = 0.0;\\n@compute @workgroup_size(1) fn main() {}',\n });\n\n device.createComputePipeline({\n layout: 'auto',\n compute: {\n module: testModule,\n entryPoint: 'main',\n constants: { TEST_VALUE: 1.0 },\n },\n });\n\n void device.popErrorScope().then((error) =>\n {\n this.supportsOverrideConstants = !error;\n });\n }\n\n public destroy(): void\n {\n // boom!\n }\n}\n","import { ExtensionType } from '../../../../extensions/Extensions';\nimport { State } from '../../shared/state/State';\nimport { GpuBlendModesToPixi } from './GpuBlendModesToPixi';\n\nimport type { BLEND_MODES } from '../../shared/state/const';\nimport type { System } from '../../shared/system/System';\nimport type { GPU } from '../GpuDeviceSystem';\n\n/**\n * System plugin to the renderer to manage WebGL state machines.\n * @category rendering\n * @advanced\n */\nexport class GpuStateSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\n ],\n name: 'state',\n } as const;\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 gpu: GPU;\n\n /**\n * Default WebGL State\n * @readonly\n */\n protected defaultState: State;\n\n constructor()\n {\n this.defaultState = new State();\n this.defaultState.blend = true;\n }\n\n protected contextChange(gpu: GPU): void\n {\n this.gpu = gpu;\n }\n\n /**\n * Gets the blend mode data for the current state\n * @param state - The state to get the blend mode from\n * @param count - The number of color targets to create\n * @param format - The texture format of the color attachments (assumed uniform across attachments)\n */\n public getColorTargets(state: State, count: number, format: GPUTextureFormat): GPUColorTargetState[]\n {\n // WebGPU blending is enabled/disabled by the presence of `GPUColorTargetState.blend`.\n // A boolean flag alone doesn't exist at the API level.\n // If `state.blend` is false (e.g. filters doing multiple passes) we must omit the blend descriptor entirely.\n const blend = (state.blend)\n ? (GpuBlendModesToPixi[state.blendMode] || GpuBlendModesToPixi.normal)\n : undefined;\n\n const targets: GPUColorTargetState[] = [];\n\n // Emit one fresh object per attachment so the caller can mutate per-target fields\n // (e.g. writeMask) without aliasing across slots.\n for (let i = 0; i < count; i++)\n {\n targets[i] = {\n format,\n writeMask: 0,\n blend,\n };\n }\n\n return targets;\n }\n\n public destroy(): void\n {\n this.gpu = null;\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { Buffer } from '../shared/buffer/Buffer';\nimport { BufferResource } from '../shared/buffer/BufferResource';\nimport { BufferUsage } from '../shared/buffer/const';\nimport { UboBatch } from './buffer/UboBatch';\nimport { BindGroup } from './shader/BindGroup';\n\nimport type { UniformGroup } from '../shared/shader/UniformGroup';\nimport type { WebGPURenderer } from './WebGPURenderer';\n\nconst minUniformOffsetAlignment = 128;// 256 / 2;\n\n/** @internal */\nexport class GpuUniformBatchPipe\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUPipes,\n ],\n name: 'uniformBatch',\n } as const;\n\n private _renderer: WebGPURenderer;\n\n private _bindGroupHash: Record<number, BindGroup> = Object.create(null);\n private readonly _batchBuffer: UboBatch;\n\n // number of buffers..\n private _buffers: Buffer[] = [];\n\n private _bindGroups: BindGroup[] = [];\n private _bufferResources: BufferResource[] = [];\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n\n this._batchBuffer = new UboBatch({ minUniformOffsetAlignment });\n\n const totalBuffers = (256 / minUniformOffsetAlignment);\n\n for (let i = 0; i < totalBuffers; i++)\n {\n let usage = BufferUsage.UNIFORM | BufferUsage.COPY_DST;\n\n if (i === 0) usage |= BufferUsage.COPY_SRC;\n\n this._buffers.push(new Buffer({\n data: this._batchBuffer.data,\n usage\n }));\n }\n }\n\n public renderEnd()\n {\n this._uploadBindGroups();\n this._resetBindGroups();\n }\n\n private _resetBindGroups()\n {\n this._bindGroupHash = Object.create(null);\n this._batchBuffer.clear();\n }\n\n // just works for single bind groups for now\n public getUniformBindGroup(group: UniformGroup<any>, duplicate: boolean): BindGroup\n {\n if (!duplicate && this._bindGroupHash[group.uid])\n {\n return this._bindGroupHash[group.uid];\n }\n\n this._renderer.ubo.ensureUniformGroup(group);\n\n const data = group.buffer.data as Float32Array;\n\n const offset = this._batchBuffer.addEmptyGroup(data.length);\n\n this._renderer.ubo.syncUniformGroup(group, this._batchBuffer.data, offset / 4);\n\n this._bindGroupHash[group.uid] = this._getBindGroup(offset / minUniformOffsetAlignment);\n\n return this._bindGroupHash[group.uid];\n }\n\n public getUboResource(group: UniformGroup<any>): BufferResource\n {\n this._renderer.ubo.updateUniformGroup(group);\n\n const data = group.buffer.data as Float32Array;\n\n const offset = this._batchBuffer.addGroup(data);\n\n return this._getBufferResource(offset / minUniformOffsetAlignment);\n }\n\n public getArrayBindGroup(data: Float32Array): BindGroup\n {\n const offset = this._batchBuffer.addGroup(data);\n\n return this._getBindGroup(offset / minUniformOffsetAlignment);\n }\n\n public getArrayBufferResource(data: Float32Array): BufferResource\n {\n const offset = this._batchBuffer.addGroup(data);\n\n const index = offset / minUniformOffsetAlignment;\n\n return this._getBufferResource(index);\n }\n\n private _getBufferResource(index: number): BufferResource\n {\n if (!this._bufferResources[index])\n {\n const buffer = this._buffers[index % 2];\n\n this._bufferResources[index] = new BufferResource({\n buffer,\n offset: ((index / 2) | 0) * 256,\n size: minUniformOffsetAlignment\n });\n }\n\n return this._bufferResources[index];\n }\n\n private _getBindGroup(index: number): BindGroup\n {\n if (!this._bindGroups[index])\n {\n // even!\n const bindGroup = new BindGroup({\n 0: this._getBufferResource(index),\n });\n\n this._bindGroups[index] = bindGroup;\n }\n\n return this._bindGroups[index];\n }\n\n private _uploadBindGroups()\n {\n const bufferSystem = this._renderer.buffer;\n\n const firstBuffer = this._buffers[0];\n\n firstBuffer.update(this._batchBuffer.byteIndex);\n\n bufferSystem.updateBuffer(firstBuffer);\n\n const commandEncoder = this._renderer.gpu.device.createCommandEncoder();\n\n for (let i = 1; i < this._buffers.length; i++)\n {\n const buffer = this._buffers[i];\n\n commandEncoder.copyBufferToBuffer(\n bufferSystem.getGPUBuffer(firstBuffer),\n minUniformOffsetAlignment,\n bufferSystem.getGPUBuffer(buffer),\n 0,\n this._batchBuffer.byteIndex\n );\n }\n\n // TODO make a system that will que up all commands in to one array?\n this._renderer.gpu.device.queue.submit([commandEncoder.finish()]);\n }\n\n public destroy()\n {\n for (let i = 0; i < this._bindGroups.length; i++)\n {\n this._bindGroups[i]?.destroy();\n }\n\n this._bindGroups = null;\n this._bindGroupHash = null;\n\n for (let i = 0; i < this._buffers.length; i++)\n {\n this._buffers[i].destroy();\n }\n this._buffers = null;\n\n for (let i = 0; i < this._bufferResources.length; i++)\n {\n this._bufferResources[i].destroy();\n }\n\n this._bufferResources = null;\n\n this._batchBuffer.destroy();\n\n this._renderer = null;\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { warn } from '../../../utils/logging/warn';\nimport { type ShaderOverrides } from '../shared/shader/ShaderOverrides';\nimport { RenderBundle } from './RenderBundle';\n\nimport type { Rectangle } from '../../../maths/shapes/Rectangle';\nimport type { Buffer } from '../shared/buffer/Buffer';\nimport type { Topology } from '../shared/geometry/const';\nimport type { Geometry } from '../shared/geometry/Geometry';\nimport type { Shader } from '../shared/shader/Shader';\nimport type { UniformGroup } from '../shared/shader/UniformGroup';\nimport type { State } from '../shared/state/State';\nimport type { System } from '../shared/system/System';\nimport type { GPU } from './GpuDeviceSystem';\nimport type { GpuRenderTarget } from './renderTarget/GpuRenderTarget';\nimport type { BindGroup } from './shader/BindGroup';\nimport type { GpuProgram } from './shader/GpuProgram';\nimport type { WebGPURenderer } from './WebGPURenderer';\n\ninterface BoundBindGroupSlot\n{\n bindGroup: BindGroup;\n program: GpuProgram;\n key: string;\n}\n\n/**\n * The system that handles encoding commands for the GPU.\n * @category rendering\n * @advanced\n */\nexport class GpuEncoderSystem implements System\n{\n /** @ignore */\n public static extension = {\n type: [ExtensionType.WebGPUSystem],\n name: 'encoder',\n priority: 1\n } as const;\n\n public commandEncoder: GPUCommandEncoder;\n /**\n * The active command target that draws and state are recorded into. This is the live render\n * pass during normal rendering, or a {@link GPURenderBundleEncoder} while a render bundle is\n * being recorded (see {@link beginBundle}). Both encoders expose the same render/bind command\n * API the encoder relies on (`GPURenderCommandsMixin` + `GPUBindingCommandsMixin`),\n * so callers write to it without caring which one is active. Pass-level commands (viewport,\n * stencil, executeBundles, end) are not part of that shared API and go through the private pass encoder.\n */\n public renderPassEncoder: GPURenderPassEncoder | GPURenderBundleEncoder;\n public commandFinished: Promise<void>;\n\n private _resolveCommandFinished: (value: void) => void;\n\n private _gpu: GPU;\n /**\n * Per-slot cache of the last (bindGroup, program, resource-key) bound to that\n * group index. All three prongs must match for the encoder to skip rebinding —\n * see {@link setBindGroup}. Slots are allocated once in the constructor and\n * mutated in place to avoid per-call allocation on the hot path.\n */\n private _boundBindGroup: Record<number, BoundBindGroupSlot> = Object.create(null);\n private _boundVertexBuffer: Record<number, Buffer> = Object.create(null);\n private _boundIndexBuffer: Buffer;\n private _boundPipeline: GPURenderPipeline;\n /**\n * The real render pass encoder. Unlike {@link renderPassEncoder}, this is never swapped out for\n * a bundle encoder, so pass-level commands (viewport, stencil, executeBundles, end) always have\n * a correctly typed target — even while a bundle is being recorded.\n */\n private _passEncoder: GPURenderPassEncoder;\n /**\n * {@link PipelineSystem.bundleStateKey} as it was when {@link beginBundle} built the bundle\n * encoder's descriptor, ready to stamp onto the {@link RenderBundle} that {@link endBundle}\n * returns. Sampled at that moment so the stamp and the state the bundle actually baked cannot\n * describe different render targets.\n */\n private _bundleStateKey: number;\n /** The label passed to {@link beginBundle}, carried through to the finished bundle. */\n private _bundleLabel: string;\n\n private readonly _renderer: WebGPURenderer;\n\n constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n\n for (let i = 0; i < 16; i++)\n {\n this._boundBindGroup[i] = { bindGroup: null, program: null, key: null };\n }\n }\n\n public renderStart(): void\n {\n this.commandFinished = new Promise((resolve) =>\n {\n this._resolveCommandFinished = resolve;\n });\n\n // generate a render pass description..\n // create an encoder..\n this.commandEncoder = this._renderer.gpu.device.createCommandEncoder();\n }\n\n /**\n * Ends any open pass and begins one on the target's descriptor.\n * @param gpuRenderTarget - the target to render to\n * @returns the begun pass\n */\n public beginRenderPass(gpuRenderTarget: GpuRenderTarget): GPURenderPassEncoder\n {\n this.endRenderPass();\n\n this._clearCache();\n\n this._passEncoder = this.commandEncoder.beginRenderPass(gpuRenderTarget.descriptor);\n this.renderPassEncoder = this._passEncoder;\n\n return this._passEncoder;\n }\n\n public endRenderPass()\n {\n if (this._passEncoder)\n {\n this._passEncoder.end();\n }\n\n this.renderPassEncoder = null;\n this._passEncoder = null;\n }\n\n /**\n * Begins recording a render bundle. While recording, all draw commands are captured into a\n * {@link GPURenderBundleEncoder} instead of the active render pass. The current render pass\n * encoder is saved and restored when {@link endBundle} is called.\n *\n * Render bundles allow pre-recording of draw commands that can be replayed multiple times\n * via {@link executeBundle}, reducing CPU overhead for repeated draw sequences.\n * @param label - Optional debug label. Names the bundle in GPU captures and in the WebGPU\n * validation errors it can raise when replayed, instead of `(unlabeled)`.\n * @throws If a render bundle is already being recorded.\n */\n public beginBundle(label?: string): void\n {\n // While a bundle is recording, renderPassEncoder is swapped to the bundle encoder and no\n // longer matches the real pass. Equal references therefore mean no bundle is active.\n if (this._passEncoder !== this.renderPassEncoder)\n {\n throw new Error('Cannot begin a new render bundle while one is already being recorded.');\n }\n\n this._clearCache();\n\n const pipeline = this._renderer.pipeline;\n const descriptor = pipeline.getBundleDescriptor();\n\n descriptor.label = label;\n\n this._bundleStateKey = pipeline.bundleStateKey;\n this._bundleLabel = label;\n\n // A bundle encoder exposes the same render/bind command API as the pass, so it stands in as\n // the write target while recording. The real pass stays in _passEncoder and is restored by\n // endBundle.\n this.renderPassEncoder = this._gpu.device.createRenderBundleEncoder(descriptor);\n }\n\n /**\n * Finishes recording the current render bundle and restores the previous render pass encoder.\n * @returns The recorded {@link RenderBundle}, ready to be executed via {@link executeBundle} and\n * stamped with the pipeline state it baked so {@link isBundleValid} can vet it on later frames.\n */\n public endBundle(): RenderBundle\n {\n const encoder = this.renderPassEncoder;\n\n // `finish` only exists on a bundle encoder, so it both narrows the type for the call below\n // and guards against endBundle being called without an active bundle.\n if (!encoder || !('finish' in encoder))\n {\n throw new Error('endBundle called without an active render bundle.');\n }\n\n // the label goes on the bundle as well as on its encoder: WebGPU names the bundle, not the\n // encoder, in the validation error executeBundles raises\n const gpuBundle = encoder.finish({ label: this._bundleLabel });\n\n this.renderPassEncoder = this._passEncoder;\n this._clearCache();\n\n return new RenderBundle(gpuBundle, this._bundleStateKey, this._gpu.device, this._bundleLabel);\n }\n\n /**\n * Checks whether a recorded bundle can still be replayed against the render target that is\n * bound now.\n *\n * A bundle permanently bakes the attachment state it was recorded with — color format(s),\n * color target count, depth/stencil format, sample count — and WebGPU rejects the entire\n * command buffer if any of it differs at execute time. It also bakes the front-face winding of\n * its pipelines, which WebGPU does *not* validate: once the target's {@link RenderTarget.flipY}\n * parity changes, replaying silently renders geometry inside out.\n *\n * Ask before replaying rather than after: only the caller owns the draw commands, so only the\n * caller can re-record. A missing bundle reports `false`, so `!isBundleValid(bundles[i])` reads\n * correctly on the first frame, before anything has been recorded.\n * @param bundle - The bundle to check, as returned by {@link endBundle}.\n * @returns `true` if the bundle is safe to execute right now, `false` if it must be re-recorded.\n */\n public isBundleValid(bundle: RenderBundle): boolean\n {\n return bundle?.stateKey === this._renderer.pipeline.bundleStateKey && bundle.device === this._gpu.device;\n }\n\n /**\n * Replays previously recorded render bundles on the current render pass.\n * The bound state cache is cleared since a bundle may set its own pipeline, bind groups, and buffers.\n *\n * Pass a whole run of bundles rather than calling this once per bundle: WebGPU resets the pass\n * state after every call, so N calls cost N cache clears and N trips through the binding layer\n * for exactly the same result.\n *\n * Every bundle must have been recorded against a matching render target — check with\n * {@link isBundleValid} first and re-record if it says no, as Pixi cannot rebuild your draw\n * commands for you.\n * @param bundle - The render bundle to execute, or a run of them to execute in one call.\n */\n public executeBundle(bundle: RenderBundle | RenderBundle[]): void\n {\n const gpuBundles: GPURenderBundle[] = [];\n\n if (Array.isArray(bundle))\n {\n for (let i = 0; i < bundle.length; i++)\n {\n gpuBundles[i] = this._getGpuBundle(bundle[i]);\n }\n }\n else\n {\n gpuBundles[0] = this._getGpuBundle(bundle);\n }\n\n this._clearCache();\n this._passEncoder.executeBundles(gpuBundles);\n }\n\n /**\n * Unwraps a bundle for {@link executeBundle}, complaining first if it no longer matches the\n * bound render target — the winding half of that mismatch is invisible otherwise, since WebGPU\n * validates attachments but not front-face order.\n * @param bundle - The bundle being executed.\n * @returns The native bundle to hand to `executeBundles`.\n */\n private _getGpuBundle(bundle: RenderBundle): GPURenderBundle\n {\n // #if _DEBUG\n if (!this.isBundleValid(bundle))\n {\n warn(`Render bundle ${bundle?.label ?? '(unlabeled)'} was recorded against a different render `\n + 'target state or on a lost device. Re-record it — replaying it will either be rejected by WebGPU or draw '\n + 'with the wrong winding. Check encoder.isBundleValid(bundle) before executing.');\n }\n // #endif\n\n return bundle.gpuBundle;\n }\n\n public setViewport(viewport: Rectangle): void\n {\n this._passEncoder.setViewport(viewport.x, viewport.y, viewport.width, viewport.height, 0, 1);\n }\n\n /**\n * Sets the stencil reference value for subsequent draws. This is a pass-level command, so it\n * always targets the real render pass — not a bundle encoder, which cannot set stencil state.\n * @param stencilReference - The stencil reference value to use.\n */\n public setStencilReference(stencilReference: number): void\n {\n this._passEncoder.setStencilReference(stencilReference);\n }\n\n public setPipelineFromGeometryProgramAndState(\n geometry: Geometry,\n program: GpuProgram,\n state: any,\n topology?: Topology,\n overrides?: ShaderOverrides,\n ): void\n {\n const pipeline = this._renderer.pipeline.getPipeline(\n geometry,\n program,\n state,\n topology,\n overrides,\n );\n\n this.setPipeline(pipeline);\n }\n\n public setPipeline(pipeline: GPURenderPipeline)\n {\n if (this._boundPipeline === pipeline) return;\n this._boundPipeline = pipeline;\n\n this.renderPassEncoder.setPipeline(pipeline);\n }\n\n private _setVertexBuffer(index: number, buffer: Buffer)\n {\n if (this._boundVertexBuffer[index] === buffer) return;\n\n this._boundVertexBuffer[index] = buffer;\n\n this.renderPassEncoder.setVertexBuffer(index, this._renderer.buffer.updateBuffer(buffer));\n }\n\n private _setIndexBuffer(buffer: Buffer)\n {\n if (this._boundIndexBuffer === buffer) return;\n\n this._boundIndexBuffer = buffer;\n\n const indexFormat = buffer.data.BYTES_PER_ELEMENT === 2 ? 'uint16' : 'uint32';\n\n this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(buffer), indexFormat);\n }\n\n public resetBindGroup(index: number)\n {\n const slot = this._boundBindGroup[index];\n\n slot.bindGroup = null;\n slot.program = null;\n slot.key = null;\n }\n\n public setBindGroup(index: number, bindGroup: BindGroup, program: GpuProgram)\n {\n // The cached GPUBindGroup is only valid when the JS BindGroup, the program\n // (its layout key), and the BindGroup's resource set (its _key) are all unchanged.\n // BindGroupSystem interns one GPUBindGroup per (bindGroup, program, groupIndex),\n // so if any prong differs we must re-resolve and rebind.\n const slot = this._boundBindGroup[index];\n\n if (slot.bindGroup === bindGroup\n && slot.program === program\n && slot.key === bindGroup._key) return;\n\n slot.bindGroup = bindGroup;\n slot.program = program;\n slot.key = bindGroup._key;\n\n bindGroup._touch(this._renderer.gc.now);\n\n const gpuBindGroup = this._renderer.bindGroup.getBindGroup(bindGroup, program, index);\n\n this.renderPassEncoder.setBindGroup(index, gpuBindGroup);\n }\n\n public setGeometry(geometry: Geometry, program: GpuProgram)\n {\n // when binding a buffers for geometry, there is no need to bind a buffer more than once if it is interleaved.\n // which is often the case for Pixi. This is a performance optimisation.\n // Instead of looping through the attributes, we instead call getBufferNamesToBind\n // which returns a list of buffer names that need to be bound.\n // we can then loop through this list and bind the buffers.\n // essentially only binding a single time for any buffers that are interleaved.\n const buffersToBind = this._renderer.pipeline.getBufferNamesToBind(geometry, program);\n\n for (let i = 0; i < buffersToBind.length; i++)\n {\n this._setVertexBuffer(i, geometry.attributes[buffersToBind[i]].buffer);\n }\n\n if (geometry.indexBuffer)\n {\n this._setIndexBuffer(geometry.indexBuffer);\n }\n }\n\n private _setShaderBindGroups(shader: Shader, skipSync?: boolean)\n {\n const program = shader.gpuProgram;\n const layout = program.layout;\n\n // indexed over the layout so no key list is built per draw. Groups outside the layout\n // (e.g. GL-fallback uniforms, parked in group 99 by Shader.from) have nothing to sync or bind\n for (let i = 0; i < layout.length; i++)\n {\n const bindGroup = shader.groups[i];\n\n // a gap in a sparse layout, or a group this shader never filled\n if (!layout[i] || !bindGroup) continue;\n\n // update any uniforms?\n if (!skipSync)\n {\n this._syncBindGroup(bindGroup);\n }\n\n this.setBindGroup(i, bindGroup, program);\n }\n }\n\n private _syncBindGroup(bindGroup: BindGroup)\n {\n const resources = bindGroup.resources;\n const keys = bindGroup._resourceKeys;\n\n for (let i = 0; i < keys.length; i++)\n {\n const resource = resources[keys[i]];\n\n // a destroyed buffer-like resource leaves a null slot (see BindGroup.onResourceChange)\n if (!resource) continue;\n\n if ((resource as UniformGroup).isUniformGroup)\n {\n this._renderer.ubo.updateUniformGroup(resource as UniformGroup);\n }\n }\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 baseVertex?: number;\n instanceCount?: number;\n skipSync?: boolean;\n firstInstance?: number;\n })\n {\n const { geometry, shader, state, topology, size, start, baseVertex, instanceCount, skipSync, firstInstance }\n = options;\n\n this.setPipelineFromGeometryProgramAndState(geometry, shader.gpuProgram, state, topology, shader._overrides);\n this.setGeometry(geometry, shader.gpuProgram);\n this._setShaderBindGroups(shader, skipSync);\n\n if (geometry.indexBuffer)\n {\n this.renderPassEncoder.drawIndexed(\n size || geometry.indexCount || geometry.indexBuffer.data.length,\n instanceCount ?? geometry.instanceCount,\n start || 0,\n baseVertex || 0,\n firstInstance || 0\n );\n }\n else\n {\n this.renderPassEncoder.draw(\n size || geometry.vertexCount,\n instanceCount ?? geometry.instanceCount,\n start || 0,\n firstInstance || 0\n );\n }\n }\n\n /**\n * Sets up the pipeline, geometry, and bind groups then issues an indirect draw call.\n * Uses `drawIndexedIndirect` when the geometry has an index buffer, otherwise `drawIndirect`.\n * Draw parameters (vertex count, instance count, etc.) are read from the indirect buffer on the GPU.\n * @param options - The draw options.\n * @param options.geometry - The geometry to draw.\n * @param options.shader - The shader to use.\n * @param options.state - Optional render state (blending, depth, etc.).\n * @param options.topology - Optional primitive topology override.\n * @param options.skipSync - If true, skips syncing uniform groups to their GPU buffers.\n * @param options.indirectBuffer - The GPU buffer containing the indirect draw parameters.\n * @param options.indirectOffset - Byte offset into the indirect buffer.\n */\n public drawIndirect(options: {\n geometry: Geometry;\n shader: Shader;\n state?: State;\n topology?: Topology;\n skipSync?: boolean;\n indirectBuffer: GPUBuffer;\n indirectOffset: number;\n })\n {\n const { geometry, shader, state, topology, skipSync, indirectBuffer, indirectOffset } = options;\n\n this.setPipelineFromGeometryProgramAndState(geometry, shader.gpuProgram, state, topology, shader._overrides);\n this.setGeometry(geometry, shader.gpuProgram);\n this._setShaderBindGroups(shader, skipSync);\n\n if (geometry.indexBuffer)\n {\n this.renderPassEncoder.drawIndexedIndirect(indirectBuffer, indirectOffset);\n }\n else\n {\n this.renderPassEncoder.drawIndirect(indirectBuffer, indirectOffset);\n }\n }\n\n public finishRenderPass()\n {\n if (this._passEncoder)\n {\n this._passEncoder.end();\n this.renderPassEncoder = null;\n this._passEncoder = null;\n }\n }\n\n public postrender()\n {\n this.finishRenderPass();\n\n this._gpu.device.queue.submit([this.commandEncoder.finish()]);\n\n this._resolveCommandFinished();\n\n this.commandEncoder = null;\n }\n\n private _clearCache()\n {\n for (let i = 0; i < 16; i++)\n {\n const slot = this._boundBindGroup[i];\n\n slot.bindGroup = null;\n slot.program = null;\n slot.key = null;\n this._boundVertexBuffer[i] = null;\n }\n\n this._boundIndexBuffer = null;\n this._boundPipeline = null;\n }\n\n public destroy()\n {\n (this._renderer as null) = null;\n this._gpu = null;\n this._boundBindGroup = null;\n this._boundVertexBuffer = null;\n this._boundIndexBuffer = null;\n this._boundPipeline = null;\n this.renderPassEncoder = null;\n this._passEncoder = null;\n }\n\n protected contextChange(gpu: GPU): void\n {\n this._gpu = gpu;\n }\n}\n","import { ExtensionType } from '../../../extensions/Extensions';\nimport { Matrix } from '../../../maths/matrix/Matrix';\nimport { compileHighShaderGpuProgram } from '../../../rendering/high-shader/compileHighShaderToProgram';\nimport { localUniformBit } from '../../../rendering/high-shader/shader-bits/localUniformBit';\nimport { roundPixelsBit } from '../../../rendering/high-shader/shader-bits/roundPixelsBit';\nimport { textureBit } 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 { WebGPURenderer } from '../../../rendering/renderers/gpu/WebGPURenderer';\nimport type { Mesh } from '../shared/Mesh';\nimport type { MeshAdaptor, MeshPipe } from '../shared/MeshPipe';\n\n/**\n * The WebGL adaptor for the mesh system. Allows the Mesh System to be used with the WebGl renderer\n * @category rendering\n * @ignore\n */\nexport class GpuMeshAdapter implements MeshAdaptor\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUPipesAdaptor,\n ],\n name: 'mesh',\n } as const;\n\n private _shader: Shader;\n\n public init(): void\n {\n const gpuProgram = compileHighShaderGpuProgram({\n name: 'mesh',\n bits: [\n localUniformBit,\n textureBit,\n roundPixelsBit,\n ]\n });\n\n this._shader = new Shader({\n gpuProgram,\n resources: {\n uTexture: Texture.EMPTY._source,\n uSampler: Texture.EMPTY._source.style,\n textureUniforms: {\n uTextureMatrix: { type: 'mat3x3<f32>', value: new Matrix() },\n }\n }\n });\n }\n\n public execute(meshPipe: MeshPipe, mesh: Mesh)\n {\n const renderer = meshPipe.renderer as WebGPURenderer;\n\n let shader: Shader = mesh._shader;\n\n if (!shader)\n {\n shader = this._shader;\n\n shader.groups[2] = renderer.texture.getTextureBindGroup(mesh.texture);\n }\n else if (!shader.gpuProgram)\n {\n // #if _DEBUG\n warn('Mesh shader has no gpuProgram', mesh.shader);\n // #endif\n\n return;\n }\n\n const gpuProgram = shader.gpuProgram;\n // GPU..\n\n if (gpuProgram.autoAssignGlobalUniforms)\n {\n shader.groups[0] = renderer.globalUniforms.bindGroup;\n }\n\n if (gpuProgram.autoAssignLocalUniforms)\n {\n const localUniforms = meshPipe.localUniforms;\n\n shader.groups[1] = (renderer as WebGPURenderer)\n .renderPipes.uniformBatch.getUniformBindGroup(localUniforms, true);\n }\n\n renderer.encoder.draw({\n geometry: mesh._geometry,\n shader,\n state: mesh.state\n });\n }\n\n public destroy(): void\n {\n // the program comes from the shared GpuProgram cache and is used by every WebGPU renderer,\n // so only the per-renderer shader is destroyed here\n this._shader.destroy();\n this._shader = null;\n }\n}\n","import { DOMAdapter } from '../../../../environment/adapter';\nimport { extensions, ExtensionType } from '../../../../extensions/Extensions';\nimport { type GPUData } from '../../../../scene/view/ViewContainer';\nimport { GCManagedHash } from '../../../../utils/data/GCManagedHash';\nimport { UniformGroup } from '../../shared/shader/UniformGroup';\nimport { CanvasPool } from '../../shared/texture/CanvasPool';\nimport { BindGroup } from '../shader/BindGroup';\nimport { gpuUploadBufferImageResource } from './uploaders/gpuUploadBufferImageResource';\nimport { blockDataMap, gpuUploadCompressedTextureResource } from './uploaders/gpuUploadCompressedTextureResource';\nimport { createGpuUploadCubeTextureResource } from './uploaders/gpuUploadCubeTextureResource';\nimport { gpuUploadImageResource } from './uploaders/gpuUploadImageSource';\nimport { gpuUploadVideoResource } from './uploaders/gpuUploadVideoSource';\nimport { assertMipmap3dTexture, Gpu3dMipmapGenerator } from './utils/Gpu3dMipmapGenerator';\nimport { GpuMipmapGenerator } from './utils/GpuMipmapGenerator';\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, Texture } from '../../shared/texture/Texture';\nimport type { TextureStyle } from '../../shared/texture/TextureStyle';\nimport type { GPU } from '../GpuDeviceSystem';\nimport type { WebGPURenderer } from '../WebGPURenderer';\nimport type { GpuTextureUploader } from './uploaders/GpuTextureUploader';\n\n/**\n * Stores GPU-specific data for a Texture instance in WebGL context.\n * @internal\n */\nexport class GPUTextureGpuData implements GPUData\n{\n public gpuTexture: GPUTexture;\n public textureView: GPUTextureView = null;\n public textureViews: Record<string, GPUTextureView> = Object.create(null);\n\n constructor(gpuTexture: GPUTexture)\n {\n this.gpuTexture = gpuTexture;\n }\n\n /** Destroys this GPU data instance. */\n public destroy(): void\n {\n this.gpuTexture.destroy();\n this.textureView = null;\n this.textureViews = null;\n this.gpuTexture = null;\n }\n}\n\n/** formats that have an `-srgb` version (8-bit RGBA/BGRA and the compressed colour formats) */\nconst SRGB_CAPABLE = /^(rgba8|bgra8|bc[1237]-rgba-|etc2-rgb8|etc2-rgb8a1|etc2-rgba8|astc-\\d+x\\d+-)unorm$/;\n\n/**\n * Declares the `-srgb` version of a format as an extra view format, so any texture that has one can\n * also be bound through an sRGB `TextureView` (the GPU decodes gamma when sampling) from the same bytes.\n * Pixi's own rendering keeps using the plain view. Declaring it measured free on Apple, Mali, Adreno\n * and PowerVR GPUs.\n * @param format - the texture's format\n */\nfunction srgbViewFormat(format: GPUTextureFormat): GPUTextureFormat[] | undefined\n{\n return SRGB_CAPABLE.test(format) ? [`${format}-srgb` as GPUTextureFormat] : undefined;\n}\n\n/**\n * Builds a cache key covering every view-affecting field of a GPUTextureViewDescriptor —\n * two descriptors selecting different subresources (mips, layers, aspects, formats) must\n * never share a cached GPUTextureView. Only runs when bind groups / pass descriptors are\n * (re)built, never per draw.\n * @param viewDescriptor\n */\nfunction getViewDescriptorKey(viewDescriptor: GPUTextureViewDescriptor): string\n{\n return `${viewDescriptor.format || ''}.${viewDescriptor.dimension || ''}.${viewDescriptor.aspect || ''}.`\n + `${viewDescriptor.baseMipLevel || 0}.${viewDescriptor.mipLevelCount || ''}.`\n + `${viewDescriptor.baseArrayLayer || 0}.${viewDescriptor.arrayLayerCount || ''}`;\n}\n\n/**\n * The system that handles textures for the GPU.\n * @category rendering\n * @advanced\n */\nexport class GpuTextureSystem implements System, CanvasGenerator\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUSystem,\n ],\n name: 'texture',\n } as const;\n\n /**\n * Optional uploaders registered via {@link ExtensionType.TextureUploaderWebGPU}. 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, GpuTextureUploader> = Object.create(null);\n\n protected CONTEXT_UID: number;\n private _gpuSamplers: Record<string, GPUSampler> = Object.create(null);\n private _bindGroupHash: Record<string, BindGroup> = Object.create(null);\n\n private readonly _uploads: Record<string, GpuTextureUploader>;\n\n private _gpu: GPU;\n private _mipmapGenerator?: GpuMipmapGenerator;\n private _mipmap3dGenerator?: Gpu3dMipmapGenerator;\n\n private readonly _renderer: WebGPURenderer;\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 constructor(renderer: WebGPURenderer)\n {\n this._renderer = renderer;\n renderer.gc.addCollection(this, '_bindGroupHash', 'hash');\n\n this._managedTextures = new GCManagedHash({\n renderer,\n type: 'resource',\n onUnload: this.onSourceUnload.bind(this),\n name: 'gpuTextureSource'\n });\n\n const baseUploaders = {\n image: gpuUploadImageResource,\n buffer: gpuUploadBufferImageResource,\n video: gpuUploadVideoResource,\n compressed: gpuUploadCompressedTextureResource,\n ...GpuTextureSystem.uploadExtensions,\n };\n\n this._uploads = {\n ...baseUploaders,\n cube: createGpuUploadCubeTextureResource(baseUploaders),\n };\n }\n\n protected contextChange(gpu: GPU): void\n {\n this._gpu = gpu;\n\n // everything created by the previous device died with it\n this._managedTextures.removeAll();\n this._gpuSamplers = Object.create(null);\n this._mipmapGenerator = null;\n this._mipmap3dGenerator = null;\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): GPUTexture\n {\n return (source._gpuData[this._renderer.uid] as GPUTextureGpuData)?.gpuTexture || this._initSource(source);\n }\n\n private _initSource(source: TextureSource): GPUTexture\n {\n if (source.autoGenerateMipmaps)\n {\n // fail before allocating a mip chain that could never be filled\n if (source.dimension === '3d') assertMipmap3dTexture(source.format, source.storage);\n\n const biggestDimension = Math.max(source.pixelWidth, source.pixelHeight, source.depth);\n\n source.mipLevelCount = Math.floor(Math.log2(biggestDimension)) + 1;\n }\n\n let usage: number;\n let viewFormats: GPUTextureFormat[];\n\n if (source.sampleCount > 1)\n {\n // MSAA textures are only rendered into and resolved — never sampled, uploaded, or\n // copied — so they need RENDER_ATTACHMENT alone.\n usage = GPUTextureUsage.RENDER_ATTACHMENT;\n\n // TRANSIENT_ATTACHMENT goes on top when the source is marked transient AND the browser\n // exposes the bit. The render target adaptor never loads or stores a transient MSAA colour\n // buffer (a reopened pass restores it from the resolved texture instead).\n if (source.transient && this._renderer.device.extensions.transientAttachment)\n {\n usage |= (GPUTextureUsage as { TRANSIENT_ATTACHMENT: number }).TRANSIENT_ATTACHMENT;\n }\n }\n else\n {\n usage = GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST;\n\n if (source.uploadMethodId !== 'compressed')\n {\n usage |= GPUTextureUsage.RENDER_ATTACHMENT;\n usage |= GPUTextureUsage.COPY_SRC;\n }\n\n if (source.storage) usage |= GPUTextureUsage.STORAGE_BINDING;\n\n viewFormats = srgbViewFormat(source.format);\n }\n\n const blockData = blockDataMap[source.format] || { blockBytes: 4, blockWidth: 1, blockHeight: 1 };\n\n const width = Math.ceil(source.pixelWidth / blockData.blockWidth) * blockData.blockWidth;\n const height = Math.ceil(source.pixelHeight / blockData.blockHeight) * blockData.blockHeight;\n\n const textureDescriptor: GPUTextureDescriptor = {\n label: source.label,\n // WebGPU cube textures are 2D textures with 6 array layers and a cube view.\n size: { width, height, depthOrArrayLayers: source.depthOrArrayLayers },\n format: source.format,\n viewFormats,\n sampleCount: source.sampleCount,\n mipLevelCount: source.mipLevelCount,\n dimension: source.dimension,\n usage\n };\n\n const gpuTexture = this._gpu.device.createTexture(textureDescriptor);\n\n source._gpuData[this._renderer.uid] = new GPUTextureGpuData(gpuTexture);\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.onSourceResize, this);\n source.on('updateMipmaps', this.onUpdateMipmaps, this);\n }\n\n this.onSourceUpdate(source);\n\n return gpuTexture;\n }\n\n protected onSourceUpdate(source: TextureSource): void\n {\n const gpuTexture = this.getGpuSource(source);\n\n // destroyed!\n if (!gpuTexture) return;\n\n if (this._uploads[source.uploadMethodId])\n {\n this._uploads[source.uploadMethodId].upload(source, gpuTexture, this._gpu);\n }\n\n if (source.autoGenerateMipmaps && source.mipLevelCount > 1)\n {\n this.onUpdateMipmaps(source);\n }\n }\n\n protected onUpdateMipmaps(source: TextureSource): void\n {\n const gpuTexture = this.getGpuSource(source);\n\n if (source.dimension === '3d')\n {\n this._mipmap3dGenerator ??= new Gpu3dMipmapGenerator(this._gpu.device);\n this._mipmap3dGenerator.generateMipmap(gpuTexture);\n\n return;\n }\n\n this._mipmapGenerator ??= new GpuMipmapGenerator(this._gpu.device);\n this._mipmapGenerator.generateMipmap(gpuTexture);\n }\n\n protected onSourceUnload(source: TextureSource): void\n {\n source.off('update', this.onSourceUpdate, this);\n source.off('resize', this.onSourceResize, this);\n source.off('updateMipmaps', this.onUpdateMipmaps, this);\n }\n\n protected onSourceResize(source: TextureSource): void\n {\n source._gcLastUsed = this._renderer.gc.now;\n\n const gpuData = source._gpuData[this._renderer.uid] as GPUTextureGpuData;\n const gpuTexture = gpuData?.gpuTexture;\n\n if (!gpuTexture)\n {\n this.initSource(source);\n }\n else if (gpuTexture.width !== source.pixelWidth || gpuTexture.height !== source.pixelHeight)\n {\n gpuData.destroy();\n this._bindGroupHash[source.uid] = null;\n source._gpuData[this._renderer.uid] = null;\n this.initSource(source);\n }\n }\n\n private _initSampler(sampler: TextureStyle): GPUSampler\n {\n this._gpuSamplers[sampler._resourceId] = this._gpu.device.createSampler(sampler);\n\n return this._gpuSamplers[sampler._resourceId];\n }\n\n public getGpuSampler(sampler: TextureStyle): GPUSampler\n {\n return this._gpuSamplers[sampler._resourceId] || this._initSampler(sampler);\n }\n\n public getGpuSource(source: TextureSource): GPUTexture\n {\n source._gcLastUsed = this._renderer.gc.now;\n\n return (source._gpuData[this._renderer.uid] as GPUTextureGpuData)?.gpuTexture || this.initSource(source);\n }\n\n /**\n * this returns s bind group for a specific texture, the bind group contains\n * - the texture source\n * - the texture style\n * - the texture matrix\n * This is cached so the bind group should only be created once per texture\n * @param texture - the texture you want the bindgroup for\n * @returns the bind group for the texture\n */\n public getTextureBindGroup(texture: Texture)\n {\n return this._bindGroupHash[texture.uid] || this._createTextureBindGroup(texture);\n }\n\n private _createTextureBindGroup(texture: Texture)\n {\n const source = texture.source;\n\n this._bindGroupHash[texture.uid] = new BindGroup({\n 0: source,\n 1: source.style,\n 2: new UniformGroup({\n uTextureMatrix: { type: 'mat3x3<f32>', value: texture.textureMatrix.mapCoord },\n })\n });\n\n return this._bindGroupHash[texture.uid];\n }\n\n public getTextureView(texture: BindableTexture, viewDescriptor?: GPUTextureViewDescriptor)\n {\n const source = texture.source;\n\n source._gcLastUsed = this._renderer.gc.now;\n let gpuData = source._gpuData[this._renderer.uid] as GPUTextureGpuData;\n\n if (!gpuData)\n {\n this.initSource(source);\n gpuData = source._gpuData[this._renderer.uid] as GPUTextureGpuData;\n }\n\n const descriptorKey = viewDescriptor ? getViewDescriptorKey(viewDescriptor) : 0;\n\n gpuData.textureViews[descriptorKey] ||= gpuData.gpuTexture.createView({\n dimension: source.viewDimension,\n ...viewDescriptor\n });\n\n return gpuData.textureViews[descriptorKey];\n }\n\n public getTextureRenderTargetView(\n texture: BindableTexture,\n mipLevel = 0,\n layer = 0,\n viewDescriptor?: GPUTextureViewDescriptor\n )\n {\n const source = texture.source;\n\n source._gcLastUsed = this._renderer.gc.now;\n let gpuData = source._gpuData[this._renderer.uid] as GPUTextureGpuData;\n\n if (!gpuData)\n {\n this.initSource(source);\n gpuData = source._gpuData[this._renderer.uid] as GPUTextureGpuData;\n }\n\n // a 3D texture renders through a whole-volume view, and the pass picks the slice with `depthSlice`\n const is3D = source.dimension === '3d';\n\n if (is3D) layer = 0;\n\n // numeric fast path for the common case; explicit descriptors get the full string key.\n // (+1 keeps mip 0 / layer 0 distinct from the default bind view at key 0)\n let descriptorKey: string | number = (layer * (source.mipLevelCount || 1)) + mipLevel + 1;\n\n if (viewDescriptor)\n {\n descriptorKey = `${descriptorKey}.${getViewDescriptorKey(viewDescriptor)}`;\n }\n\n gpuData.textureViews[descriptorKey] ||= gpuData.gpuTexture.createView({\n dimension: is3D ? '3d' : '2d',\n baseMipLevel: mipLevel,\n mipLevelCount: 1,\n baseArrayLayer: layer,\n arrayLayerCount: 1,\n ...viewDescriptor\n });\n\n return gpuData.textureViews[descriptorKey];\n }\n\n public generateCanvas(texture: Texture): ICanvas\n {\n const renderer = this._renderer;\n\n const commandEncoder = renderer.gpu.device.createCommandEncoder();\n\n // create canvas\n const canvas = DOMAdapter.get().createCanvas();\n\n canvas.width = texture.source.pixelWidth;\n canvas.height = texture.source.pixelHeight;\n\n const context = canvas.getContext('webgpu') as unknown as GPUCanvasContext;\n\n context.configure({\n device: renderer.gpu.device,\n\n usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC,\n format: DOMAdapter.get().getNavigator().gpu.getPreferredCanvasFormat(),\n alphaMode: 'premultiplied',\n });\n\n commandEncoder.copyTextureToTexture({\n texture: renderer.texture.getGpuSource(texture.source),\n origin: {\n x: 0,\n y: 0,\n },\n }, {\n texture: context.getCurrentTexture(),\n }, {\n width: canvas.width,\n height: canvas.height,\n });\n\n renderer.gpu.device.queue.submit([commandEncoder.finish()]);\n\n return canvas;\n }\n\n public getPixels(texture: Texture): GetPixelsOutput\n {\n const webGPUCanvas = this.generateCanvas(texture);\n\n const canvasAndContext = CanvasPool.getOptimalCanvasAndContext(webGPUCanvas.width, webGPUCanvas.height);\n\n const context = canvasAndContext.context;\n\n context.drawImage(webGPUCanvas, 0, 0);\n\n const { width, height } = webGPUCanvas;\n\n const imageData = context.getImageData(0, 0, width, height);\n\n const pixels = new Uint8ClampedArray(imageData.data.buffer);\n\n CanvasPool.returnCanvasAndContext(canvasAndContext);\n\n return { pixels, width, height };\n }\n\n public destroy(): void\n {\n this._managedTextures.destroy();\n for (const k of Object.keys(this._bindGroupHash))\n {\n const key = Number(k);\n const bindGroup = this._bindGroupHash[key];\n\n bindGroup?.destroy();\n }\n\n (this._renderer as null) = null;\n this._gpu = null;\n this._mipmapGenerator = null;\n this._mipmap3dGenerator = null;\n this._gpuSamplers = null;\n this._bindGroupHash = null;\n }\n}\n\nextensions.handleByMap(ExtensionType.TextureUploaderWebGPU, GpuTextureSystem.uploadExtensions);\n","import { STENCIL_MODES } from '../../shared/state/const';\n\nimport type { TextureSource } from '../../shared/texture/sources/TextureSource';\n\n/**\n * A class which holds the canvas contexts and textures for a render target.\n * @category rendering\n * @ignore\n */\nexport class GpuRenderTarget\n{\n public contexts: GPUCanvasContext[] = [];\n /**\n * Per canvas attachment, the canvas texture the last pass drew into. A canvas hands out a new, empty\n * texture each frame, so a different one means nothing has been drawn this frame yet.\n */\n public canvasTextures: GPUTexture[] = [];\n public msaaTextures: TextureSource[] = [];\n public msaa: boolean;\n /**\n * The user marked this multisampled target `transient` (single pass, never reopened), so its MSAA\n * depth/stencil is discarded too. Read once from the colour texture, like `msaa`. Separate from each\n * `msaaTextures[i].transient`, which is also set on every tile-based GPU.\n */\n public transient = false;\n public msaaSamples = 1;\n public width: number;\n public height: number;\n public descriptor: GPURenderPassDescriptor;\n /**\n * Per MSAA colour attachment, the copy of its resolved image that a reopened pass draws back in (see\n * GpuMsaaRestore), as FilterSystem's `backTexture` is a copy of what a filter draws over. Created on the\n * first restore, then resized and destroyed with `msaaTextures`.\n */\n public msaaBackTextures: TextureSource[] = [];\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 { Matrix } from '../../../maths/matrix/Matrix';\nimport { getTextureBatchBindGroup } from '../../../rendering/batcher/gpu/getTextureBatchBindGroup';\nimport { compileHighShaderGpuProgram } from '../../../rendering/high-shader/compileHighShaderToProgram';\nimport { colorBit } from '../../../rendering/high-shader/shader-bits/colorBit';\nimport { generateTextureBatchBit } from '../../../rendering/high-shader/shader-bits/generateTextureBatchBit';\nimport { localUniformBitGroup2 } from '../../../rendering/high-shader/shader-bits/localUniformBit';\nimport { roundPixelsBit } from '../../../rendering/high-shader/shader-bits/roundPixelsBit';\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 { GpuEncoderSystem } from '../../../rendering/renderers/gpu/GpuEncoderSystem';\nimport type { WebGPURenderer } from '../../../rendering/renderers/gpu/WebGPURenderer';\nimport type { Topology } from '../../../rendering/renderers/shared/geometry/const';\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 the GPU to render graphics.\n * @category rendering\n * @ignore\n */\nexport class GpuGraphicsAdaptor implements GraphicsAdaptor\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGPUPipesAdaptor,\n ],\n name: 'graphics',\n } as const;\n\n public shader: Shader;\n\n private _maxTextures = 0;\n\n public contextChange(renderer: Renderer): void\n {\n const localUniforms = new UniformGroup({\n uTransformMatrix: { value: new Matrix(), type: 'mat3x3<f32>' },\n uColor: { value: new Float32Array([1, 1, 1, 1]), type: 'vec4<f32>' },\n uRound: { value: 0, type: 'f32' },\n });\n\n this._maxTextures = renderer.limits.maxBatchableTextures;\n\n const gpuProgram = compileHighShaderGpuProgram({\n name: 'graphics',\n bits: [\n colorBit,\n generateTextureBatchBit(this._maxTextures),\n\n localUniformBitGroup2,\n roundPixelsBit\n ]\n });\n\n this.shader = new Shader({\n gpuProgram,\n resources: {\n // added on the fly!\n localUniforms,\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 WebGPURenderer;\n const contextSystem = renderer.graphicsContext as GraphicsContextSystem;\n\n const {\n batcher, instructions\n } = contextSystem.getContextRenderData(context);\n\n // WebGPU specific...\n\n // TODO perf test this a bit...\n const encoder = renderer.encoder as GpuEncoderSystem;\n\n encoder.setGeometry(batcher.geometry, shader.gpuProgram);\n\n const globalUniformsBindGroup = renderer.globalUniforms.bindGroup;\n\n encoder.setBindGroup(0, globalUniformsBindGroup, shader.gpuProgram);\n\n const localBindGroup = (renderer as WebGPURenderer)\n .renderPipes.uniformBatch.getUniformBindGroup(shader.resources.localUniforms, true);\n\n encoder.setBindGroup(2, localBindGroup, shader.gpuProgram);\n\n const batches = instructions.instructions as Batch[];\n\n let topology: Topology = null;\n\n for (let i = 0; i < instructions.instructionSize; i++)\n {\n const batch = batches[i];\n\n if (batch.topology !== topology)\n {\n topology = batch.topology;\n\n encoder.setPipelineFromGeometryProgramAndState(\n batcher.geometry,\n shader.gpuProgram,\n graphicsPipe.state,\n batch.topology,\n shader._overrides\n );\n }\n\n shader.groups[1] = batch.bindGroup;\n\n if (!batch.gpuBindGroup)\n {\n const textureBatch = batch.textures;\n\n batch.bindGroup = getTextureBatchBindGroup(\n textureBatch.textures,\n textureBatch.count,\n this._maxTextures\n );\n\n batch.gpuBindGroup = renderer.bindGroup.getBindGroup(\n batch.bindGroup, shader.gpuProgram, 1\n );\n }\n\n encoder.setBindGroup(1, batch.bindGroup, shader.gpuProgram);\n\n encoder.renderPassEncoder.drawIndexed(batch.size, 1, batch.start);\n }\n }\n\n public destroy(): void\n {\n // the program comes from the shared GpuProgram cache and is used by every WebGPU renderer,\n // so only the per-renderer shader is destroyed here\n this.shader.destroy();\n this.shader = null;\n }\n}\n","import { extensions, ExtensionType } from '../../../extensions/Extensions';\nimport { GpuGraphicsAdaptor } from '../../../scene/graphics/gpu/GpuGraphicsAdaptor';\nimport { GpuMeshAdapter } from '../../../scene/mesh/gpu/GpuMeshAdapter';\nimport { GpuBatchAdaptor } from '../../batcher/gpu/GpuBatchAdaptor';\nimport { AbstractRenderer } from '../shared/system/AbstractRenderer';\nimport { SharedRenderPipes, SharedSystems } from '../shared/system/SharedSystems';\nimport { RendererType } from '../types';\nimport { BindGroupSystem } from './BindGroupSystem';\nimport { GpuBufferSystem } from './buffer/GpuBufferSystem';\nimport { GpuColorMaskSystem } from './GpuColorMaskSystem';\nimport { type GPU, GpuDeviceSystem } from './GpuDeviceSystem';\nimport { GpuEncoderSystem } from './GpuEncoderSystem';\nimport { GpuLimitsSystem } from './GpuLimitsSystem';\nimport { GpuStencilSystem } from './GpuStencilSystem';\nimport { GpuUboSystem } from './GpuUboSystem';\nimport { GpuUniformBatchPipe } from './GpuUniformBatchPipe';\nimport { PipelineSystem } from './pipeline/PipelineSystem';\nimport { GpuRenderTargetSystem } from './renderTarget/GpuRenderTargetSystem';\nimport { GpuShaderSystem } from './shader/GpuShaderSystem';\nimport { GpuStateSystem } from './state/GpuStateSystem';\nimport { GpuTextureSystem } from './texture/GpuTextureSystem';\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';\n\nconst DefaultWebGPUSystems = [\n ...SharedSystems,\n GpuUboSystem,\n GpuEncoderSystem,\n GpuDeviceSystem,\n GpuLimitsSystem,\n GpuBufferSystem,\n GpuTextureSystem,\n GpuRenderTargetSystem,\n GpuShaderSystem,\n GpuStateSystem,\n PipelineSystem,\n GpuColorMaskSystem,\n GpuStencilSystem,\n BindGroupSystem,\n];\nconst DefaultWebGPUPipes = [...SharedRenderPipes, GpuUniformBatchPipe];\nconst DefaultWebGPUAdapters = [GpuBatchAdaptor, GpuMeshAdapter, GpuGraphicsAdaptor];\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.WebGPUSystem, systems);\nextensions.handleByNamedList(ExtensionType.WebGPUPipes, renderPipes);\nextensions.handleByNamedList(ExtensionType.WebGPUPipesAdaptor, renderPipeAdaptors);\nextensions.handleByNamedList(ExtensionType.WebGPULoader, loaders);\n\n// add all the default systems as well as any user defined ones from the extensions\nextensions.add(...DefaultWebGPUSystems, ...DefaultWebGPUPipes, ...DefaultWebGPUAdapters);\n\n/**\n * The default WebGPU systems. These are the systems that are added by default to the WebGPURenderer.\n * @category rendering\n * @standard\n * @interface\n */\nexport type WebGPUSystems = ExtractSystemTypes<typeof DefaultWebGPUSystems> &\nPixiMixins.RendererSystems &\nPixiMixins.WebGPUSystems;\n\n/**\n * The WebGPU renderer pipes. These are used to render the scene.\n * @see {@link WebGPURenderer}\n * @internal\n */\nexport type WebGPUPipes = ExtractSystemTypes<typeof DefaultWebGPUPipes> &\nPixiMixins.RendererPipes &\nPixiMixins.WebGPUPipes;\n\n/**\n * Options for WebGPURenderer.\n * @category rendering\n * @standard\n */\nexport interface WebGPUOptions extends\n SharedRendererOptions,\n ExtractRendererOptions<typeof DefaultWebGPUSystems>,\n PixiMixins.WebGPUOptions{}\n\n// eslint-disable-next-line requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface WebGPURenderer<T extends ICanvas = HTMLCanvasElement>\n extends AbstractRenderer<WebGPUPipes, WebGPUOptions, T>,\n WebGPUSystems {}\n\n/* eslint-disable max-len */\n/**\n * The WebGPU PixiJS Renderer. This renderer allows you to use the next-generation graphics API, WebGPU.\n * ```ts\n * // Create a new renderer\n * const renderer = new WebGPURenderer();\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 * ```ts\n * import { autoDetectRenderer } from 'pixi.js';\n * // Create a new renderer\n * const renderer = await autoDetectRenderer();\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 WebGPU renderer:\n *\n * | WebGPU Core Systems | Systems that are specific to the WebGL renderer |\n * | ---------------------------------------- | ----------------------------------------------------------------------------- |\n * | {@link GpuUboSystem} | This manages WebGPU uniform buffer objects feature for shaders |\n * | {@link GpuEncoderSystem} | This manages the WebGPU command encoder |\n * | {@link GpuDeviceSystem} | This manages the WebGPU Device and its extensions |\n * | {@link GpuBufferSystem} | This manages buffers and their GPU resources, keeps everything in sync |\n * | {@link GpuTextureSystem} | This manages textures and their GPU resources, keeps everything in sync |\n * | {@link GpuRenderTargetSystem} | This manages what we render too. For example the screen, or another texture |\n * | {@link GpuShaderSystem} | This manages shaders, programs that run on the GPU to output lovely pixels |\n * | {@link GpuStateSystem} | This manages the state of the WebGPU Pipelines. eg the various flags that can be set blend modes / depthTesting etc |\n * | {@link PipelineSystem} | This manages the WebGPU pipelines, used for rendering |\n * | {@link GpuColorMaskSystem} | This manages the color mask. Used for color masking |\n * | {@link GpuStencilSystem} | This manages the stencil buffer. Used primarily for masking |\n * | {@link BindGroupSystem} | This manages the WebGPU bind groups. this is how data is bound to a shader when rendering |\n *\n * The breadth of the API surface provided by the renderer is contained within these systems.\n * @category rendering\n * @standard\n * @property {GpuUboSystem} ubo - UboSystem instance.\n * @property {GpuEncoderSystem} encoder - EncoderSystem instance.\n * @property {GpuDeviceSystem} device - DeviceSystem instance.\n * @property {GpuBufferSystem} buffer - BufferSystem instance.\n * @property {GpuTextureSystem} texture - TextureSystem instance.\n * @property {GpuRenderTargetSystem} renderTarget - RenderTargetSystem instance.\n * @property {GpuShaderSystem} shader - ShaderSystem instance.\n * @property {GpuStateSystem} state - StateSystem instance.\n * @property {PipelineSystem} pipeline - PipelineSystem instance.\n * @property {GpuColorMaskSystem} colorMask - ColorMaskSystem instance.\n * @property {GpuStencilSystem} stencil - StencilSystem instance.\n * @property {BindGroupSystem} bindGroup - BindGroupSystem instance.\n * @extends AbstractRenderer\n */\nexport class WebGPURenderer<T extends ICanvas = HTMLCanvasElement>\n extends AbstractRenderer<WebGPUPipes, WebGPUOptions, T>\n implements WebGPUSystems\n{\n /** The WebGPU Device. */\n public gpu: GPU;\n\n constructor()\n {\n const systemConfig = {\n name: 'webgpu',\n type: RendererType.WEBGPU,\n systems,\n renderPipes,\n renderPipeAdaptors,\n loaders,\n };\n\n super(systemConfig);\n }\n}\n"],"names":[],"mappings":"+OgCyCkC,EAAA,CAAA,CAAA,kBACJ,iCAA6B,CAAc,QACrD,CAAE,IrBLkC,EqBKlC,IAAA,aAAA,GAA4B,CVeZ,AUfY,GAAM,CAAC,CAAC,OAAS,WAAA,CAAY,M7BVF,W6BW7C,KAAA,mCAGK,CAAO,oBAAA,KAE9B,EAAA,CAAA,EAAa,EAAA,CAAA,EAAA,sBAET,WAEF,EAAwB,IAAA,CAAA,YAAiB,CAAA,IAEzC,ATIwC,AMXG,CNWH,yCSG5C,UAAW,eAEP,KAKL,QAAA,CAAA,CAAA,CAAwC,CAC/C,OACoB,EAAW,CXiBD,MWjBC,GACZ,EAAQ,YAAA,EAAA,IAAgB,CAAK,CtBoCC,KsBpCD,GAC3B,EAAa,QAAA,wEAUd,CzBnBF,CyBmBW,OAAA,ECvBf,CDyBF,CCzBwB,UDyBxB,CAAY,EAAQ,QAAA,CAAA,EAAiB,UAAU,CAAA,uBAEd,CAAe,SAAA,eAEhD,CAAA,EAAA,EAAA,EAAgD,SLOS,CKPC,CAAA,ETsD9D,KSpDoB,EACnB,WAAA,CAAY,CXa2B,GX2BwB,CAAA,KGhCd,CAAA,CmBRrC,CAAa,mBAAA,CAAoB,EAAO,IAAP,KAAO,CAAU,aAAA,EAAe,IAAI,CAAA,eAE9D,EAAA,EAAA,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